Code

Updated in_array checks in GOsa.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jul 2011 06:38:29 +0000 (06:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jul 2011 06:38:29 +0000 (06:38 +0000)
PHPs in_array function casts operant types in a unconventional way.

e.g.    This is true in_array("+49134", array("00491234"))

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20952 594d385d-05f5-0310-b6e9-bd551577e9d8

48 files changed:
gosa-core/include/class_CopyPasteHandler.inc
gosa-core/include/class_ItemSelector.inc
gosa-core/include/class_acl.inc
gosa-core/include/class_config.inc
gosa-core/include/class_configRegistry.inc
gosa-core/include/class_gosaSupportDaemon.inc
gosa-core/include/class_ldap.inc
gosa-core/include/class_listing.inc
gosa-core/include/class_log.inc
gosa-core/include/class_management.inc
gosa-core/include/class_msg_dialog.inc
gosa-core/include/class_multi_plug.inc
gosa-core/include/class_plugin.inc
gosa-core/include/class_releaseSelector.inc
gosa-core/include/class_remoteObject.inc
gosa-core/include/class_sortableListing.inc
gosa-core/include/class_tabs.inc
gosa-core/include/class_userFilter.inc
gosa-core/include/class_userFilterEditor.inc
gosa-core/include/class_userinfo.inc
gosa-core/include/exporter/class_pdfExporter.inc
gosa-core/include/functions.inc
gosa-core/include/utils/class_tests.inc
gosa-core/include/utils/class_xml.inc
gosa-core/plugins/addons/dyngroup/class_DynamicLdapGroup.inc
gosa-core/plugins/addons/propertyEditor/class_propertyEditor.inc
gosa-core/plugins/admin/departments/class_department.inc
gosa-core/plugins/admin/groups/class_group.inc
gosa-core/plugins/admin/ogroups/class_ogroup.inc
gosa-core/plugins/admin/ogroups/objectSelect/class_objectSelect.inc
gosa-core/plugins/admin/ogroups/tabs_ogroups.inc
gosa-core/plugins/admin/users/class_userManagement.inc
gosa-core/plugins/generic/dashBoard/class_rssReader.inc
gosa-core/plugins/generic/infoPage/class_infoPage.inc
gosa-core/plugins/generic/references/class_aclResolver.inc
gosa-core/plugins/generic/statistics/chartClasses/class_actionSelectChart.inc
gosa-core/plugins/generic/statistics/chartClasses/class_categoryActionOverTime.inc
gosa-core/plugins/generic/statistics/chartClasses/class_objectCountChart.inc
gosa-core/plugins/generic/statistics/chartClasses/class_passwordChangeChart.inc
gosa-core/plugins/generic/statistics/chartClasses/class_statChart.inc
gosa-core/plugins/generic/statistics/class_statistics.inc
gosa-core/plugins/personal/generic/class_user.inc
gosa-core/plugins/personal/posix/class_posixAccount.inc
gosa-core/plugins/personal/posix/groupSelect/class_filterLDAPBlacklist.inc
gosa-core/plugins/personal/posix/trustModeDialog/class_trustModeDialog.inc
gosa-core/setup/class_setupStep_Ldap.inc
gosa-core/setup/class_setupStep_Migrate.inc
gosa-core/setup/class_setupStep_Schema.inc

index 62f3e3702e01ee030248ed034f9f0735e35a1ff7..1149370076b558c8f19c07a94fd80e5169a97006 100644 (file)
@@ -73,7 +73,7 @@ class CopyPasteHandler {
       return(FALSE);
     }
 
-    if(!in_array($action,array("cut","copy"))){
+    if(!in_array_strict($action,array("cut","copy"))){
       trigger_error(sprintf("Specified action %s does not exists for copy & paste.", bold($action)));
       return(FALSE);
     } 
index 3d7bdbf2179092979d311497fbbb5c0a800b1048..4b7d180b78dbe03916c2d17d4410389d20b1b476 100644 (file)
@@ -46,7 +46,7 @@ class ItemSelector {
 
         // Generate instance wide unique ID
         $pid = "";
-        while($pid == "" || in_array($pid, $usedIds)){
+        while($pid == "" || in_array_strict($pid, $usedIds)){
 
             // Wait 1 msec to ensure that we definately get a new id
             if($pid != "") usleep(1);
index d60af7ce369b04b6c9195538ab8e3b87d3f99053..ce9785fa98401b92198bccbee70880202b43a07d 100644 (file)
@@ -572,7 +572,7 @@ class acl extends plugin
 
             if($this->acl_is_writeable("")) {
                 foreach($this->dialog->save() as $entry) {
-                    if(in_array("posixGroup", $entry['objectClass'])) {
+                    if(in_array_strict("posixGroup", $entry['objectClass'])) {
                         $key = "G:" . $entry['dn'];
                         $vData = array("data" => array($groupIcon, $entry['cn'][0], $entry['description'][0]));
 
index d53fe27ae7679f81e4d63d55ba2e029b5f9e564a..5293e4138ab91a1dea7894649c7a647c97e34794 100644 (file)
@@ -756,7 +756,7 @@ class config  {
             /* Detect department type */
             $type_data = array();
             foreach($types as $t => $data){
-                if(in_array($data['OC'],$attrs['objectClass'])){
+                if(in_array_strict($data['OC'],$attrs['objectClass'])){
                     $type_data = $data;
                     break;
                 }
index e9b48edab7ee406194d2c09fe708f0ada2792e08..ca23f4b003d65b7c7ed0853ac2230c3c54408a33 100644 (file)
@@ -334,7 +334,7 @@ class configRegistry{
                     if(count($info) > 2){
                         foreach($info as $name => $value){
                             
-                            if(!in_array($name, array('CLASS','NAME'))){
+                            if(!in_array_strict($name, array('CLASS','NAME'))){
                                 $class= $info['CLASS'];    
                                 $this->fileStoredProperties[$class][strtolower($name)] = $value;
                             }
@@ -355,7 +355,7 @@ class configRegistry{
                 
                     if(count($entry) > 2 ){
                         foreach($entry as $name => $value){
-                            if(!in_array($name, array('CLASS','ACL'))){
+                            if(!in_array_strict($name, array('CLASS','ACL'))){
                                 $this->fileStoredProperties[strtolower($class)][strtolower($name)] = $value;
                             }
                         }
@@ -375,7 +375,7 @@ class configRegistry{
 
                 if(count($entry) > 2 ){
                     foreach($entry as $name => $value){
-                        if(!in_array($name, array('CLASS','ACL'))){
+                        if(!in_array_strict($name, array('CLASS','ACL'))){
                             $this->fileStoredProperties[strtolower($class)][strtolower($name)] = $value;
                         }
                     }
@@ -567,7 +567,7 @@ class configRegistry{
         foreach($this->properties as $prop){
 
             // Is this property modified
-            if(in_array($prop->getStatus(),array('modified','removed'))){
+            if(in_array_strict($prop->getStatus(),array('modified','removed'))){
 
                 // Check if we've to migrate something before we can make the changes effective. 
                 if($prop->migrationRequired()){
@@ -681,7 +681,7 @@ class gosaProperty
 
     static function isBool($message,$class,$name,$value, $type)
     {
-        $match = in_array($value,array('true','false',''));
+        $match = in_array_strict($value,array('true','false',''));
 
         // Display the reason for failing this check.         
         if($message && ! $match){
@@ -912,7 +912,7 @@ class gosaProperty
 
     function setValue($str) 
     {
-        if(in_array($this->getStatus(), array('modified'))){
+        if(in_array_strict($this->getStatus(), array('modified'))){
             $this->tmp_value = $str; 
         }elseif($this->value != $str){
             $this->setStatus('modified'); 
@@ -923,7 +923,7 @@ class gosaProperty
     function getValue($temporary = FALSE) 
     { 
         if($temporary){
-            if(in_array($this->getStatus(), array('modified','removed'))){
+            if(in_array_strict($this->getStatus(), array('modified','removed'))){
                 return($this->tmp_value); 
             }else{
                 return($this->value); 
@@ -945,7 +945,7 @@ class gosaProperty
 
     function restoreDefault() 
     {
-        if(in_array($this->getStatus(),array('ldap'))){
+        if(in_array_strict($this->getStatus(),array('ldap'))){
             $this->setStatus('removed'); 
 
             // Second check for values in the config file.
@@ -1024,7 +1024,7 @@ class gosaProperty
 
     private function setStatus($state) 
     {
-        if(!in_array($state, array('ldap','file','undefined','modified','removed'))) {
+        if(!in_array_strict($state, array('ldap','file','undefined','modified','removed'))) {
             trigger_error("Unknown property status given '{$state}' for {$this->class}:{$this->name}!");
         }else{
             $this->status = $state; 
index 81272f9a4c5f4e808a7a9e7e685aca6df02eac93..b140e805370f13b39e3ee36bdbd599dc644c72bc 100644 (file)
@@ -177,7 +177,7 @@ class gosaSupportDaemon
     $line = __LINE__;
     $class = __CLASS__;
     foreach($debug as $info){
-      if(!in_array($info['function'],array("send_data","_send","set_error","connect"))){
+      if(!in_array_strict($info['function'],array("send_data","_send","set_error","connect"))){
         $file = $info['file'];
         $line = $info['line'];
         $class = get_class($this);
@@ -1039,7 +1039,7 @@ class gosaSupportDaemon
     $line = __LINE__;
     $class = __CLASS__;
     foreach($debug as $info){
-      if(!in_array($info['function'],array("send_data","_send"))){
+      if(!in_array_strict($info['function'],array("send_data","_send"))){
         $file = $info['file'];
         $line = $info['line'];
         $class = get_class($this);
index eae0753ceee665b22910ddee690b85ca457f4cdb..0d30c00399bf3fc9ffc1bc71fd7b9bdf15596641 100644 (file)
@@ -787,7 +787,7 @@ class LDAP
                     /* Get name of first matching objectClass */
                     $ocname= "";
                     foreach($classes as $class){
-                        if (isset($class['MUST']) && in_array($type, $class['MUST'])){
+                        if (isset($class['MUST']) && in_array_strict($type, $class['MUST'])){
 
                             /* Look for first classes that is structural... */
                             if (isset($class['STRUCTURAL'])){
@@ -988,7 +988,7 @@ class LDAP
 
         // Check scope values
         $scope = trim($scope);
-        if(!empty($scope) && !in_array($scope, array('base', 'one', 'sub', 'children'))){
+        if(!empty($scope) && !in_array_strict($scope, array('base', 'one', 'sub', 'children'))){
             trigger_error(sprintf("Invalid parameter for scope '%s', please use 'base', 'one', 'sub' or 'children'."), $scope);
             return(NULL);
         }
@@ -1303,7 +1303,7 @@ class LDAP
                     $attrs = $this->fetch($srp);
                     foreach($attrs as $name => $value ){
                         if(!is_numeric($name)){
-                            if(in_array($name,array("dn","count"))) continue;
+                            if(in_array_strict($name,array("dn","count"))) continue;
                             if(!isset($data[$name])){
                                 $data[$name] = array();
                             }
@@ -1398,7 +1398,7 @@ class LDAP
 
                     case ')': if ($name != ""){
                                   $v = $this->value2container($value);
-                                  if(in_array($name, array('MUST', 'MAY')) && !is_array($v)){
+                                  if(in_array_strict($name, array('MUST', 'MAY')) && !is_array($v)){
                                       $v = array($v);
                                   }
                                   $objectclasses[$ocname][$name]= $v;
@@ -1417,7 +1417,7 @@ class LDAP
                     case 'MAY':
                               if ($name != ""){
                                   $v = $this->value2container($value);
-                                  if(in_array($name, array('MUST', 'MAY')) && !is_array($v)){
+                                  if(in_array_strict($name, array('MUST', 'MAY')) && !is_array($v)){
                                       $v = array($v);
                                   }
                                   $objectclasses[$ocname][$name]= $v;
index 90b774208c1420c08d2ecda18f636c9b86cd89d3..5f04cdf3171a7afaec3a68837a978771564a0ba6 100644 (file)
@@ -872,11 +872,11 @@ function getObjectType($types, $classes)
         foreach ($ocs as $oc){
             if (preg_match('/^!(.*)$/', $oc, $match)) {
                 $oc= $match[1];
-                if (in_array($oc, $classes)) {
+                if (in_array_strict($oc, $classes)) {
                     $found= false;
                 }
             } else {
-                if (!in_array($oc, $classes)) {
+                if (!in_array_strict($oc, $classes)) {
                     $found= false;
                 }
             }
@@ -956,12 +956,12 @@ function filterActions($dn, $row, $classes)
             $objectclass= $action['objectclass'];
             if (preg_match('/^!(.*)$/', $objectclass, $m)){
                 $objectclass= $m[1];
-                if(in_array($objectclass, $classes)) {
+                if(in_array_strict($objectclass, $classes)) {
                     $result.= image('images/empty.png');
                     continue;
                 }
             } elseif (is_string($objectclass)) {
-                if(!in_array($objectclass, $classes)) {
+                if(!in_array_strict($objectclass, $classes)) {
                     $result.= image('images/empty.png');
                     continue;
                 }
@@ -1427,14 +1427,14 @@ function getDepartments()
 
     // Analyze list of departments
     foreach ($res as $department) {
-        if (!in_array($department['dn'], $validDepartments)) {
+        if (!in_array_strict($department['dn'], $validDepartments)) {
             continue;
         }
 
         // Add the attribute where we use for sorting
         $oc= null;
         foreach(array_keys($types) as $type) {
-            if (in_array($type, $department['objectClass'])) {
+            if (in_array_strict($type, $department['objectClass'])) {
                 $oc= $type;
                 break;
             }
index b03687de7ef086ec8acea8499efafc0957311f5b..6568778daf26807c5ee9576fe302679f78f78869 100644 (file)
@@ -98,7 +98,7 @@ class log {
   {
     $msgs = array();
 
-    if(!isset($entry['action']) || !in_array($entry['action'],array("modify","create","remove","copy","snapshot","view","security","debug"))){
+    if(!isset($entry['action']) || !in_array_strict($entry['action'],array("modify","create","remove","copy","snapshot","view","security","debug"))){
       $msgs[] = sprintf(_("Invalid option %s specified!"), bold($entry['action']));
     }
 
index 0e31efbeac96d938ecda86638fc755ea22286ca5..eb00b048b947f6af87f979d80fd9e785e3167cf3 100644 (file)
@@ -1016,7 +1016,7 @@ class management
    */
   function handle_post_events($mode, $addAttrs= array())
   {
-    if(!in_array($mode, array('add','remove','modify'))){
+    if(!in_array_strict($mode, array('add','remove','modify'))){
       trigger_error(sprintf("Invalid post event type given %s! Valid types are [add,modify,remove].", bold($mode)));
       return;
     }
index 656fe69440c5deb283210726cc22496f291852c2..203dfd8ccb89b4334c318a9b87d80cac81bae9c2 100644 (file)
@@ -41,7 +41,7 @@ class msg_dialog
 
         if(empty($s_message)) return;
 
-        if(!in_array($i_type,array(INFO_DIALOG,WARNING_DIALOG,ERROR_DIALOG,CONFIRM_DIALOG,FATAL_ERROR_DIALOG,OK_CANCEL_DIALOG))){
+        if(!in_array_strict($i_type,array(INFO_DIALOG,WARNING_DIALOG,ERROR_DIALOG,CONFIRM_DIALOG,FATAL_ERROR_DIALOG,OK_CANCEL_DIALOG))){
             trigger_error("Invalid msg_dialog type.");
             $i_type = INFO_DIALOG;
         }
index ff1e8b6c520656b6a6bcabe78343de21032d688a..3c9d5aaba0b1a8115865b5ddc8277ef69e8e4337 100644 (file)
@@ -213,7 +213,7 @@ class multi_plug
             $add[$key]['count'] = count($add[$key]);
           }
           for($i=0;$i<$add[$key]['count'];$i++){
-            if(!in_array($add[$key][$i],$base[$key])){
+            if(!in_array_strict($add[$key][$i],$base[$key])){
               $base[$key][] = $add[$key][$i];
               $base[$key]['count']++;
             }
@@ -245,7 +245,7 @@ class multi_plug
             $base[$key]['count'] = count($base[$key]);
           }
         for($i = 0 ; $i < $base[$key]['count'] ; $i ++){
-          if(isset($base[$key][$i]) && in_array($base[$key][$i],$minus[$key])){
+          if(isset($base[$key][$i]) && in_array_strict($base[$key][$i],$minus[$key])){
             $tmp[] = $base[$key][$i];
           }
         }
index 0180a8529a50fc25e108417911f1fecfdd84d9ad..692feb5e82481b2cee96d093ab56f93a5c28c22d 100644 (file)
@@ -438,7 +438,7 @@ class plugin
    */
   function handle_pre_events($mode, $addAttrs= array())
   {
-    if(!in_array($mode, array('add','remove','modify'))){
+    if(!in_array_strict($mode, array('add','remove','modify'))){
       trigger_error(sprintf("Invalid pre event type given %s! Valid types are [add,modify,remove].", $mode));
       return;
     }
@@ -607,7 +607,7 @@ class plugin
     foreach($this->attributes as $name){
 
         // Skip the ones in skip list 
-        if (in_array($name, $skip)) continue;
+        if (in_array_strict($name, $skip)) continue;
         if (!isset($this->attrs[$name]['count'])) continue;
 
         $value= $this->attrs[$name][0];
@@ -982,7 +982,7 @@ class plugin
     // Update 'manager' attributes from gosaDepartment and inetOrgPerson 
     $filter = "(&(objectClass=inetOrgPerson)(manager=".LDAP::prepare4filter(LDAP::fix($src_dn))."))";
     $ocs = $ldap->get_objectclasses();
-    if(isset($ocs['gosaDepartment']['MAY']) && in_array('manager', $ocs['gosaDepartment']['MAY'])){
+    if(isset($ocs['gosaDepartment']['MAY']) && in_array_strict('manager', $ocs['gosaDepartment']['MAY'])){
       $filter = "(|".$filter."(&(objectClass=gosaDepartment)(manager=".LDAP::prepare4filter(LDAP::fix($src_dn)).")))";
     }
     $leaf_deps=  get_list($filter,array("all"),$this->config->current['BASE'], 
@@ -1106,7 +1106,7 @@ class plugin
     if(count($this->objectclasses)){
       $this->is_account = TRUE;
       foreach($this->objectclasses as $class){
-        if(!in_array($class,$source['objectClass'])){
+        if(!in_array_strict($class,$source['objectClass'])){
           $this->is_account = FALSE;
         }
       }
@@ -1480,7 +1480,7 @@ class plugin
   {
     $ret = array();
     foreach($this->attributes as $attr){
-      if(in_array($attr,$this->multi_boxes)){
+      if(in_array_strict($attr,$this->multi_boxes)){
         $ret[$attr] = $this->$attr;
       }
     }
@@ -1585,7 +1585,7 @@ class plugin
    */
   function handle_post_events($mode, $addAttrs= array())
   {
-    if(!in_array($mode, array('add','remove','modify'))){
+    if(!in_array_strict($mode, array('add','remove','modify'))){
       trigger_error(sprintf("Invalid post event type given %s! Valid types are [add,modify,remove].", bold($mode)));
       return;
     }
index fe62b530e3f04569c119237a92929c8968091186..3800728e04f274bf277915f14a6e392b012e895d 100644 (file)
@@ -46,7 +46,7 @@ class releaseSelector {
 
         // Generate instance wide unique ID
         $pid = "";
-        while($pid == "" || in_array($pid, $usedIds)){
+        while($pid == "" || in_array_strict($pid, $usedIds)){
 
             // Wait 1 msec to ensure that we definately get a new id
             if($pid != "") usleep(1);
index 7e21a248d1ae259267543cfa89d370d45968b5c0..3de0b77db1473a7cc83a475d2d871e51a29449b9 100644 (file)
@@ -99,25 +99,25 @@ class remoteObject
         if(preg_match("/^get/", $name)){
             $varName = ucfirst(preg_replace("/^get/","", $name));
             $varName2 = lcfirst($varName);
-            if(in_array($varName, $this->properties)){
+            if(in_array_strict($varName, $this->properties)){
                 $force = isset($args[0]) && $args[0];
                 return($this->__getProperty($varName, $force));
-            }elseif(in_array($varName2, $this->properties)){
+            }elseif(in_array_strict($varName2, $this->properties)){
                 $force = isset($args[0]) && $args[0];
                 return($this->__getProperty($varName2, $force));
             } 
         }elseif(preg_match("/^set/", $name)){
             $varName = ucfirst(preg_replace("/^set/","", $name));
             $varName2 = lcfirst($varName);
-            if(in_array($varName, $this->properties)){
+            if(in_array_strict($varName, $this->properties)){
                 return($this->__setProperty($varName, $args[0]));
-            }elseif(in_array($varName2, $this->properties)){
+            }elseif(in_array_strict($varName2, $this->properties)){
                 return($this->__setProperty($varName2, $args[0]));
             }
         }
 
         // Forward to the call to the backend.
-        if(in_array($name, $this->methods)){
+        if(in_array_strict($name, $this->methods)){
             $this->lastError = "";
             $this->success = TRUE;
             $fArgs = array();
@@ -160,7 +160,7 @@ class remoteObject
     function __set($varName, $value)
     {
         // Set property value
-        if(in_array($varName, $this->properties)){
+        if(in_array_strict($varName, $this->properties)){
             return($this->__setProperty($varName, $value));
         }
 
@@ -181,7 +181,7 @@ class remoteObject
      */
     function __get($varName)
     {
-        if(in_array($varName, $this->properties)){
+        if(in_array_strict($varName, $this->properties)){
             return($this->__getProperty($varName));
         }
 
index 541977aa123d49490e95b211541fcaf891ffbc7b..e6632b147c03dd1fdf35177fd269a39a2614f052 100644 (file)
@@ -70,7 +70,7 @@ class sortableListing {
 
         // Generate instance wide unique ID
         $id = "";
-        while($id == "" || in_array($id, $usedIds)){
+        while($id == "" || in_array_strict($id, $usedIds)){
 
             // Wait 1 msec to ensure that we definately get a new id
             if($id != "") usleep(1);
@@ -574,7 +574,7 @@ class sortableListing {
     {
         // Only add if not already there
         if (!$key) {
-            if (in_array($entry, $this->data)) {
+            if (in_array_strict($entry, $this->data)) {
                 return;
             }
         } else {
index efcaa4f4e5d8190ccb1d00503b637ded035b6e0f..f7cb676cff694ed4dcfbb27713ae480d68fed0f6 100644 (file)
@@ -116,7 +116,7 @@ class tabs
     $baseobject= NULL;
     foreach($this->by_object as $name => $object){
       $class = get_class($object);
-      if(in_array($class,array("reference","acl"))) continue;
+      if(in_array_strict($class,array("reference","acl"))) continue;
       if ($baseobject === NULL){
         $baseobject= new $class($this->config, $this->dn);
         $baseobject->enable_CSN_check();
index b1ee8224726524993d36f576a5a0143750d94b8a..4cbf99af336388d6822517e6538cd15e7612df3c 100644 (file)
@@ -228,8 +228,8 @@ class userFilter extends plugin
  
         // The filter is visible if it is shared or if is one of our own creations.
         //  ... and enabled.
-        $visible = in_array('enable', $tmp['flags']) && 
-          ($attrs['dn'] == $ui->dn || in_array('share', $tmp['flags']));
+        $visible = in_array_strict('enable', $tmp['flags']) && 
+          ($attrs['dn'] == $ui->dn || in_array_strict('share', $tmp['flags']));
          
         // Add filter if it matches the category list
         if($visible && (count($category) == 0 || array_intersect($category, $tmp['categories']))){ 
index 5cfc7c073d44f9eb3a823a433131d5bce4ee16a8..cdf62871bb984d04d778597e26a15adffced2a6f 100644 (file)
@@ -42,8 +42,8 @@ class userFilterEditor extends plugin
                 $this->queries[] = $query;
             }
             $this->selectedCategories = $entry['categories'];
-            $this->share = in_array("share",$entry['flags']);
-            $this->enable = in_array("enable",$entry['flags']);
+            $this->share = in_array_strict("share",$entry['flags']);
+            $this->enable = in_array_strict("enable",$entry['flags']);
         }
         $this->orig_name = $this->name;
 
index 4a7d1ec4d499e3c44b1508c75488d9cf9327b83e..d16d8658061a3b88e9f37c96e3f1e6e597b4c41b 100644 (file)
@@ -373,7 +373,7 @@ class userinfo
         if(!isset($this->ocMapping[$aclCategory])){
             trigger_error("Invalid ACL category '".$aclCategory."'! ({$object})");
             return("");
-        }elseif(isset($aclClass) && !in_array($aclClass, $this->ocMapping[$aclCategory])){
+        }elseif(isset($aclClass) && !in_array_strict($aclClass, $this->ocMapping[$aclCategory])){
             trigger_error("Invalid ACL class '".$aclClass."'! ({$object})");
             return("");
         }
index d1c836e79e0296e0db033ac865126d856744bd59..35e8325aa5f15d9b3e56c0e3e5749e939175d221 100644 (file)
@@ -4,7 +4,7 @@
 
 // Load supporter class only if FPDF is loaded
 $classes= get_declared_classes();
-if(in_array('FPDF', $classes)) {
+if(in_array_strict('FPDF', $classes)) {
   include('class_PDF.inc');
 }
 
@@ -141,7 +141,7 @@ class pdfExporter
   {
     // Check if class defined
     $classes= get_declared_classes();
-    if(in_array('FPDF', $classes)) {
+    if(in_array_strict('FPDF', $classes)) {
       return array("exportPDF" => array( "label" => _("PDF"), "image" => "images/lists/pdf.png", "class"=> "pdfExporter", "mime" => "application/pdf", "filename" => "export.pdf" ));
     } else {
       return null;
index ed0491bd325cabd9f927c973a49f87672453bbbd..dc61ad92d3c292fb4194bd346dc9c7e4365ad7b8 100644 (file)
@@ -608,7 +608,7 @@ function ldap_login_user ($username, $password)
   if($config->get_cfg_value("core","loginAttribute") != ""){
     $tmp = explode(",", $config->get_cfg_value("core","loginAttribute")); 
     foreach($tmp as $attr){
-      if(in_array($attr,$allowed_attributes)){
+      if(in_array_strict($attr,$allowed_attributes)){
         $verify_attr[] = $attr;
       }
     }
@@ -3515,7 +3515,7 @@ function get_next_id_traditional($attrib, $dn)
     $base= get_base_from_hook($dn, $attrib);
   }
   for ($id= $base; $id++; $id < pow(2,32)){
-    if (!in_array($id, $ids)){
+    if (!in_array_strict($id, $ids)){
       return ($id);
     }
   }
@@ -3942,6 +3942,9 @@ function gosa_fopen($filename, $mode)
 /*\brief    Our own in_array method which defaults to a strict mode.
  */
 function in_array_strict($needle, $haystack, $strict = TRUE){
+    if(!$strict){
+        syslog(1, "!");
+    }
     return(in_array($needle, $haystack, $strict));
 }
 
index 6b2e283a2ac6167972563a6e90d8c5cf24b75d7a..2bfbf0d46afebd3544398cff6be007dbf9898c24 100644 (file)
@@ -155,7 +155,7 @@ class tests {
                           "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/","",$ip);
 
                   $mask = preg_replace("/^\//","",$mask);
-                  if((in_array("$mask",$res)) && preg_match("/^[0-9\.]/",$mask)){
+                  if((in_array_strict("$mask",$res)) && preg_match("/^[0-9\.]/",$mask)){
                           return(TRUE);
                   }
           }
index 01d5a4ade3cd0997dc86c2128edda4ad8d24b95d..bb79e33e326444cc5249ae4557be4d459a55171e 100644 (file)
@@ -109,7 +109,7 @@ class xml {
         //See tag status and do the needed.
         if($type == "open") {//The starting of the tag '<tag>'
             $parent[$level-1] = &$current;
-            if(!is_array($current) or (!in_array($tag, array_keys($current)))) { //Insert New tag
+            if(!is_array($current) or (!in_array_strict($tag, array_keys($current)))) { //Insert New tag
                 $current[$tag] = $result;
                 if($attributes_data) $current[$tag. '_attr'] = $attributes_data;
                 $repeated_tag_index[$tag.'_'.$level] = 1;
index c49e0f930c93d1e84f6e86afc735491443b4b0ed..bedc5eecc7d4e7b47c096665ac1f656d7e5c198b 100644 (file)
@@ -84,7 +84,7 @@ class DynamicLdapGroup extends plugin
             list($base,$attr,$scope,$filter) = preg_split("/\?/",$entry); 
             
             // Ignore entries that do not have a valid scope value (one,base,sub)
-            if(!in_array($scope,array('base','one','sub'))) continue;
+            if(!in_array_strict($scope,array('base','one','sub'))) continue;
 
             // Append parsed uri
             $scope = array_search($scope,$this->scopes);
@@ -130,7 +130,7 @@ class DynamicLdapGroup extends plugin
             // Check for invalid attributes
             if(empty($entry['attr'])){
                 $messages[] = msgPool::required(_("Attribute")." {$nr}");
-            }elseif(in_array(strtolower($entry['attr']), array('objectclass'))){
+            }elseif(in_array_strict(strtolower($entry['attr']), array('objectclass'))){
                 $messages[] = msgPool::reserved(_("Attribute")." {$nr}");
             }
 
index cba453763cfbbf45b54746bda336a9a49a741b77..b4fc9924ef8a65591bdf4a6bda558e3c3ae674b8 100644 (file)
@@ -131,7 +131,7 @@ class propertyEditor extends management
         // Walk trough all properties and check if we have modified something
         $all = $this->config->configRegistry->getAllProperties();
         foreach($all as $prop){
-            $modified = in_array($prop->getStatus(),array('modified','removed'));
+            $modified = in_array_strict($prop->getStatus(),array('modified','removed'));
             if($modified) break;
         }
        
index 99c36aa7d41fe66ceacbbbf9e73ba19554d1ace6..da11d868e14a65c4959818663532caa938791035 100644 (file)
@@ -137,7 +137,7 @@ class department extends plugin
         // If the 'manager' attribute is present in gosaDepartment allow to manage it.
         $ldap = $this->config->get_ldap_link();
         $ocs = $ldap->get_objectclasses();
-        if(isset($ocs['gosaDepartment']['MAY']) && in_array('manager', $ocs['gosaDepartment']['MAY'])){
+        if(isset($ocs['gosaDepartment']['MAY']) && in_array_strict('manager', $ocs['gosaDepartment']['MAY'])){
             $this->manager_enabled = TRUE;
 
             // Detect the managers name
index 7412166ec1933994074a9d27b824864293b85897..b0d44f6f1e3923e7e27494b2d32a6f39f3597c3f 100644 (file)
@@ -131,7 +131,7 @@ class group extends plugin
         }
 
         /* Set mail flag */
-        if (isset($this->attrs['objectClass']) && in_array('gosaMailAccount', $this->attrs['objectClass'])){
+        if (isset($this->attrs['objectClass']) && in_array_strict('gosaMailAccount', $this->attrs['objectClass'])){
             $this->has_mailAccount= TRUE;
         }
 
@@ -425,14 +425,14 @@ class group extends plugin
         $smarty->assign("multiple_support",$this->multiple_support_active);
 
         foreach($this->attributes as $val){
-            if(in_array($val,$this->multi_boxes)){
+            if(in_array_strict($val,$this->multi_boxes)){
                 $smarty->assign("use_".$val,TRUE);
             }else{
                 $smarty->assign("use_".$val,FALSE);
             }
         }
         foreach(array("base","smbgroup","groupType","sambaDomainName","fon_group","nagios_group") as $val){
-            if(in_array($val,$this->multi_boxes)){
+            if(in_array_strict($val,$this->multi_boxes)){
                 $smarty->assign("use_".$val,TRUE);
             }else{
                 $smarty->assign("use_".$val,FALSE);
@@ -1154,7 +1154,7 @@ class group extends plugin
         $ret = array_merge($ret,$this->trustModeDialog->get_multi_edit_values());
 
         foreach(array("base","smbgroup","groupType","sambaDomainName","fon_group","nagios_group") as $attr){    
-            if(in_array($attr,$this->multi_boxes)){
+            if(in_array_strict($attr,$this->multi_boxes)){
                 $ret[$attr] = $this->$attr;
             }
         }
@@ -1188,7 +1188,7 @@ class group extends plugin
 
         if (isset($all['memberUid'])){
             for ($i= 0; $i<$all['memberUid']['count']; $i++){
-                if(!in_array($all['memberUid'][$i],$this->memberUid)){
+                if(!in_array_strict($all['memberUid'][$i],$this->memberUid)){
                     $this->memberUid_used_by_some[$all['memberUid'][$i]]= $all['memberUid'][$i];
                 }
             }
@@ -1269,7 +1269,7 @@ class group extends plugin
         }
 
         // Detect samba groups and adapt its values.
-        $this->smbgroup = in_array('sambaGroupMapping', $source['objectClass']);
+        $this->smbgroup = in_array_strict('sambaGroupMapping', $source['objectClass']);
         if ($this->smbgroup) { 
             $this->sambaSID = $this->getSambaSID(); 
         } 
@@ -1305,7 +1305,7 @@ class group extends plugin
 
         /* Update groupMembership, keep optinal group */
         foreach($attrs['memberUid_used_by_some'] as $uid){
-            if(in_array($uid,$this->memberUid)){
+            if(in_array_strict($uid,$this->memberUid)){
                 $users[$uid] = $uid;
             }
         }
index cf60da6fd3e2aa29991b703ca1a8700487f2c650..cb719055c989632e07a5c4f0f0aaeae6bc304644 100644 (file)
@@ -513,7 +513,7 @@ class ogroup extends plugin
                     /* Skip workstations which are already assigned to an object group.
                      */
                     if ($this->gosaGroupObjects == "[W]" || $this->gosaGroupObjects == "[T]"){
-                        if(in_array($attrs['dn'],$this->used_workstations)){
+                        if(in_array_strict($attrs['dn'],$this->used_workstations)){
                             continue;
                         }
                     }
@@ -618,7 +618,7 @@ class ogroup extends plugin
         $type= "I";
 
         foreach($this->typeToClass as $index => $class){
-            if (in_array($class, $attrs['objectClass'])){
+            if (in_array_strict($class, $attrs['objectClass'])){
                 $type= $index;
                 break;
             }
@@ -631,7 +631,7 @@ class ogroup extends plugin
     {
         /* Person? */
         $name =""; 
-        if (in_array('gosaAccount', $attrs['objectClass'])){
+        if (in_array_strict('gosaAccount', $attrs['objectClass'])){
             if(isset($attrs['sn']) && isset($attrs['givenName'])){
                 $name= $attrs['sn'][0].", ".$attrs['givenName'][0];
             } else {
index b25311e133b3d8a39f40492bec848527052918c2..03a6d1bec85218ce73f47b5ebb0aa6cd68f5d8d3 100644 (file)
@@ -71,7 +71,7 @@ class objectSelect extends management
     static function filterDepLabel($row,$dn,$pid,$base,$objectClass, $cn)
     {
         $cn = $cn[0];
-        if(!in_array('gosaDepartment', $objectClass)){
+        if(!in_array_strict('gosaDepartment', $objectClass)){
             return($cn);
         }
         if($dn == $base){
index df5694788e89b0b5d7995922e4b97f3412b9324e..c285290fee4a29641930efdcfd23095bc9c6ab45 100644 (file)
@@ -63,7 +63,7 @@ class ogrouptabs extends tabs
                 if(isset($this->by_object['ogroup']->objcache[$dn])){
                     $obj = $this->by_object['ogroup']->objcache[$dn];
                     if(isset($obj['objectClass'])){
-                        if(in_array("goFonAccount",$obj['objectClass'])){
+                        if(in_array_strict("goFonAccount",$obj['objectClass'])){
                             $usePhoneTab = true;
                         }
                     }
@@ -135,7 +135,7 @@ class ogrouptabs extends tabs
                     if(isset($this->by_object['ogroup']->objcache[$dn])){
                         $obj = $this->by_object['ogroup']->objcache[$dn];
                         if(isset($obj['objectClass'])){
-                            if(in_array("goFonAccount",$obj['objectClass'])){
+                            if(in_array_strict("goFonAccount",$obj['objectClass'])){
                                 $this->by_name['phonequeue']= _("Phone queue");
                                 $this->by_object['phonequeue']= new phonequeue($this->config, $this->dn);
                                 $this->by_object['phonequeue']->parent= &$this;
index 50aefa3eae2ee42f9c1ec3491f221d3e7d1c2490..67f6021bca54dadf832fb7c1d0b6b85b90a954c1 100644 (file)
@@ -274,8 +274,8 @@ class userManagement extends management
             $ldap->cat($this->dn);
             $attrs = $ldap->fetch();
             $this->passwordChangeForceable = 
-                    in_array('sambaAccount', $attrs['objectClass']) || 
-                    (in_array('posixAccount', $attrs['objectClass']) && isset($attrs['shadowMax']));
+                    in_array_strict('sambaAccount', $attrs['objectClass']) || 
+                    (in_array_strict('posixAccount', $attrs['objectClass']) && isset($attrs['shadowMax']));
             $smarty->assign("passwordChangeForceable" , $this->passwordChangeForceable);
             $smarty->assign("enforcePasswordChange" , $this->enforcePasswordChange);
 
@@ -363,8 +363,8 @@ class userManagement extends management
                     $ldap->cd($this->config->current['BASE']);
                     $ldap->cat($this->dn);
                     $attrs = $ldap->fetch();
-                    $samba = in_array('sambaSamAccount', $attrs['objectClass']);
-                    $posix = in_array('posixAccount', $attrs['objectClass']);
+                    $samba = in_array_strict('sambaSamAccount', $attrs['objectClass']);
+                    $posix = in_array_strict('posixAccount', $attrs['objectClass']);
 
                     // Update the posix shadow flag...
                     if($posix){
index 4e3d0976dfe49aae785c9687b7ce48a306254b25..eeedcef69180ac34bda140a772c749e8c2fe2695 100644 (file)
@@ -73,7 +73,7 @@ class rssReader{
     {
 
         // Do not try to sort for invalid attributes.
-        if(!in_array($sortBy, self::$attributes)){
+        if(!in_array_strict($sortBy, self::$attributes)){
             trigger_error("Invalid sortby attribute '{$sortBy}'!");
             return($feedRes);
         }
index d4f158e9e1711a89bb73fc56720c0695989e0dfe..b42c67e63b7ee22da7ef337a1ca192db56c8d46f 100644 (file)
@@ -57,7 +57,7 @@ class infoPage extends plugin
     function checkAccess($class)
     {
         foreach($this->ui->ocMapping as $cat => $aclClasses){
-            if(in_array($class, $aclClasses)){
+            if(in_array_strict($class, $aclClasses)){
                 if(preg_match('/[rw]/',$this->ui->get_permissions($this->ui->dn, "{$cat}/{$class}", ''))){
                     return(TRUE);
                 }
index 22d76e176f15159c76232476114329b163dfd822..f1526468cc14fc0fc81150070c096cd20b859521 100644 (file)
@@ -252,7 +252,7 @@ class aclResolver
                                 $ldap->cat($gdn,array('memberUid'));
                                 if($ldap->count()){
                                     $attrs = $ldap->fetch();
-                                    if(isset($attrs['memberUid']) && in_array($this->validateUid, $attrs['memberUid'])){
+                                    if(isset($attrs['memberUid']) && in_array_strict($this->validateUid, $attrs['memberUid'])){
                                         $found = TRUE;
                                         $groups[] = $name;
                                         continue;
index e78ff90d294b2f4ed30da6ee6b5e4b635cd363f5..f77ae3732ffecd72e448fce5af35ed48e005804a 100644 (file)
@@ -34,7 +34,7 @@ class actionSelectChart extends statChart
             $dataBase = $gData['actionTypeGraph'][$this->current_action];
 
             foreach($dataBase as $category => $entriesPerDate){
-                if(empty($category) || in_array($category, $this->skipSeries)) continue;
+                if(empty($category) || in_array_strict($category, $this->skipSeries)) continue;
 
                 // Add results to our data set.
                 $dataSet->AddPoint($entriesPerDate, $category);
index 99703a56a08ffe6c6f2c854d287feaf25060a666..236e133c865ed5e871a9f8253a179c8592b7f417 100644 (file)
@@ -21,7 +21,7 @@ class categoryActionsOverTime extends statChart
         $dataSet = new pData;  
         $seriesCnt = 0;
         foreach($gData['actionsGraph'] as $category => $entriesPerDate){
-            if(empty($category) || in_array($category, $this->skipSeries)) continue;
+            if(empty($category) || in_array_strict($category, $this->skipSeries)) continue;
 
             // Add results to our data set.
             $dataSet->AddPoint($entriesPerDate, $category);
@@ -44,7 +44,7 @@ class categoryActionsOverTime extends statChart
 
         // Create a dataSet containing all series 
         $allSeriesDataSet = clone $dataSet;
-        if(!in_array('errorsPerInterval', $this->skipSeries)){
+        if(!in_array_strict('errorsPerInterval', $this->skipSeries)){
             $allSeriesDataSet->AddPoint($gData['errorsPerInterval'], 'Errors');
             $allSeriesDataSet->SetSerieName(_('Error'), 'Errors');
             $allSeriesDataSet->AddSerie('Errors');
@@ -86,7 +86,7 @@ class categoryActionsOverTime extends statChart
         // Do we've to add the errors series?
         // If we have to, then add the error-data-series.
         //  and set the color for the new error-series to red.
-        if(!in_array('errorsPerInterval', $this->skipSeries)){
+        if(!in_array_strict('errorsPerInterval', $this->skipSeries)){
 
             // Set the color for the error Series to 'red'. 
             // This has to be done before drawing the legend.
@@ -101,7 +101,7 @@ class categoryActionsOverTime extends statChart
 
         // Draw the error graph on top of the other graphs now.
         // But remove the category-graph before. 
-        if(!in_array('errorsPerInterval', $this->skipSeries)){
+        if(!in_array_strict('errorsPerInterval', $this->skipSeries)){
 
             // Remove all graph series and add the error-series, then draw the new graph.
             // (It is not relevant if it was really added before, so we simply remove all series!)
index 4c5a2f55948da394ed66fb8e2ed28987f4042deb..bf62fe4993cc8ad77f3e6a6dff6c0067abeab609 100644 (file)
@@ -21,7 +21,7 @@ class objectCountChart extends statChart
         $seriesCnt = 0;
 
         foreach($gData['objectCountPerInterval'] as $category => $count){
-            if(empty($category) || in_array($category, $this->skipSeries)) continue;
+            if(empty($category) || in_array_strict($category, $this->skipSeries)) continue;
 
             // Add results to our data set.
             $dataSet->AddPoint($count, $category);
index a2fb8d93f323a2efd56eeffb50e3f885a6451d48..ddcfc48e83c05d1b4b4b1a02403706da553007ed 100644 (file)
@@ -24,7 +24,7 @@ class passwordChangeChart extends statChart
         $dataBase = $gData['usedPasswordHashes'];
     
         foreach($dataBase as $category => $entriesPerDate){
-            if(empty($category) || in_array($category, $this->skipSeries)) continue;
+            if(empty($category) || in_array_strict($category, $this->skipSeries)) continue;
 
             // Add results to our data set.
             $dataSet->AddPoint($entriesPerDate, $category);
index 7b5046506ec8aaf853da590378a3a78d97251c9d..32fd19db3db50ed2a8e56b01d6b85152b78fbef6 100644 (file)
@@ -104,7 +104,7 @@ class statChart{
         $str = "<input type='hidden' name='{$this->graphName}_posted' value='1'>";
         $list = $this->getSeriesList();
         foreach($list as $key => $item){
-            $checked = (in_array($key, $this->skipSeries))? '': 'checked';
+            $checked = (in_array_strict($key, $this->skipSeries))? '': 'checked';
             $str .= "<span style='padding-right:20px'>".
                     "   <input id='addSeries_{$this->graphName}_{$key}' type='checkbox' ".
                     "       name='addSeries_{$this->graphName}_{$key}' value='1'".
index aaedbbee13238dec2f9c85281e53932b487179bb..a74335c38c94745b37c9d7d335c88f69ae1e15b3 100644 (file)
@@ -366,12 +366,12 @@ class statistics extends plugin
         $gData['objectCountPerInterval'] = array(); 
         foreach($res['objectCountPerInterval'] as $category => $data){
             if(empty($category)) continue;
-            if(in_array($category,$mapSystems)){
+            if(in_array_strict($category,$mapSystems)){
                 $category = 'systems';
             }
 
             // Skip series which are not interesting for us
-            if(!in_array($category,array('users','groups','department','systems','ogroups','fai'))){
+            if(!in_array_strict($category,array('users','groups','department','systems','ogroups','fai'))){
                 $category = 'remaining';
             }
 
index e2c45e168778c7e01797ded55b12dc45097ec8ff..da5180054daee2081c0b2ace8e55b483fd594e40 100644 (file)
@@ -629,14 +629,14 @@ class user extends plugin
     $ui =get_userinfo();
     foreach($this->attributes as $val){
       $smarty->assign("$val", set_post($this->$val));
-      if(in_array($val,$this->multi_boxes)){
+      if(in_array_strict($val,$this->multi_boxes)){
         $smarty->assign("use_".$val,TRUE);
       }else{
         $smarty->assign("use_".$val,FALSE);
       }
     }
     foreach(array("base","pw_storage","edit_picture") as $val){
-      if(in_array($val,$this->multi_boxes)){
+      if(in_array_strict($val,$this->multi_boxes)){
         $smarty->assign("use_".$val,TRUE);
       }else{
         $smarty->assign("use_".$val,FALSE);
@@ -753,7 +753,7 @@ class user extends plugin
     // Update 'manager' attributes from gosaDepartment and inetOrgPerson
     $filter = "(&(objectClass=inetOrgPerson)(manager=".LDAP::prepare4filter($this->dn)."))";
     $ocs = $ldap->get_objectclasses();
-    if(isset($ocs['gosaDepartment']['MAY']) && in_array('manager', $ocs['gosaDepartment']['MAY'])){
+    if(isset($ocs['gosaDepartment']['MAY']) && in_array_strict('manager', $ocs['gosaDepartment']['MAY'])){
       $filter = "(|".$filter."(&(objectClass=gosaDepartment)(manager=".LDAP::prepare4filter($this->dn).")))";
     }
     $leaf_deps=  get_list($filter,array("all"),$this->config->current['BASE'],
@@ -1387,7 +1387,7 @@ class user extends plugin
       return(FALSE);
     }else{
 
-      if(in_array("pw_storage",$this->multi_boxes)){
+      if(in_array_strict("pw_storage",$this->multi_boxes)){
         return(TRUE);
       }
       return($this->pw_storage != $this->last_pw_storage && !$this->is_template);
@@ -1509,7 +1509,7 @@ class user extends plugin
       /* Walk through govattrs */
       foreach ($this->govattrs as $val){
 
-        if (in_array($val, $skip)){
+        if (in_array_strict($val, $skip)){
           continue;
         }
 
@@ -1755,10 +1755,10 @@ class user extends plugin
   function get_multi_edit_values()
   {
     $ret = plugin::get_multi_edit_values();
-    if(in_array("pw_storage",$this->multi_boxes)){
+    if(in_array_strict("pw_storage",$this->multi_boxes)){
       $ret['pw_storage'] = $this->pw_storage;
     }
-    if(in_array("edit_picture",$this->multi_boxes)){
+    if(in_array_strict("edit_picture",$this->multi_boxes)){
       $ret['jpegPhoto'] = $this->jpegPhoto;
       $ret['photoData'] = $this->photoData;
       $ret['old_jpegPhoto'] = $this->old_jpegPhoto;
@@ -1771,7 +1771,7 @@ class user extends plugin
       unset($ret['cn']);
     }
     $ret['is_modified'] = $this->is_modified;
-    if(in_array("base",$this->multi_boxes)){
+    if(in_array_strict("base",$this->multi_boxes)){
       $ret['orig_base']="Changed_by_Multi_Plug";
       $ret['base']=$this->base;
     }
@@ -1838,25 +1838,25 @@ class user extends plugin
     if($this->dn == "new") {
       $this->set_acl_base($this->base);
     }
-    if (!tests::is_url($this->labeledURI) && in_array("labeledURI",$this->multi_boxes)){
+    if (!tests::is_url($this->labeledURI) && in_array_strict("labeledURI",$this->multi_boxes)){
       $message[]= msgPool::invalid(_("Homepage"));
     }
-    if (!tests::is_phone_nr($this->telephoneNumber) && in_array("telephoneNumber",$this->multi_boxes)){
+    if (!tests::is_phone_nr($this->telephoneNumber) && in_array_strict("telephoneNumber",$this->multi_boxes)){
       $message[]= msgPool::invalid(_("Phone"), $this->telephoneNumber, "/[\/0-9 ()+*-]/");
     }
-    if (!tests::is_phone_nr($this->facsimileTelephoneNumber) &&  in_array("facsimileTelephoneNumber",$this->multi_boxes)){
+    if (!tests::is_phone_nr($this->facsimileTelephoneNumber) &&  in_array_strict("facsimileTelephoneNumber",$this->multi_boxes)){
       $message[]= msgPool::invalid(_("Fax"), $this->facsimileTelephoneNumber, "/[\/0-9 ()+*-]/");
     }
-    if (!tests::is_phone_nr($this->mobile) && in_array("mobile",$this->multi_boxes)){
+    if (!tests::is_phone_nr($this->mobile) && in_array_strict("mobile",$this->multi_boxes)){
       $message[]= msgPool::invalid(_("Mobile"), $this->mobile, "/[\/0-9 ()+*-]/");
     }
-    if (!tests::is_phone_nr($this->pager) && in_array("pager",$this->multi_boxes)){
+    if (!tests::is_phone_nr($this->pager) && in_array_strict("pager",$this->multi_boxes)){
       $message[]= msgPool::invalid(_("Pager"), $this->pager, "/[\/0-9 ()+*-]/");
     }
-    if (preg_match ('/[,+"?\'()=<>;\\\\]/', $this->givenName) && in_array("givenName",$this->multi_boxes)){
+    if (preg_match ('/[,+"?\'()=<>;\\\\]/', $this->givenName) && in_array_strict("givenName",$this->multi_boxes)){
       $message[]= msgPool::invalid(_("Given name"), $this->giveName, '/[^,+"?\'()=<>;\\\\]/');
     }
-    if (preg_match ('/[,+"?\'()=<>;\\\\]/', $this->sn) && in_array("sn",$this->multi_boxes)){
+    if (preg_match ('/[,+"?\'()=<>;\\\\]/', $this->sn) && in_array_strict("sn",$this->multi_boxes)){
       $message[]= msgPool::invalid(_("Name"), $this->sn, '/[^,+"?\'()=<>;\\\\]/');
     }
     return($message);
@@ -1922,7 +1922,7 @@ class user extends plugin
 
     // Update loginRestrictions, keep my settings while ip is optional
     foreach($attrs['gosaLoginRestriction_some'] as $ip){
-      if(in_array($ip, $this->gosaLoginRestriction) && in_array($ip, $attrs['gosaLoginRestriction'])){
+      if(in_array_strict($ip, $this->gosaLoginRestriction) && in_array_strict($ip, $attrs['gosaLoginRestriction'])){
         $lR[] = $ip;
       }
     }
@@ -1945,7 +1945,7 @@ class user extends plugin
     $data = array();
     foreach($all as $ip){
       $data['data'][] = $ip;
-      if(!in_array($ip, $this->gosaLoginRestriction)){
+      if(!in_array_strict($ip, $this->gosaLoginRestriction)){
         $data['displayData'][] = array('mode' => LIST_MARKED , 'data' => array($ip.' ('._("Entries differ").')'));
       }else{
         $data['displayData'][] = array('mode' => 0 , 'data' => array($ip));
index 74ee4740c75cb03b70a47ae75b751b496f86fc0a..924153c380ddbd3f0ef8aaaf8eb959be936a84e5 100644 (file)
@@ -134,7 +134,7 @@ class posixAccount extends plugin
 
       /* Correct is_account. shadowAccount is not required. */
       if (isset($this->attrs['objectClass']) &&
-          in_array ('posixAccount', $this->attrs['objectClass'])){
+          in_array_strict('posixAccount', $this->attrs['objectClass'])){
 
         $this->is_account= TRUE;
       }
@@ -226,7 +226,7 @@ class posixAccount extends plugin
     }
 
     /* Insert possibly missing loginShell */
-    if ($this->loginShell != "" && !in_array($this->loginShell, $this->loginShellList)){
+    if ($this->loginShell != "" && !in_array_strict($this->loginShell, $this->loginShellList)){
       $this->loginShellList[]= $this->loginShell;
     }
 
@@ -494,7 +494,7 @@ class posixAccount extends plugin
     $smarty->assign("force_idsACL", $this->getacl("uidNumber").$this->getacl("gidNumber"));
 
     foreach(array("primaryGroup","activate_shadowWarning","activate_shadowInactive","activate_shadowMin","activate_shadowMax","activate_shadowExpire","mustchangepassword") as $val){
-      if(in_array($val,$this->multi_boxes)){
+      if(in_array_strict($val,$this->multi_boxes)){
         $smarty->assign("use_".$val,TRUE);
       }else{
         $smarty->assign("use_".$val,FALSE);
@@ -504,7 +504,7 @@ class posixAccount extends plugin
 
     /* Load attributes and acl's */
     foreach($this->attributes as $val){
-      if(in_array($val,$this->multi_boxes)){
+      if(in_array_strict($val,$this->multi_boxes)){
         $smarty->assign("use_".$val,TRUE);
       }else{
         $smarty->assign("use_".$val,FALSE);
@@ -974,47 +974,47 @@ class posixAccount extends plugin
   function multiple_check()
   {
     $message = plugin::multiple_check();
-    if ($this->homeDirectory == "" && in_array("homeDirectory",$this->multi_boxes)){
+    if ($this->homeDirectory == "" && in_array_strict("homeDirectory",$this->multi_boxes)){
       $message[]= msgPool::required(_("Home directory"));
     }
-    if (!tests::is_path($this->homeDirectory) && in_array("homeDirectory",$this->multi_boxes)){
+    if (!tests::is_path($this->homeDirectory) && in_array_strict("homeDirectory",$this->multi_boxes)){
       $message[]= msgPool::invalid(_("Home directory"), "", "", "/home/yourname" );
     }
 
     /* Check shadow settings, well I like spaghetties... */
-    if ($this->activate_shadowMin && in_array("activate_shadowMin",$this->multi_boxes)){
+    if ($this->activate_shadowMin && in_array_strict("activate_shadowMin",$this->multi_boxes)){
       if (!tests::is_id($this->shadowMin)){
         $message[]= msgPool::invalid(_("shadowMin"), $this->shadowMin, "/[0-9]/");
       }
     }
-    if ($this->activate_shadowMax && in_array("activate_shadowMax",$this->multi_boxes)){
+    if ($this->activate_shadowMax && in_array_strict("activate_shadowMax",$this->multi_boxes)){
       if (!tests::is_id($this->shadowMax)){
         $message[]= msgPool::invalid(_("shadowMax"), $this->shadowMax, "/[0-9]/");
       }
     }
-    if ($this->activate_shadowWarning && in_array("activate_shadowWarning",$this->multi_boxes)){
+    if ($this->activate_shadowWarning && in_array_strict("activate_shadowWarning",$this->multi_boxes)){
       if (!tests::is_id($this->shadowWarning)){
         $message[]= msgPool::invalid(_("shadowWarning"), $this->shadowWarning, "/[0-9]/");
       }
-      if (!$this->activate_shadowMax && in_array("activate_shadowMax",$this->multi_boxes)){
+      if (!$this->activate_shadowMax && in_array_strict("activate_shadowMax",$this->multi_boxes)){
         $message[]= msgPool::depends("shadowWarning", "shadowMax");
       }
-      if ($this->shadowWarning > $this->shadowMax && in_array("activate_shadowWarning",$this->multi_boxes)){
+      if ($this->shadowWarning > $this->shadowMax && in_array_strict("activate_shadowWarning",$this->multi_boxes)){
         $message[]= msgPool::toobig("shadowWarning", "shadowMax");
       }
-      if ($this->activate_shadowMin && $this->shadowWarning < $this->shadowMin && in_array("activate_shadowMin",$this->multi_boxes)){
+      if ($this->activate_shadowMin && $this->shadowWarning < $this->shadowMin && in_array_strict("activate_shadowMin",$this->multi_boxes)){
         $message[]= msgPool::tosmall("shadowWarning", "shadowMin");
       }
     }
-    if ($this->activate_shadowInactive && in_array("activate_shadowInactive",$this->multi_boxes)){
+    if ($this->activate_shadowInactive && in_array_strict("activate_shadowInactive",$this->multi_boxes)){
       if (!tests::is_id($this->shadowInactive)){
         $message[]= msgPool::invalid(_("shadowInactive"), $this->shadowInactive, "/[0-9]/");
       }
-      if (!$this->activate_shadowMax && in_array("activate_shadowMax",$this->multi_boxes)){
+      if (!$this->activate_shadowMax && in_array_strict("activate_shadowMax",$this->multi_boxes)){
         $message[]= msgPool::depends("shadowInactive", "shadowMax");
       }
     }
-    if ($this->activate_shadowMin && $this->activate_shadowMax && in_array("activate_shadowMin",$this->multi_boxes)){
+    if ($this->activate_shadowMin && $this->activate_shadowMax && in_array_strict("activate_shadowMin",$this->multi_boxes)){
       if ($this->shadowMin > $this->shadowMax){
         $message[]= msgPool::toobig("shadowMin", "shadowMax");
       }
@@ -1393,17 +1393,17 @@ class posixAccount extends plugin
     $ret['groupMembership']     = $this->groupMembership;
     $ret['groupMembership_some']= $this->groupMembership_some;
 
-    if(in_array("primaryGroup",$this->multi_boxes)){
+    if(in_array_strict("primaryGroup",$this->multi_boxes)){
       $ret['primaryGroup'] = $this->primaryGroup;
     }
     foreach(array("shadowWarning","shadowInactive","shadowMin","shadowMax", "shadowExpire") as $entry){
       $active = "activate_".$entry;
-      if(in_array($active,$this->multi_boxes)){
+      if(in_array_strict($active,$this->multi_boxes)){
         $ret[$entry] = $this->$entry;
         $ret[$active] = $this->$active;
       }
     }
-    if(in_array("mustchangepassword",$this->multi_boxes)){
+    if(in_array_strict("mustchangepassword",$this->multi_boxes)){
       $ret['mustchangepassword'] = $this->mustchangepassword;
     }
     return($ret);
@@ -1435,7 +1435,7 @@ class posixAccount extends plugin
       foreach(array("shadowMin","shadowMax","shadowExpire","shadowInactive","shadowWarning") as $var) {
         if($this->acl_is_writeable($var)){
           $activate_var = "activate_".$var;
-          if(in_array($activate_var, $this->multi_boxes)){
+          if(in_array_strict($activate_var, $this->multi_boxes)){
             if(isset($_POST['activate_'.$var])){
               $this->$activate_var  = true;
               $this->$var      = get_post($var);
@@ -1448,7 +1448,7 @@ class posixAccount extends plugin
       }
 
       /* Restore shadow value, if the shadow attribute isn't used */
-      if(!in_array("activate_shadowExpire",$this->multi_boxes)){
+      if(!in_array_strict("activate_shadowExpire",$this->multi_boxes)){
         $this->shadowExpire = $expire_tmp;
       }
 
@@ -1521,7 +1521,7 @@ class posixAccount extends plugin
     $groups_all = $groups_some;
     foreach($groups_all as $id => $group){
       foreach($uids as $uid){
-        if(!in_array($uid,$groups_uid[$id])){
+        if(!in_array_strict($uid,$groups_uid[$id])){
           unset($groups_all[$id]);
           break;
         }
index b78f2b2871be4d7f4043df69f3c9d79a91455465..2454e522624879650a6af11fb9e2feae551a235c 100644 (file)
@@ -18,7 +18,7 @@ class filterLDAPBlacklist {
             if(isset($entry[$attr_name])){
               $test = $entry[$attr_name];
               if(!is_array($test)) $test = array($test);
-              if(in_array($match, $test)) unset($entries[$id]);
+              if(in_array_strict($match, $test)) unset($entries[$id]);
             }
           }
         }
index 35ca9921c1b06e3a9fb0cc6974d9957579899755..9098913142a0583533a1f97e7f87f90e6c49ac6c 100644 (file)
@@ -78,11 +78,11 @@ class trustModeDialog extends plugin
         if($ldap->count() != 0){
             $attrs = $ldap->fetch();
             $img = $desc = "";
-            if(in_array("gotoWorkstation",$attrs['objectClass'])){
+            if(in_array_strict("gotoWorkstation",$attrs['objectClass'])){
                 $img = image('plugins/systems/images/select_workstation.png'); 
-            }elseif(in_array("gotoTerminal",$attrs['objectClass'])){
+            }elseif(in_array_strict("gotoTerminal",$attrs['objectClass'])){
                 $img = image('plugins/systems/images/select_terminal.png'); 
-            }elseif(in_array("goServer",$attrs['objectClass'])){
+            }elseif(in_array_strict("goServer",$attrs['objectClass'])){
                 $img = image('plugins/systems/images/select_server.png'); 
             }
             if(isset($attrs['description'][0])) {
@@ -180,7 +180,7 @@ class trustModeDialog extends plugin
             $smarty->assign("emptyArrAccess",false);
 
 
-        $smarty->assign($smarty->assign("use_trustmode",in_array("trustmode", $this->multi_boxes)));
+        $smarty->assign($smarty->assign("use_trustmode",in_array_strict("trustmode", $this->multi_boxes)));
         $smarty->assign("multiple_support" , $this->multiple_support_active);
 #        $this->trustList->update();
         $smarty->assign("trustList", $this->trustList->render());
@@ -258,7 +258,7 @@ class trustModeDialog extends plugin
     public function get_multi_edit_values()
     {
         $ret = plugin::get_multi_edit_values();
-        if(in_array("trustmode",$this->multi_boxes)){
+        if(in_array_strict("trustmode",$this->multi_boxes)){
             $ret['trustModel'] = $this->trustModel;
             $ret['accessTo'] = $this->accessTo;
         }
index cf0370712e984f5aea7eb22cce501a60d9e06a5e..12454831bd3a0b71cd3cd43df001084f8ba2b80a 100644 (file)
@@ -151,7 +151,7 @@ class Step_Ldap extends setup_step
     $reset = FALSE;
     foreach($this->attributes as $attr){
       if(isset($_POST[$attr])){
-        if(in_array($attr,array("base","connection")) && $this->$attr != get_post($attr)){
+        if(in_array_strict($attr,array("base","connection")) && $this->$attr != get_post($attr)){
           $reset = TRUE;
         }
         $this->$attr = get_post($attr);
@@ -161,7 +161,7 @@ class Step_Ldap extends setup_step
     if($reset){
       $this->parent->disable_steps_from(($this->parent->step_name_to_id(get_class($this))) +1);
       $attr = @LDAP::get_naming_contexts($this->connection);
-      if(is_array($attr) && !in_array(get_post("base"),$attr)){
+      if(is_array($attr) && !in_array_strict(get_post("base"),$attr)){
         if(isset($attr[0])){
           $this->base = $attr[0];
         }
index 84360939770a737ce0ad790f1d9d08abca7d9a89..cceda31c8dcf578e4008dd14a2697c04e7eefe46 100644 (file)
@@ -715,7 +715,7 @@ class Step_Migrate extends setup_step
 
         /* Root object doesn't exists 
          */
-        if(!in_array("gosaDepartment",$attrs['objectClass'])){
+        if(!in_array_strict("gosaDepartment",$attrs['objectClass'])){
             if($just_check){
 
                 $this->rootOC_details = array();       
@@ -737,7 +737,7 @@ class Step_Migrate extends setup_step
                 $dep_types = departmentManagement::get_support_departments();
                 $dep_type ="";
                 foreach($dep_types as $dep_name => $dep_class){
-                    if(in_array($dep_class['CLASS'], $attrs['objectClass'])){
+                    if(in_array_strict($dep_class['CLASS'], $attrs['objectClass'])){
                         $dep_type = $dep_name;
                         break;
                     }
index b58b9013705bc3c041af15b2153c0a4228efac2f..eb3b9473122bda14f991d2251bf89ca56cfe9e10 100644 (file)
@@ -76,7 +76,7 @@ class Step_Schema extends setup_step
         $this->is_completed = count($objectclasses);
 
         // Now check if the core requirements are fulfilled.
-        if(in_array('core', $disabled)){
+        if(in_array_strict('core', $disabled)){
             $message = "";
             $this->is_completed = FALSE;
             $coreDefs = core::plInfo();