initial support for multiple browser windows
[openemr.git] / interface / login / login.php
blob76ef049e37e80b8993f7363658e0627df4daafe4
1 <?php
2 $ignoreAuth=true;
3 include_once("../globals.php");
4 include_once("$srcdir/md5.js");
5 include_once("$srcdir/sql.inc");
6 ?>
7 <html>
8 <head>
9 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
11 <script language='JavaScript'>
13 function imsubmitted() {
14 <?php if (!empty($GLOBALS['restore_sessions'])) { ?>
15 // Delete the session cookie by setting its expiration date in the past.
16 // This forces the server to create a new session ID.
17 var olddate = new Date();
18 olddate.setFullYear(olddate.getFullYear() - 1);
19 document.cookie = '<?php echo session_name() . '=' . session_id() ?>; path=/; expires=' + olddate.toGMTString();
20 <?php } ?>
21 return true;
24 </script>
26 </head>
27 <body <?echo $login_body_line;?> topmargin=0 rightmargin=0 leftmargin=2 bottommargin=0 marginwidth=2 marginheight=0 onload="javascript:document.login_form.authUser.focus();" >
29 <span class="text"></span>
31 <center>
33 <form method="POST" action="../main/main_screen.php?auth=login" target="_top"
34 name="login_form" onsubmit="return imsubmitted();">
36 <?php
37 $res = sqlStatement("select distinct name from groups");
38 for ($iter = 0;$row = sqlFetchArray($res);$iter++)
39 $result[$iter] = $row;
40 if (count($result) == 1) {
41 $resvalue = $result[0]{"name"};
42 echo "<input type='hidden' name='authProvider' value='$resvalue' />\n";
46 <table width=100% height="90%">
47 <tr>
48 <td valign=middle width=33%>
49 <?echo $logocode;?>
50 </td>
51 <td align='center' valign='middle' width=34%>
52 <table>
53 <?php
54 if (count($result) != 1) {
56 <tr>
57 <td><span class="text"><? xl('Group:','e'); ?></span></td>
58 <td>
59 <select name=authProvider>
60 <?php
61 foreach ($result as $iter) {
62 echo "<option value='".$iter{"name"}."'>".$iter{"name"}."</option>\n";
65 </select>
66 </td></tr>
67 <?php
70 <tr>
71 <td><span class="text"><? xl('Username:','e'); ?></span></td>
72 <td>
73 <input type="entry" size=10 name=authUser>
74 </td></tr><tr>
75 <td><span class="text"><? xl('Password:','e'); ?></span></td>
76 <td>
77 <input type="password" size=10 name=clearPass>
78 </td></tr>
79 <tr><td>&nbsp;</td><td>
80 <input type="hidden" name="authPass">
81 <input type="submit" onClick="javascript:this.form.authPass.value=MD5(this.form.clearPass.value);this.form.clearPass.value='';" value=<? xl('Login','e');?>>
82 </td></tr>
83 </table>
85 </td>
86 <td width=33%>
88 <!-- Uncomment this for the OpenEMR demo installation
89 <p><center>login = admin
90 <br>password = pass
91 -->
93 </center></p>
95 </td>
96 </table>
98 </form>
100 <address>
101 <a href="copyright_notice.html" target="main"><? xl('Copyright Notice','e'); ?></a><br />
102 </address>
104 </center>
105 </body>
106 </html>