/[libdata]/branches/pear-db/admin/login.phtml
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /branches/pear-db/admin/login.phtml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 50 - (hide annotations)
Fri Mar 5 22:38:33 2004 UTC (20 years, 1 month ago) by dpavlin
File size: 2413 byte(s)
initial changes to support PEAR::DB. Mostly broken, can it can select.

1 dpavlin 1 <?php
2     // Load global parameters
3     require_once ("global_vars.php");
4    
5 dpavlin 50
6 dpavlin 1 // Includes
7     require_once ($GLOBAL_ADMIN_INC."db_connect.php");
8     require_once ($GLOBAL_ADMIN_INC."validate_mysql.php");
9     require_once ($GLOBAL_ADMIN_INC."sessionClass.php");
10    
11     // Login status message
12     $message ="";
13    
14     // User is validating
15     if (strlen($user) > 0 && strlen($pass) > 0) {
16    
17     // Attempt to validate
18     $validated = 0;
19     $validated = validateUser($con, $pass, $user);
20     if ($validated > 0) {
21     $sessionClass = new sessionClass(7200, "", $user);
22     header("Location: " . $GLOBAL_ADMIN_URL. "console.phtml?session_id=" . $sessionClass->session_id);
23     exit;
24     } // redirect
25     else $message = "<font color=\"#660000\"><b>Message</b>:</font> Invalid user/password.<BR><BR>";
26    
27     } // validating
28    
29    
30     // User is logging out.
31     else if (strlen($session_id) > 0) {
32     $sessionClass = new sessionClass("", $session_id, "");
33     //Call the logout method
34     if ($sessionClass->valid > 0){
35     $sessionClass->logoutSessionID();
36     $message = "<font color=\"#660000\"><b>Message:</b></font> Logged out successfully.<BR><BR>";
37     }
38     }
39    
40     // Blow away the cache regardless
41     header ("Expires: Fri,09 Sep 1966 06:09:06 GMT");
42     header ("Last-Modified: ") . gmdate("D, d M Y H:i:s") . " GMT";
43     header ("Cache-Control: no-cache, must revalidate");
44     header ("Pragma: no-cache");
45    
46     // Page title
47     printf("<title>%s Login</title>", $GLOBAL_SYS_NAME);
48     printf("<link rel=\"stylesheet\" href=\"%s\" type=\"text/css\">", $GLOBAL_ADMIN_CSS);
49    
50    
51     // Page header display
52     require_once ($GLOBAL_ADMIN_HEADER);
53    
54    
55     printf("<center>");
56    
57     ?>
58    
59    
60     <table width="450" height="200" class="backLight" border="1" cellpadding="4">
61     <tr>
62     <td class="cellPlain">
63     <?php
64     printf("%s ", $GLOBAL_SYS_NAME);
65     ?>
66     </td>
67     </tr>
68    
69     <tr align="center">
70     <td>
71     <br>
72     <form method="post" action="login.phtml">
73     Account: <input type="text" name="user"><br><br>
74     Password: <input type="password" name="pass"><br>
75     <br>
76     <input type="submit" value="Login">
77     </form>
78    
79     <br>Cookies must be enabled on your browser.<br><br>
80     <h6>Access to this resource is logged.<br>Restricted to authorized staff only.</h6>
81     <?php
82     printf("%s<BR>", $message);
83     printf("If you are unable to login, please contact ");
84     printf("<a href=\"mailto:%s\">%s</a>.", $GLOBAL_ADMIN_EMAIL, $GLOBAL_ADMIN_NAME);
85     ?>
86     </td>
87     </tr>
88     </table>
89    
90    
91     <?php
92    
93    
94     // Page footer
95     require_once ($GLOBAL_ADMIN_FOOTER);
96     ?>
97    
98     </center>
99     </body>
100     </html>

  ViewVC Help
Powered by ViewVC 1.1.26