cvs: pearweb /include pear-auth.php /public_html login.php
| From: | Daniel Convissor | Date: | Sat, 12 Jun 2004 13:32:45 +0000 |
| Subject: | cvs: pearweb /include pear-auth.php /public_html login.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-20562@lists.php.net to get a copy of this message | ||
danielc Sat Jun 12 09:32:45 2004 EDT
Modified files:
/pearweb/include pear-auth.php
/pearweb/public_html login.php
Log:
Perform basic check for user having coookies on in login.php
http://cvs.php.net/diff.php/pearweb/include/pear-auth.php?r1=1.44&r2=1.45&ty=u
Index: pearweb/include/pear-auth.php
diff -u pearweb/include/pear-auth.php:1.44 pearweb/include/pear-auth.php:1.45
--- pearweb/include/pear-auth.php:1.44 Fri Jun 11 00:37:53 2004
+++ pearweb/include/pear-auth.php Sat Jun 12 09:32:44 2004
@@ -15,7 +15,7 @@
+----------------------------------------------------------------------+
| Authors: |
+----------------------------------------------------------------------+
- $Id: pear-auth.php,v 1.44 2004/06/11 04:37:53 danielc Exp $
+ $Id: pear-auth.php,v 1.45 2004/06/12 13:32:44 danielc Exp $
*/
function auth_reject($realm = null, $message = null)
@@ -68,7 +68,6 @@
print "\" />\n";
print "</form>\n";
print hdelim();
- print "<p><strong>Note:</strong> Cookies must be enabled to log
in.</p>\n";
print "<p><strong>Note:</strong> If you just want to browse the
website, ";
print "you will not need to log in. For all tasks that require ";
print "authentication, you will be redirected to this form ";
@@ -274,4 +273,5 @@
$auth_user = null;
return false;
}
-?>
\ No newline at end of file
+
+?>
http://cvs.php.net/diff.php/pearweb/public_html/login.php?r1=1.16&r2=1.17&ty=u
Index: pearweb/public_html/login.php
diff -u pearweb/public_html/login.php:1.16 pearweb/public_html/login.php:1.17
--- pearweb/public_html/login.php:1.16 Thu Feb 12 16:17:12 2004
+++ pearweb/public_html/login.php Sat Jun 12 09:32:45 2004
@@ -15,9 +15,22 @@
+----------------------------------------------------------------------+
| Authors: |
+----------------------------------------------------------------------+
- $Id: login.php,v 1.16 2004/02/12 21:17:12 mj Exp $
+ $Id: login.php,v 1.17 2004/06/12 13:32:45 danielc Exp $
*/
+/*
+ * If the PHPSESSID cookie isn't set, the user MAY have cookies turned off.
+ * To figure out cookies are REALLY off, check to see if the person came
+ * from within the PEAR website or just submitted the login form.
+ */
+if (!isset($_COOKIE['PHPSESSID']) &&
+ ((strpos(@$_SERVER['HTTP_REFERER'], @$_GET['redirect']) !== false) ||
+ (isset($_POST['PEAR_USER']) && isset($_POST['PEAR_PW']))
+ )
+) {
+ auth_reject(PEAR_AUTH_REALM, 'Cookies must be enabled to log in.');
+}
+
if (auth_verify(@$_POST['PEAR_USER'], @$_POST['PEAR_PW'])) {
if (!empty($_POST['PEAR_PERSIST'])) {
$expire = 2147483647;
@@ -55,4 +68,5 @@
}
auth_reject(PEAR_AUTH_REALM, $msg);
+
?>