Converting number of Excel column names no longer limited
[phpmyadmin/arisferyanto.git] / libraries / auth / config.auth.lib.php
blob71b94e53880cb29a530ed3ed9f0cfd91e422a99b
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Set of functions used to run config authentication (ie no authentication).
6 * @package phpMyAdmin-Auth-Config
7 * @version $Id$
8 */
11 /**
12 * Displays authentication form
14 * @return boolean always true
16 * @access public
18 function PMA_auth()
20 return TRUE;
21 } // end of the 'PMA_auth()' function
24 /**
25 * Gets advanced authentication settings
27 * @return boolean always true
29 * @access public
31 function PMA_auth_check()
33 return TRUE;
34 } // end of the 'PMA_auth_check()' function
37 /**
38 * Set the user and password after last checkings if required
40 * @return boolean always true
42 * @access public
44 function PMA_auth_set_user()
46 return TRUE;
47 } // end of the 'PMA_auth_set_user()' function
50 /**
51 * User is not allowed to login to MySQL -> authentication failed
53 * @global string the MySQL error message PHP returns
54 * @global string the connection type (persistent or not)
55 * @global string the MySQL server port to use
56 * @global string the MySQL socket port to use
57 * @global array the current server settings
58 * @global string the font face to use in case of failure
59 * @global string the default font size to use in case of failure
60 * @global string the big font size to use in case of failure
61 * @global boolean tell the "PMA_mysqlDie()" function headers have been
62 * sent
64 * @return boolean always true (no return indeed)
66 * @access public
68 function PMA_auth_fails()
70 global $php_errormsg, $cfg;
72 $conn_error = PMA_DBI_getError();
73 if (!$conn_error) {
74 if (isset($php_errormsg)) {
75 $conn_error = $php_errormsg;
76 } else {
77 $conn_error = $GLOBALS['strConnectionError'];
81 // Defines the charset to be used
82 header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
83 /* HTML header */
84 $page_title = $GLOBALS['strAccessDenied'];
85 require './libraries/header_meta_style.inc.php';
87 </head>
89 <body>
90 <br /><br />
91 <center>
92 <h1><?php echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin '); ?></h1>
93 </center>
94 <br />
95 <table border="0" cellpadding="0" cellspacing="3" align="center" width="80%">
96 <tr>
97 <td>
99 <?php
100 $GLOBALS['is_header_sent'] = TRUE;
102 if (isset($GLOBALS['allowDeny_forbidden']) && $GLOBALS['allowDeny_forbidden']) {
103 trigger_error($GLOBALS['strAccessDenied'], E_USER_NOTICE);
104 } else {
105 // Check whether user has configured something
106 if ($_SESSION['PMA_Config']->source_mtime == 0) {
107 echo '<p>' . sprintf($GLOBALS['strAccessDeniedCreateConfig'], '<a href="setup/">', '</a>') . '</p>' . "\n";
108 } elseif (!isset($GLOBALS['errno']) || (isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002) && $GLOBALS['errno'] != 2003) {
109 // if we display the "Server not responding" error, do not confuse users
110 // by telling them they have a settings problem
111 // (note: it's true that they could have a badly typed host name, but
112 // anyway the current $strAccessDeniedExplanation tells that the server
113 // rejected the connection, which is not really what happened)
114 // 2002 is the error given by mysqli
115 // 2003 is the error given by mysql
116 trigger_error($GLOBALS['strAccessDeniedExplanation'], E_USER_WARNING);
118 PMA_mysqlDie($conn_error, '', true, '', false);
120 $GLOBALS['error_handler']->dispUserErrors();
122 </td>
123 </tr>
124 <?php
125 if (count($GLOBALS['cfg']['Servers']) > 1) {
126 // offer a chance to login to other servers if the current one failed
127 require_once './libraries/select_server.lib.php';
128 echo '<tr>' . "\n";
129 echo ' <td>' . "\n";
130 PMA_select_server(TRUE, TRUE);
131 echo ' </td>' . "\n";
132 echo '</tr>' . "\n";
134 echo '</table>' . "\n";
135 require_once './libraries/footer.inc.php';
136 return TRUE;
137 } // end of the 'PMA_auth_fails()' function