use user nick render

main
Philip Häusler 10 years ago
parent dc412ba826
commit 1ec2783a8e

@ -6,7 +6,7 @@
/** /**
* Update user. * Update user.
* *
* @param User $user * @param User $user
*/ */
function User_update($user) { function User_update($user) {
@ -243,7 +243,7 @@ function User_generate_password_recovery_token(&$user) {
$result = sql_query("UPDATE `User` SET `password_recovery_token`='" . sql_escape($user['password_recovery_token']) . "' WHERE `UID`='" . sql_escape($user['UID']) . "' LIMIT 1"); $result = sql_query("UPDATE `User` SET `password_recovery_token`='" . sql_escape($user['password_recovery_token']) . "' WHERE `UID`='" . sql_escape($user['UID']) . "' LIMIT 1");
if ($result === false) if ($result === false)
return false; return false;
engelsystem_log("Password recovery for " . $user['Nick'] . " started."); engelsystem_log("Password recovery for " . User_Nick_render($user) . " started.");
return $user['password_recovery_token']; return $user['password_recovery_token'];
} }

@ -9,13 +9,13 @@
*/ */
function engelsystem_log($message) { function engelsystem_log($message) {
global $user; global $user;
if (isset($user)) { if (isset($user)) {
$nick = $user['Nick']; $nick = User_Nick_render($user);
} else { } else {
$nick = "Guest"; $nick = "Guest";
} }
LogEntry_create($nick, $message); LogEntry_create($nick, $message);
} }
@ -27,14 +27,14 @@ function debug_string_backtrace() {
debug_print_backtrace(); debug_print_backtrace();
$trace = ob_get_contents(); $trace = ob_get_contents();
ob_end_clean(); ob_end_clean();
// Remove first item from backtrace as it's this function which // Remove first item from backtrace as it's this function which
// is redundant. // is redundant.
$trace = preg_replace('/^#0\s+' . __FUNCTION__ . "[^\n]*\n/", '', $trace, 1); $trace = preg_replace('/^#0\s+' . __FUNCTION__ . "[^\n]*\n/", '', $trace, 1);
// Renumber backtrace items. // Renumber backtrace items.
$trace = preg_replace('/^#(\d+)/me', '\'#\' . ($1 - 1)', $trace); $trace = preg_replace('/^#(\d+)/me', '\'#\' . ($1 - 1)', $trace);
return $trace; return $trace;
} }

Loading…
Cancel
Save