2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Set of functions used to run config authentication (ie no authentication).
11 * Displays authentication form
13 * @return boolean always true
20 } // end of the 'PMA_auth()' function
24 * Gets advanced authentication settings
26 * @return boolean always true
30 function PMA_auth_check()
33 } // end of the 'PMA_auth_check()' function
37 * Set the user and password after last checkings if required
39 * @return boolean always true
43 function PMA_auth_set_user()
46 } // end of the 'PMA_auth_set_user()' function
50 * User is not allowed to login to MySQL -> authentication failed
52 * @global string the MySQL error message PHP returns
53 * @global string the connection type (persistent or not)
54 * @global string the MySQL server port to use
55 * @global string the MySQL socket port to use
56 * @global array the current server settings
57 * @global string the font face to use in case of failure
58 * @global string the default font size to use in case of failure
59 * @global string the big font size to use in case of failure
60 * @global boolean tell the "PMA_mysqlDie()" function headers have been
63 * @return boolean always true (no return indeed)
67 function PMA_auth_fails()
69 global $php_errormsg, $cfg;
71 $conn_error = PMA_DBI_getError();
73 if (isset($php_errormsg)) {
74 $conn_error = $php_errormsg;
76 $conn_error = $GLOBALS['strConnectionError'];
80 // Defines the charset to be used
81 header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
83 $page_title = $GLOBALS['strAccessDenied'];
84 require './libraries/header_meta_style.inc.php';
91 <h1
><?php
echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin ' . PMA_VERSION
); ?
></h1
>
94 <table border
="0" cellpadding
="0" cellspacing
="3" align
="center" width
="80%">
99 $GLOBALS['is_header_sent'] = TRUE;
102 * @todo I have included this div from libraries/header.inc.php to work around
103 * an undefined variable in tooltip.js, when the server is not responding.
104 * Work has to be done to merge all code that starts the page (DOCTYPE and
105 * this div) to one place
108 <div id
="TooltipContainer" onmouseover
="holdTooltip();" onmouseout
="swapTooltip('default');"></div
>
111 if (isset($GLOBALS['allowDeny_forbidden']) && $GLOBALS['allowDeny_forbidden']) {
112 echo '<p>' . $GLOBALS['strAccessDenied'] . '</p>' . "\n";
114 // Check whether user has configured something
115 if ($_SESSION['PMA_Config']->source_mtime
== 0) {
116 echo '<p>' . sprintf($GLOBALS['strAccessDeniedCreateConfig'], '<a href="scripts/setup.php">', '</a>') . '</p>' . "\n";
117 } elseif (!isset($GLOBALS['errno']) ||
(isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002) && $GLOBALS['errno'] != 2003) {
118 // if we display the "Server not responding" error, do not confuse users
119 // by telling them they have a settings problem
120 // (note: it's true that they could have a badly typed host name, but
121 // anyway the current $strAccessDeniedExplanation tells that the server
122 // rejected the connection, which is not really what happened)
123 // 2002 is the error given by mysqli
124 // 2003 is the error given by mysql
125 echo '<p>' . $GLOBALS['strAccessDeniedExplanation'] . '</p>' . "\n";
127 PMA_mysqlDie($conn_error, '', true, '', false);
129 if (! empty($GLOBALS['PMA_errors']) && is_array($GLOBALS['PMA_errors'])) {
130 foreach ($GLOBALS['PMA_errors'] as $error) {
131 echo '<div class="error">' . $error . '</div>' . "\n";
138 if (count($GLOBALS['cfg']['Servers']) > 1) {
139 // offer a chance to login to other servers if the current one failed
140 require_once './libraries/select_server.lib.php';
143 PMA_select_server(TRUE, TRUE);
144 echo ' </td>' . "\n";
147 echo '</table>' . "\n";
148 require_once './libraries/footer.inc.php';
150 } // end of the 'PMA_auth_fails()' function