phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] api/class.auth.php, 1.1.1.1.2.10


From: nomail
Subject: [Phpgroupware-cvs] api/class.auth.php, 1.1.1.1.2.10
Date: Tue, 6 Jul 2004 09:23:58 +0200

Update of /api
Modified Files:
        Branch: proposal-branch
          class.auth.php

date: 2004/07/06 07:23:58;  author: jengo;  state: Exp;  lines: +11 -11

Log Message:
Initial work to ACL, more info is in the wiki journal
=====================================================================
Index: api/class.auth.php
diff -u api/class.auth.php:1.1.1.1.2.9 api/class.auth.php:1.1.1.1.2.10
--- api/class.auth.php:1.1.1.1.2.9      Mon Jun 28 21:40:56 2004
+++ api/class.auth.php  Tue Jul  6 07:23:58 2004
@@ -66,8 +66,8 @@
                        switch 
($GLOBALS['phpgw_data']['server']['password_type'])
                        {
                                case 'SSHA':
-                                       mt_srand((double)microtime()*1000000);
-                                       $salt = mhash_keygen_s2k(MHASH_SHA1, 
$passwd, substr(pack('h*', md5(mt_rand())),0,8),4);
+                                       mt_srand((double)microtime()*1000000);
+                                       $salt = mhash_keygen_s2k(MHASH_SHA1, 
$passwd, substr(pack('h*', md5(mt_rand())),0,8),4);
                                        return '{SSHA}' . 
base64_encode(mhash(MHASH_SHA1, $passwd.$salt) . $salt);
                                        break;
                                case 'SHA':
@@ -77,7 +77,7 @@
                                        return '{CRYPT}' . crypt($passwd);
                                        break;
                                case 'SMD5':
-                                       $salt = substr(md5(time() . mt_rand() . 
$passwd),0,8);
+                                       $salt = substr(md5(time() . mt_rand() . 
$passwd),0,8);
                                        return '{SMD5}' . $salt . md5($salt . 
$passwd);
                                        break;
                                // Default type is MD5 no salt
@@ -92,10 +92,10 @@
                        switch ($type)
                        {
                                case 'SSHA':
-                                       $h_passwd      = 
base64_decode($h_passwd);
-                                       $original_hash = substr($h_passwd, 0, 
20);
-                                       $salt          = substr($h_passwd, 20);
-                                       $new_hash      = mhash(MHASH_SHA1, 
$u_passwd . $salt);
+                                       $h_passwd      = 
base64_decode($h_passwd);
+                                       $original_hash = substr($h_passwd, 0, 
20);
+                                       $salt          = substr($h_passwd, 20);
+                                       $new_hash      = mhash(MHASH_SHA1, 
$u_passwd . $salt);
                                        if ($original_hash == $new_hash)
                                        {
                                                return true;
@@ -114,10 +114,10 @@
                                        }
                                        break;
                                case 'SMD5':
-                                       $salt = substr($h_passwd,0,8);
+                                       $salt = substr($h_passwd,0,8);
                                        if ($salt . md5($salt . $u_passwd) == 
$h_passwd)
-                                       {
-                                               return true;
+                                       {
+                                               return true;
                                        }
                                        break;
                                // Default type is MD5 no salt




reply via email to

[Prev in Thread] Current Thread [Next in Thread]