Code

Fixed problem with case sensitivity in class name comparals. PHP5 returns case sensit...
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 21 May 2005 09:50:42 +0000 (09:50 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 21 May 2005 09:50:42 +0000 (09:50 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@315 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_password-methods.inc

index 97157804e0f749f8ef3af84d1b0c3e92ca399780..f580eb75882b36879383f893e0e1c56efc38e0d5 100644 (file)
@@ -66,18 +66,18 @@ class passwordMethod
   function get_available_methods()
   {
     $ret =false;
-    $all = (get_declared_classes());
+    $all = get_declared_classes();
     $i = 0;
     foreach($all as $one) {
-      if((strstr($one,"passwordmethod" ))&&($one  != "passwordmethod")){
-        $name = str_replace ("passwordmethod","",$one);
+      if(preg_match('/passwordMethod/i', $one) && !preg_match("/^passwordMethod$/i", $one)){
+        $name = preg_replace ("/passwordMethod/i", "", $one);
         $test = new $one(false);
         if($test->is_available()) {
-          $ret['name'][$i]=str_replace ("passwordmethod","",$one);
+          $ret['name'][$i]= preg_replace ("/passwordMethod/i","",$one);
           $ret['class'][$i]=$one;
-          $ret[$i]['name']=str_replace ("passwordmethod","",$one);
-          $ret[$i]['class']=$one;
-          $ret[str_replace ("passwordmethod","",$one)]=$one;                    
+          $ret[$i]['name']= preg_replace("/passwordMethod/i","",$one);
+          $ret[$i]['class']= $one;
+          $ret[preg_replace ("/passwordMethod/i","",$one)]=$one;                    
           $i++;
         }
       }