Mods-for-HESK-Netsyms/internal-api/dao/api_authentication_dao.php

12 lines
492 B
PHP
Raw Normal View History

2015-11-17 22:14:34 -05:00
<?php
function store_token($user_id, $token_hash, $hesk_settings) {
2015-11-19 20:37:49 -05:00
$sql = "INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "user_api_tokens` (`user_id`, `token`)
2015-11-19 21:14:15 -05:00
VALUES (" . intval($user_id) . ", '" . hesk_dbEscape($token_hash) . "')";
hesk_dbQuery($sql);
}
function reset_tokens($user_id, $hesk_settings) {
$sql = "DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "user_api_tokens` WHERE `user_id` = ".intval($user_id);
2015-11-19 20:37:49 -05:00
hesk_dbQuery($sql);
2015-11-17 22:14:34 -05:00
}