2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Set of functions used to run config authentication (ie no authentication).
6 * @package phpMyAdmin-Auth-Config
12 * Displays authentication form
14 * @return boolean always true
21 } // end of the 'PMA_auth()' function
25 * Gets advanced authentication settings
27 * @return boolean always true
31 function PMA_auth_check()
34 } // end of the 'PMA_auth_check()' function
38 * Set the user and password after last checkings if required
40 * @return boolean always true
44 function PMA_auth_set_user()
47 } // end of the 'PMA_auth_set_user()' function
51 * User is not allowed to login to MySQL -> authentication failed
53 * @global string the MySQL error message PHP returns
54 * @global string the connection type (persistent or not)
55 * @global string the MySQL server port to use
56 * @global string the MySQL socket port to use
57 * @global array the current server settings
58 * @global string the font face to use in case of failure
59 * @global string the default font size to use in case of failure
60 * @global string the big font size to use in case of failure
61 * @global boolean tell the "PMA_mysqlDie()" function headers have been
64 * @return boolean always true (no return indeed)
68 function PMA_auth_fails()
70 global $php_errormsg, $cfg;
72 $conn_error = PMA_DBI_getError();
74 if (isset($php_errormsg)) {
75 $conn_error = $php_errormsg;
77 $conn_error = $GLOBALS['strConnectionError'];
81 // Defines the charset to be used
82 header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
84 $page_title = $GLOBALS['strAccessDenied'];
85 require './libraries/header_meta_style.inc.php';
92 <h1
><?php
echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin '); ?
></h1
>
95 <table border
="0" cellpadding
="0" cellspacing
="3" align
="center" width
="80%">
100 $GLOBALS['is_header_sent'] = TRUE;
102 if (isset($GLOBALS['allowDeny_forbidden']) && $GLOBALS['allowDeny_forbidden']) {
103 trigger_error($GLOBALS['strAccessDenied'], E_USER_NOTICE
);
105 // Check whether user has configured something
106 if ($_SESSION['PMA_Config']->source_mtime
== 0) {
107 echo '<p>' . sprintf($GLOBALS['strAccessDeniedCreateConfig'], '<a href="setup/">', '</a>') . '</p>' . "\n";
108 } elseif (!isset($GLOBALS['errno']) ||
(isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002) && $GLOBALS['errno'] != 2003) {
109 // if we display the "Server not responding" error, do not confuse users
110 // by telling them they have a settings problem
111 // (note: it's true that they could have a badly typed host name, but
112 // anyway the current $strAccessDeniedExplanation tells that the server
113 // rejected the connection, which is not really what happened)
114 // 2002 is the error given by mysqli
115 // 2003 is the error given by mysql
116 trigger_error($GLOBALS['strAccessDeniedExplanation'], E_USER_WARNING
);
118 PMA_mysqlDie($conn_error, '', true, '', false);
120 $GLOBALS['error_handler']->dispUserErrors();
125 if (count($GLOBALS['cfg']['Servers']) > 1) {
126 // offer a chance to login to other servers if the current one failed
127 require_once './libraries/select_server.lib.php';
130 PMA_select_server(TRUE, TRUE);
131 echo ' </td>' . "\n";
134 echo '</table>' . "\n";
135 require_once './libraries/footer.inc.php';
137 } // end of the 'PMA_auth_fails()' function