cvs: pearweb /include pear-auth.php
| From: | Thomas V.V.Cox | Date: | Tue, 21 Aug 2001 02:27:59 +0000 |
| Subject: | cvs: pearweb /include pear-auth.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-603@lists.php.net to get a copy of this message | ||
cox Mon Aug 20 22:27:59 2001 EDT
Modified files:
/pearweb/include pear-auth.php
Log:
whitespaces
Index: pearweb/include/pear-auth.php
diff -u pearweb/include/pear-auth.php:1.7 pearweb/include/pear-auth.php:1.8
--- pearweb/include/pear-auth.php:1.7 Tue Aug 7 17:18:37 2001
+++ pearweb/include/pear-auth.php Mon Aug 20 22:27:59 2001
@@ -25,38 +25,38 @@
$auth_user =& new PEAR_User($dbh, $user);
$ok = false;
switch (strlen(@$auth_user->password)) {
- // handle old-style DES-encrypted passwords
- case 13: {
- $seed = substr($auth_user->password, 0, 2);
- if (crypt($PHP_AUTH_PW, $seed) == @$auth_user->password) {
- $ok = true;
- }
- break;
- }
- // handle new-style MD5-encrypted passwords
- case 32: {
- if (md5($PHP_AUTH_PW) == @$auth_user->password) {
- $ok = true;
- }
- break;
- }
+ // handle old-style DES-encrypted passwords
+ case 13: {
+ $seed = substr($auth_user->password, 0, 2);
+ if (crypt($PHP_AUTH_PW, $seed) == @$auth_user->password) {
+ $ok = true;
+ }
+ break;
+ }
+ // handle new-style MD5-encrypted passwords
+ case 32: {
+ if (md5($PHP_AUTH_PW) == @$auth_user->password) {
+ $ok = true;
+ }
+ break;
+ }
}
if (empty($auth_user->registered)) {
- $ok = false;
+ $ok = false;
}
if (!$ok) {
- if (cvs_verify_password($user, $PHP_AUTH_PW)) {
- $auth_user = (object)array('handle' => $user);
- } else {
- auth_reject();
- }
+ if (cvs_verify_password($user, $PHP_AUTH_PW)) {
+ $auth_user = (object)array('handle' => $user);
+ } else {
+ auth_reject();
+ }
}
$auth_user->_readonly = true;
if ($admin && empty($auth_user->admin)) {
- response_header("Insufficient Privileges");
- report_error("Insufficient Privileges");
- response_footer();
- exit;
+ response_header("Insufficient Privileges");
+ report_error("Insufficient Privileges");
+ response_footer();
+ exit;
}
}
@@ -67,11 +67,11 @@
global $cvspasswd_file;
$fp = fopen($cvspasswd_file,"r");
while ($line = fgets($fp, 120)) {
- list($luser, $passwd, $groups) = explode(":", $line);
- if ($user == $luser) {
- fclose($fp);
- return $passwd;
- }
+ list($luser, $passwd, $groups) = explode(":", $line);
+ if ($user == $luser) {
+ fclose($fp);
+ return $passwd;
+ }
}
fclose($fp);
return false;
@@ -81,11 +81,11 @@
{
$psw = cvs_find_password($user);
if (strlen($psw) > 0) {
- if (crypt($pass,substr($psw,0,2)) == $psw) {
- return true;
- }
+ if (crypt($pass,substr($psw,0,2)) == $psw) {
+ return true;
+ }
}
return false;
}
-?>
+?>
\ No newline at end of file