Author: coudot
Date: 2010-02-13 16:56:45 +0100 (Sat, 13 Feb 2010)
New Revision: 54

Modified:
   self-service-password/trunk/functions.inc.php
   self-service-password/trunk/index.php
   self-service-password/trunk/lang.inc.php
Log:
#164: add mhash verification and sambaPwdLastSet value

Modified: self-service-password/trunk/functions.inc.php
===================================================================
--- self-service-password/trunk/functions.inc.php       2010-02-12 17:14:33 UTC 
(rev 53)
+++ self-service-password/trunk/functions.inc.php       2010-02-13 15:56:45 UTC 
(rev 54)
@@ -86,7 +86,7 @@
 # Get message criticity
 function get_criticity( $msg ) {
        
-       if ( ereg( "nophpldap|ldaperror|nomatch|badcredentials|passworderror" , 
$msg ) ) {
+       if ( ereg( 
"nophpldap|nophpmhash|ldaperror|nomatch|badcredentials|passworderror" , $msg ) 
) {
                return "critical";
        }
        

Modified: self-service-password/trunk/index.php
===================================================================
--- self-service-password/trunk/index.php       2010-02-12 17:14:33 UTC (rev 53)
+++ self-service-password/trunk/index.php       2010-02-13 15:56:45 UTC (rev 54)
@@ -63,6 +63,9 @@
 # Check PHP-LDAP presence
 if( ! function_exists('ldap_connect') ) { $result="nophpldap"; }
 
+# Check PHP mhash presence if Samba mode on
+if( $samba_mode == "on" and ! function_exists('mhash') ) { 
$result="nophpmhash"; }
+
 #==============================================================================
 # Change password
 #==============================================================================
@@ -115,7 +118,8 @@
 
     # Set Samba password value
     if ( $samba_mode == "on" ) {
-       $userdata["sambaNTPassword"] = make_md4_password($newpassword);
+        $userdata["sambaNTPassword"] = make_md4_password($newpassword);
+        $userdata["sambaPwdLastSet"] = time();
     }
 
     # Transform password value

Modified: self-service-password/trunk/lang.inc.php
===================================================================
--- self-service-password/trunk/lang.inc.php    2010-02-12 17:14:33 UTC (rev 53)
+++ self-service-password/trunk/lang.inc.php    2010-02-13 15:56:45 UTC (rev 54)
@@ -23,6 +23,7 @@
 # English
 #==============================================================================
 $messages['en']['nophpldap'] = "You should install PHP-Ldap to use this tool";
+$messages['en']['nophpmhash'] = "You should install PHP mhash to use Samba 
mode";
 $messages['en']['ldaperror'] = "Cannot access to LDAP directory";
 $messages['en']['loginrequired'] = "Your login is required";
 $messages['en']['oldpasswordrequired'] = "Your old password is required";
@@ -43,6 +44,7 @@
 # French
 #==============================================================================
 $messages['fr']['nophpldap'] = "Vous devriez installer PHP-Ldap pour utiliser 
cet outil";
+$messages['fr']['nophpmhash'] = "Vous devriez installer PHP mhash pour 
utiliser le mode Samba";
 $messages['fr']['ldaperror'] = "Erreur d'accès à l'annuaire";
 $messages['fr']['loginrequired'] = "Vous devez indiquer votre identifiant";
 $messages['fr']['oldpasswordrequired'] = "Vous devez indiquer votre ancien mot 
de passe";
@@ -63,6 +65,7 @@
 # German
 #==============================================================================
 $messages['de']['nophpldap'] = "Sie benötigen die PHP-Ldap Erweiterung um 
dieses Tool zu nutzen";
+$messages['de']['nophpmash'] = "Sie benötigen die PHP mhash Erweiterung um 
Samba mode zu nutzen";
 $messages['de']['ldaperror'] = "Kein Zugriff auf das LDAP möglich";
 $messages['de']['loginrequired'] = "Ihr Login wird benötigt";
 $messages['de']['oldpasswordrequired'] = "Ihr altes Passwort wird benötigt";

_______________________________________________
ltb-changes mailing list
[email protected]
http://lists.ltb-project.org/listinfo/ltb-changes

Reply via email to