summaryrefslogtreecommitdiff
path: root/includes/model/User_model.php
diff options
context:
space:
mode:
authorFelix Favre <gnomus@gnomus.de>2014-12-16 00:54:50 +0100
committerFelix Favre <gnomus@gnomus.de>2014-12-16 00:54:50 +0100
commit807e4208832288dbbd876056621a36f58e836d42 (patch)
tree0afd60270963169187b3a11cb23e62d22a2fc2db /includes/model/User_model.php
parentd2e59e8f86f643ca3f9776a334f0eb38b6efe2a5 (diff)
only log if api key was reset on purpose
Diffstat (limited to 'includes/model/User_model.php')
-rw-r--r--includes/model/User_model.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/model/User_model.php b/includes/model/User_model.php
index 95ba32be..a6c12f9d 100644
--- a/includes/model/User_model.php
+++ b/includes/model/User_model.php
@@ -191,12 +191,13 @@ function User_by_password_recovery_token($token) {
*
* @param User $user
*/
-function User_reset_api_key(&$user) {
+function User_reset_api_key(&$user, $log = true) {
$user['api_key'] = md5($user['Nick'] . time() . rand());
$result = sql_query("UPDATE `User` SET `api_key`='" . sql_escape($user['api_key']) . "' WHERE `UID`='" . sql_escape($user['UID']) . "' LIMIT 1");
if ($result === false)
return false;
- engelsystem_log(sprintf("API key resetted (%s).",User_Nick_render($user)));
+ if ($log)
+ engelsystem_log(sprintf("API key resetted (%s).",User_Nick_render($user)));
}
/**