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
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 = __('Cannot connect: invalid settings.');
80 // Defines the charset to be used
81 header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
83 $page_title = __('Access denied');
84 require './libraries/header_meta_style.inc.php';
91 <h1
><?php
echo sprintf(__('Welcome to %s'), ' phpMyAdmin '); ?
></h1
>
94 <table border
="0" cellpadding
="0" cellspacing
="3" align
="center" width
="80%">
99 $GLOBALS['is_header_sent'] = TRUE;
101 if (isset($GLOBALS['allowDeny_forbidden']) && $GLOBALS['allowDeny_forbidden']) {
102 trigger_error(__('Access denied'), E_USER_NOTICE
);
104 // Check whether user has configured something
105 if ($GLOBALS['PMA_Config']->source_mtime
== 0) {
106 echo '<p>' . sprintf(__('You probably did not create a configuration file. You might want to use the %1$ssetup script%2$s to create one.'), '<a href="setup/">', '</a>') . '</p>' . "\n";
107 } elseif (!isset($GLOBALS['errno']) ||
(isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002) && $GLOBALS['errno'] != 2003) {
108 // if we display the "Server not responding" error, do not confuse users
109 // by telling them they have a settings problem
110 // (note: it's true that they could have a badly typed host name, but
111 // anyway the current message tells that the server
112 // rejected the connection, which is not really what happened)
113 // 2002 is the error given by mysqli
114 // 2003 is the error given by mysql
115 trigger_error(__('phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.'), E_USER_WARNING
);
117 PMA_mysqlDie($conn_error, '', true, '', false);
119 $GLOBALS['error_handler']->dispUserErrors();
124 if (count($GLOBALS['cfg']['Servers']) > 1) {
125 // offer a chance to login to other servers if the current one failed
126 require_once './libraries/select_server.lib.php';
129 PMA_select_server(TRUE, TRUE);
130 echo ' </td>' . "\n";
133 echo '</table>' . "\n";
134 require './libraries/footer.inc.php';
136 } // end of the 'PMA_auth_fails()' function