svn: /web/php-bugs/trunk/www/ login.php
| From: | Felipe Pena | Date: | Sun, 03 Jul 2011 20:32:37 +0000 |
| Subject: | svn: /web/php-bugs/trunk/www/ login.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-11445@lists.php.net to get a copy of this message | ||
felipe Sun, 03 Jul 2011 20:32:37 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=312866
Log:
- Added login form
Changed paths:
A web/php-bugs/trunk/www/login.php
Added: web/php-bugs/trunk/www/login.php
===================================================================
--- web/php-bugs/trunk/www/login.php (rev 0)
+++ web/php-bugs/trunk/www/login.php 2011-07-03 20:32:37 UTC (rev 312866)
@@ -0,0 +1,52 @@
+<?php
+
+session_start();
+
+require_once '../include/prepend.php';
+
+if (isset($_SESSION['credentials']) && count($_SESSION['credentials'])
== 2) {
+ if (!empty($_SESSION['credentials'][0])) {
+ header('location: index.php');
+ exit;
+ } else {
+ $_SESSION['credentials'] = NULL;
+ }
+}
+
+response_header('Login');
+
+if (isset($_POST['user'])) {
+ bugs_authenticate (&$user, &$pwd, &$logged_in, &$user_flags);
+
+ if ($logged_in === 'developer') {
+ header('location: index.php');
+ exit;
+ } else {
+?>
+ <div style="background: #AB1616; padding: 3px; width: 300px; color: #FFF; margin:
3px;">Wrong username or password!</div>
+<?php
+ }
+}
+
+?>
+
+<form method="post" action="login.php">
+<input type="hidden" name="save" value="1" />
+<table>
+ <tr>
+ <th align="right">Username:</th>
+ <td><input type="text" name="user" value="<?php print
isset($user) ? htmlspecialchars($user) : ''; ?>" />@php.net
+ </tr>
+ <tr>
+ <th align="right">Password:</th>
+ <td><input type="password" name="pw" value="<?php print
isset($pwd) ? htmlspecialchars($pwd) : ''; ?>" />
+ </tr>
+ <tr>
+ <td align="center" colspan="2"><input type="submit"
value="Login" /></td>
+ </tr>
+</table>
+</form>
+
+<?php
+response_footer();
+?>