lang
[phpmyadmin/crack.git] / libraries / auth / config.auth.lib.php3
blob3e1e97b73bde020d46bc96ad7200ed5fac679829
1 <?php
2 /* $Id$ */
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);
14 /**
15 * Displays authentication form
17 * @return boolean always true
19 * @access public
21 function PMA_auth()
23 return TRUE;
24 } // end of the 'PMA_auth()' function
27 /**
28 * Gets advanced authentication settings
30 * @return boolean always true
32 * @access public
34 function PMA_auth_check()
36 return TRUE;
37 } // end of the 'PMA_auth_check()' function
40 /**
41 * Set the user and password after last checkings if required
43 * @return boolean always true
45 * @access public
47 function PMA_auth_set_user()
49 return TRUE;
50 } // end of the 'PMA_auth_set_user()' function
53 /**
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
65 * sent
67 * @return boolean always true (no return indeed)
69 * @access public
71 function PMA_auth_fails()
73 global $php_errormsg;
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;
81 } else {
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'] . ')';*/
92 $local_query = '';
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']; ?>">
101 <head>
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">
105 <!--
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}
108 //-->
109 </style>
110 </head>
112 <body bgcolor="<?php echo $cfg['RightBgColor']; ?>">
113 <br /><br />
114 <center>
115 <h1><?php echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin ' . PMA_VERSION); ?></h1>
116 </center>
117 <br />
118 <?php
119 echo "\n";
120 $is_header_sent = TRUE;
121 echo '<p>' . $GLOBALS['strAccessDeniedExplanation'] . '</p>' . "\n";
122 PMA_mysqlDie($conn_error, $local_query, FALSE);
124 return TRUE;
125 } // end of the 'PMA_auth_fails()' function
127 } // $__PMA_CONFIG_AUTH_LIB__