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 $conn_error = PMA_DBI_getError();
71 $conn_error = __('Cannot connect: invalid settings.');
74 // Defines the charset to be used
75 header('Content-Type: text/html; charset=utf-8');
77 $page_title = __('Access denied');
78 include './libraries/header_meta_style.inc.php';
85 <h1
><?php
echo sprintf(__('Welcome to %s'), ' phpMyAdmin '); ?
></h1
>
88 <table border
="0" cellpadding
="0" cellspacing
="3" align
="center" width
="80%">
93 $GLOBALS['is_header_sent'] = true;
95 if (isset($GLOBALS['allowDeny_forbidden']) && $GLOBALS['allowDeny_forbidden']) {
96 trigger_error(__('Access denied'), E_USER_NOTICE
);
98 // Check whether user has configured something
99 if ($GLOBALS['PMA_Config']->source_mtime
== 0) {
100 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";
101 } elseif (!isset($GLOBALS['errno']) ||
(isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002) && $GLOBALS['errno'] != 2003) {
102 // if we display the "Server not responding" error, do not confuse users
103 // by telling them they have a settings problem
104 // (note: it's true that they could have a badly typed host name, but
105 // anyway the current message tells that the server
106 // rejected the connection, which is not really what happened)
107 // 2002 is the error given by mysqli
108 // 2003 is the error given by mysql
109 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
);
111 PMA_mysqlDie($conn_error, '', true, '', false);
113 $GLOBALS['error_handler']->dispUserErrors();
118 if (count($GLOBALS['cfg']['Servers']) > 1) {
119 // offer a chance to login to other servers if the current one failed
120 include_once './libraries/select_server.lib.php';
123 PMA_select_server(true, true);
124 echo ' </td>' . "\n";
127 echo '</table>' . "\n";
128 include './libraries/footer.inc.php';
130 } // end of the 'PMA_auth_fails()' function