1. Check existence of mb_string, mysql and xml extensions before installation.
[openemr.git] / phpmyadmin / libraries / plugins / AuthenticationPlugin.class.php
blob19f4dd21f6efc953d686c94aecc688ebb0d0e331
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Abstract class for the authentication plugins
6 * @package PhpMyAdmin
7 */
8 if (! defined('PHPMYADMIN')) {
9 exit;
12 /**
13 * Provides a common interface that will have to be implemented by all of the
14 * authentication plugins.
16 * @package PhpMyAdmin
18 abstract class AuthenticationPlugin
20 /**
21 * Displays authentication form
23 * @return boolean
25 abstract public function auth();
27 /**
28 * Gets advanced authentication settings
30 * @return boolean
32 abstract public function authCheck();
34 /**
35 * Set the user and password after last checkings if required
37 * @return boolean
39 abstract public function authSetUser();
41 /**
42 * Stores user credentials after successful login.
44 * @return void
46 public function storeUserCredentials()
50 /**
51 * User is not allowed to login to MySQL -> authentication failed
53 * @return boolean
55 abstract public function authFails();
57 /**
58 * Returns error message for failed authentication.
60 * @return string
62 public function getErrorMessage()
64 if (! empty($GLOBALS['login_without_password_is_forbidden'])) {
65 return __(
66 'Login without a password is forbidden by configuration'
67 . ' (see AllowNoPassword)'
69 } elseif (! empty($GLOBALS['allowDeny_forbidden'])) {
70 return __('Access denied!');
71 } elseif (! empty($GLOBALS['no_activity'])) {
72 return sprintf(
73 __('No activity within %s seconds; please log in again.'),
74 $GLOBALS['cfg']['LoginCookieValidity']
76 } else {
77 $dbi_error = $GLOBALS['dbi']->getError();
78 if (! empty($dbi_error)) {
79 return PMA_sanitize($dbi_error);
80 } elseif (isset($GLOBALS['errno'])) {
81 return '#' . $GLOBALS['errno'] . ' '
82 . __('Cannot log in to the MySQL server');
83 } else {
84 return __('Cannot log in to the MySQL server');
89 /**
90 * Callback when user changes password.
92 * @param string $password New password to set
94 * @return void
96 public function handlePasswordChange($password)