PMA\libraries\Logging::logUser PHP Méthode

logUser() public static méthode

Logs user information to webserver logs.
public static logUser ( string $user, string $status = 'ok' ) : void
$user string user name
$status string status message
Résultat void
    public static function logUser($user, $status = 'ok')
    {
        if (function_exists('apache_note')) {
            apache_note('userID', $user);
            apache_note('userStatus', $status);
        }
        if (function_exists('syslog') && $status != 'ok') {
            @openlog('phpMyAdmin', LOG_NDELAY | LOG_PID, LOG_AUTHPRIV);
            @syslog(LOG_WARNING, 'user denied: ' . $user . ' (' . $status . ') from ' . PMA_getIp());
        }
    }

Usage Example

Exemple #1
0
         $error_message_tz = sprintf(__('Unable to use timezone %1$s for server %2$d. ' . 'Please check your configuration setting for ' . '[em]$cfg[\'Servers\'][%3$d][\'SessionTimeZone\'][/em]. ' . 'phpMyAdmin is currently using the default time zone ' . 'of the database server.'), $cfg['Servers'][$GLOBALS['server']]['SessionTimeZone'], $GLOBALS['server'], $GLOBALS['server']);
         $GLOBALS['error_handler']->addError($error_message_tz, E_USER_WARNING, '', '', false);
     }
 }
 if (!$controllink) {
     /*
      * Open separate connection for control queries, this is needed
      * to avoid problems with table locking used in main connection
      * and phpMyAdmin issuing queries to configuration storage, which
      * is not locked by that time.
      */
     $controllink = $GLOBALS['dbi']->connect(DatabaseInterface::CONNECT_USER);
 }
 $auth_plugin->storeUserCredentials();
 /* Log success */
 Logging::logUser($cfg['Server']['user']);
 if (PMA_MYSQL_INT_VERSION < $cfg['MysqlMinVersion']['internal']) {
     PMA_fatalError(__('You should upgrade to %s %s or later.'), array('MySQL', $cfg['MysqlMinVersion']['human']));
 }
 /**
  * Type handling object.
  */
 $GLOBALS['PMA_Types'] = new TypesMySQL();
 // Loads closest context to this version.
 SqlParser\Context::loadClosest('MySql' . PMA_MYSQL_INT_VERSION);
 // Sets the default delimiter (if specified).
 if (!empty($_REQUEST['sql_delimiter'])) {
     SqlParser\Lexer::$DEFAULT_DELIMITER = $_REQUEST['sql_delimiter'];
 }
 // TODO: Set SQL modes too.
 /**
All Usage Examples Of PMA\libraries\Logging::logUser
Logging