3 // vim: expandtab sw=4 ts=4 sts=4:
5 // +--------------------------------------------------------------------------+
6 // | Set of functions used to run config authentication (ie no |
7 // | authentication). |
8 // +--------------------------------------------------------------------------+
11 if (!defined('PMA_CONFIG_AUTH_INCLUDED')) {
12 define('PMA_CONFIG_AUTH_INCLUDED', 1);
15 * Displays authentication form
17 * @return boolean always true
24 } // end of the 'PMA_auth()' function
28 * Gets advanced authentication settings
30 * @return boolean always true
34 function PMA_auth_check()
37 } // end of the 'PMA_auth_check()' function
41 * Set the user and password after last checkings if required
43 * @return boolean always true
47 function PMA_auth_set_user()
50 } // end of the 'PMA_auth_set_user()' function
54 * User is not allowed to login to MySQL -> authentication failed
56 * @global string the MySQL error message PHP returns
57 * @global string the connection type (persistent or not)
58 * @global string the MySQL server port to use
59 * @global string the MySQL socket port to use
60 * @global array the current server settings
61 * @global string the font face to use in case of failure
62 * @global string the default font size to use in case of failure
63 * @global string the big font size to use in case of failure
64 * @global boolean tell the "PMA_mysqlDie()" function headers have been
67 * @return boolean always true (no return indeed)
71 function PMA_auth_fails()
74 global $connect_func, $server_port, $server_socket, $cfg;
75 global $right_font_family, $font_size, $font_bigger;
76 global $is_header_sent;
77 if (PMA_mysql_error()) {
78 $conn_error = PMA_mysql_error();
79 } else if (isset($php_errormsg)) {
80 $conn_error = $php_errormsg;
82 $conn_error = 'Cannot connect: invalid settings.';
84 /* Commented out by Nijel: This causes displaying login and password from
85 * config when connection to MySQL server can't be established. (SQL parser
86 * fails on this and then displays it as wrong SQL.
88 /* $local_query = $connect_func . '('
89 . $cfg['Server']['host'] . $server_port . $server_socket . ', '
90 . $cfg['Server']['user'] . ', '
91 . $cfg['Server']['password'] . ')';*/
94 // Defines the charset to be used
95 header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
97 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
98 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
99 <html xmlns
="http://www.w3.org/1999/xhtml" xml
:lang
="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][2]; ?>" lang
="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][2]; ?>" dir
="<?php echo $GLOBALS['text_dir']; ?>">
102 <title
><?php
echo $GLOBALS['strAccessDenied']; ?
></title
>
103 <meta http
-equiv
="Content-Type" content
="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
104 <style type
="text/css">
106 body
{font
-family
: <?php
echo $right_font_family; ?
>; font
-size
: <?php
echo $font_size; ?
>; color
: #000000}
107 h1
{font
-family
: <?php
echo $right_font_family; ?
>; font
-size
: <?php
echo $font_bigger; ?
>; font
-weight
: bold
}
112 <body bgcolor
="<?php echo $cfg['RightBgColor']; ?>">
115 <h1
><?php
echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin ' . PMA_VERSION
); ?
></h1
>
120 $is_header_sent = TRUE;
121 echo '<p>' . $GLOBALS['strAccessDeniedExplanation'] . '</p>' . "\n";
122 PMA_mysqlDie($conn_error, $local_query, FALSE);
125 } // end of the 'PMA_auth_fails()' function
127 } // $__PMA_CONFIG_AUTH_LIB__