clearUserCache(); } // Returns whether we get authentication settings or not if (empty($PHP_AUTH_USER)) { unset($_SESSION['LAST_SIGNON_URL']); return false; } else { $_SESSION['LAST_SIGNON_URL'] = $GLOBALS['cfg']['Server']['SignonURL']; return true; } } /** * Set the user and password after last checkings if required * * @global array the valid servers settings * @global integer the id of the current server * @global array the current server settings * @global string the current username * @global string the current password * * @return boolean always true */ public function authSetUser() { global $cfg; global $PHP_AUTH_USER, $PHP_AUTH_PW; $cfg['Server']['user'] = $PHP_AUTH_USER; $cfg['Server']['password'] = $PHP_AUTH_PW; return true; } /** * User is not allowed to login to MySQL -> authentication failed * * @return boolean always true (no return indeed) */ public function authFails() { /* Session name */ $session_name = $GLOBALS['cfg']['Server']['SignonSession']; /* Does session exist? */ if (isset($_COOKIE[$session_name])) { /* End current session */ $old_session = session_name(); $old_id = session_id(); session_write_close(); /* Load single signon session */ session_name($session_name); session_id($_COOKIE[$session_name]); session_start(); /* Set error message */ if (! empty($GLOBALS['login_without_password_is_forbidden'])) { $_SESSION['PMA_single_signon_error_message'] = __( 'Login without a password is forbidden by configuration ' . '(see AllowNoPassword)' ); } elseif (! empty($GLOBALS['allowDeny_forbidden'])) { $_SESSION['PMA_single_signon_error_message'] = __('Access denied'); } elseif (! empty($GLOBALS['no_activity'])) { $_SESSION['PMA_single_signon_error_message'] = sprintf( __('No activity within %s seconds; please log in again'), $GLOBALS['cfg']['LoginCookieValidity'] ); } elseif (PMA_DBI_getError()) { $_SESSION['PMA_single_signon_error_message'] = PMA_sanitize( PMA_DBI_getError() ); } else { $_SESSION['PMA_single_signon_error_message'] = __( 'Cannot log in to the MySQL server' ); } } $this->auth(); } /** * This method is called when any PluginManager to which the observer * is attached calls PluginManager::notify() * * @param SplSubject $subject The PluginManager notifying the observer * of an update. * * @return void */ public function update (SplSubject $subject) { } }