* [MOD] Print timestamp when logging to file

* [MOD] Display user name and login when listing API tokens
This commit is contained in:
nuxsmin
2017-02-23 17:49:33 +01:00
parent 86838ab049
commit 12dee92632
2 changed files with 11 additions and 10 deletions

View File

@@ -67,11 +67,11 @@ $timeStart = Init::microtime_float();
* Función para enviar mensajes al log de errores
*
* @param mixed $data
* @param bool $printLastCaller
* @param bool $printLastCaller
*/
function debugLog($data, $printLastCaller = false)
{
if (!error_log(print_r($data, true) . PHP_EOL, 3, LOG_FILE)) {
if (!error_log(date('Y-m-d H:i:s') . ' - ' . print_r($data, true) . PHP_EOL, 3, LOG_FILE)) {
error_log(print_r($data, true));
}
@@ -94,7 +94,7 @@ function debugLog($data, $printLastCaller = false)
* Alias gettext function
*
* @param string $string
* @param bool $tranlate Si es necesario traducir
* @param bool $tranlate Si es necesario traducir
* @return string
*/
function __($string, $tranlate = true)

View File

@@ -43,13 +43,14 @@ class ApiTokenSearch extends ApiTokenBase implements ItemSearchInterface
*/
public function getMgmtSearch(ItemSearchData $SearchData)
{
$query = 'SELECT authtoken_id,' .
'authtoken_userId,' .
'authtoken_actionId, ' .
'authtoken_token, ' .
'user_login ' .
'FROM authTokens ' .
'LEFT JOIN usrData ON user_id = authtoken_userId ';
$query = /** @lang SQL */
'SELECT authtoken_id,
authtoken_userId,
authtoken_actionId,
authtoken_token,
CONCAT(user_name, \' (\', user_login, \')\') AS user_login
FROM authTokens
LEFT JOIN usrData ON user_id = authtoken_userId ';
$Data = new QueryData();