Fix for the Open in New Window in Patient/Client->Patients search gui, take 2.
[openemr.git] / phpmyadmin / libraries / auth / config.auth.lib.php
bloba73775122ebe64e9eaf84ac69c1f0b5cd3194831
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 * @version $Id$
7 */
10 /**
11 * Displays authentication form
13 * @return boolean always true
15 * @access public
17 function PMA_auth()
19 return TRUE;
20 } // end of the 'PMA_auth()' function
23 /**
24 * Gets advanced authentication settings
26 * @return boolean always true
28 * @access public
30 function PMA_auth_check()
32 return TRUE;
33 } // end of the 'PMA_auth_check()' function
36 /**
37 * Set the user and password after last checkings if required
39 * @return boolean always true
41 * @access public
43 function PMA_auth_set_user()
45 return TRUE;
46 } // end of the 'PMA_auth_set_user()' function
49 /**
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
61 * sent
63 * @return boolean always true (no return indeed)
65 * @access public
67 function PMA_auth_fails()
69 global $php_errormsg, $cfg;
71 $conn_error = PMA_DBI_getError();
72 if (!$conn_error) {
73 if (isset($php_errormsg)) {
74 $conn_error = $php_errormsg;
75 } else {
76 $conn_error = $GLOBALS['strConnectionError'];
80 // Defines the charset to be used
81 header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
82 /* HTML header */
83 $page_title = $GLOBALS['strAccessDenied'];
84 require './libraries/header_meta_style.inc.php';
86 </head>
88 <body>
89 <br /><br />
90 <center>
91 <h1><?php echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin ' . PMA_VERSION); ?></h1>
92 </center>
93 <br />
94 <table border="0" cellpadding="0" cellspacing="3" align="center" width="80%">
95 <tr>
96 <td>
97 <?php
98 echo "\n";
99 $GLOBALS['is_header_sent'] = TRUE;
102 * @todo I have included this div from libraries/header.inc.php to work around
103 * an undefined variable in tooltip.js, when the server is not responding.
104 * Work has to be done to merge all code that starts the page (DOCTYPE and
105 * this div) to one place
108 <div id="TooltipContainer" onmouseover="holdTooltip();" onmouseout="swapTooltip('default');"></div>
109 <?php
111 if (isset($GLOBALS['allowDeny_forbidden']) && $GLOBALS['allowDeny_forbidden']) {
112 echo '<p>' . $GLOBALS['strAccessDenied'] . '</p>' . "\n";
113 } else {
114 // Check whether user has configured something
115 if ($_SESSION['PMA_Config']->source_mtime == 0) {
116 echo '<p>' . sprintf($GLOBALS['strAccessDeniedCreateConfig'], '<a href="scripts/setup.php">', '</a>') . '</p>' . "\n";
117 } elseif (!isset($GLOBALS['errno']) || (isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002) && $GLOBALS['errno'] != 2003) {
118 // if we display the "Server not responding" error, do not confuse users
119 // by telling them they have a settings problem
120 // (note: it's true that they could have a badly typed host name, but
121 // anyway the current $strAccessDeniedExplanation tells that the server
122 // rejected the connection, which is not really what happened)
123 // 2002 is the error given by mysqli
124 // 2003 is the error given by mysql
125 echo '<p>' . $GLOBALS['strAccessDeniedExplanation'] . '</p>' . "\n";
127 PMA_mysqlDie($conn_error, '', true, '', false);
129 if (! empty($GLOBALS['PMA_errors']) && is_array($GLOBALS['PMA_errors'])) {
130 foreach ($GLOBALS['PMA_errors'] as $error) {
131 echo '<div class="error">' . $error . '</div>' . "\n";
135 </td>
136 </tr>
137 <?php
138 if (count($GLOBALS['cfg']['Servers']) > 1) {
139 // offer a chance to login to other servers if the current one failed
140 require_once './libraries/select_server.lib.php';
141 echo '<tr>' . "\n";
142 echo ' <td>' . "\n";
143 PMA_select_server(TRUE, TRUE);
144 echo ' </td>' . "\n";
145 echo '</tr>' . "\n";
147 echo '</table>' . "\n";
148 require_once './libraries/footer.inc.php';
149 return TRUE;
150 } // end of the 'PMA_auth_fails()' function