Code

Backport from trunk
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 15 Sep 2011 08:37:00 +0000 (08:37 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 15 Sep 2011 08:37:00 +0000 (08:37 +0000)
-Replaced all in_array calls with self-made in_array_strict which simple calls in_array([],[], TRUE) from strict matching mode

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

109 files changed:
gosa-plugins/connectivity/personal/connectivity/class_intranetAccount.inc
gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpAdvanced.inc
gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc
gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPool.inc
gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc
gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc
gosa-plugins/dns/admin/systems/services/dns/class_DNS.inc
gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc
gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc
gosa-plugins/fai/admin/fai/classSelect/class_classSelect.inc
gosa-plugins/fai/admin/fai/classSelect/class_filterFAIClass.inc
gosa-plugins/fai/admin/fai/class_FAI.inc
gosa-plugins/fai/admin/fai/class_askClassName.inc
gosa-plugins/fai/admin/fai/class_debconfTemplate.inc
gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc
gosa-plugins/fai/admin/fai/class_faiGroupHandle.inc
gosa-plugins/fai/admin/fai/class_faiHookEntry.inc
gosa-plugins/fai/admin/fai/class_faiManagement.inc
gosa-plugins/fai/admin/fai/class_faiPackage.inc
gosa-plugins/fai/admin/fai/class_faiPartition.inc
gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc
gosa-plugins/fai/admin/fai/class_faiProfile.inc
gosa-plugins/fai/admin/fai/class_faiScript.inc
gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc
gosa-plugins/fai/admin/fai/class_filterFAI.inc
gosa-plugins/fai/admin/fai/class_filterOPSIPackages.inc
gosa-plugins/fai/admin/fai/packageSelect/class_filterFAIPackages.inc
gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc
gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc
gosa-plugins/gofon/admin/ogroups/gofon/class_phonequeue.inc
gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc
gosa-plugins/gofon/admin/systems/services/gofon/class_goFonServer.inc
gosa-plugins/gofon/gofon/macro/class_gofonMacroParameters.inc
gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc
gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementDataModel.inc
gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc
gosa-plugins/goto/addons/goto/class_filterGotoEvents.inc
gosa-plugins/goto/addons/goto/class_gotoLogView.inc
gosa-plugins/goto/addons/goto/class_goto_import_file.inc
gosa-plugins/goto/addons/goto/class_gotomasses.inc
gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc
gosa-plugins/goto/addons/goto/events/class_DaemonEvent_notify.inc
gosa-plugins/goto/addons/goto/events/class_EventAddSystemDialog.inc
gosa-plugins/goto/addons/goto/events/class_EventAddUserDialog.inc
gosa-plugins/goto/admin/ConfigManagement/class_ConfigManagement.inc
gosa-plugins/goto/admin/ConfigManagement/class_TemplateWidget_fixedList.inc
gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc
gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc
gosa-plugins/goto/admin/ogroups/goto/class_termgroup.inc
gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc
gosa-plugins/goto/admin/systems/goto/class_gotoLpdEnabled.inc
gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc
gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc
gosa-plugins/goto/admin/systems/goto/class_terminalService.inc
gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc
gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc
gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc
gosa-plugins/goto/admin/systems/goto/tabs_printers.inc
gosa-plugins/goto/admin/systems/goto/tabs_terminal.inc
gosa-plugins/goto/admin/systems/goto/tabs_workstation.inc
gosa-plugins/goto/admin/systems/ppd/class_ppdManager.inc
gosa-plugins/goto/admin/systems/services/kiosk/class_goKioskService.inc
gosa-plugins/goto/admin/systems/services/shares/class_servNfs.inc
gosa-plugins/goto/admin/systems/services/terminal/class_goTerminalServer.inc
gosa-plugins/goto/personal/environment/class_environment.inc
gosa-plugins/groupware/admin/ogroups/GroupwareDistributionList/class_GroupwareDistributionList.inc
gosa-plugins/groupware/personal/groupware/class_FilterEditor.inc
gosa-plugins/groupware/personal/groupware/class_Groupware.inc
gosa-plugins/heimdal/admin/systems/services/kerberos/class_goKrbServer.inc
gosa-plugins/kolab/personal/connectivity/kolab/class_kolabAccount.inc
gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab.inc
gosa-plugins/mail/addons/mailqueue/class_mailqueue.inc
gosa-plugins/mail/addons/mailqueue/class_si_mailqueue.inc
gosa-plugins/mail/admin/groups/mail/class_groupMail.inc
gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc
gosa-plugins/mail/personal/mail/class_mail-methods.inc
gosa-plugins/mail/personal/mail/class_mailAccount.inc
gosa-plugins/mail/personal/mail/sieve/class_My_Tree.inc
gosa-plugins/mail/personal/mail/sieve/class_parser.inc
gosa-plugins/mail/personal/mail/sieve/class_scanner.inc
gosa-plugins/mail/personal/mail/sieve/class_sieveElement_If.inc
gosa-plugins/mail/personal/mail/sieve/class_sieveElement_Require.inc
gosa-plugins/mail/personal/mail/sieve/class_sieveElement_Vacation.inc
gosa-plugins/mail/personal/mail/sieve/class_sieveManagement.inc
gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_goKrbServer.inc
gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_krb5_policy.inc
gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_password-methods-MIT.inc
gosa-plugins/nagios/personal/nagios/class_nagiosAccount.inc
gosa-plugins/opengroupware/personal/connectivity/opengroupware/class_opengw.inc
gosa-plugins/opengroupware/personal/connectivity/opengroupware/class_opengwAccount.inc
gosa-plugins/opsi/admin/opsiLicenses/class_licenseGeneric.inc
gosa-plugins/opsi/admin/opsiLicenses/class_licensePoolGeneric.inc
gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsageByHost.inc
gosa-plugins/phpgw/personal/connectivity/phpgw/class_phpgwAccount.inc
gosa-plugins/pureftpd/personal/connectivity/pureftpd/class_pureftpdAccount.inc
gosa-plugins/rsyslog/addons/rsyslog/class_rsyslog.inc
gosa-plugins/rsyslog/admin/systems/services/rsyslog/class_rSyslogServer.inc
gosa-plugins/samba/personal/samba/class_sambaAccount.inc
gosa-plugins/samba/personal/samba/class_sambaMungedDial.inc
gosa-plugins/scalix/personal/scalix/class_scalixAccount.inc
gosa-plugins/squid/personal/connectivity/squid/class_proxyAccount.inc
gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc
gosa-plugins/sudo/admin/sudo/class_sudoOption.inc
gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc
gosa-plugins/systems/admin/systems/class_systemManagement.inc
gosa-plugins/systems/admin/systems/class_termDNS.inc
gosa-plugins/systems/admin/systems/tabs_server.inc
gosa-plugins/webdav/personal/connectivity/webdav/class_webdavAccount.inc

index bc9d0267437f3029d4061b050a8d299151b60df0..b30938db9d166ae781f4d2ce94aeedb2568e50c9 100644 (file)
@@ -94,7 +94,7 @@ class intranetAccount extends plugin
       $smarty->assign('gosaIntranetACL', $this->getacl("",$this->ReadOnly));
     }
 
-    $smarty->assign("use_intranet",in_array("intranet",$this->multi_boxes));
+    $smarty->assign("use_intranet",in_array_strict("intranet",$this->multi_boxes));
     $smarty->assign("multiple_support",$this->multiple_support_active);
     $display.= $smarty->fetch (get_template_path('intranet.tpl', TRUE, dirname(__FILE__)));
     return ($display);
@@ -246,7 +246,7 @@ class intranetAccount extends plugin
   function get_multi_edit_values()
   {
     $ret = plugin::get_multi_edit_values();
-    if(in_array("intranet",$this->multi_boxes)){
+    if(in_array_strict("intranet",$this->multi_boxes)){
       $ret['is_account'] = $this->is_account;
     }
     return($ret);
@@ -263,7 +263,7 @@ class intranetAccount extends plugin
   function init_multiple_support($attrs,$all)
   {
     plugin::init_multiple_support($attrs,$all);
-    if(isset($attrs['objectClass']) && in_array("gosaIntranetAccount",$attrs['objectClass'])){
+    if(isset($attrs['objectClass']) && in_array_strict("gosaIntranetAccount",$attrs['objectClass'])){
       $this->is_account = TRUE;
     }
   }
index 47799858a8de747d4275f5460a6088f32432296c..bcad3a306e76fea5c0d51dbf1df4645f22a3281d 100644 (file)
@@ -61,7 +61,7 @@ class dhcpAdvanced extends plugin
         if ($acl_writeable && isset($_POST['delete_statement']) && isset($_POST['dhcpstatements'])){
             $name = preg_replace('/_[0-9]*$/', '', get_post('dhcpstatements'));
             $key  = preg_replace('/^.*_/', '', get_post('dhcpstatements'));
-            if (in_array($name, $this->autoStatements)){
+            if (in_array_strict($name, $this->autoStatements)){
                 msg_dialog::display(_("Error"), _("Cannot delete automatic statements!"), ERROR_DIALOG);
             } else {
                 $this->statements->remove($name,$key); 
@@ -75,7 +75,7 @@ class dhcpAdvanced extends plugin
         if ($acl_writeable && isset($_POST['delete_option']) && isset($_POST['dhcpoptions'])){
             $name = preg_replace('/_[0-9]*$/', '', get_post('dhcpoptions'));
             $key  = preg_replace('/^.*_/', '', get_post('dhcpoptions'));
-            if (in_array($name, $this->autoOptions)){
+            if (in_array_strict($name, $this->autoOptions)){
                 msg_dialog::display(_("Error"), _("Cannot delete automatic statements!"), ERROR_DIALOG);
             } else {
                 $this->options->remove($name,$key);    
@@ -90,7 +90,7 @@ class dhcpAdvanced extends plugin
         /* Assign statements  */
         $statements= array();
         foreach ($this->statements->getAll() as $key => $val){
-            if (in_array($key, $this->autoStatements)){
+            if (in_array_strict($key, $this->autoStatements)){
                 foreach($val as $id => $entry){
                     $statements[$key."_".$id]= "$key $entry ["._("automatic")."]";
                 }       
@@ -105,7 +105,7 @@ class dhcpAdvanced extends plugin
         /* Assign options  */
         $options= array();
         foreach ($this->options->getAll() as $key => $val){
-            if (in_array($key, $this->autoOptions)){
+            if (in_array_strict($key, $this->autoOptions)){
                 foreach($val as $id => $entry){
                     $options[$key."_".$id]= "$key $entry ["._("automatic")."]";
                 }       
index f02c993328173ceced8c8b0b49106d18b0f6a01e..259ae39272c455f86efde45ffd13ba6d1ed378d6 100644 (file)
@@ -168,7 +168,7 @@ class dhcpNetwork extends plugin
                 } else {
 
                     /* Only quote filename values */
-                    if(in_array($key,array("filename"))){
+                    if(in_array_strict($key,array("filename"))){
                         $this->statements->set($key,'"'.trim(get_post($val),"\"").'"');
                     }else{
                         $this->statements->set($key,get_post($val));
index ecb2ecacbe4498bcf9f7b3538123e6816d896c3e..23a5553e1ca2429f759b0e3a204bc417865368cb 100644 (file)
@@ -171,7 +171,7 @@ class dhcpPool extends dhcpPlugin
                 "dhcpGroup", "dhcpPool", "dhcpSubnet", "dhcpSharedNetwork");
 
         foreach ($cache[$dn]['objectClass'] as $oc){
-            if (in_array($oc, $types)){
+            if (in_array_strict($oc, $types)){
                 $type= $oc;
                 break;
             }
index 49c5a56957f0206ff20000ab33f05af41677e29d..679acf16dcf0f66b1d342761569a3e6c6ee455ea 100644 (file)
@@ -59,7 +59,7 @@ class dhcpSharedNetwork extends dhcpPlugin
                     "unknown-clients" => "allow_unknown_state",
                     "bootp" => "allow_bootp_state",
                     "booting" => "allow_booting_state") as $state => $target){
-            if(in_array($state,$allow)){
+            if(in_array_strict($state,$allow)){
                 $smarty->assign($target,"checked");
             }else{
                 $smarty->assign($target,"");
index 65f61d7579f57555be5543a86164617f7e4fbadc..8acb472eb550fc706fe889a1986d4c23647930e2 100644 (file)
@@ -351,7 +351,7 @@ class servdhcp extends goService
         foreach($this->dhcpSections as $section => $values ){
 
             // Ensure that we've a valid id for this section.
-            if(!in_array($section,$this->dhcpDNtoID)){
+            if(!in_array_strict($section,$this->dhcpDNtoID)){
                 $this->dhcpDNtoID[] = $section;
             }
 
@@ -481,7 +481,7 @@ class servdhcp extends goService
             if($this->dn != $this->orig_dn){
                 $fixed = FALSE;
                 foreach(array("dhcpHost","dhcpSubnet","dhcpGroup","dhcpSharedNetwork") as $object){
-                    if(in_array($object,$data['objectClass']) && isset($data['dhcpOption'])){
+                    if(in_array_strict($object,$data['objectClass']) && isset($data['dhcpOption'])){
                         foreach($data['dhcpOption'] as $key => $option){
                             if(preg_match("/^server-name /",$option)){
                                 $data['dhcpOption'][$key] = "server-name ".$this->cn;
@@ -514,7 +514,7 @@ class servdhcp extends goService
                         continue;
                     }
 
-                    if(in_array($attribute,array("dhcpPrimaryDN","dhcpSecondaryDN","dhcpServerDN","dhcpFailOverPeerDN"))){
+                    if(in_array_strict($attribute,array("dhcpPrimaryDN","dhcpSecondaryDN","dhcpServerDN","dhcpFailOverPeerDN"))){
                         foreach($values as $v_key => $value){
                             $values[$v_key] = preg_replace("/".preg_quote($this->orig_dn, '/')."$/i",$this->dn,$value);
                         }
@@ -526,7 +526,7 @@ class servdhcp extends goService
                             foreach($values as $key => $value){
                                 $option_name = trim(preg_replace("/[^ ]*$/","",$value));
                                 $option_value= trim(preg_replace("/^[^ ]*/","",$value));
-                                if(in_array($option_name,$this->quote_option)){
+                                if(in_array_strict($option_name,$this->quote_option)){
                                     $values[$key] = $option_name." \"".$option_value."\"";
                                 }
                             }
@@ -645,7 +645,7 @@ class servdhcp extends goService
                         foreach($values as $key => $value){
                             $value_name = trim(preg_replace("/[^ ]*$/","",$value));
                             $value_value= trim(preg_replace("/^[^ ]*/","",$value));
-                            if(in_array($value_name,$this->quote_option)){
+                            if(in_array_strict($value_name,$this->quote_option)){
                                 $value_value = preg_replace("/^\"/","",$value_value);
                                 $value_value = preg_replace("/\"$/","",$value_value);
                                 $sattrs[$name][$key] = $value_name." ".$value_value;
@@ -663,7 +663,7 @@ class servdhcp extends goService
                 }
 
                 foreach ($this->types as $key => $val){
-                    if (in_array("$key", $attrs['objectClass'])){
+                    if (in_array_strict("$key", $attrs['objectClass'])){
                         $type= $val;
                         break;
                     }
@@ -698,7 +698,7 @@ class servdhcp extends goService
                 "dhcpTSigKey", "dhcpDnsZone");
 
         foreach ($this->dhcpObjectCache[$dn]['objectClass'] as $oc){
-            if (in_array($oc, $types)){
+            if (in_array_strict($oc, $types)){
                 $type= $oc;
                 break;
             }
index b53e986d1829caddbb9dbc491e6f747361743586..5128c82ed35201e95df11d72dc234a132878ae0b 100644 (file)
@@ -138,7 +138,7 @@ class DNS
 
                 /* Skip some attributes 
                  */
-                if(in_array($name,$SkipRecords)) continue;
+                if(in_array_strict($name,$SkipRecords)) continue;
 
                 /* If there is a record attribute
                  */
@@ -560,7 +560,7 @@ class DNS
          *  Or overwritten and filled with new values.
          */
         foreach($newRecords as $name => $def){
-            if(!in_array($name,$specialAttributes)){
+            if(!in_array_strict($name,$specialAttributes)){
                 $add[$stdDn][$name] = $def;
             }
         }
@@ -568,7 +568,7 @@ class DNS
         /* Delete all OLD special attributes.
          */
         foreach($oldEntry['RECORDS'] as $id => $rec){
-            if(in_array($rec['type'],$specialAttributes)){
+            if(in_array_strict($rec['type'],$specialAttributes)){
                 $deldn= "relativeDomainName=".$rec['value'].",".$baseDn;
                 $del[$deldn] = "";
             }
index 17fd6741e85c5cb8dcfadebb9de305c68cc8be4c..6ffdc38ba790b5a3b55f501197e2747076ca6764 100644 (file)
@@ -75,7 +75,7 @@ class servdns extends goService
                 continue;
             }
             $dn = preg_replace("/^zoneName=[^,]+,/","",$attrs['dn']);
-            if(preg_match("/^cn=/",$dn) && !in_array($dn,$dns)){
+            if(preg_match("/^cn=/",$dn) && !in_array_strict($dn,$dns)){
                 $dns[] = $dn;
             }
         }
index 5721d9505ed54420dae80925bb9ec28009e1dc6f..255cf1ea1775084bac2d99b74399858ab3db7bef 100644 (file)
@@ -129,7 +129,7 @@ class servDNSeditZoneEntries extends plugin
                 /* Check if there is at least one visible record. Else remove complete entry */
                 $visible = false;
                 foreach($this->Devices[$Name]['RECORDS'] as $rec){
-                    if(in_array($rec['type'],$this->RecordTypes)){
+                    if(in_array_strict($rec['type'],$this->RecordTypes)){
                         $visible = true;  
                         break;
                     }
@@ -301,7 +301,7 @@ class servDNSeditZoneEntries extends plugin
 
                 /* Check for multiple use of unique record types
                  */
-                if(in_array($Rec['type'],$singleEntries)){
+                if(in_array_strict($Rec['type'],$singleEntries)){
                     if(!isset($tmp[$Rec['type']])){
                         $tmp[$Rec['type']] = "";
                     }else{
index 518193c76ec2e847d31ebffee4d6fad631eebcad..dbfe227568e7dc748a8df7c36271437087c6e53e 100644 (file)
@@ -61,7 +61,7 @@ class classSelect extends management
 
     $str = "";
     foreach($objTypes as $class => $img){
-      if(in_array($class, $classes)){
+      if(in_array_strict($class, $classes)){
         $str .= $img;
       }else{
         $str .= image('images/empty.png');
index 2659b3f6f2fbf1a63574aa009cc947be8973a18c..10fdfa4664f6f2e7577eaa3131315fc4ecc0c695 100644 (file)
@@ -42,7 +42,7 @@ class filterFAIClass {
     
       if(isset($attrs['cn'][0]) && preg_match("/".$regex."/i", $attrs['cn'][0])){
         foreach($categories as $cat => $acl){
-          if(in_array($cat,$attrs['objectClass'])){
+          if(in_array_strict($cat,$attrs['objectClass'])){
             $acl =  $ui->get_permissions($attrs['dn'],"fai/".$acl);
             if(!isset($FAIAllclasses[$attrs['cn'][0]])){
               $FAIAllclasses[$attrs['cn'][0]] = $attrs ;
@@ -67,7 +67,7 @@ class filterFAIClass {
             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 e5d40a9808a9fbccc1222b2fe359d514b75a3807..ec22c35a6f00d07180559cdc0f4d404f07c90d51 100644 (file)
@@ -860,7 +860,7 @@ class FAI
       }
 
       /* Get sub release departments of this department */
-      if(in_array("FAIbranch",$attr['objectClass'])) {
+      if(in_array_strict("FAIbranch",$attr['objectClass'])) {
         if($flat){
           $tmp = FAI::                       get_sub_releases_of_this_release($attr['dn'],$flat);
           foreach($tmp as $dn => $value){
@@ -892,7 +892,7 @@ class FAI
         $ou = $attrs['ou'][0]; 
       }
 
-      if((in_array("FAIbranch",$attrs['objectClass'])) || ($ou == "fai")){
+      if((in_array_strict("FAIbranch",$attrs['objectClass'])) || ($ou == "fai")){
         return($attrs['dn']);
       }
     }
@@ -1115,7 +1115,7 @@ class FAI
       /* The current object we want to create is an department.
        * Create the department and add the FAIbranch tag.
        */
-      if(in_array("organizationalUnit",$attr['objectClass'])){
+      if(in_array_strict("organizationalUnit",$attr['objectClass'])){
         $attr['dn'] = LDAP::convert($destinationdn);
         $ldap->cd($basedn);
         $ldap->create_missing_trees($destinationdn);
@@ -1154,7 +1154,7 @@ class FAI
          */
         foreach($attr as $key => $value){
 
-          if(in_array($key ,array("gotoLogonScript", "gosaApplicationIcon","gotoMimeIcon"))){
+          if(in_array_strict($key ,array("gotoLogonScript", "gosaApplicationIcon","gotoMimeIcon"))){
             $sr= ldap_read($ldap->cid, LDAP::fix($sourcedn), "$key=*", array($key));
             $ei= ldap_first_entry($ldap->cid, $sr);
             if ($tmp= @ldap_get_values_len($ldap->cid, $ei,$key)){
@@ -1171,7 +1171,7 @@ class FAI
         }
         unset($attr['count']);
         unset($attr['dn']);
-        if(!in_array("FAIobject",$attr['objectClass'])){
+        if(!in_array_strict("FAIobject",$attr['objectClass'])){
           $attr['objectClass'][] = "FAIobject";
         }
         $attr['FAIstate'] = $type;
@@ -1215,7 +1215,7 @@ class FAI
       if($dn != $destinationdn){
         $ldap->cd($basedn);
         $item = $ldap->fetch($ldap->cat($dn));
-        if(!in_array("FAIbranch",$item['objectClass'])){
+        if(!in_array_strict("FAIbranch",$item['objectClass'])){
           FAI::copy_FAI_resource_recursive($dn,str_replace($sourcedn,$destinationdn,$dn),$destinationName,$type,false,$depth);
         }
       }
index 2203198ea2d0d6688bb468eb541f80a9ab1c68c6..31db9026e4c727a4215c747a962da25d5c9dc02b 100644 (file)
@@ -57,7 +57,7 @@ class askClassName extends plugin
     foreach($res as $object){
 
       /* skip class names with this name */ 
-      if(in_array($this->objectClass,$object['objectClass']) || in_array("FAIprofile",$object['objectClass'])){
+      if(in_array_strict($this->objectClass,$object['objectClass']) || in_array_strict("FAIprofile",$object['objectClass'])){
         if(isset($object['FAIstate'][0]) && preg_match("/removed$/",$object['FAIstate'][0])){
           continue;
         }
@@ -65,7 +65,7 @@ class askClassName extends plugin
       }
 
       /* Skip profiles */
-      if(!in_array("FAIprofile",$object['objectClass'])){
+      if(!in_array_strict("FAIprofile",$object['objectClass'])){
         if(isset($object['cn'])){
           $used[$object['cn'][0]]= $object['cn'][0];
         }
@@ -150,7 +150,7 @@ class askClassName extends plugin
       $message[]= msgPool::required(_("Name"));
     }
 
-    if(in_array($this->ClassName,$this->forbidden)){
+    if(in_array_strict($this->ClassName,$this->forbidden)){
       $message[]= msgPool::duplicated(_("Name"));
     }
 
index f5bb9ad758bd1bfc7c9ecfab1a72e9b94b6a8711..2f66dd422b8680c8573d2e939e93511b56d02903 100644 (file)
@@ -262,7 +262,7 @@ class debconf
         
       $defs = explode(", ",$data['Default']);
       foreach($choices as $value){
-        if(in_array($value,$defs)){
+        if(in_array_strict($value,$defs)){
           $result.="\n<input name='".$post_name."-multi-".$value."' type='checkbox' value='".set_post($value)."' checked>".$value."<br>";
         }else{
           $result.="\n<input name='".$post_name."-multi-".$value."' type='checkbox' value='".set_post($value)."'>".$value."<br>";
index 7742ad6a810a75035d5d79d494417ec177c94035..0c63bf53617c2b2e1e475eee21044d765655c28d 100644 (file)
@@ -366,7 +366,7 @@ class faiDiskEntry extends plugin
     // Check which of the available disks are unused.
     $ret = array();
     foreach($may as $val){
-      if(!in_array($val,$used)){
+      if(!in_array_strict($val,$used)){
         $ret[$val] = $val;
       }
     }
@@ -429,7 +429,7 @@ class faiDiskEntry extends plugin
       $used[$key] = $part['FAIpartitionNr'];
     }
     $id = 1;
-    while(in_array($id,$used) && $id < 16 ){
+    while(in_array_strict($id,$used) && $id < 16 ){
       $id++;
     }
     return($id);
index c9dd0a34f616047cf1e113f3d9afc050bd8950a9..095be052362b32859b9655137f2c2c7b929608a3 100644 (file)
@@ -10,7 +10,7 @@ class faiGroupHandle{
 
   public function __construct($FAI_group, $Action)
   {
-    if(in_array($Action,array("edit","remove","copy","cut"))){
+    if(in_array_strict($Action,array("edit","remove","copy","cut"))){
       $this->mode = $Action;
     }else{
       trigger_error("Wrong action type '".$Action."'.");
@@ -42,7 +42,7 @@ class faiGroupHandle{
   function save_object()
   {
     if(isset($_POST['faiGroupHandle'])){
-      if(in_array($this->mode,array("copy","cut","remove"))){
+      if(in_array_strict($this->mode,array("copy","cut","remove"))){
         foreach($this->FAI_group as $key => $group){
           if(isset($_POST[$this->mode."_".$key])){
             $this->FAI_group[$key]['selected'] = TRUE;
index 84bac6b142b325f108cb0acaa536a2ccfb81b782..a72c866da7691937fea79a8fcab143de89433097 100644 (file)
@@ -111,7 +111,7 @@ class faiHookEntry extends plugin
     $used_tasks = $this->parent->getUsedFAItask($this->cn);
     $tasks = $this->tasks;
     foreach($this->tasks as $id => $task){
-      if(in_array($task,$used_tasks)){
+      if(in_array_strict($task,$used_tasks)){
         unset($tasks[$id]);
       }
     }
index c420d22243d5f78bdd956cd6dd4e43a5dfcc6150..5dfe887d0061e2301233cd6ac259c3f266d94c51 100644 (file)
@@ -159,7 +159,7 @@ class faiManagement extends management
           $entry = $headpage->getEntry($t);
 
           // Check for valid FAI objects
-          if(in_array('FAKE_OC_FAI', $entry['objectClass'])){
+          if(in_array_strict('FAKE_OC_FAI', $entry['objectClass'])){
             foreach($entry['GROUPS'] as $g){
               $type = $this->get_type($g);
               $this->cpHandler->add_to_queue($g['dn'],"copy",$type[0],$type[2],'fai',$this);
@@ -284,7 +284,7 @@ class faiManagement extends management
       if($entry){
 
         // Edit Opsi objects here 
-        if(in_array("opsi_local", $entry['TYPES']) || in_array("opsi_netboot", $entry['TYPES'])){ 
+        if(in_array_strict("opsi_local", $entry['TYPES']) || in_array_strict("opsi_netboot", $entry['TYPES'])){ 
           $name = $entry['cn'];
           $cfg = $this->opsi->get_product_properties($name);
 
@@ -351,7 +351,7 @@ class faiManagement extends management
       $to_delete = array();
       foreach($target as $id){
         $object = $headpage->getEntry($id);
-        if(in_array("FAKE_OC_FAI", $object['objectClass'])){
+        if(in_array_strict("FAKE_OC_FAI", $object['objectClass'])){
           foreach($object['GROUPS']  as $entry){
             array_push($to_delete, $entry);
           }
@@ -364,7 +364,7 @@ class faiManagement extends management
       $headpage = $this->getHeadpage();
       if(count($target) == 1){
         $entry = $headpage->getEntry($target[0]);
-        if($entry && in_array("FAKE_OC_FAI",$entry['objectClass'])){
+        if($entry && in_array_strict("FAKE_OC_FAI",$entry['objectClass'])){
           $this->dialogObject = new faiGroupHandle($entry['GROUPS'],"remove");
         }
       }
@@ -1039,25 +1039,25 @@ class faiManagement extends management
   function get_type($array)
   {
     if(!isset($array['objectClass'])) return(array());
-    if(in_array("FAIpartitionTable",$array['objectClass'])){
+    if(in_array_strict("FAIpartitionTable",$array['objectClass'])){
       return(array("tabsPartition","faiPartitionTable","FAIPARTITIONTABS"));
     }
-    if(in_array("FAIscript",$array['objectClass'])){
+    if(in_array_strict("FAIscript",$array['objectClass'])){
       return(array("tabsScript","faiScript","FAISCRIPTTABS"));
     }
-    if(in_array("FAItemplate",$array['objectClass'])){
+    if(in_array_strict("FAItemplate",$array['objectClass'])){
       return(array("tabsTemplate","faiTemplate","FAITEMPLATETABS"));
     }
-    if(in_array("FAIhook",$array['objectClass'])){
+    if(in_array_strict("FAIhook",$array['objectClass'])){
       return(array("tabsHook","faiHook","FAIHOOKTABS"));
     }
-    if(in_array("FAIvariable",$array['objectClass'])){
+    if(in_array_strict("FAIvariable",$array['objectClass'])){
       return(array("tabsVariable","faiVariable","FAIVARIABLETABS"));
     }
-    if(in_array("FAIprofile",$array['objectClass'])){
+    if(in_array_strict("FAIprofile",$array['objectClass'])){
       return(array("tabsProfile","faiProfile","FAIPROFILETABS"));
     }
-    if(in_array("FAIpackageList",$array['objectClass'])){
+    if(in_array_strict("FAIpackageList",$array['objectClass'])){
       return(array("tabsPackage","faiPackage","FAIPACKAGETABS"));
     }
     return(array());
@@ -1096,7 +1096,7 @@ class faiManagement extends management
     $f = $this->fai_release;
     if($name == ""){
       return(false);
-    }elseif(in_array($name,$this->getBranches($f))) {
+    }elseif(in_array_strict($name,$this->getBranches($f))) {
       return(false);
     }elseif(tests::is_department_name_reserved($name,$base)){
       return(false);
@@ -1132,7 +1132,7 @@ class faiManagement extends management
 
     $icon_list = "";
     foreach($objects as $type => $type_data){
-      if(in_array($type, $classes)){
+      if(in_array_strict($type, $classes)){
         $icon_list .= image($type_data['IMG'],'edit_'.$row.'_'.$type,$type_data['NAME']);
       }else{
         $icon_list .= image('images/empty.png');
@@ -1203,7 +1203,7 @@ class faiManagement extends management
         $headpage = $this->getHeadpage();
         $entry = $headpage->entries[$id];
 
-        if(in_array('FAKE_OC_FAI', $entry['objectClass'])){
+        if(in_array_strict('FAKE_OC_FAI', $entry['objectClass'])){
           unset($_POST[$name]);
           if(isset($headpage->entries[$id]['GROUPS'][$tab])){
             $data =$headpage->entries[$id]['GROUPS'][$tab];
index 01b10daba5b9b77db43fdc2a3a749a6b79438916..703f197cbf68a50531adedcc830c9d7f017882bf 100644 (file)
@@ -109,7 +109,7 @@ class faiPackage extends plugin
         $tmp['Type']  = $attr['FAIvariableType'][0];
 
         if (isset($attr['FAIvariableContent'][0])){
-          if(!in_array($attr['FAIvariableType'],array("multiselect"))){
+          if(!in_array_strict($attr['FAIvariableType'],array("multiselect"))){
             $tmp['Value'] = $attr['FAIvariableContent'][0];
           }else{
             $content = array();        
@@ -646,7 +646,7 @@ class faiPackage extends plugin
         /* Tag object */
         $this->tag_attrs($pkgattrs, $pkgdn, $this->gosaUnitTag);
 
-        if(in_array($pkgattrs['FAIvariableType'],array("boolean","multiselect","password","select","string","text"))){
+        if(in_array_strict($pkgattrs['FAIvariableType'],array("boolean","multiselect","password","select","string","text"))){
 
           if($pkgattrs['FAIvariableType'] == "text" && $pkgattrs['FAIvariableContent'] == ""){
             gosa_log("Skipped saving FAIvariable '$name' empty string can't be saved.");
@@ -755,7 +755,7 @@ class faiPackage extends plugin
       $tmp['Type']  = $attr['FAIvariableType'][0];
 
       if (isset($attr['FAIvariableContent'][0])){
-        if(!in_array($attr['FAIvariableType'],array("multiselect"))){
+        if(!in_array_strict($attr['FAIvariableType'],array("multiselect"))){
           $tmp['Value'] = $attr['FAIvariableContent'][0];
         }else{
           $content = array();        
index 006bc35ee2d126de3a23236f26dde1ddbff0a949..094275ef942d2be184b2657e31af426ca84327d2 100644 (file)
@@ -275,7 +275,7 @@ class faiPartition extends plugin
     // Check which of the available disks are unused. 
     $ret = array();
     foreach($may as $val){
-      if(!in_array($val,$used)){
+      if(!in_array_strict($val,$used)){
         $ret[$val] = $val;
       }
     }
index 3619ef8f6296587f95ef2ba4ab727f62f50f16e4..57c630564b6af7e1c09e27513b6c4d99cae4f75b 100644 (file)
@@ -275,7 +275,7 @@ class faiPartitionTable extends plugin
       if(isset($this->disks[$s_entry]['FAIdiskType'])){
         $type = $this->disks[$s_entry]['FAIdiskType'];
       }
-      if(in_array($type,array('raid','lvm','disk'))){
+      if(in_array_strict($type,array('raid','lvm','disk'))){
         $this->dialog = new faiDiskEntry(
             $this->config,$this->dn,$this,$this->disks[$s_entry], 
             $this->disks[$s_entry]['FAIdiskType']); 
index 9784bc74cd5aa6c1f1d37655b92b388630469f59..797afc1d0759beae8b017c9dc13c68870558763b 100644 (file)
@@ -295,7 +295,7 @@ class faiPartitionTableEntry extends plugin
 
       foreach($this->partitions as $key => $part){
         foreach($this->UsedAttrs as $attrs){
-          if(in_array($attrs,array('cn','description'))) continue;
+          if(in_array_strict($attrs,array('cn','description'))) continue;
           
           if($this->acl_is_writeable($attrs)){
 
@@ -333,7 +333,7 @@ class faiPartitionTableEntry extends plugin
       $message[] = msgPool::invalid(_("Name"),$d,"/[a-z0-9_\-]/i");
     }
 
-    if($this->old_cn != $this->DISKcn && in_array($this->DISKcn,$this->parent->getUsedDiskNames())){
+    if($this->old_cn != $this->DISKcn && in_array_strict($this->DISKcn,$this->parent->getUsedDiskNames())){
       $message[] = msgPool::duplicated(_("Name"));
     }
        
@@ -356,7 +356,7 @@ class faiPartitionTableEntry extends plugin
         continue;
       }
  
-      if((in_array($part['FAImountPoint'],$alreadyUsed['FAImountPoint']))&&($part['FAIfsType']!="swap")){
+      if((in_array_strict($part['FAImountPoint'],$alreadyUsed['FAImountPoint']))&&($part['FAIfsType']!="swap")){
         $message[]=sprintf(_("please enter a unique mount point for partition %s"),($key));
       }
 
@@ -366,7 +366,7 @@ class faiPartitionTableEntry extends plugin
         }
       }
       if($part['FAIfsType'] == "swap"){
-        if(in_array($part['FAIfsType'],$alreadyUsed['FAIfsType'])){
+        if(in_array_strict($part['FAIfsType'],$alreadyUsed['FAIfsType'])){
           $message[]=sprintf(_("File system type 'swap' is already used, change file system type for partition %s."),$key);
         }
       }
index 52b98a2ecf60c0a2089ec99fbe6157b227deb734..2f7d34773450892951386dfc935343494794858d 100644 (file)
@@ -68,7 +68,7 @@ class faiProfile extends plugin
 
             /* Sort by categorie */
             foreach($categories as $cat){
-                if(in_array($cat,$attrs['objectClass'])){
+                if(in_array_strict($cat,$attrs['objectClass'])){
 
                     /* Append entry */
                     $this->FAIAllclasses[$attrs['cn'][0]][$cat]=$attrs;
index da995c33e5799147b3be96a650e1887567a81302..7551ad1186cf1e6bb55e568f84eff7b32150ef6c 100644 (file)
@@ -330,7 +330,7 @@ class faiScript extends plugin
     }
     
     /* Get sort order */
-    if(isset($_GET['sort']) && in_array($_GET['sort'],array("name","priority"))){
+    if(isset($_GET['sort']) && in_array_strict($_GET['sort'],array("name","priority"))){
       if($this->sort_by == $_GET['sort']){
         if($this->sort_order == "up"){
           $this->sort_order = "down";
index c39eaf2963b67b51a9ed9e6db8fe982fb8810b09..2dae9bc1fc35e841b27d2b3a8e5875cb372eff6a 100644 (file)
@@ -246,7 +246,7 @@ class faiSummaryTab extends plugin{
           "<b>".$this->objs[$key]['Name']."</b></a></td></tr>";
 
         /* Display FAItemplate FAIhook FAIscript entries */ 
-        if(in_array($key,array("FAItemplate","FAIhook","FAIscript"))){
+        if(in_array_strict($key,array("FAItemplate","FAIhook","FAIscript"))){
 
           $nums = array();          
           $tmp  = array();
@@ -305,7 +305,7 @@ class faiSummaryTab extends plugin{
         }
 
         /* Create variable entries */
-        if(in_array($key,array("FAIvariable"))) {
+        if(in_array_strict($key,array("FAIvariable"))) {
           foreach($entry['Entries'] as $cn => $data){
             $str .="<tr><td style='padding-left:20px;'>";
             $str .= $image."&nbsp;".$data['cn'][0];
@@ -322,7 +322,7 @@ class faiSummaryTab extends plugin{
         }
 
         /* Create packagelist entries */ 
-        if(in_array($key,array("FAIpackageList"))) {
+        if(in_array_strict($key,array("FAIpackageList"))) {
           ksort($entry['Entries']);
           foreach($entry['Entries'] as $data){
             $str .="<tr><td style='padding-left:20px;'>";
@@ -333,7 +333,7 @@ class faiSummaryTab extends plugin{
         }
 
         /* Create partition table entries */
-        if(in_array($key,array("FAIpartitionTable"))) {
+        if(in_array_strict($key,array("FAIpartitionTable"))) {
           foreach($entry['Entries'] as $cn => $data){
             $str .= "<tr><td style='padding-left:20px;'>";
             $str .= $image."&nbsp;".$data['name'];
@@ -407,7 +407,7 @@ class faiSummaryTab extends plugin{
       while($attrs = $ldap->fetch()){
 
         foreach($this-> objs as $key => $rest){
-          if(in_array($key,$attrs['objectClass'])){
+          if(in_array_strict($key,$attrs['objectClass'])){
 
             if(!isset($this->usedClasses[$key][$class])){
               $this->usedClasses[$key][$class] = true;
index 5f1065ce35df6554ed7fdbb7c503bd7a0f3061c3..d102d80cfd08322fa5669b4654c198458958fb2a 100644 (file)
@@ -42,7 +42,7 @@ class filterFAI extends filterLDAP{
 
         $acl = $ui->get_permissions($object['dn'],"fai/".$rest ['ACL']);
 
-        if(in_array($type,$object['objectClass']) && preg_match("/r/",$acl)){
+        if(in_array_strict($type,$object['objectClass']) && preg_match("/r/",$acl)){
 
           /* Prepare object */
           unset($object['objectClass']['count']);
index e1712163406b19f0aa6a1ff8dab959f2eb143412..53c4f65acd6e20aa77fd2c172ce3e8d461db151f 100644 (file)
@@ -61,7 +61,7 @@ class filterOPSIPackages extends filterLDAP{
         $data = array_pop($data);
 
         // Display only requested object types
-        if(!in_array($data['type'], $types)) continue;
+        if(!in_array_strict($data['type'], $types)) continue;
 
         // Filter out those entries that doesn't match the filter.
         if(!preg_match("/".$filter."/i",  $data['cn'])){
index 5dd6232a46ec28de2faa957ff97576e9f4013697..a992bd1f141fd7d23ac3ad1dae6aece7494cece5 100644 (file)
@@ -44,7 +44,7 @@ class filterFAIPackages {
             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 6507ba07a6529bb23a4764fd1d64927057ba289c..34b3f7c5a42448485826da3db7966254e577246c 100644 (file)
@@ -43,14 +43,14 @@ class blocklistGeneric extends plugin
       $this->readonly = TRUE;
   
       /* Get blocklist type and defined numbers */
-      if (in_array("goFaxSBlock",$this->attrs['objectClass'])){
+      if (in_array_strict("goFaxSBlock",$this->attrs['objectClass'])){
         if(isset($this->attrs["goFaxSBlocklist"])){
           for ($i= 0; $i<$this->attrs["goFaxSBlocklist"]["count"]; $i++){
             $this->goFaxBlocklist[]= $this->attrs["goFaxSBlocklist"][$i];
           }
         }
         $this->type= BLOCK_LIST_SEND;
-      } elseif (in_array("goFaxRBlock",$this->attrs['objectClass'])){
+      } elseif (in_array_strict("goFaxRBlock",$this->attrs['objectClass'])){
         if(isset($this->attrs["goFaxRBlocklist"])){
           for ($i= 0; $i<$this->attrs["goFaxRBlocklist"]["count"]; $i++){
             $this->goFaxBlocklist[]= $this->attrs["goFaxRBlocklist"][$i];
@@ -179,7 +179,7 @@ class blocklistGeneric extends plugin
       $tmp = $this->attributes;
       $tmp[] = "type";
       foreach($tmp as $attr){
-        if(in_array($attr,array("cn","type")) && $this->readonly){
+        if(in_array_strict($attr,array("cn","type")) && $this->readonly){
           continue;
         }elseif(isset($_POST[$attr]) && $this->acl_is_writeable($attr)){
           $this->$attr = get_post($attr);
@@ -289,7 +289,7 @@ class blocklistGeneric extends plugin
   /* Add number */
   function addNumber($number)
   {
-    if (!in_array($number, $this->goFaxBlocklist)){
+    if (!in_array_strict($number, $this->goFaxBlocklist)){
       $this->goFaxBlocklist[]= $number;
       sort($this->goFaxBlocklist);
     }
@@ -301,7 +301,7 @@ class blocklistGeneric extends plugin
   {
     $tmp= array();
     foreach ($this->goFaxBlocklist as $val){
-      if (!in_array($val, $numbers)){
+      if (!in_array_strict($val, $numbers)){
         $tmp[]= $val;
       }
     }
@@ -336,14 +336,14 @@ class blocklistGeneric extends plugin
     $this->readonly = TRUE;
 
     /* Get blocklist type and defined numbers */
-    if (in_array("goFaxSBlock",$source['objectClass'])){
+    if (in_array_strict("goFaxSBlock",$source['objectClass'])){
       if(isset($source["goFaxSBlocklist"])){
         for ($i= 0; $i<$source["goFaxSBlocklist"]["count"]; $i++){
           $this->goFaxBlocklist[]= $source["goFaxSBlocklist"][$i];
         }
       }
       $this->type= BLOCK_LIST_SEND;
-    } elseif (in_array("goFaxRBlock",$source['objectClass'])){
+    } elseif (in_array_strict("goFaxRBlock",$source['objectClass'])){
       if(isset($source["goFaxRBlocklist"])){
         for ($i= 0; $i<$source["goFaxRBlocklist"]["count"]; $i++){
           $this->goFaxBlocklist[]= $source["goFaxRBlocklist"][$i];
index 8a065436f3251c036be32a4bbc3afad38843f44e..65ca2b13428543fcee5474351d98c6ea471731ad 100644 (file)
@@ -78,7 +78,7 @@ class gofaxAccount extends plugin
       }
 
       /* Set up has_mailAccount */
-      if (in_array("gosaMailAccount", $this->attrs['objectClass'])){
+      if (in_array_strict("gosaMailAccount", $this->attrs['objectClass'])){
         $this->has_mailAccount= TRUE;
       }
     }
@@ -286,7 +286,7 @@ class gofaxAccount extends plugin
     if (isset($_POST['delete_blocklist_number']) && isset($_POST['block_list'])){
       $tmp= array();
       foreach($this->current_blocklist as $val){
-        if (!in_array($val, $_POST['block_list'])){
+        if (!in_array_strict($val, $_POST['block_list'])){
           $tmp[]= $val;
         }
       }
@@ -559,14 +559,14 @@ class gofaxAccount extends plugin
     }
 
     foreach($this->attributes as $attr){
-      if(in_array($attr,$this->multi_boxes)) {
+      if(in_array_strict($attr,$this->multi_boxes)) {
         $smarty->assign("use_".$attr,TRUE);
       }else{
         $smarty->assign("use_".$attr,FALSE);
       }
     }
     foreach(array("goFaxIsEnabled","edit_outgoing","edit_incoming","faxtomail","faxtoprinter") as $attr){
-      if(in_array($attr,$this->multi_boxes)) {
+      if(in_array_strict($attr,$this->multi_boxes)) {
         $smarty->assign("use_".$attr,TRUE);
       }else{
         $smarty->assign("use_".$attr,FALSE);
@@ -754,7 +754,7 @@ class gofaxAccount extends plugin
     foreach (array("goFaxRBlocklist", "goFaxRBlockgroups", "goFaxSBlocklist",
           "goFaxSBlockgroups", "facsimileAlternateTelephoneNumber") as $val){
 
-      if (in_array($val, $skip)){
+      if (in_array_strict($val, $skip)){
         continue;
       }
 
@@ -852,14 +852,14 @@ class gofaxAccount extends plugin
       }
 
       $tmp = 0+$this->goFaxDeliveryMode;
-      if(in_array("faxtomail",$this->multi_boxes)){
+      if(in_array_strict("faxtomail",$this->multi_boxes)){
         if (isset($_POST["faxtomail"]) && $_POST["faxtomail"] == 1){
           $tmp |= 32;
         }elseif($tmp & 32){
           $tmp &= (!32);
         }
       }
-      if(in_array("faxtoprinter",$this->multi_boxes)){
+      if(in_array_strict("faxtoprinter",$this->multi_boxes)){
         if (isset($_POST["faxtoprinter"]) && $_POST["faxtoprinter"] == 1){
           $tmp |= 64;
         }elseif($tmp & 64){
@@ -873,7 +873,7 @@ class gofaxAccount extends plugin
         } else {
           $this->goFaxIsEnabled= "1";
         }
-      if (isset($_POST['mail']) && in_array("mail",$this->multi_boxes)){
+      if (isset($_POST['mail']) && in_array_strict("mail",$this->multi_boxes)){
         $this->mail= get_post('mail');
       }
     }
@@ -882,21 +882,21 @@ class gofaxAccount extends plugin
   function get_multi_edit_values()
   {
     $ret = plugin::get_multi_edit_values();
-    if(in_array("goFaxIsEnabled",$this->multi_boxes)){
+    if(in_array_strict("goFaxIsEnabled",$this->multi_boxes)){
       $ret['goFaxIsEnabled'] = $this->goFaxIsEnabled;
     }
-    if(in_array("faxtoprinter",$this->multi_boxes)){
+    if(in_array_strict("faxtoprinter",$this->multi_boxes)){
       $ret['faxtoprinter'] = $this->goFaxDeliveryMode & 64;
     }
-    if(in_array("faxtomail",$this->multi_boxes)){
+    if(in_array_strict("faxtomail",$this->multi_boxes)){
       $ret['faxtomail'] = $this->goFaxDeliveryMode & 32;
     }
 
-    if(in_array("edit_incoming",$this->multi_boxes)){
+    if(in_array_strict("edit_incoming",$this->multi_boxes)){
       $ret['goFaxRBlocklist'] = $this->goFaxRBlocklist;
       $ret['goFaxRBlockgroups'] = $this->goFaxRBlockgroups;
     }
-    if(in_array("edit_outgoing",$this->multi_boxes)){
+    if(in_array_strict("edit_outgoing",$this->multi_boxes)){
       $ret['goFaxSBlocklist'] = $this->goFaxSBlocklist;
       $ret['goFaxSBlockgroups'] = $this->goFaxSBlockgroups;
     }
index a798c7efb0fd4b3785908111b4e2389e80bf41f2..426675e0aa8c4d30cb5b4cb579018e4661b52456 100644 (file)
@@ -220,7 +220,7 @@ class phonequeue extends plugin
 
             /* Add queue number */ 
             if(isset($_POST['add_phonenumber'])&&(isset($_POST['phonenumber']))&&(!empty($_POST['phonenumber']))){
-                if((!in_array($_POST['phonenumber'],$this->telephoneNumber))&&(is_numeric($_POST['phonenumber']))){
+                if((!in_array_strict($_POST['phonenumber'],$this->telephoneNumber))&&(is_numeric($_POST['phonenumber']))){
                     $this->telephoneNumber[]=get_post('phonenumber');
                 }
             }
@@ -549,7 +549,7 @@ class phonequeue extends plugin
                     $obj = $ldap->fetch();
 
                     /* Calculate server and account dependencies */
-                    $is_acc = in_array("goFonAccount",$obj['objectClass']);
+                    $is_acc = in_array_strict("goFonAccount",$obj['objectClass']);
                     $is_home= isset($obj['goFonHomeServer'][0]) && $obj['goFonHomeServer'][0] == $this->goFonHomeServer; 
 
                     /* Append user to list of queue member,
index dfade68515d76919dc2864dae3c33accbf9d86c5..200d5d49ddaac1a298e5087ab34ed023267549e6 100644 (file)
@@ -209,7 +209,7 @@ class phoneGeneric extends plugin
 
         /* deativate all fields that are not used by the specified type */
         foreach($this->attributes as $att){
-            if((!in_array($att,$this->usedattrs[$this->selected_category]))){
+            if((!in_array_strict($att,$this->usedattrs[$this->selected_category]))){
                 $smarty->assign($att."USED", "disabled" );
                 $smarty->assign($att, "");
             }else{
@@ -377,7 +377,7 @@ class phoneGeneric extends plugin
         foreach($this->attributes as $att){
 
             /* Check all attributes, if they are needed for this type of phone */
-            if(!in_array($att,$this->usedattrs[$mode])){
+            if(!in_array_strict($att,$this->usedattrs[$mode])){
                 $this->attrs[$att] = array();
             }
         }
index 85822332bd5f55caa72ae3b3ee3b291318b80be4..6c707f4d1de205e3bf4b9bd2204e257c80b0ad87 100644 (file)
@@ -130,7 +130,7 @@ class goFonServer extends goService{
         /* Update goFonAccounts if server was is renamed.
            Set attribute goFonHomeServer to current dn
          */
-        if(in_array("goFonServer",$this->objectclasses)){
+        if(in_array_strict("goFonServer",$this->objectclasses)){
             if($this->orig_dn != "new" && $this->orig_dn != $this->dn){
                 $ldap = $this->config->get_ldap_link();
                 $ldap->cd($this->config->current['BASE']);
index 75da3a7e9181206bd75db0670e5fe21eb7d570ab..8117ceae285e8a42580bcf4b6aa1b0b46f6ae385 100644 (file)
@@ -345,7 +345,7 @@ class macroParameter extends plugin
             }
             switch($val['type']){
                 case 'bool'   :   $possible = array("","0","1");
-                                  if(!in_array($val['default'],$possible)) {
+                                  if(!in_array_strict($val['default'],$possible)) {
                                       $message[] = sprintf(_("Parameter %s is invalid!"),$val['name']);
                                   };break;
                 case 'string' :
index 872faefff6ddd4b96eefdd1eed5a32861be8e616..330f21f844028909f6c218bde430e411e4f662e6 100644 (file)
@@ -1329,7 +1329,7 @@ class phoneAccount extends plugin
 
 
         foreach($this->attributes as $attr){
-            if(in_array($attr,$this->multi_boxes)){
+            if(in_array_strict($attr,$this->multi_boxes)){
                 $smarty->assign("use_".$attr,TRUE);
             }else{
                 $smarty->assign("use_".$attr,FALSE);
@@ -1337,7 +1337,7 @@ class phoneAccount extends plugin
         }
 
         foreach(array("goFonVoiceMailContext","goFonContext") as $attr){
-            if(in_array($attr,$this->multi_boxes)){
+            if(in_array_strict($attr,$this->multi_boxes)){
                 $smarty->assign("use_".$attr,TRUE);
             }else{
                 $smarty->assign("use_".$attr,FALSE);
@@ -1603,7 +1603,7 @@ class phoneAccount extends plugin
         plugin::adapt_from_template($dn, $skip);
 
         /* Assemble phone numbers */
-        if (isset($this->attrs['telephoneNumber']) && !in_array("telephoneNumber", $skip)){
+        if (isset($this->attrs['telephoneNumber']) && !in_array_strict("telephoneNumber", $skip)){
             for ($i= 0; $i<$this->attrs['telephoneNumber']['count']; $i++){
                 $number= $this->attrs['telephoneNumber'][$i];
                 $this->phoneNumbers[$number]= $number;
@@ -1747,7 +1747,7 @@ class phoneAccount extends plugin
         $ldap->cd($this->config->current['BASE']);
         $ldap->search("(&(objectClass=goFonQueue)(member=*))", array("member"));
         while($attr = $ldap->fetch()){
-            if(in_array($this->dn,$attr['member'])){
+            if(in_array_strict($this->dn,$attr['member'])){
                 $new =new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'],$attr['dn']);
                 unset($new->by_object['ogroup']->memberList[$this->dn]);
                 unset($new->by_object['ogroup']->member[$this->dn]);
@@ -1949,30 +1949,30 @@ class phoneAccount extends plugin
     {
         $message = plugin::multiple_check();
 
-        if(!count($this->goFonHomeServers) && in_array("goFonHomeServers",$this->multi_boxes)){
+        if(!count($this->goFonHomeServers) && in_array_strict("goFonHomeServers",$this->multi_boxes)){
             $message[] = _("There is currently no asterisk server defined!");
         }
 
-        if(empty($this->goFonHomeServer) && in_array("goFonHomeServers",$this->multi_boxes)){
+        if(empty($this->goFonHomeServer) && in_array_strict("goFonHomeServers",$this->multi_boxes)){
             $message[] = _("Asterisk server is invalid!");
         }
 
-        if(in_array("goFonVoicemailPIN",$this->multi_boxes) && 
+        if(in_array_strict("goFonVoicemailPIN",$this->multi_boxes) && 
                 ( (strlen($this->goFonVoicemailPIN)==0)||
                   (strlen($this->goFonVoicemailPIN)>4))){
             $message[]=(_("Voice mail PIN must be 4 characters long!"));
         }else{
-            if(preg_match("/[^0-9]/",$this->goFonVoicemailPIN) && in_array("goFonVoicemailPIN",$this->multi_boxes) ){
+            if(preg_match("/[^0-9]/",$this->goFonVoicemailPIN) && in_array_strict("goFonVoicemailPIN",$this->multi_boxes) ){
                 $message[]=(_("Voice mail PIN contains invalid characters!"));
             }
         }
 
-        if(preg_match("/[^0-9a-z]/i",$this->goFonPIN) && in_array("goFonPIN",$this->multi_boxes)){
+        if(preg_match("/[^0-9a-z]/i",$this->goFonPIN) && in_array_strict("goFonPIN",$this->multi_boxes)){
             $message[]=(_("Phone PIN contains invalid characters!"));
         }
 
         /* check for ! in any parameter setting*/
-        if(isset($this->macroarray[$this->macro]) && in_array("macro",$this->multi_boxes)){
+        if(isset($this->macroarray[$this->macro]) && in_array_strict("macro",$this->multi_boxes)){
             foreach($this->macroarray[$this->macro] as $val){
                 if((strstr($val['choosen'],"!"))||(strstr($val['choosen'],"#"))){
                     $message[] = sprintf(_("The parameter %s contains invalid char. '!,#' is used as delimiter"),$val['name']);
@@ -1986,7 +1986,7 @@ class phoneAccount extends plugin
     function get_multi_edit_values()
     {
         $ret = plugin::get_multi_edit_values();
-        if(in_array("macro",$this->multi_boxes)){
+        if(in_array_strict("macro",$this->multi_boxes)){
             $ret['macro'] = $this->macro;
             $ret['macroarray'] = $this->macroarray;
             $ret['macros'] = $this->macros;
index a4cc53143dbcf56dcd8378ca08ee9b6145d15816..8f89e66eb6e44bfe71910783fb31029928ae790f 100644 (file)
@@ -94,7 +94,7 @@ class ConfigManagementDataModel
     {
         $res = array();
         foreach($this->data['linear'] as $path => $item){
-            if(in_array($item['type'],$types)) $res[] = $item;
+            if(in_array_strict($item['type'],$types)) $res[] = $item;
         }
         return($res);
     }
index dda5975ef37969189fe1caa1da83979ecd3c764d..66aadf839ee297d01551da3995119f8ca7e7b8c4 100644 (file)
@@ -226,7 +226,7 @@ class newConfigManagement extends plugin
     function __recurseItem($item, $types, $parent = "")
     {
         $res = array();
-        if(in_array($item['type'], $types)){
+        if(in_array_strict($item['type'], $types)){
             $path = preg_replace("/".preg_quote($parent,'/')."/","",$item['path']);
             $res[$path] = array('name' => $item['name'],'desc'=>$item['type']);
         }
@@ -331,9 +331,9 @@ class newConfigManagement extends plugin
         $id = $ids[0];
         $item = $this->dataModel->getItemById($id);
         if($item){
-            if(in_array($item['type'], array('Distribution', 'Release'))){
+            if(in_array_strict($item['type'], array('Distribution', 'Release'))){
                 $this->setCurrentContainer($item['path'], $this->selectedItem);
-            }elseif(in_array($item['type'], array('Component'))){
+            }elseif(in_array_strict($item['type'], array('Component'))){
                 $next = preg_replace("/".preg_quote($this->selectedContainer,'/')."/","", $item['path']);
                 $this->setCurrentContainer($this->selectedContainer, $next);
             }else{
index d81a227e17c9606ffcdc51b87fcd8d735eea705c..3ac29153e40007fbbc2998a661528355687fa032 100644 (file)
@@ -37,7 +37,7 @@ class filterGotoEvents extends  filterLDAP {
 
             /* If WAITING add priority action
              */
-            if(in_array($entry['STATUS'],array("waiting")) && $acl_is_writeable){
+            if(in_array_strict($entry['STATUS'],array("waiting")) && $acl_is_writeable){
                 $entry['objectClass'][] = "FAKE_OC__prioUp";
                 $entry['objectClass'][] = "FAKE_OC__prioDown";
                 $entry['objectClass'][] = "FAKE_OC__prioPause";
@@ -45,13 +45,13 @@ class filterGotoEvents extends  filterLDAP {
 
             /* If PAUSED add resume action
              */
-            if(in_array($entry['STATUS'],array("paused")) && $acl_is_writeable){
+            if(in_array_strict($entry['STATUS'],array("paused")) && $acl_is_writeable){
                 $entry['objectClass'][] = "FAKE_OC__prioResume";
             }
 
             /* If PAUSED or WAITING add execution action
              */
-            if(in_array($entry['STATUS'],array("paused","waiting")) && $acl_is_writeable){
+            if(in_array_strict($entry['STATUS'],array("paused","waiting")) && $acl_is_writeable){
                 $entry['objectClass'][] = "FAKE_OC__processNow";
             }
 
@@ -63,23 +63,23 @@ class filterGotoEvents extends  filterLDAP {
 
             /* If PAUSED or WAITING add edit action
              */
-            if(in_array($entry['STATUS'],array("waiting")) && $acl_is_writeable){
+            if(in_array_strict($entry['STATUS'],array("waiting")) && $acl_is_writeable){
                 $entry['objectClass'][] = "FAKE_OC__edit";
             }
 
 
             /* If PROCESSING add abort action
              */
-            if(in_array($entry['STATUS'],array("processing")) && preg_match("/install/",$entry['HEADERTAG']) && $acl_is_writeable){
+            if(in_array_strict($entry['STATUS'],array("processing")) && preg_match("/install/",$entry['HEADERTAG']) && $acl_is_writeable){
                 $entry['objectClass'][] = "FAKE_OC__abort";
             }
 
             /* If WAITING or ERROR add remove action
              */
-            if( $acl_is_removeable && in_array($entry['STATUS'],array("waiting","error","processed"))){
+            if( $acl_is_removeable && in_array_strict($entry['STATUS'],array("waiting","error","processed"))){
                 $entry['objectClass'][] = "FAKE_OC__remove";
             }
-            if($acl_is_writeable && in_array($entry['STATUS'],array("processing")) && !preg_match("/install/",$entry['HEADERTAG'])){
+            if($acl_is_writeable && in_array_strict($entry['STATUS'],array("processing")) && !preg_match("/install/",$entry['HEADERTAG'])){
                 $entry['objectClass'][] = "FAKE_OC__remove";
             }
 
@@ -101,7 +101,7 @@ class filterGotoEvents extends  filterLDAP {
 
 
 #     /* Skip entries which will be removed within the next seconds */
-#     if(isset($entry['MACADDRESS']) && in_array($entry['MACADDRESS'],$recently_removed)){
+#     if(isset($entry['MACADDRESS']) && in_array_strict($entry['MACADDRESS'],$recently_removed)){
 #       continue;
 #     }
             $data[] = $item;
index a0196eb1b31332ad2e481da1802211a2cec5a96d..ac03a2338eb7b4c90b4942748abc32dc23cabb24 100644 (file)
@@ -166,7 +166,7 @@ class gotoLogView extends plugin
                 $this->$dest = $_GET[$attr];
             }
         }
-        if(isset($_GET['sort_by']) && in_array($_GET['sort_by'],array("file","time"))){
+        if(isset($_GET['sort_by']) && in_array_strict($_GET['sort_by'],array("file","time"))){
             if($_GET['sort_by'] == $this->sort_by){
                 $this->sort_dir = !$this->sort_dir;
             }
index 5b0795a4856ed219918793e50bf45aef9cde8b30..8f1cd908564cb288775ce6054d36434031fe9c50 100644 (file)
@@ -142,7 +142,7 @@ class goto_import_file extends plugin
         $evts = $this->events;
         foreach($this->events as $id => $evt){
             foreach($evt as $key => $val){
-                if(in_array($key,$this->csv_fields)){
+                if(in_array_strict($key,$this->csv_fields)){
                     $evts[$id][$key] = "<span style=\"white-space: nowrap;\">".strip_tags($val)."</span>"; 
                 }
             }
index 23df6ee468532233628f97a13054cc1a4de0e489..46c0cffae5702f85c8a7962fe47d5095480225b8 100644 (file)
@@ -246,7 +246,7 @@ class gotomasses extends management
                 }
 
                 /* Only remove WAITING or ERROR entries */
-                if(in_array($task['STATUS'],array("waiting","error","processed")) ||
+                if(in_array_strict($task['STATUS'],array("waiting","error","processed")) ||
                         ($task['STATUS'] == "processing" && !preg_match("/install/",$task['HEADERTAG'])) ){
                     $this->ids_to_remove[] = $task['ID'];
                     $deleteable_jobs[] = $j_name;
@@ -503,7 +503,7 @@ class gotomasses extends management
         foreach($ids as $id){
             $tmp = $headpage->getEntry($id);
             $entry = $tmp['EVENT'];
-            if(in_array($entry['STATUS'],array("paused","waiting"))){
+            if(in_array_strict($entry['STATUS'],array("paused","waiting"))){
                 $update_ids[] = $entry['ID'];
             }
         }
index f711b7b2331355beab5fd5ad6eca0e749bdf2781..21137c7319a9844a24e574ffe21d3d31c7a90de8 100644 (file)
@@ -573,7 +573,7 @@ class DaemonEvent
     public function set_value($name,$value)
     {
         $name = strtolower($name);
-        if(isset($this->$name) && in_array($name,$this->attributes)){
+        if(isset($this->$name) && in_array_strict($name,$this->attributes)){
             $this->$name = $value;
         }
     }
index 51ee3f218abd821bcac22fe0236f3024c0c19840..889196c8e226fdbb7083494fa826bda151cb5869 100644 (file)
@@ -143,7 +143,7 @@ class DaemonEvent_notify extends DaemonEvent
             $add = array($add);
         }
         foreach($add as $target){
-            if(!in_array($target,$this->user)){
+            if(!in_array_strict($target,$this->user)){
                 $this->user[] = $target;
             }
         }
@@ -157,7 +157,7 @@ class DaemonEvent_notify extends DaemonEvent
             $add = array($add);
         }
         foreach($add as $target){
-            if(!in_array($target,$this->group)){
+            if(!in_array_strict($target,$this->group)){
                 $this->group[] = $target;
             }
         }
index 64c196d8326dee56af3fb43acae5ef5aea663bde..ac98b5c93e39d71bafe45c5fa14ac2c83ee56824 100644 (file)
@@ -75,7 +75,7 @@ class EventAddSystemDialog extends management
     $member_dns = array();
     foreach($entries as $entry){
       $member_dns[] = $entry['dn'];
-      if(in_array("gosaGroupOfNames", $entry['objectClass'])){
+      if(in_array_strict("gosaGroupOfNames", $entry['objectClass'])){
         $ldap->cat($entry['dn']);
         if($ldap->count()){
           $attrs = $ldap->fetch();
index 7c941735528b7fc99014d26f868042499b4242f4..94c5990df9489ade20e7324345acf64ece38f93c 100644 (file)
@@ -68,10 +68,10 @@ class EventAddUserDialog extends management
         $entries = $this->save();
         $a_targets = array("USERS" => array(),"GROUPS" => array());
         foreach($entries as $entry){
-            if(in_array("posixGroup",$entry['objectClass'])){
+            if(in_array_strict("posixGroup",$entry['objectClass'])){
                 $a_targets['GROUPS'][] = $entry['cn'][0];
             }
-            if(in_array("gosaAccount",$entry['objectClass'])){
+            if(in_array_strict("gosaAccount",$entry['objectClass'])){
                 $a_targets['USERS'][] = $entry['uid'][0];
             }
         }
index 5f0c18ca7ccd17bfe8e89b96103b4d4e4ae3f927..2c0918ee633ce0b34250cdabd7d85d13bceab1f0 100644 (file)
@@ -510,7 +510,7 @@ class ConfigManagement extends management
         // Add sub-module requested.
         if(isset($_POST['addSubModule']) && isset($_POST['subModule'])){
             $sub = get_post('subModule');
-            if(in_array($sub, $this->currentItemDescriptor['container'])){
+            if(in_array_strict($sub, $this->currentItemDescriptor['container'])){
 
                 // Check if this is a valid item
                 if(!isset($this->itemConfig[$sub])) {
index 0f9809728beb0dcc3f32b310101a13c55ec9a1d4..a0e9bd023670bd3e84104addb02a08e5e7ef0ce5 100644 (file)
@@ -21,7 +21,7 @@ class TemplateWidget_fixedList extends TemplateWidget
     {
         $tmp = array();
         foreach($this->values as $key => $name){
-            if(!in_array($key, $this->value)){
+            if(!in_array_strict($key, $this->value)){
                 $tmp[$key]=$name;
             }
         }
index 14d4d775766cb189e261da7637641e7795ab3a08..c89059640324dd44a25cf12526321f94beac0acf 100644 (file)
@@ -315,7 +315,7 @@ class appgroup extends plugin
 
                     /* Add a menu folder 
                      */
-                    if(in_array("gotoSubmenuEntry",$attrs['objectClass'])){
+                    if(in_array_strict("gotoSubmenuEntry",$attrs['objectClass'])){
                         $type = "FOLDER";
 
                         $data['ICON'] = "";
@@ -325,7 +325,7 @@ class appgroup extends plugin
 
                         /* Add a menu entry 
                          */
-                    }elseif(in_array("gotoMenuEntry",$attrs['objectClass'])){
+                    }elseif(in_array_strict("gotoMenuEntry",$attrs['objectClass'])){
 
                         $type = "ENTRY";
                         $data['INFO'] = "";
@@ -345,7 +345,7 @@ class appgroup extends plugin
 
                         /* Add a release
                          */
-                    }elseif(in_array("FAIbranch",$attrs['objectClass'])){
+                    }elseif(in_array_strict("FAIbranch",$attrs['objectClass'])){
                         $type = "RELEASE";
                         if(isset($attrs['FAIstate'][0])){
                             $data['FAIstate'] = $attrs['FAIstate'][0];
@@ -465,7 +465,7 @@ class appgroup extends plugin
         // Add applications found on this base 
         $used_apps = $this->_get_used_entry_name();
         foreach($this->apps as $key => $app){
-            if(in_array($app['cn'][0],$used_apps)) continue;
+            if(in_array_strict($app['cn'][0],$used_apps)) continue;
             if(!preg_match("/".get_ou("application", "applicationRDN").preg_quote($this->curbase, '/')."$/",$app['dn'])){
                 continue;
             }
@@ -758,7 +758,7 @@ class appgroup extends plugin
                 break;
             }
         }
-        while(isset($all_l[$i]) && !in_array($all_l[$i]['TYPE'],array("ENTRY","FOLDER","CLOSE","OPEN")) && $i < count($all_l)){
+        while(isset($all_l[$i]) && !in_array_strict($all_l[$i]['TYPE'],array("ENTRY","FOLDER","CLOSE","OPEN")) && $i < count($all_l)){
             $i++;
         }
 
@@ -766,7 +766,7 @@ class appgroup extends plugin
             return(FALSE);
         }
 
-        if(in_array($all_l[$i]['TYPE'],array("CLOSE","OPEN"))){
+        if(in_array_strict($all_l[$i]['TYPE'],array("CLOSE","OPEN"))){
             return($all_l[$i]['PARENT']);
         }     
 
@@ -791,14 +791,14 @@ class appgroup extends plugin
                 $i++;
             }
         }else{
-            while(isset($all_l[$i]) && !in_array($all_l[$i]['TYPE'],array("ENTRY","FOLDER")) && $i < count($all_l)){
+            while(isset($all_l[$i]) && !in_array_strict($all_l[$i]['TYPE'],array("ENTRY","FOLDER")) && $i < count($all_l)){
                 $i++;
             }
         }
         if(!isset($all_l[$i])){
             return(FALSE);
         }
-        if(in_array($all_l[$i]['TYPE'],array("CLOSE","OPEN"))){
+        if(in_array_strict($all_l[$i]['TYPE'],array("CLOSE","OPEN"))){
             return($all_l[$i]['PARENT']);
         }
         return($all_l[$i]['UNIQID']);
@@ -831,7 +831,7 @@ class appgroup extends plugin
                 $menu = $all[$source_rel]['ENTRIES'];
 
                 foreach($menu as $entry){
-                    if(in_array($entry['TYPE'],array("FOLDER","ENTRY","SEPERATOR"))){
+                    if(in_array_strict($entry['TYPE'],array("FOLDER","ENTRY","SEPERATOR"))){
                         $this->_add_entry($current_rel,$entry,-1);
                     }
                 }
@@ -1296,7 +1296,7 @@ class appgroup extends plugin
             if(isset($entry['LDAP_ATTRS'])){
                 for($i = 0 ; $i < $entry['LDAP_ATTRS']['objectClass']['count']; $i ++){
                     $oc = $entry['LDAP_ATTRS']['objectClass'][$i];
-                    if(!in_array($oc,$attrs['objectClass'])){
+                    if(!in_array_strict($oc,$attrs['objectClass'])){
                         $attrs['objectClass'][] = $oc;
                     }
                 }
@@ -1442,7 +1442,7 @@ class appgroup extends plugin
     {
         $ret = plugin::get_multi_edit_values();
 
-        if(in_array("apps",$this->multi_boxes)){
+        if(in_array_strict("apps",$this->multi_boxes)){
             $ret['gosaApplicationParameter'] = $this->gosaApplicationParameter;
             $ret['Categories']               = $this->Categories;
             $ret['gosaMemberApplication']    = $this->gosaMemberApplication;
index e583d72fd8c53509c52b5bc7dc53ea0ab2968490..86a2dd710a1398bd7fe24118cb9c295f57e3ee3b 100644 (file)
@@ -234,7 +234,7 @@ class mimetype extends plugin
                     if(isset($_POST['NewApplication']) && !empty($_POST['NewApplication'])){
                         $str = trim(get_post("NewApplication"));
                     }
-                    if($str != "" && !in_array($str,$this->use_gotoMimeApplication)){
+                    if($str != "" && !in_array_strict($str,$this->use_gotoMimeApplication)){
                         $this->use_gotoMimeApplication[] = $str;
                     }
                 }
@@ -253,7 +253,7 @@ class mimetype extends plugin
                     if(isset($_POST['NewEmbeddedApplication']) && !empty($_POST['NewEmbeddedApplication'])){
                         $str = trim(get_post('NewEmbeddedApplication'));
                     }
-                    if($str != "" && !in_array($str,$this->use_gotoMimeEmbeddedApplication)){
+                    if($str != "" && !in_array_strict($str,$this->use_gotoMimeEmbeddedApplication)){
                         $this->use_gotoMimeEmbeddedApplication[] = $str;
                     }
                 }
@@ -329,15 +329,15 @@ class mimetype extends plugin
             $this->embeddedList->save_object();
 
             $action=$this->patternList->getAction();
-            if(in_array($action['action'],array('delete', 'reorder'))){
+            if(in_array_strict($action['action'],array('delete', 'reorder'))){
                 $this->use_gotoMimeFilePattern = array_values($this->patternList->getMaintainedData());
             }
             $action=$this->applicationList->getAction();
-            if(in_array($action['action'],array('delete', 'reorder'))){
+            if(in_array_strict($action['action'],array('delete', 'reorder'))){
                 $this->use_gotoMimeApplication = array_values($this->applicationList->getMaintainedData());
             }
             $action=$this->embeddedList->getAction();
-            if(in_array($action['action'],array('delete', 'reorder'))){
+            if(in_array_strict($action['action'],array('delete', 'reorder'))){
                 $this->use_gotoMimeEmbeddedApplication = array_values($this->embeddedList->getMaintainedData());
             }
 
index fe2496c6b05ae12c93eb565a5ef44dca8672782e..2ea00f50e7903eec16d7704fdcc8bf9957404aec 100644 (file)
@@ -65,8 +65,8 @@ class termgroup extends plugin
                 $ldap->cat($member, array('objectClass', 'macAddress', 'cn'));
                 if ($ldap->success()){
                     $attrs = $ldap->fetch();
-                    if (in_array("gotoTerminal", $attrs['objectClass']) ||
-                            in_array("gotoWorkstation", $attrs['objectClass'])){
+                    if (in_array_strict("gotoTerminal", $attrs['objectClass']) ||
+                            in_array_strict("gotoWorkstation", $attrs['objectClass'])){
                         if (isset($attrs['macAddress'])){
                             $this->members[$attrs['cn'][0]]= $attrs['macAddress'][0];
                         } else {
@@ -118,7 +118,7 @@ class termgroup extends plugin
         $this->nfsservers= $tmp2;
 
         /* Set inherit checkbox state */
-        if(in_array("default",$this->gotoNtpServer)){
+        if(in_array_strict("default",$this->gotoNtpServer)){
             $this->inheritTimeServer = true;
             $this->gotoNtpServer=array();
         }
@@ -272,7 +272,7 @@ class termgroup extends plugin
 
         $tmp = array();
         foreach($this->gotoNtpServers as $server){
-            if(!in_array($server,$this->gotoNtpServer)){
+            if(!in_array_strict($server,$this->gotoNtpServer)){
                 $tmp[$server] = $server;
             }
         }
@@ -426,7 +426,7 @@ class termgroup extends plugin
         }
 
         /* Set inherit checkbox state */
-        if(in_array("default",$this->gotoNtpServer)){
+        if(in_array_strict("default",$this->gotoNtpServer)){
             $this->inheritTimeServer = true;
             $this->gotoNtpServer=array();
         }
index fe34a37baecd8117cf73435be11ee55a968b7901..f7916dc73335a2193e0d98354ead46975adb786a 100644 (file)
@@ -95,7 +95,7 @@ class InstallRecipe extends plugin
         // Detect account status by checking the used objectClasses
         $this->is_account = FALSE;
         foreach($this->map as $type){
-            if(in_array($type['objectClass'], $this->attrs['objectClass'])){
+            if(in_array_strict($type['objectClass'], $this->attrs['objectClass'])){
                 $this->installBootstrapMethod = $type['bootstrap'];
                 $this->installConfigManagement = $type['type'];
                 $this->is_account = TRUE;
@@ -381,7 +381,7 @@ class InstallRecipe extends plugin
             $this->installNTPServer = $this->installNTPServerList->getMaintainedData();
             if(isset($_POST['installNTPServer_Input']) && isset($_POST['installNTPServer_Add'])){
                 $add = get_post('installNTPServer_Input');
-                if(!in_array($add, $this->installNTPServer) && !empty($add)){
+                if(!in_array_strict($add, $this->installNTPServer) && !empty($add)){
                     $this->installNTPServer[] = $add;
                 }
             }
index f0d9fb3c6ec50f9526ce725460e8114bb995c8b5..4c5ee7ce6213362df8e54e025e3551c13d56de37 100644 (file)
@@ -228,7 +228,7 @@ class gotoLpdEnable extends plugin
         foreach($this->data as $entry){
             $str = "";
             foreach($attrs as $attr){
-                if(in_array($attr,$serial_only) && $entry['s_Type'] != "Serial"){
+                if(in_array_strict($attr,$serial_only) && $entry['s_Type'] != "Serial"){
                     $str .= ":";
                 }else{
                     $str .= $entry[$attr].":";
index 11936d4f071bd993880524bbb4cf887d3b9e20f8..c0d13d93d00bf6eab336aaf2618b60dad481bfb7 100644 (file)
@@ -271,7 +271,7 @@ class printgeneric extends plugin
 
             if($ldap->count()){
                 $attrs = $ldap->fetch();
-                if(in_array("gotoPrinter",$attrs['objectClass'])){
+                if(in_array_strict("gotoPrinter",$attrs['objectClass'])){
                     $this->initially_was_account = true;
                     $this->is_account             = true;
                 }else{
@@ -512,7 +512,7 @@ class printgeneric extends plugin
                 $add = 'Admin';
             }
             foreach($users as $user){
-                if(in_array('gosaAccount', $user['objectClass'])){
+                if(in_array_strict('gosaAccount', $user['objectClass'])){
                     $type = 'Add'.$add.'User';  
                 }else{
                     $type = 'Add'.$add.'Group';  
@@ -643,7 +643,7 @@ class printgeneric extends plugin
 
             /* Check if obejct is a printer */
             $CheckPrinter = $ldap->fetch();
-            if(!in_array("gotoPrinter",$CheckPrinter['objectClass'])){
+            if(!in_array_strict("gotoPrinter",$CheckPrinter['objectClass'])){
                 msg_dialog::display(_("Error"), _("Object is no printer!"), ERROR_DIALOG);
                 return;
             }
index cb0220a34a81d1579f594557a5a5d6847f06c0ac..2e5e3899e845c72e007ad8e0700c64e938219911 100644 (file)
@@ -100,7 +100,7 @@ class termgeneric extends plugin
         }
 
         /* Set inherit checkbox state */
-        if((in_array("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer)==0)){
+        if((in_array_strict("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer)==0)){
             $this->inheritTimeServer = true;
             $this->gotoNtpServer=array();
         }
@@ -276,7 +276,7 @@ class termgeneric extends plugin
 
         $tmp = array();
         foreach($this->gotoNtpServers as $server){
-            if(!in_array($server,$this->gotoNtpServer)){
+            if(!in_array_strict($server,$this->gotoNtpServer)){
                 $tmp[$server] = $server;
             }
         }
@@ -659,7 +659,7 @@ another location! */
         }
 
         /* Set inherit checkbox state */
-        if((in_array("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer)==0)){
+        if((in_array_strict("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer)==0)){
             $this->inheritTimeServer = true;
             $this->gotoNtpServer=array();
         }
index 7ee59c595b6619643b89b89d8f84e6949fdae8ed..528088a73cc1c0c97f1d8a90f0522af0e4a85a40 100644 (file)
@@ -333,7 +333,7 @@ class termservice extends plugin
         }
 
         if(isset($_POST['gotoXdmcpServer_add']) && isset($_POST['XdmcpAddServer'])){
-            if(!in_array($_POST['gotoXdmcpServer_add'],$this->selected_xdmcp_servers)){
+            if(!in_array_strict($_POST['gotoXdmcpServer_add'],$this->selected_xdmcp_servers)){
                 $this->selected_xdmcp_servers[] =get_post('gotoXdmcpServer_add');
             }
         }
@@ -341,7 +341,7 @@ class termservice extends plugin
         if(isset($_POST['selected_xdmcp_servers']) && isset($_POST['XdmcpDelServer'])){
             $tmp = array();
             foreach($this->selected_xdmcp_servers as $name){
-                if(!in_array($name,$_POST['selected_xdmcp_servers'])){
+                if(!in_array_strict($name,$_POST['selected_xdmcp_servers'])){
                     $tmp[] =  $name;
                 }
             }
@@ -364,7 +364,7 @@ class termservice extends plugin
         $xdmcp_types =  $this->config->data['SERVERS']['TERMINAL_SESSION_TYPES'];
         $available_servers = array();
         foreach($xdmcp_types as $servername =>$supported_types){
-            if(in_array(strtoupper($this->gotoXMethod),$supported_types)){
+            if(in_array_strict(strtoupper($this->gotoXMethod),$supported_types)){
                 $available_servers[]  = $servername;
             }
         }
@@ -373,7 +373,7 @@ class termservice extends plugin
          */
         $tmp = array();
         foreach($this->selected_xdmcp_servers as $server){
-            if(in_array($server,$available_servers)){
+            if(in_array_strict($server,$available_servers)){
                 $tmp[$server] = $server;
             }else{
                 $tmp[$server] = $server."&nbsp;-&nbsp;"._("Unsupported");
@@ -536,12 +536,12 @@ class termservice extends plugin
             $xdmcp_types =  $this->config->data['SERVERS']['TERMINAL_SESSION_TYPES'];
             $available_servers = array();
             foreach($xdmcp_types as $servername =>$supported_types){
-                if(in_array(strtoupper($this->gotoXMethod),$supported_types)){
+                if(in_array_strict(strtoupper($this->gotoXMethod),$supported_types)){
                     $available_servers[]  = $servername;
                 }
             }
             foreach($this->selected_xdmcp_servers as $server){
-                if(!in_array($server,$available_servers)){
+                if(!in_array_strict($server,$available_servers)){
                     $message[] = _("Remote desktop settings contains servers that do not support the selected connection method.");
                     break;
                 }
index 077eb7123a4d4cb4da575ba4de40c7cabe2b116b..a368ae9b04eebbe6dd5c304417eef10dfbfb748d 100644 (file)
@@ -255,7 +255,7 @@ class termstartup extends plugin
         if(!$this->gotoLdap_inherit && isset($_POST['add_ldap_server']) && isset($_POST['ldap_server_to_add'])){
             if(isset($this->gotoLdapServerList[$_POST['ldap_server_to_add']])){
                 $to_add = $this->gotoLdapServerList[$_POST['ldap_server_to_add']];
-                if(!in_array($to_add,$this->gotoLdapServers)){
+                if(!in_array_strict($to_add,$this->gotoLdapServers)){
                     $this->gotoLdapServers[] = $to_add;
                 }
             }
@@ -282,7 +282,7 @@ class termstartup extends plugin
             $data[$key]=$server;
 
             /* Announce missing entries */
-            if(!in_array($server,$this->gotoLdapServerList)){
+            if(!in_array_strict($server,$this->gotoLdapServerList)){
                 $server = $server."&nbsp;<font style='color:red'>(missing)</font>";
             }
 
@@ -308,7 +308,7 @@ class termstartup extends plugin
 
         $list = array();
         foreach($this->gotoLdapServerList as $key => $entry){
-            if(!in_array($entry,$this->gotoLdapServers)){
+            if(!in_array_strict($entry,$this->gotoLdapServers)){
                 $list[$key] = $entry;
             }
         }
@@ -442,7 +442,7 @@ class termstartup extends plugin
     {
         $tmp= array();
         foreach ($array as $mod){
-            if (!in_array($mod, $list)){
+            if (!in_array_strict($mod, $list)){
                 $tmp[]= $mod;
             }
         }
index db2febb4ddfd6300de06f77870c86bb5443ed18f..506c3cfaf6e5d34cf4bbe607bc43c732f378e9d0 100644 (file)
@@ -116,7 +116,7 @@ class workgeneric extends plugin
         }
 
         /* Set inherit checkbox state */
-        if((in_array("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer) == 0)){
+        if((in_array_strict("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer) == 0)){
             $this->inheritTimeServer = true;
             $this->gotoNtpServer=array();
         }
@@ -263,7 +263,7 @@ class workgeneric extends plugin
 
         $tmp = array();
         foreach($this->gotoNtpServers as $server){
-            if(!in_array($server,$this->gotoNtpServer)){
+            if(!in_array_strict($server,$this->gotoNtpServer)){
                 $tmp[$server] = $server;
             }
         }
@@ -303,7 +303,7 @@ class workgeneric extends plugin
 
         $ntpser = array();
         foreach($this->gotoNtpServers as $server){
-            if(!in_array($server,$this->gotoNtpServer)){
+            if(!in_array_strict($server,$this->gotoNtpServer)){
                 $ntpser[$server] = set_post($server);
             }
         }
@@ -682,7 +682,7 @@ class workgeneric extends plugin
         }
 
         /* Set inherit checkbox state */
-        if((in_array("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer)==0)){
+        if((in_array_strict("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer)==0)){
             $this->inheritTimeServer = true;
             $this->gotoNtpServer=array();
         }
index 8fa9eddc727ef19ff860c7fb648c55e2a68d9031..7945fd2fbf7cd5ccb242d4f75b17e73de5c8cde8 100644 (file)
@@ -447,7 +447,7 @@ class workstartup extends plugin
                 isset($_POST['ldap_server_to_add'])){
             if(isset($this->gotoLdapServerList[get_post('ldap_server_to_add')])){
                 $to_add = $this->gotoLdapServerList[get_post('ldap_server_to_add')];
-                if(!in_array($to_add,$this->gotoLdapServers)){
+                if(!in_array_strict($to_add,$this->gotoLdapServers)){
                     $this->gotoLdapServers[] = $to_add;
                 }
             }
@@ -471,7 +471,7 @@ class workstartup extends plugin
             $data[$key]=$server;
 
             /* Announce missing entries */
-            if(!in_array($server,$this->gotoLdapServerList)){
+            if(!in_array_strict($server,$this->gotoLdapServerList)){
                 $server = $server."&nbsp;<font style='color:red'>(missing)</font>";
             }
 
@@ -495,7 +495,7 @@ class workstartup extends plugin
 
         $list = array();
         foreach($this->gotoLdapServerList as $key => $entry){
-            if(!in_array($entry,$this->gotoLdapServers)){
+            if(!in_array_strict($entry,$this->gotoLdapServers)){
 
                 /* Convert old style entry */
                 if (!preg_match('%:ldap[s]*://%', $entry)){
@@ -868,7 +868,7 @@ another location! */
     {
         $tmp= array();
         foreach ($array as $mod){
-            if (!in_array($mod, $list)){
+            if (!in_array_strict($mod, $list)){
                 $tmp[]= $mod;
             }
         }
@@ -1149,7 +1149,7 @@ another location! */
         $Abbr ="";
         $ret= array();
         foreach($classes as $class_name => $class_types){
-            if(!in_array($class_name,$this->FAIclass)){
+            if(!in_array_strict($class_name,$this->FAIclass)){
                 $Abbr = "";
                 foreach($class_types as $type){
                     if(!preg_match("/".$type['Abbr']."/",$Abbr)){
index 8160246ba40f0fe511bbc8550e2bd4d959a5c577..f732bd24a19763216d64c3bfdae998e3971fc961 100644 (file)
@@ -52,7 +52,7 @@ class printtabs extends 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,NULL,$this);
         $baseobject->enable_CSN_check();
index 68d30ea43043eed2b20537c8cbcc4834e516639b..49c62d87ea6b24577997d54f924a4473ecfc94b2 100644 (file)
@@ -51,7 +51,7 @@ class termtabs extends 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,NULL,$this);
         $baseobject->enable_CSN_check();
index 75f6bd4e9b2511d9946d6fe6c24ead250cf8ea97..f73c8211277af8fc952b6a888ccaec9444312cfb 100644 (file)
@@ -54,7 +54,7 @@ class worktabs extends 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,NULL,$this);
         $baseobject->enable_CSN_check();
index d75fa472b5764d798f179d4f8acccef18a15fa5f..704366b49143e369c5df39c859571bb7b95ee95e 100644 (file)
@@ -211,7 +211,7 @@ class ppdManager
                     trigger_error(_('Nested groups are not supported!'), E_USER_WARNING);
                     continue;
                 }
-                if (in_array($group, $properties)){
+                if (in_array_strict($group, $properties)){
                     trigger_error(_('Group name not unique!'), E_USER_WARNING);
                     continue;
                 }
index 8b49ea30bd3623605a2325854b706235422700f7..0b93f966aaee40c9ffb9208e5e1baa319ebf15a2 100644 (file)
@@ -135,7 +135,7 @@ class goKioskService extends goService{
                 foreach($this->gotoKioskProfiles as $k){
                     $used[] = $k['name'];
                 }  
-                if(in_array($file['name'], $used)){
+                if(in_array_strict($file['name'], $used)){
                     msg_dialog::display(_("Warning"), msgPool::duplicated(_("Profile")), WARNING_DIALOG);
                 }else{
                     $this->gotoKioskProfiles[] = $tmp;
index ecfaf6110c875bc5c4c368de29d1aa97100d7067..48f9b035ed754e1986f1d3f85ac32be47f0dca0d 100644 (file)
@@ -189,7 +189,7 @@ class servnfs extends plugin
             }
         }
 
-        if(!in_array($this->type,$this->types)){
+        if(!in_array_strict($this->type,$this->types)){
             $message[]= msgPool::required(_("Type"));
         }
 
index 793c91465354575165691080e9c583259daa6514..40ec0d83dd7f279971ef5aee263081d6a5330e51 100644 (file)
@@ -58,7 +58,7 @@ class goTerminalServer extends goService{
 
         $tmp = array();
         foreach($this->gotoSessionTypes as $type){
-            if(in_array($type,$this->gotoSessionType)){
+            if(in_array_strict($type,$this->gotoSessionType)){
                 $tmp[$type] = TRUE;
             }else{
                 $tmp[$type] = FALSE;
index a82e5d409bfdc0545d643e2c5477130babc14607..9c7fccefae5762a32e3b32960a267f8b11d09f4a 100644 (file)
@@ -313,7 +313,7 @@ class environment extends plugin
     $error = false;
     if(!isset($this->gotoKioskProfiles['SERVERS'][$this->gotoKioskProfile_Server])){
       $error = true;
-    }elseif(!in_array($this->gotoKioskProfile_Profile, $this->gotoKioskProfiles['BY_SERVER'][$this->gotoKioskProfile_Server])){
+    }elseif(!in_array_strict($this->gotoKioskProfile_Profile, $this->gotoKioskProfiles['BY_SERVER'][$this->gotoKioskProfile_Server])){
       $error = true;
     }
     if($error && !empty($this->gotoKioskProfile)){
@@ -348,7 +348,7 @@ class environment extends plugin
     /* Log view */
     if($this->is_account && !$this->view_logged){
       $this->view_logged = TRUE;
-      if(isset($this->parent->by_object['user']) || (isset($this->attrs['objectClass']) &&in_array("gosaAccount",$this->attrs['objectClass']))){
+      if(isset($this->parent->by_object['user']) || (isset($this->attrs['objectClass']) &&in_array_strict("gosaAccount",$this->attrs['objectClass']))){
         new log("view","users/".get_class($this),$this->dn);
       }else{
         new log("view","groups/".get_class($this),$this->dn);
@@ -450,7 +450,7 @@ class environment extends plugin
            If theres is no posixAccount enabled, you won't be able to enable 
            environment extensions
          */
-        if((isset($this->parent->by_object['group']))||(isset($this->attrs['objectClass']))&&((in_array("posixAccount",$this->attrs['objectClass'])))){
+        if((isset($this->parent->by_object['group']))||(isset($this->attrs['objectClass']))&&((in_array_strict("posixAccount",$this->attrs['objectClass'])))){
           $display= $this->show_enable_header(msgPool::addFeaturesButton(_("Desktop")),
               msgPool::featuresDisabled(_("Desktop")));
           return $display;
@@ -1027,7 +1027,7 @@ class environment extends plugin
     foreach(array("gotoPrinter","kiosk_server","gotoProfileFlagL","gotoXResolution",
                   "useProfile","gotoProfileServer","gotoProfileQuota","gotoProfileFlagC") as $box){
       $ubox ="use_".$box;
-      if(in_array($box,$this->multi_boxes)){
+      if(in_array_strict($box,$this->multi_boxes)){
         $smarty->assign($ubox,TRUE);
       }else{
         $smarty->assign($ubox,FALSE);
@@ -1100,7 +1100,7 @@ class environment extends plugin
       }
       if(isset($_POST['kiosk_profile'])){
         $tmp = get_post('kiosk_profile');
-        if(in_array($tmp,$this->gotoKioskProfiles['BY_SERVER'][$this->gotoKioskProfile_Server])){
+        if(in_array_strict($tmp,$this->gotoKioskProfiles['BY_SERVER'][$this->gotoKioskProfile_Server])){
           $this->gotoKioskProfile_Profile = get_post('kiosk_profile');
         }
       }
@@ -1132,7 +1132,7 @@ class environment extends plugin
       plugin::save_object();
       foreach($this->attributes as $s_attr){
         if((!isset($_POST[$s_attr])) || 
-            in_array($s_attr,array("gosaDefaultPrinter","gotoShare","gotoHotplugDevices","gotoPrinter","gotoLogonScripts","uid"))) continue;
+            in_array_strict($s_attr,array("gosaDefaultPrinter","gotoShare","gotoHotplugDevices","gotoPrinter","gotoLogonScripts","uid"))) continue;
         if(!$this->acl_is_writeable($s_attr)){
           continue;
         }else{ 
@@ -1162,7 +1162,7 @@ class environment extends plugin
       $this->attrs['objectClass']=array();
     } 
     if(!$this->is_group){
-      if((!((in_array("posixAccount",$this->attrs['objectClass']))||($this->parent->by_object['posixAccount']->is_account==true)))&&(!$this->is_group)){
+      if((!((in_array_strict("posixAccount",$this->attrs['objectClass']))||($this->parent->by_object['posixAccount']->is_account==true)))&&(!$this->is_group)){
         $message[]= msgPool::featuresDisabled(_("environment"),_("POSIX"));  
       }
     }
@@ -1666,7 +1666,7 @@ class environment extends plugin
     $ret['gotoLogonScripts'] = $this->gotoLogonScripts;
     $ret['gotoHotplugDevices'] = $this->gotoHotplugDevices;
   
-    if(in_array("gotoPrinter",$this->multi_boxes)){
+    if(in_array_strict("gotoPrinter",$this->multi_boxes)){
       $ret['gotoPrinter'] = $this->gotoPrinter;
       $ret['gotoPrinterSel'] = $this->gotoPrinterSel;
       $ret['gosaDefaultPrinter'] = $this->gosaDefaultPrinter;
@@ -1675,26 +1675,26 @@ class environment extends plugin
       $ret['add_del_printer_member_was_called'] = TRUE;
     }
   
-    if(in_array("gotoProfileFlagL",$this->multi_boxes)){
+    if(in_array_strict("gotoProfileFlagL",$this->multi_boxes)){
       $ret['gotoProfileFlagL'] = $this->gotoProfileFlagL;
     }
 
-    if(in_array("useProfile",$this->multi_boxes)){
+    if(in_array_strict("useProfile",$this->multi_boxes)){
       $ret['useProfile']=$this->useProfile;
-      if(in_array("gotoProfileServer",$this->multi_boxes)){
+      if(in_array_strict("gotoProfileServer",$this->multi_boxes)){
         $ret['gotoProfileServer']=$this->gotoProfileServer;
       }
-      if(in_array("gotoProfileQuota",$this->multi_boxes)){
+      if(in_array_strict("gotoProfileQuota",$this->multi_boxes)){
         $ret['gotoProfileQuota']=$this->gotoProfileQuota;
       }
-      if(in_array("gotoProfileFlagC",$this->multi_boxes)){
+      if(in_array_strict("gotoProfileFlagC",$this->multi_boxes)){
         $ret['gotoProfileFlagC'] = $this->gotoProfileFlagC;
       }
     }
-    if(in_array("gotoXResolution",$this->multi_boxes)){
+    if(in_array_strict("gotoXResolution",$this->multi_boxes)){
       $ret['gotoXResolution'] = $this->gotoXResolution;
     }
-    if(in_array("kiosk_server",$this->multi_boxes)){
+    if(in_array_strict("kiosk_server",$this->multi_boxes)){
       $ret['gotoKioskProfile_Server'] = $this->gotoKioskProfile_Server;
       $ret['gotoKioskProfile_Profile'] = $this->gotoKioskProfile_Profile;
     }
@@ -1707,7 +1707,7 @@ class environment extends plugin
     $message = plugin::multiple_check();
     $this->detect_grouptype();
 
-    if(preg_match("/[^0-9]/",$this->gotoProfileQuota) && in_array("gotoProfileQuota",$this->multi_boxes)) {
+    if(preg_match("/[^0-9]/",$this->gotoProfileQuota) && in_array_strict("gotoProfileQuota",$this->multi_boxes)) {
       $message[] = msgPool::invalid(_("Profile quota"),$this->gotoProfileQuota,"/[0-9]/") ;
     }
     return($message);
@@ -1751,7 +1751,7 @@ class environment extends plugin
       }
       if(isset($_POST['kiosk_profile'])){
         $tmp = get_post('kiosk_profile');
-        if(in_array($tmp,$this->gotoKioskProfiles['BY_SERVER'][$this->gotoKioskProfile_Server])){
+        if(in_array_strict($tmp,$this->gotoKioskProfiles['BY_SERVER'][$this->gotoKioskProfile_Server])){
           $this->gotoKioskProfile_Profile = get_post('kiosk_profile');
         }
       }
index 704c53f57017f749675edbe4acc5952e9e5b5aba..b9d1955f48f92d56038b70d0019763763043c9a9 100644 (file)
@@ -341,7 +341,7 @@ class GroupwareDistributionList extends plugin
                 }
                 return ($attrs["uid"][0]);
             }
-            if (!in_array($address, $this->alternateAddresses)){
+            if (!in_array_strict($address, $this->alternateAddresses)){
                 $this->alternateAddresses[]= $address;
                 $this->is_modified= TRUE;
             }
@@ -470,14 +470,14 @@ class GroupwareDistributionList extends plugin
         // Check for added or removed distribution list members now.
         $all = array_merge($hasExt, $this->saved_attributes['memberList']);
         foreach($all as $member){
-            if(!in_array($member,$hasExt)){
+            if(!in_array_strict($member,$hasExt)){
                 $rpc->gwDistDelMember($this->cn, $member);
                 if(!$rpc->success()){
                     $message = sprintf(_("Failed to remove member '%s' from distribution list '%s'! Error was: '%s'."), 
                             $member, $this->cn, $rpc->get_error());
                     msg_dialog::display(_("Error"),msgPool::rpcError($message), ERROR_DIALOG);
                 }
-            }elseif(!in_array($member,$this->saved_attributes['memberList'])){
+            }elseif(!in_array_strict($member,$this->saved_attributes['memberList'])){
                 $rpc->gwDistAddMember($this->cn, $member);
                 if(!$rpc->success()){
                     $message = sprintf(_("Failed to add member '%s' to distribution list '%s'! Error was: '%s'."), 
index 9f39d6effe741127261915be8bc3f7bb98efd796..eaa46c401889580343d7b85c87fd6d50a5196a07 100644 (file)
@@ -104,7 +104,7 @@ class FilterEditor extends plugin
                 $str.= "\n<option {$checked} value=\"".set_post($comparator)."\">".set_post($desc)."</option>";
             }
             $str .= "\n</select>&nbsp;";
-            if(!in_array($cond['COMPARATOR'], array('is in addressbook','is not in addressbook','is empty','is not empty'))){
+            if(!in_array_strict($cond['COMPARATOR'], array('is in addressbook','is not in addressbook','is empty','is not empty'))){
                 $str .= "<input style='width:400px;' type='text' name='cMatch_{$id}' value=\"".set_post($cond['MATCH'])."\">";
             }
             if(count($filter['CONDITIONS']) >= 2){
@@ -129,7 +129,7 @@ class FilterEditor extends plugin
                 $str.= "\n<option {$checked} value=\"".set_post($act)."\">".set_post($desc)."</option>";
             }
             $str .= "</select>&nbsp;";
-            if(!in_array($action['ACTION'], array('DROP'))){
+            if(!in_array_strict($action['ACTION'], array('DROP'))){
                 $str .= "<input style='width:500px;' type='text' name='cValue_{$id}' value=\"".set_post($action['VALUE'])."\">";
             }
 
index b517c3c3a71e61b5613e3e24608c9d0fe518e28b..df39903517e1713f69084be2c8b313afbb7f48c0 100644 (file)
@@ -456,7 +456,7 @@ class Groupware extends plugin
                                         "","","your-address@your-domain.com"),ERROR_DIALOG);
                         }
                     }
-                } elseif ($address == $this->mailAddress || in_array($address, $this->alternateAddresses)) {
+                } elseif ($address == $this->mailAddress || in_array_strict($address, $this->alternateAddresses)) {
                     msg_dialog::display(_("Error"),_("Cannot add primary address to the list of forwarders!") , ERROR_DIALOG);
                 } else {
                     $valid= TRUE;
@@ -709,7 +709,7 @@ class Groupware extends plugin
                 }
                 return ($attrs["uid"][0]);
             }
-            if (!in_array($address, $this->alternateAddresses)){
+            if (!in_array_strict($address, $this->alternateAddresses)){
                 $this->alternateAddresses[]= $address;
                 $this->is_modified= TRUE;
             }
index 5f153e67e753a16ba3150a845dc6986295a87744..43db540702b76c92a5abd93cdce7f91802f85a26 100644 (file)
@@ -353,7 +353,7 @@ class goKrbServer extends goService{
     /* Send remove policy event  
      */
     foreach($actions['del'] as $policy){
-      if(!in_array($policy['NAME'],$policies)) continue;
+      if(!in_array_strict($policy['NAME'],$policies)) continue;
       if(!$o->krb5_del_policy($this->macAddress,$policy['NAME'])){
         msg_dialog::display(_("Service infrastructure"),msgPool::siError($o->get_error()),ERROR_DIALOG);
       }
@@ -362,7 +362,7 @@ class goKrbServer extends goService{
     /* Send add new/edit policy event
      */
     foreach($actions['add_edit'] as $policy){
-      if(in_array($policy['NAME'],$policies)){
+      if(in_array_strict($policy['NAME'],$policies)){
         if(!$o->krb5_set_policy($this->macAddress,$policy['NAME'],$policy['DATA'])){
           msg_dialog::display(_("Service infrastructure"),msgPool::siError($o->get_error()),ERROR_DIALOG);
         }
index bc21f2b6a831042642f7889efae88401d4a1b9f4..f5ef63436f7723aef9391ade6c1a6e6aa389f230 100644 (file)
@@ -305,10 +305,10 @@ class kolabAccount extends plugin
 
     $smarty->assign("multiple_support",$this->multiple_support_active);
     foreach($this->attributes as $attr){
-      $smarty->assign("use_".$attr,in_array($attr,$this->multi_boxes));
+      $smarty->assign("use_".$attr,in_array_strict($attr,$this->multi_boxes));
     }
     foreach(array("kolabState") as $attr){
-      $smarty->assign("use_".$attr,in_array($attr,$this->multi_boxes));
+      $smarty->assign("use_".$attr,in_array_strict($attr,$this->multi_boxes));
     }
 
     if($this->multiple_support_active){
@@ -328,7 +328,7 @@ class kolabAccount extends plugin
     /* Optionally execute a command after we're done */
     plugin::remove_from_parent();
     
-    if(!in_array("kolabInetOrgPerson",$this->attrs['objectClass'])){
+    if(!in_array_strict("kolabInetOrgPerson",$this->attrs['objectClass'])){
       $this->attrs['objectClass'][] = "kolabInetOrgPerson";
     }
 
@@ -571,7 +571,7 @@ class kolabAccount extends plugin
   public function get_multi_edit_values()
   {
     $ret = plugin::get_multi_edit_values();
-    if(in_array("kolabState",$this->multi_boxes)){
+    if(in_array_strict("kolabState",$this->multi_boxes)){
       $ret['is_account'] = $this->is_account;
     }
     return($ret);
@@ -599,7 +599,7 @@ class kolabAccount extends plugin
   public function init_multiple_support($attrs,$all)
   {
     plugin::init_multiple_support($attrs,$all);
-    if(isset($attrs['objectClass']) && in_array("kolabInetOrgPerson",$attrs['objectClass'])){
+    if(isset($attrs['objectClass']) && in_array_strict("kolabInetOrgPerson",$attrs['objectClass'])){
       $this->is_account = TRUE;
     }
 
@@ -626,14 +626,14 @@ class kolabAccount extends plugin
     plugin::adapt_from_template($dn, $skip);
 
     /* Setting uid to default */
-    if(isset($this->attrs['uid'][0]) && !in_array("uid", $skip)){
+    if(isset($this->attrs['uid'][0]) && !in_array_strict("uid", $skip)){
       $this->uid = $this->attrs['uid'][0];
     }
 
     /* Pull arrays */
     foreach(array("kolabDelegate", "kolabInvitationPolicy") as $attr){
 
-      if (in_array($attr, $skip)){
+      if (in_array_strict($attr, $skip)){
         continue;
       }
 
index 690c0d8ed8d3d836098a409cd50887c58d732c26..ec09821b9fcaec42652aa01b3eba718c422d675b 100644 (file)
@@ -261,7 +261,7 @@ class mailMethodKolab extends mailMethodCyrus
       if(in_array_ics("kolabDeleteflag",array_keys($this->parent->attrs))){
         $reason = _("Waiting for Kolab to remove mail properties...");
         return(FALSE);
-      }elseif(in_array("gosaMailAccount",$this->parent->attrs['objectClass'])){
+      }elseif(in_array_strict("gosaMailAccount",$this->parent->attrs['objectClass'])){
         $reason = _("Please remove the mail settings first!");
         return(FALSE);
       }
index 74cc95774433f14cf557e0b861710a5793fa269a..88597256b65586b60d6bc988cb00b44e9883a2d4 100644 (file)
@@ -93,7 +93,7 @@ class mailqueue extends plugin
     }
 
     /* Send action for given mail id */
-    if(in_array($action,array("del","hold","unhold","requeue"))){
+    if(in_array_strict($action,array("del","hold","unhold","requeue"))){
       foreach($entry as $server => $entries){
         $this->si_queue->send_queue_action($entries,$server,$action);
       }
index 3eb055bde5f576fed9d53d28dc24c389fdf9df65..ca4dd0c4279c580fcb5d6d16d9c1f1154a065bd3 100644 (file)
@@ -131,7 +131,7 @@ class si_mailqueue extends gosaSupportDaemon
     /* Check triggered action 
      */
     $allowed_actions = array("hold","unhold","requeue","del");
-    if(!in_array($action,$allowed_actions)){
+    if(!in_array_strict($action,$allowed_actions)){
       trigger_error("Unknown queue action triggered '".$action."'. Request aborted.");  
       return(FALSE);
     }    
index 85df964d322317600d9675a1f600bc2409264d55..d28b9526fa11b5884f98497ecd58bb4e995def99 100644 (file)
@@ -157,7 +157,7 @@ class mailgroup extends plugin
                 if($this->mailMethod->domainSelectionEnabled() || $this->mailMethod->mailEqualsCN()){
                     $this->mailDomainPart = preg_replace("/^[^@]*+@/","",$this->mail);
                     $this->mail = preg_replace("/@.*$/","\\1",$this->mail);
-                    if(!in_array($this->mailDomainPart,$this->mailDomainParts)){
+                    if(!in_array_strict($this->mailDomainPart,$this->mailDomainParts)){
                         $this->mailDomainParts[] = $this->mailDomainPart;
                     }
                 }
@@ -188,7 +188,7 @@ class mailgroup extends plugin
             $member = $this->get_member();
             foreach($this->folder_acls as $user => $acl){
                 if(preg_match("/^__/",$user)) continue;
-                if(!in_array($user,$member['mail'])) continue; 
+                if(!in_array_strict($user,$member['mail'])) continue; 
                 if(!isset($acl_usage[$acl])) $acl_usage[$acl]=0;
                 $acl_usage[$acl] ++;
                 if($acl_usage[$acl] > $most_cnt){
@@ -199,7 +199,7 @@ class mailgroup extends plugin
             $this->folder_acls['__member__'] = $most_acl;  
             foreach($this->folder_acls as $name => $acl){
                 if(preg_match("/^__/",$name)) continue;
-                if($acl == $most_acl && in_array($name,$member['mail'])){
+                if($acl == $most_acl && in_array_strict($name,$member['mail'])){
                     unset($this->folder_acls[$name]);
                 }
             }
@@ -246,8 +246,8 @@ class mailgroup extends plugin
             foreach($users as $user){
                 $member['all'][$user['uid'][0]] = $user['dn'];
                 if(isset($user[$uattrib]) 
-                        && in_array("gosaMailAccount",$user['objectClass']) 
-                        && (in_array($user['uid'][0], $this->attrs['memberUid']))){
+                        && in_array_strict("gosaMailAccount",$user['objectClass']) 
+                        && (in_array_strict($user['uid'][0], $this->attrs['memberUid']))){
                     $member['mail'][$user['uid'][0]] = $user[$uattrib][0];
                 }
             }
@@ -380,7 +380,7 @@ class mailgroup extends plugin
                         }
                     }
                 } elseif ($address == $this->mail
-                        || in_array($address, $this->gosaMailAlternateAddress)) {
+                        || in_array_strict($address, $this->gosaMailAlternateAddress)) {
                     msg_dialog::display(_("Error"),_("Cannot add primary address to the list of forwarders!") , ERROR_DIALOG);
                 } else {
                     $valid= TRUE;
@@ -502,7 +502,7 @@ class mailgroup extends plugin
           Multi edit support 
          ******/
         foreach($this->attributes as $attr){
-            if(in_array($attr,$this->multi_boxes)){
+            if(in_array_strict($attr,$this->multi_boxes)){
                 $smarty->assign("use_".$attr,TRUE);
             }else{
                 $smarty->assign("use_".$attr,FALSE);
@@ -511,7 +511,7 @@ class mailgroup extends plugin
 
         /* Multiple support handling */
         foreach(array("kolabFolderType") as $attr){
-            if(in_array($attr,$this->multi_boxes)){
+            if(in_array_strict($attr,$this->multi_boxes)){
                 $smarty->assign("use_".$attr,TRUE);
             }else{
                 $smarty->assign("use_".$attr,FALSE);
@@ -624,7 +624,7 @@ class mailgroup extends plugin
                 /* Get posted mail domain part, if necessary
                  */
                 if($this->mailMethod->domainSelectionEnabled() && isset($_POST['MailDomain'])){
-                    if(in_array(get_post('MailDomain'), $this->mailDomainParts)){
+                    if(in_array_strict(get_post('MailDomain'), $this->mailDomainParts)){
                         $this->mailDomainPart = get_post('MailDomain');
                     }
                 }
@@ -913,7 +913,7 @@ class mailgroup extends plugin
 
         foreach (array("gosaMailAlternateAddress", "gosaMailForwardingAddress") as $val){
 
-            if (in_array($val, $skip)){
+            if (in_array_strict($val, $skip)){
                 continue;
             }
 
@@ -1044,7 +1044,7 @@ class mailgroup extends plugin
         $this->gosaMailForwardingAddress_Some = array();
         if(isset($all['gosaMailForwardingAddress'])){
             for($i = 0 ; $i < $all['gosaMailForwardingAddress']['count'] ; $i++){
-                if(!in_array($all['gosaMailForwardingAddress'][$i],$this->gosaMailForwardingAddress)){
+                if(!in_array_strict($all['gosaMailForwardingAddress'][$i],$this->gosaMailForwardingAddress)){
                     $this->gosaMailForwardingAddress_Some[] = $all['gosaMailForwardingAddress'][$i];
                 }
             }
@@ -1096,11 +1096,11 @@ class mailgroup extends plugin
         $ret = plugin::get_multi_edit_values();
         $ret['Forward_some'] = $this->gosaMailForwardingAddress_Some;    
         $ret['Forward_all'] = $this->gosaMailForwardingAddress;    
-        if(in_array('kolabFolderType',$this->multi_boxes)){
+        if(in_array_strict('kolabFolderType',$this->multi_boxes)){
             $ret['kolabFolderTypeType'] = $this->kolabFolderTypeType;
             $ret['kolabFolderTypeSubType'] = $this->kolabFolderTypeSubType;
         }
-        if(in_array("acl",$this->multi_boxes)){
+        if(in_array_strict("acl",$this->multi_boxes)){
             $ret['imapacl'] = $this->imapacl;
         }
         return($ret);
@@ -1110,7 +1110,7 @@ class mailgroup extends plugin
     {
         $forward = array();
         foreach($attrs['Forward_some'] as $addr){
-            if(in_array($addr,$this->gosaMailForwardingAddress)){
+            if(in_array_strict($addr,$this->gosaMailForwardingAddress)){
                 $forward[] = $addr;
             }
         }
@@ -1183,7 +1183,7 @@ class mailgroup extends plugin
         }
 
         /* Add to list of alternates */
-        if (!in_array($address, $this->gosaMailAlternateAddress)){
+        if (!in_array_strict($address, $this->gosaMailAlternateAddress)){
             $this->gosaMailAlternateAddress[]= $address;
         }
 
index db67e08c080ee699fb033d52dde28b2623216ebd..81180d6a1f55cc0b692858d6de18a9b533ac8dc2 100644 (file)
@@ -507,7 +507,7 @@ class mailMethodCyrus extends mailMethod{
      */
     $script= "";
     if($sieve->sieve_listscripts()){
-      if (in_array("gosa", $sieve->response)){
+      if (in_array_strict("gosa", $sieve->response)){
         if(!$sieve->sieve_getscript("gosa")){
           $this->error = sprintf(_("Cannot retrieve SIEVE script: %s"),to_string($sieve->error_raw));
           @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__,$sieve->error_raw ,
index 2515d3a458c761fbd91eca92dd81ba0779866ccc..f75e0e0061ec00873a7f18c634e26574b0f55d10 100644 (file)
@@ -106,7 +106,7 @@ class mailMethod{
       trigger_error("mailMethod with invalid parent object initialized.");
     }
 
-    if(!in_array($this->type,array("user","group"))){
+    if(!in_array_strict($this->type,array("user","group"))){
       trigger_error("Unknown mail class type used '".$type."'.");
     }else{
       $this->type = $type;
@@ -133,7 +133,7 @@ class mailMethod{
      */
     if($this->config->get_cfg_value("core","mailAttribute") != ""){
       $new_uattrib= strtolower($this->config->get_cfg_value("core","mailAttribute"));
-      if(in_array($new_uattrib,array("mail","uid"))){
+      if(in_array_strict($new_uattrib,array("mail","uid"))){
         $this->uattrib = $new_uattrib;
       }else{
         @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "<b>".$new_uattrib."</b>",
@@ -231,7 +231,7 @@ class mailMethod{
       $ocs = $this->shareObjectClasses;
     }
     foreach($ocs as $oc){
-      if(!in_array($oc, $this->parent->attrs['objectClass'])){
+      if(!in_array_strict($oc, $this->parent->attrs['objectClass'])){
         $this->parent->attrs['objectClass'][] = $oc;
       }
     }
index bbb0021dd347037113b74ca85a647b25a7bdd433..ba6b720d023d41a59b628b335367aa6e545eca87 100644 (file)
@@ -187,7 +187,7 @@ class mailAccount extends plugin
         if($this->mailMethod->domainSelectionEnabled()){
           $this->mailDomainPart = preg_replace("/^[^@]*+@/","",$this->mail);
           $this->mail = preg_replace("/@.*$/","\\1",$this->mail);
-          if(!in_array($this->mailDomainPart,$this->mailDomainParts)){
+          if(!in_array_strict($this->mailDomainPart,$this->mailDomainParts)){
             $this->mailDomainParts[] = $this->mailDomainPart;
           }
         }
@@ -351,7 +351,7 @@ class mailAccount extends plugin
             }
           }
         } elseif ($address == $this->mail
-            || in_array($address, $this->gosaMailAlternateAddress)) {
+            || in_array_strict($address, $this->gosaMailAlternateAddress)) {
           msg_dialog::display(_("Error"),_("Cannot add primary address to the list of forwarders!") , ERROR_DIALOG);
         } else {
           $valid= TRUE;
@@ -440,11 +440,11 @@ class mailAccount extends plugin
     /* _Multiple users vars_ */
     foreach($this->attributes as $attr){
       $u_attr = "use_".$attr;
-      $smarty->assign($u_attr,in_array($attr,$this->multi_boxes));
+      $smarty->assign($u_attr,in_array_strict($attr,$this->multi_boxes));
     }
     foreach(array("only_local","gosaMailForwardingAddress","use_mailsize_limit","drop_own_mails","use_vacation","use_spam_filter") as $attr){
       $u_attr = "use_".$attr;
-      $smarty->assign($u_attr,in_array($attr,$this->multi_boxes));
+      $smarty->assign($u_attr,in_array_strict($attr,$this->multi_boxes));
     }
 
 
@@ -525,7 +525,7 @@ class mailAccount extends plugin
         /* Get posted mail domain part, if necessary  
          */
         if($this->mailMethod->domainSelectionEnabled() && isset($_POST['MailDomain'])){
-          if(in_array(get_post('MailDomain'), $this->mailDomainParts)){
+          if(in_array_strict(get_post('MailDomain'), $this->mailDomainParts)){
             $this->mailDomainPart = get_post('MailDomain');
           }
         }
@@ -701,7 +701,7 @@ class mailAccount extends plugin
         }
         return ($attrs["uid"][0]);
       }
-      if (!in_array($address, $this->gosaMailAlternateAddress)){
+      if (!in_array_strict($address, $this->gosaMailAlternateAddress)){
         $this->gosaMailAlternateAddress[]= $address;
         $this->is_modified= TRUE;
       }
@@ -1119,7 +1119,7 @@ class mailAccount extends plugin
 
     foreach (array("gosaMailAlternateAddress", "gosaMailForwardingAddress") as $val){
 
-      if (in_array($val, $skip)){
+      if (in_array_strict($val, $skip)){
         continue;
       }
 
@@ -1156,7 +1156,7 @@ class mailAccount extends plugin
     if($this->is_account && $this->mailMethod->domainSelectionEnabled()){
       $this->mailDomainPart = preg_replace("/^[^@]*+@/","",$this->mail);
       $this->mail = preg_replace("/@.*$/","\\1",$this->mail);
-      if(!in_array($this->mailDomainPart,$this->mailDomainParts)){
+      if(!in_array_strict($this->mailDomainPart,$this->mailDomainParts)){
         $this->mailDomainParts[] = $this->mailDomainPart;
       }
     }
@@ -1218,7 +1218,7 @@ class mailAccount extends plugin
       if($this->mailMethod->domainSelectionEnabled()){
           $this->mailDomainPart = preg_replace("/^[^@]*+@/","",$this->mail);
           $this->mail = preg_replace("/@.*$/","\\1",$this->mail);
-          if(!in_array($this->mailDomainPart,$this->mailDomainParts)){
+          if(!in_array_strict($this->mailDomainPart,$this->mailDomainParts)){
               $this->mailDomainParts[] = $this->mailDomainPart;
           }
       }
@@ -1238,7 +1238,7 @@ class mailAccount extends plugin
   function get_multi_edit_values()
   {
     $ret = plugin::get_multi_edit_values();
-    if(in_array("gosaMailQuota",$this->multi_boxes)){
+    if(in_array_strict("gosaMailQuota",$this->multi_boxes)){
       $ret['gosaMailQuota'] = $this->gosaMailQuota;
     }
     $flag_add = $flag_remove = array();
@@ -1251,7 +1251,7 @@ class mailAccount extends plugin
         "C"   => "own_script",
         "I"   => "drop_own_mails");
     foreach($opts as $flag => $post){
-      if(in_array($post, $this->multi_boxes)){
+      if(in_array_strict($post, $this->multi_boxes)){
         if(preg_match("/".$flag."/",$tmp)){
           $flag_add[] = $flag;
         }else{
@@ -1263,7 +1263,7 @@ class mailAccount extends plugin
     $ret['flag_remove'] = $flag_remove;
 
     if($this->mailMethod->vacationRangeEnabled()){
-      if(in_array("V",$flag_add)){
+      if(in_array_strict("V",$flag_add)){
         $ret['gosaVacationStart'] =  $this->gosaVacationStart = get_post('gosaVacationStart');
         $ret['gosaVacationStop'] =  $this->gosaVacationStop = get_post('gosaVacationStop');
       }
@@ -1278,12 +1278,12 @@ class mailAccount extends plugin
   {
     $message = plugin::multiple_check();
 
-    if(empty($this->gosaMailServer) && in_array("gosaMailServer",$this->multi_boxes)){
+    if(empty($this->gosaMailServer) && in_array_strict("gosaMailServer",$this->multi_boxes)){
       $message[]= msgPool::noserver(_("Mail"));
     }
 
     /* Check quota */
-    if ($this->gosaMailQuota != ''  && in_array("gosaMailQuota",$this->multi_boxes)){
+    if ($this->gosaMailQuota != ''  && in_array_strict("gosaMailQuota",$this->multi_boxes)){
       if (!is_numeric($this->gosaMailQuota)) {
         $message[]= msgPool::invalid(_("Quota size"),$this->gosaMailQuota,"/^[0-9]*/");
       } else {
@@ -1292,7 +1292,7 @@ class mailAccount extends plugin
     }
 
     /* Check rejectsize for integer */
-    if ($this->gosaMailMaxSize != '' && in_array("gosaMailMaxSize",$this->multi_boxes)){
+    if ($this->gosaMailMaxSize != '' && in_array_strict("gosaMailMaxSize",$this->multi_boxes)){
       if (!is_numeric($this->gosaMailMaxSize)){
         $message[]= msgPool::invalid(_("Mail reject size"),$this->gosaMailMaxSize,"/^[0-9]*/");
       } else {
@@ -1300,7 +1300,7 @@ class mailAccount extends plugin
       }
     }
 
-    if(empty($this->gosaSpamMailbox) && in_array("gosaSpamMailbox",$this->multi_boxes)){
+    if(empty($this->gosaSpamMailbox) && in_array_strict("gosaSpamMailbox",$this->multi_boxes)){
       $message[]= msgPool::required(_("Spam folder"));
     }
 
index 0f18cecc74f9638480f0f31b6466f6ed4ae3085e..82f152206755100e923c26df58d60476c9977bb0 100644 (file)
@@ -66,7 +66,7 @@ class My_Tree extends Tree
 
         $end = $this->get_block_end($key,false);
         $end2 = $this->get_block_end($key);
-        if($end != $key && in_array(get_class($object),array("sieve_if"))){
+        if($end != $key && in_array_strict(get_class($object),array("sieve_if"))){
           $ends_complete_block[$end2] = $end2;
           $this->dump_ .= "<div style='height:10px;'></div>";
           $this->dump_ .= "<div class='container_'>";
@@ -75,7 +75,7 @@ class My_Tree extends Tree
           $this->dump_  .= $block_indent_stop;
         }
         $this->dump_ .= preg_replace("/>/",">\n",$object->execute()); 
-        if($end != $key && in_array(get_class($object),array("sieve_if","sieve_else","sieve_elsif"))) {
+        if($end != $key && in_array_strict(get_class($object),array("sieve_if","sieve_else","sieve_elsif"))) {
           $ends[$end] = $end;  
           $this->dump_  .= $block_indent_start;
         }
@@ -164,7 +164,7 @@ class My_Tree extends Tree
 
     /* Handle identifiers */
     $identifiers = array("else","if","elsif","end","reject","redirect","vacation","keep","discard","fileinto","require","stop");
-    if($node['class'] == "identifier" && in_array($node['text'],$identifiers)){
+    if($node['class'] == "identifier" && in_array_strict($node['text'],$identifiers)){
       $this->mode_stack[] = array("TYPE" => $node['text']); 
     }
 
@@ -220,7 +220,7 @@ class My_Tree extends Tree
     reset($this->pap);
     foreach($this->pap as $key => $obj){
 
-      if(in_array(get_class($obj),array("sieve_if",
+      if(in_array_strict(get_class($obj),array("sieve_if",
                                         "sieve_elsif",
                                         "sieve_vacation",
                                         "sieve_comment",
@@ -252,7 +252,7 @@ class My_Tree extends Tree
     }
 
     $class = get_class($this->pap[$key_id]);
-    if(in_array($class,array("sieve_if","sieve_elsif","sieve_else"))){
+    if(in_array_strict($class,array("sieve_if","sieve_elsif","sieve_else"))){
       $block_start= $key_id;
       $block_end  = $this->get_block_end($key_id);
 
@@ -283,7 +283,7 @@ class My_Tree extends Tree
     /* Get the current element to decide what to move. */ 
     $e_class = get_class($this->pap[$key_id]);
       
-    if(in_array($e_class,array("sieve_if"))){
+    if(in_array_strict($e_class,array("sieve_if"))){
       $block_start= $key_id;
       $block_end  = $this->get_block_end($key_id);
 
@@ -298,7 +298,7 @@ class My_Tree extends Tree
       $this->move_multiple_elements($block_start,$block_end,$next_free);
     }
 
-    if(in_array($e_class,array( "sieve_stop",
+    if(in_array_strict($e_class,array( "sieve_stop",
                                 "sieve_keep",
                                 "sieve_require",
                                 "sieve_comment",
@@ -393,7 +393,7 @@ class My_Tree extends Tree
     /* Only execute if this is a really a block element. 
      * Block elements is only sieve_if
      */
-    if(in_array(get_class($this->pap[$start]),array("sieve_if","sieve_elsif","sieve_else"))){
+    if(in_array_strict(get_class($this->pap[$start]),array("sieve_if","sieve_elsif","sieve_else"))){
 
       $class      = get_class($this->pap[$start]);
       $next_class = get_class($this->pap[$start+1]);
@@ -414,7 +414,7 @@ class My_Tree extends Tree
         if($complete){
           if( $block_depth == 0 && 
               $class == "sieve_block_end" && 
-              !in_array($next_class,array("sieve_else","sieve_elsif"))){
+              !in_array_strict($next_class,array("sieve_else","sieve_elsif"))){
             $end = TRUE;
             $start --;
           }
@@ -564,7 +564,7 @@ class My_Tree extends Tree
         }
         $include_self = FALSE;
         $current_class  = get_class($test[$key_id]);
-        if(in_array($current_class, $allowed_to_add_after)){
+        if(in_array_strict($current_class, $allowed_to_add_after)){
           return($key_id);
         } 
       } 
@@ -579,7 +579,7 @@ class My_Tree extends Tree
       }
       while($key_id >=0 ){
         $current_class  = get_class($test[$key_id]);
-        if(in_array($current_class, $allowed_to_add_before)){
+        if(in_array_strict($current_class, $allowed_to_add_before)){
           return($key_id);
         } 
         $key_id --;
@@ -650,7 +650,7 @@ class My_Tree extends Tree
     }
     foreach($this->pap as $key => $obj){
       if($key == $last_found_at) break;  
-      if(!in_array(get_class($obj),array("sieve_comment","sieve_require"))){
+      if(!in_array_strict(get_class($obj),array("sieve_comment","sieve_require"))){
         $objs[] = get_class($obj);
       }
     }
index 5326c2b37628e133d50cec03c838d22830e8b639..94a48ff1ffe8c4bb7bc5c0b2fec9090bfb2d61ec 100644 (file)
@@ -62,7 +62,7 @@ class Parser
                {
                        $prev = $this->tree_->getNode($childs[$i-1]);
 
-                       if (in_array($prev['text'], array('{', '(', ',')))
+                       if (in_array_strict($prev['text'], array('{', '(', ',')))
                        {
                                // use command owning a block or list
                                $prev = $this->tree_->getNode($parent_id);
@@ -92,7 +92,7 @@ class Parser
 
        function isExtensionRegistered_($extension)
        {
-               return (in_array($extension, $this->registeredExtensions_) ? true : false);
+               return (in_array_strict($extension, $this->registeredExtensions_) ? true : false);
        }
 
        function success_($text = null)
index 3e22bb1d0ee8c6a3a2aae7b6662fa35da5e54a50..b00ffd1c50bf45d312037c195c211853e51a6f0d 100644 (file)
@@ -77,7 +77,7 @@ class Scanner
 
                if (is_array($class))
                {
-                       return in_array($next, $class);
+                       return in_array_strict($next, $class);
                }
                else if (is_string($class))
                {
index d929e3fbe08acb8ba50e4585b161e2d967d9f6a6..4412f3fe6a0a3d86062c8f01f137b9fca633c725 100644 (file)
@@ -236,7 +236,7 @@ class sieve_if
           $script .= $data['Match_type']." ";
 
           /* Add special match type for count and value */
-          if(in_array($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
+          if(in_array_strict($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
             $script .= sieve_create_strings($data['Match_type_value'])." ";
           }
 
@@ -281,7 +281,7 @@ class sieve_if
           $script .= $data['Match_type']." ";
 
           /* Add special match type for count and value */
-          if(in_array($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
+          if(in_array_strict($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
             $script .= sieve_create_strings($data['Match_type_value'])." ";
           }
 
@@ -327,7 +327,7 @@ class sieve_if
           $script .= $data['Match_type']." ";
 
           /* Add special match type for count and value */
-          if(in_array($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
+          if(in_array_strict($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
             $script .= sieve_create_strings($data['Match_type_value'])." ";
           }
 
@@ -630,7 +630,7 @@ class sieve_if
           /* In case of :count and :value match types 
            *  we have a special match operator we should save.
            */
-          if(in_array($parsed[$key]['Match_type'],array(":value",":count"))){
+          if(in_array_strict($parsed[$key]['Match_type'],array(":value",":count"))){
             if(isset($_POST['operator_'.$element_id])){
               $op = $_POST['operator_'.$element_id];
 
@@ -1266,7 +1266,7 @@ class sieve_if
             $Match_type = $node['text'];
 
             /* Get value operator */
-            if(in_array($Match_type,array(":value",":count"))){
+            if(in_array_strict($Match_type,array(":value",":count"))){
               $i ++;        
               $node = $data[$i];
 
@@ -1380,7 +1380,7 @@ class sieve_if
         
         /* Skip first values, [if,not,exists] */
         $node = $data[$id];
-        while(in_array($node['text'],array("if","not","exists"))){
+        while(in_array_strict($node['text'],array("if","not","exists"))){
           $id ++;
           $node = $data[$id];
         }
@@ -1448,16 +1448,16 @@ class sieve_if
     $next = NULL;
     $num = 0;
     for($i = $id ; $i < count($data) ; $i++ ){
-      if(in_array($data[$i]['class'],array("left-parant","left-bracket"))){
+      if(in_array_strict($data[$i]['class'],array("left-parant","left-bracket"))){
         $open_brakets ++;
       }
       if($data[$i]['class'] == "comma" && $open_brakets == 1){
         $num ++;
       }
-      if(!in_array($data[$i]['class'],array("comma","left-parant","right-parant")) || $open_brakets >1 ){
+      if(!in_array_strict($data[$i]['class'],array("comma","left-parant","right-parant")) || $open_brakets >1 ){
         $par[$num][] = $data[$i];
       }
-      if(in_array($data[$i]['class'],array("right-parant","right-bracket"))){
+      if(in_array_strict($data[$i]['class'],array("right-parant","right-bracket"))){
         $open_brakets --;
       }
     }
index bd8fe9ae9cb43a992fa0809bdf45fbd1daad8207..cbec547c7c6aaa1cc9d2bde23109c00a29f6de41 100644 (file)
@@ -33,7 +33,7 @@ class sieve_require
     foreach($this->data as $dat){
       $current[] = $dat;
     }
-    if(!in_array($str,$current)){
+    if(!in_array_strict($str,$current)){
       $this->data[] = $str;
     }
     $this->data = array_unique($this->data);
index a8ba251c6946cae21d13cca0b88db3f48c1b7b16..efb51934dfcb6e7634b9ad31661f72e31be43d8a 100644 (file)
@@ -37,7 +37,7 @@ class sieve_vacation
       $node = $data['ELEMENTS'][$i];
 
       /* Check if tag is in the specified list of attributes */
-      if($node['class'] == "tag" && in_array($node['text'],$known_attrs)){
+      if($node['class'] == "tag" && in_array_strict($node['text'],$known_attrs)){
 
         $var = preg_replace("/\:/","",$node['text']);
         $this->$var = $data['ELEMENTS'][$i+1]['text'];
@@ -63,7 +63,7 @@ class sieve_vacation
       }
 
       /* Add the vacation message */
-      if(in_array($node['class'],array("quoted-string","multi-line"))){
+      if(in_array_strict($node['class'],array("quoted-string","multi-line"))){
 
         $tmp = sieve_get_strings($data['ELEMENTS'],$i);
         $strs= $tmp['STRINGS'];
index 0fea778601cf5f5981e43e13b1ae459a310ff390..b5082aad9bc823715d31c7e1b024d52ad230ca0a 100644 (file)
@@ -524,7 +524,7 @@ class sieveManagement extends plugin
 
         /* Element selected */
         if(isset($_POST['element_type']) && isset($element_types[$_POST['element_type']]) 
-           || isset($_POST['element_type']) &&in_array($_POST['element_type'],array("sieve_else","sieve_elsif"))){
+           || isset($_POST['element_type']) &&in_array_strict($_POST['element_type'],array("sieve_else","sieve_elsif"))){
           $this->add_element_type = $_POST['element_type'];
         }
 
@@ -555,7 +555,7 @@ class sieveManagement extends plugin
            */
           foreach($this->current_handler->tree_->pap as $key => $obj){
         
-            if($obj->object_id == $this->add_new_id && in_array(get_class($obj),array("sieve_if","sieve_elsif"))){
+            if($obj->object_id == $this->add_new_id && in_array_strict(get_class($obj),array("sieve_if","sieve_elsif"))){
   
               /* Get block start/end */
               $end_id = $this->current_handler->tree_->get_block_end($key);
@@ -729,7 +729,7 @@ class sieveManagement extends plugin
      */
     foreach($this->current_handler->tree_->pap as $key => $obj){
 
-      if($obj->object_id == $id && in_array(get_class($obj),array("sieve_if","sieve_elsif"))){
+      if($obj->object_id == $id && in_array_strict(get_class($obj),array("sieve_if","sieve_elsif"))){
 
         /* Get block start/end */
         $end_id = $this->current_handler->tree_->get_block_end($key);
@@ -760,7 +760,7 @@ class sieveManagement extends plugin
         }else{
          
           /* Allow adding elsif above elsif */ 
-          if(in_array(get_class($obj),array("sieve_elsif"))){
+          if(in_array_strict(get_class($obj),array("sieve_elsif"))){
             $element_types['sieve_elsif'] = _("Else If");
           }
         }
@@ -960,7 +960,7 @@ class sieveManagement extends plugin
       $this->current_handler->save_object();
       $Mode = $this->scripts[$this->current_script]['MODE'];
       $skip_mode_change = false;
-      if(in_array($Mode,array("Source-Only","Source"))){
+      if(in_array_strict($Mode,array("Source-Only","Source"))){
         if(isset($_POST['script_contents'])){
           $sc = stripslashes($_POST['script_contents']);
           $this->scripts[$this->current_script]['SCRIPT'] = $sc;
@@ -973,7 +973,7 @@ class sieveManagement extends plugin
           }
         }
       }
-      if(in_array($Mode,array("Structured"))){
+      if(in_array_strict($Mode,array("Structured"))){
         $sc = $this->current_handler->get_sieve_script();
         $this->scripts[$this->current_script]['SCRIPT'] = $sc;
         $p = new My_Parser($this);
index 1947a40f442666cae5bc10da4c47554ee8c70fab..75e9cd46a7795fd5f0110b3de5527dc73d7c937d 100644 (file)
@@ -351,7 +351,7 @@ class goKrbServer extends goService{
         /* Send remove policy event  
          */
         foreach($actions['del'] as $policy){
-            if(!in_array($policy['NAME'],$policies)) continue;
+            if(!in_array_strict($policy['NAME'],$policies)) continue;
             if(!$o->krb5_del_policy($this->macAddress,$policy['NAME'])){
                 msg_dialog::display(_("Service infrastructure"),msgPool::siError($o->get_error()),ERROR_DIALOG);
             }
@@ -360,7 +360,7 @@ class goKrbServer extends goService{
         /* Send add new/edit policy event
          */
         foreach($actions['add_edit'] as $policy){
-            if(in_array($policy['NAME'],$policies)){
+            if(in_array_strict($policy['NAME'],$policies)){
                 if(!$o->krb5_set_policy($this->macAddress,$policy['NAME'],$policy['DATA'])){
                     msg_dialog::display(_("Service infrastructure"),msgPool::siError($o->get_error()),ERROR_DIALOG);
                 }
index ef0f7de23ec9e760e6ce8af7f397a7345893ea8f..89c07fe409a4b43ec2c20fdf6b3fe49a07d0f233 100644 (file)
@@ -105,7 +105,7 @@ class krb5_policy extends plugin
     {
         $message = array();
         $names = $this->parent->getPolicyNames();
-        if($this->name != $this->init_name && in_array($this->name,$names)){
+        if($this->name != $this->init_name && in_array_strict($this->name,$names)){
             $message[] = msgPool::duplicated(_("Policy name"));
         }
         if(empty($this->name)){
index 6be7db304fa35447bdefc97473c1bde3f86832e9..5165d43496cb757c331d3a27c354be5165d36e75 100644 (file)
@@ -675,7 +675,7 @@ class passwordMethodMIT extends passwordMethod
 
             /* Save principal changes */
             $o = new gosaSupportDaemon();
-            if(in_array($principal,$this->server_list[$server_name]['principals'])){
+            if(in_array_strict($principal,$this->server_list[$server_name]['principals'])){
                 $this->is_new = FALSE;
             }
 
index 9c0b747eb7b7cf511e3cd41832a382ce1d0480c4..909a50676617893d0b82ab6367e1f7ae4d27ba7e 100644 (file)
@@ -127,7 +127,7 @@ class nagiosAccount extends plugin
     /* Assign attributes an ACL to smarty */
     foreach($this->attributes as $val) { 
       $smarty->assign("$val", set_post($this->$val));
-      if(in_array($val,$this->is_chk_box)){
+      if(in_array_strict($val,$this->is_chk_box)){
         if($this->$val == "checked"){
           $smarty->assign($val."CHK", " checked ");
         }else{
index de50ef93690e6d277524bdc528515372df4d8132..ffc41db65051ec02925e41258510ccdd037b9fac 100644 (file)
@@ -93,7 +93,7 @@ class ogw{
 
   function Perform($option)
   {
-    if(!in_array($option,array("ADD","EDIT","REMOVE"))){
+    if(!in_array_strict($option,array("ADD","EDIT","REMOVE"))){
       $this->LastError = sprintf("Option '%s' is not allowed, possible options are 'ADD' 'EDIT' 'REMOVE'.",$option);
       return(false);
     }else{
@@ -203,7 +203,7 @@ class ogw{
     foreach($this->validLocationTeam as $id){
       $tmp[]= $id['company_id'];
     }
-    if(!in_array($this->info['LocationTeamID'],$tmp)){
+    if(!in_array_strict($this->info['LocationTeamID'],$tmp)){
       $this->LastError = "Given 'Location Team' is invalid.";
       return(false);
     }
@@ -212,7 +212,7 @@ class ogw{
     foreach($this->validTemplateUser as $id){
       $tmp[]= $id['company_id'];
     }
-    if(!in_array($this->info['template_user_id'],$tmp)){
+    if(!in_array_strict($this->info['template_user_id'],$tmp)){
       $this->LastError = "Given 'Template User ID' is invalid.";
       return(false);
     }
@@ -224,7 +224,7 @@ class ogw{
     }
     if(is_array($this->info['TeamIDis'])){
       foreach($this->info['TeamIDis'] as $id){
-        if(!in_array($id,$tmp)){
+        if(!in_array_strict($id,$tmp)){
           $this->LastError = sprintf("Given 'Team ID':%s is invalid.",$id);
           return(false);
         }
index 3fe61bed86d9ab2dff9330535b693887b10b8f1a..b52e7bd4d92f4a7f2dfde2efc98d6f30326562fb 100644 (file)
@@ -211,7 +211,7 @@ class opengwAccount extends plugin
 
                         if($this->acl_is_readable("Teams")){
                             foreach($this->handle->validTeams as $id){
-                                if(in_array($id['company_id'],$this->info['TeamIDis'])){
+                                if(in_array_strict($id['company_id'],$this->info['TeamIDis'])){
                                     $str .= "<input ".$dis." type='checkbox' value='".$id['company_id']."' 
                                         checked name='team_".base64_encode($id['description'])."'>".$id['description']."<br>";
                                 }else{
@@ -270,7 +270,7 @@ class opengwAccount extends plugin
             if($this->acl_is_writeable("Teams")) {
                 foreach($_POST as $name => $value ){
                     if(preg_match("/team_/i",$name)){
-                        if(!in_array($value,$this->info['TeamIDis'])){
+                        if(!in_array_strict($value,$this->info['TeamIDis'])){
                             $this->info['TeamIDis'][]=$value;
                         }
                     }
index 7d815d40fae10b81f7fdb9d46e61acf888a0128d..22324e41efabc4c3d95cf30e562aea70afdc8483 100644 (file)
@@ -185,8 +185,8 @@ class licenseGeneric extends plugin
             if(isset($_POST['addLicenseUsage']) && isset($_POST['selectedHostToAdd'])){
                 $host = get_post('selectedHostToAdd');
                 if(!empty($host) && 
-                        in_array($host,$this->getHosts()) && 
-                        !in_array($host, $this->usedByHost)){
+                        in_array_strict($host,$this->getHosts()) && 
+                        !in_array_strict($host, $this->usedByHost)){
                     $this->usedByHost[] = $host;
                 }
             }
index dddcd36f8f1b3398acdb356ee5d43d491633ea15..b80de75b07780e554a94bcadef10378535cbc914 100644 (file)
@@ -343,7 +343,7 @@ class licensePoolGeneric extends plugin
             if(preg_match("/w/",$this->getacl("productIds"))){
                 if(isset($_POST['availableProduct']) && isset($_POST['addProduct'])){
                     $pro = get_post('availableProduct');
-                    if(isset($this->availableProductIds[$pro]) && !in_array($this->availableProductIds[$pro], $this->productIds)){
+                    if(isset($this->availableProductIds[$pro]) && !in_array_strict($this->availableProductIds[$pro], $this->productIds)){
                         $this->productIds[] =$this->availableProductIds[$pro];
                     }
                 }
@@ -364,7 +364,7 @@ class licensePoolGeneric extends plugin
             if(preg_match("/w/",$this->getacl("windowsSoftwareIds"))){
                 if(isset($_POST['newSoftwareId']) && isset($_POST['addSoftware'])){
                     $soft = trim(get_post('newSoftwareId'));
-                    if(!empty($soft) && !in_array($soft, $this->softwareIds)){
+                    if(!empty($soft) && !in_array_strict($soft, $this->softwareIds)){
                         $this->softwareIds[] = $soft;
                     }
                 }
index 471715c7d552747719568ac4f23950f7201bbd21..e9d807549df14e0d48fa96ac0fc59aeee6458b9c 100644 (file)
@@ -176,7 +176,7 @@ class licenseUsageByHost extends plugin
         // build up a available licenses list. 
         $licenses = array();
         foreach($this->availableLicenses as $key => $license){
-            if(!in_array($license['softwareLicenseId'][0], $this->reservedLicenses)){
+            if(!in_array_strict($license['softwareLicenseId'][0], $this->reservedLicenses)){
                 $licenses[$key] = $license['softwareLicenseId'][0]." [".$license['licensePoolId'][0]."]";
             }
         }
@@ -211,7 +211,7 @@ class licenseUsageByHost extends plugin
                 // Check if we've to add reservations
                 if(isset($_POST['availableLicense']) && isset($_POST['addReservation'])){
                     $id = get_post('availableLicense');
-                    if(isset($this->availableLicenses[$id]) && !in_array($this->availableLicenses[$id],$this->reservedLicenses)){
+                    if(isset($this->availableLicenses[$id]) && !in_array_strict($this->availableLicenses[$id],$this->reservedLicenses)){
                         $this->reservedLicenses[$id] =  $this->availableLicenses[$id]['softwareLicenseId'][0];
                     }
                 }
index 306d116bbe810025b92736f4b472d1bdb21593a5..9b050c3b896451c43a6209e01800da740eb769bc 100644 (file)
@@ -59,7 +59,7 @@ class phpgwAccount extends plugin
 
     $smarty->assign('phpgwAccountACL', $this->getacl("",$this->ReadOnly));
     $smarty->assign("multiple_support",$this->multiple_support_active);
-    $smarty->assign("use_phpgw",in_array("phpgw",$this->multi_boxes));
+    $smarty->assign("use_phpgw",in_array_strict("phpgw",$this->multi_boxes));
     $display.= $smarty->fetch (get_template_path('phpgw.tpl', TRUE, dirname(__FILE__)));
     return ($display);
   }
@@ -203,7 +203,7 @@ class phpgwAccount extends plugin
   function get_multi_edit_values()
   {
     $ret = plugin::get_multi_edit_values();
-    if(in_array("phpgw",$this->multi_boxes)){
+    if(in_array_strict("phpgw",$this->multi_boxes)){
       $ret['is_account'] = $this->is_account;
     }
     return($ret);
@@ -220,7 +220,7 @@ class phpgwAccount extends plugin
   function init_multiple_support($attrs,$all)
   {
     plugin::init_multiple_support($attrs,$all);
-    if(isset($attrs['objectClass']) && in_array("phpgwAccount",$attrs['objectClass'])){
+    if(isset($attrs['objectClass']) && in_array_strict("phpgwAccount",$attrs['objectClass'])){
       $this->is_account = TRUE;
     }
   }
index 5bc49937907c5ced4a62695469d9ad2fb53038d9..b934fb33798e116a0386f55693c5a752eface17b 100644 (file)
@@ -103,13 +103,13 @@ class pureftpdAccount extends plugin
     }
 
     foreach($this->attributes as $attr){
-      if(in_array($attr,$this->multi_boxes)){
+      if(in_array_strict($attr,$this->multi_boxes)){
         $smarty->assign("use_".$attr,TRUE);
       }else{
         $smarty->assign("use_".$attr,FALSE);
       }
     }
-    $smarty->assign("use_pureftpd",in_array("pureftpd",$this->multi_boxes)); 
+    $smarty->assign("use_pureftpd",in_array_strict("pureftpd",$this->multi_boxes)); 
     $smarty->assign("multiple_support",$this->multiple_support_active);
     $smarty->assign("FTPStatus", ($this->FTPStatus == "disabled") ? "checked" : "");
     $smarty->assign('pureftpdACL', $this->getacl("",$this->ReadOnly));
@@ -307,7 +307,7 @@ class pureftpdAccount extends plugin
   function get_multi_edit_values()
   {
     $ret = plugin::get_multi_edit_values();
-    if(in_array("pureftpd",$this->multi_boxes)){
+    if(in_array_strict("pureftpd",$this->multi_boxes)){
       $ret['is_account'] = $this->is_account;
     }
     return($ret);
index 61959caa708107d14ffcd6874e75957b86de8165..7c878da801510e502af068e22fda3573e992bb29 100644 (file)
@@ -339,14 +339,14 @@ class rsyslog extends plugin
     // Get Host
     if( isset($this->servers[$this->selected_server]['Hosts']) &&  isset($_POST['selected_host']) && 
         ($_POST['selected_host'] == "all" || 
-         in_array($_POST['selected_host'],$this->servers[$this->selected_server]['Hosts']))){
+         in_array_strict($_POST['selected_host'],$this->servers[$this->selected_server]['Hosts']))){
       $this->selected_host = get_post('selected_host');
     }
 
     // Get priority from post
     if( isset($this->servers[$this->selected_server]['Priorities']) &&  isset($_POST['selected_priority']) && 
         ($_POST['selected_priority'] == "all" || 
-         in_array($_POST['selected_priority'],$this->servers[$this->selected_server]['Priorities']))){
+         in_array_strict($_POST['selected_priority'],$this->servers[$this->selected_server]['Priorities']))){
       $this->selected_priority = get_post('selected_priority');
     }
       
@@ -362,7 +362,7 @@ class rsyslog extends plugin
     }
 
     // Get sorting attributes 
-    if(isset($_GET['sort_value']) && in_array($_GET['sort_value'], 
+    if(isset($_GET['sort_value']) && in_array_strict($_GET['sort_value'], 
           array("DeviceReportedTime","FromHost","Facility","Priority","Message","SysLogTag"))){
       $sort_value = $_GET['sort_value'];
       if($this->sort_value == $sort_value){
index 2a5096c02d1f31ea654b5e032f38254c5b5e961d..497f6e4f3d1119dce96e0a33fe4c5e944dfb0e77 100644 (file)
@@ -28,7 +28,7 @@ class rSyslogServer extends goService{
         goService::goService($config,$dn);
         $this->DisplayName = _("Logging");
         $this->initial_use_database = $this->use_database = 
-            isset($this->attrs['objectClass']) &&in_array("goLogDBServer", $this->attrs['objectClass']);
+            isset($this->attrs['objectClass']) &&in_array_strict("goLogDBServer", $this->attrs['objectClass']);
 
         if($this->use_database){
             foreach($this->db_attributes as $attr){
index 6549bbdbbc533b1c201af711d568b57473bf5130..1466f0a88662ab6900655f2787ba4814b44a3e81 100644 (file)
@@ -398,7 +398,7 @@ class sambaAccount extends plugin
                 $smarty->assign("$attr", set_post($this->mungedObject->ctx[$attr]));
 
                 // Set field  to blank if value is 0
-                if(in_array($attr, array("CtxMaxConnectionTime", "CtxMaxDisconnectionTime", "CtxMaxIdleTime"))) {
+                if(in_array_strict($attr, array("CtxMaxConnectionTime", "CtxMaxDisconnectionTime", "CtxMaxIdleTime"))) {
                     if($this->mungedObject->ctx[$attr] == 0) {
                         $smarty->assign("$attr", "");
                     }
@@ -478,7 +478,7 @@ class sambaAccount extends plugin
 
         // Assign selected multi edit checkbox values.
         foreach($this->attributes as $attr){
-            if(in_array($attr,$this->multi_boxes)){
+            if(in_array_strict($attr,$this->multi_boxes)){
                 $smarty->assign("use_".$attr,TRUE);
             }else{
                 $smarty->assign("use_".$attr,FALSE);
@@ -494,7 +494,7 @@ class sambaAccount extends plugin
                     "enforcePasswordChange", "passwordNeverExpires", "noPasswordRequired",
                     "temporaryDisabled","cannotChangePassword") as $attr){
 
-            if(in_array($attr,$this->multi_boxes)){
+            if(in_array_strict($attr,$this->multi_boxes)){
                 $smarty->assign("use_".$attr,TRUE);
             }else{
                 $smarty->assign("use_".$attr,FALSE);
@@ -1146,7 +1146,7 @@ class sambaAccount extends plugin
         $this->sambaPrimaryGroupSID= "";
 
         /* Fill mungedDial field */
-        if (isset($this->attrs['sambaMungedDial']) && !in_array('sambaMungedDial', $skip)){
+        if (isset($this->attrs['sambaMungedDial']) && !in_array_strict('sambaMungedDial', $skip)){
             $this->mungedObject->load($this->sambaMungedDial);
         }
 
@@ -1237,7 +1237,7 @@ class sambaAccount extends plugin
         /* Strings */
         foreach (array( "sambaHomePath" => _("Home directory"),
                     "sambaProfilePath" => _("Profile path")) as $key => $val){
-            if (in_array($key,$this->multi_boxes) && !$this->mungedObject->is_samba_path($this->$key)){
+            if (in_array_strict($key,$this->multi_boxes) && !$this->mungedObject->is_samba_path($this->$key)){
                 $message[]= msgPool::invalid($val);
             }
         }
@@ -1246,7 +1246,7 @@ class sambaAccount extends plugin
         foreach (array( "CtxMaxConnectionTime"    => _("Connection"),
                     "CtxMaxDisconnectionTime" => _("Disconnection"),
                     "CtxMaxIdleTime"          => _("IDLE")) as $key => $val){
-            if (in_array($key,$this->multi_boxes) && 
+            if (in_array_strict($key,$this->multi_boxes) && 
                     isset($this->mungedObject->ctx[$key]) && 
                     !tests::is_id($this->mungedObject->ctx[$key]) && $val != 0){
                 $message[]=msgPool::invalid($val);
@@ -1259,7 +1259,7 @@ class sambaAccount extends plugin
         }
 
 
-        if(in_array("sambaKickoffTime", $this->multi_boxes) && $this->flag_sambaKickoffTime){
+        if(in_array_strict("sambaKickoffTime", $this->multi_boxes) && $this->flag_sambaKickoffTime){
             if(!preg_match("/^[0-3][0-9]\.[0-1][0-9]\.([0-9]){4}$/",$this->sambaKickoffTime)){
                 $message[] = msgPool::invalid(_("Account expires after"));
             }elseif(!strtotime($this->sambaKickoffTime) || strtotime($this->sambaKickoffTime) >= 2147483647){
@@ -1328,43 +1328,43 @@ class sambaAccount extends plugin
         $ret = plugin::get_multi_edit_values();
 
         /* Terminal Server  */
-        if(in_array("tslogin",$this->multi_boxes)){
+        if(in_array_strict("tslogin",$this->multi_boxes)){
             $ret['tslogin'] = $this->mungedObject->getTsLogin();
         }
-        if(in_array("CtxWFHomeDirDrive",$this->multi_boxes)){
+        if(in_array_strict("CtxWFHomeDirDrive",$this->multi_boxes)){
             $ret['CtxWFHomeDirDrive'] = $this->mungedObject->ctx['CtxWFHomeDirDrive'];
         }
-        if(in_array("CtxWFHomeDir",$this->multi_boxes)){
+        if(in_array_strict("CtxWFHomeDir",$this->multi_boxes)){
             $ret['CtxWFHomeDir'] = $this->mungedObject->ctx['CtxWFHomeDir'];
         }
-        if(in_array("CtxWFProfilePath",$this->multi_boxes)){
+        if(in_array_strict("CtxWFProfilePath",$this->multi_boxes)){
             $ret['CtxWFProfilePath'] = $this->mungedObject->ctx['CtxWFProfilePath'];
         }
 
-        if(in_array("inherit",$this->multi_boxes)){
+        if(in_array_strict("inherit",$this->multi_boxes)){
             $ret['inherit'] = $this->mungedObject->getInheritMode();
         }       
-        if(in_array("CtxInitialProgram",$this->multi_boxes)){
+        if(in_array_strict("CtxInitialProgram",$this->multi_boxes)){
             $ret['CtxInitialProgram'] = $this->mungedObject->ctx['CtxInitialProgram'];
         } 
-        if(in_array("CtxWorkDirectory",$this->multi_boxes)){
+        if(in_array_strict("CtxWorkDirectory",$this->multi_boxes)){
             $ret['CtxWorkDirectory'] = $this->mungedObject->ctx['CtxWorkDirectory'];
         } 
 
         /* Time Limits. Be careful here, there are some negations  */
-        if(in_array("CtxMaxConnectionTimeF",$this->multi_boxes)){
+        if(in_array_strict("CtxMaxConnectionTimeF",$this->multi_boxes)){
             $ret["CtxMaxConnectionTimeF"]   =  !$this->mungedObject->getCtxMaxConnectionTimeF();
             if(!$ret["CtxMaxConnectionTimeF"]){
                 $ret["CtxMaxConnectionTime"]   =  $this->mungedObject->ctx['CtxMaxConnectionTime'];
             }
         }
-        if(in_array("CtxMaxDisconnectionTimeF",$this->multi_boxes)){
+        if(in_array_strict("CtxMaxDisconnectionTimeF",$this->multi_boxes)){
             $ret["CtxMaxDisconnectionTimeF"]=  !$this->mungedObject->getCtxMaxDisconnectionTimeF();
             if(!$ret["CtxMaxDisconnectionTimeF"]){
                 $ret["CtxMaxDisconnectionTime"]=  $this->mungedObject->ctx['CtxMaxDisconnectionTime'];
             }
         }
-        if(in_array("CtxMaxIdleTimeF",$this->multi_boxes)){
+        if(in_array_strict("CtxMaxIdleTimeF",$this->multi_boxes)){
             $ret["CtxMaxIdleTimeF"]         =  !$this->mungedObject->getCtxMaxIdleTimeF();
             if(!$ret["CtxMaxIdleTimeF"]){
                 $ret["CtxMaxIdleTime"]         =  $this->mungedObject->ctx['CtxMaxIdleTime'];
@@ -1372,24 +1372,24 @@ class sambaAccount extends plugin
         }
 
         /* Client Devices */
-        if(in_array("connectclientdrives",$this->multi_boxes)){
+        if(in_array_strict("connectclientdrives",$this->multi_boxes)){
             $ret["connectclientdrives"]     =  $this->mungedObject->getConnectClientDrives();
         }
-        if(in_array("connectclientprinters",$this->multi_boxes)){
+        if(in_array_strict("connectclientprinters",$this->multi_boxes)){
             $ret["connectclientprinters"]   =  $this->mungedObject->getConnectClientPrinters();
         }
-        if(in_array("defaultprinter",$this->multi_boxes)){
+        if(in_array_strict("defaultprinter",$this->multi_boxes)){
             $ret["defaultprinter"]          =  $this->mungedObject->getDefaultPrinter();
         }
 
         /* Misc */
-        if(in_array("shadow",$this->multi_boxes)){
+        if(in_array_strict("shadow",$this->multi_boxes)){
             $ret["shadow"]    =$this->mungedObject->getShadow();
         }
-        if(in_array("brokenconn",$this->multi_boxes)){
+        if(in_array_strict("brokenconn",$this->multi_boxes)){
             $ret["brokenconn"]=$this->mungedObject->getBrokenConn();
         }
-        if(in_array("reconn",$this->multi_boxes)){
+        if(in_array_strict("reconn",$this->multi_boxes)){
             $ret["reconn"]    =$this->mungedObject->getReConn();
         }
 
@@ -1399,11 +1399,11 @@ class sambaAccount extends plugin
             $ret[$attr] = $this->$attr;
         }
 
-        if(in_array("SetSambaLogonHours",$this->multi_boxes)){
+        if(in_array_strict("SetSambaLogonHours",$this->multi_boxes)){
             $ret['sambaLogonHours'] = $this->sambaLogonHours;
         }
 
-        if(in_array("workstation_list",$this->multi_boxes)){
+        if(in_array_strict("workstation_list",$this->multi_boxes)){
             $ret['multiple_sambaUserWorkstations'] = $this->multiple_sambaUserWorkstations;
         }
 
index 788dcc2e5c7e325cb1533ddf0e9f5cf3cd086055..f4616d54b3b2fc11e67ba8b5add75ee151d97dc8 100644 (file)
@@ -160,7 +160,7 @@ class sambaMungedDial
        $result_tmp= "";
        foreach ($params as $paramName => $paramValue) {
                /* String parameter? */
-               if (in_array($paramName, $this->stringParams)){
+               if (in_array_strict($paramName, $this->stringParams)){
                        $isString= TRUE;
                        $paramValue= sambaMungedDial::strhex($paramValue.chr(0).chr(0));
                } else {
@@ -168,7 +168,7 @@ class sambaMungedDial
                }
   
                /* Time parameter? */
-               if (in_array($paramName, $this->timeParams)){
+               if (in_array_strict($paramName, $this->timeParams)){
                        $paramValue= sambaMungedDial::genTime($paramValue);
                }
   
@@ -260,11 +260,11 @@ class sambaMungedDial
                $ctxParm= substr($ctxField, 0, $ctxParmLength);
                                
                /* If string parameter, convert */
-               if (in_array($ctxParmName, $this->stringParams)){
+               if (in_array_strict($ctxParmName, $this->stringParams)){
                                $ctxParm= sambaMungedDial::hexstr($ctxParm);
                }
                /* If time parameter, convert */
-               if (in_array($ctxParmName, $this->timeParams)){
+               if (in_array_strict($ctxParmName, $this->timeParams)){
                        $ctxParm= sambaMungedDial::readTime($ctxParm);
                }
   
index ec108855ec80e6abc94da97d2f77f34e823cd022..d377105a9643b5c334464159c6c79e592fc2ef1a 100644 (file)
@@ -396,7 +396,7 @@ class scalixAccount extends plugin
 
     foreach (array("scalixEmailAddress") as $val){
 
-      if (in_array($val, $skip)){
+      if (in_array_strict($val, $skip)){
         continue;
       }
 
@@ -433,7 +433,7 @@ class scalixAccount extends plugin
     }
 
     /* Add to list of alternates */
-    if (!in_array($address, $this->scalixEmailAddress)){
+    if (!in_array_strict($address, $this->scalixEmailAddress)){
       $this->scalixEmailAddress[]= $address;
       $this->is_modified= TRUE;
     }
index 07e1836bebf3781de9cc943cc9e2efe974ba15bc..8251a37232fbad280343c4445b805f5027b27849 100644 (file)
@@ -141,7 +141,7 @@ class proxyAccount extends plugin
     /* Assign filter settings */
     $smarty->assign("changeB",$changeB);
     foreach(array("T","B","F") as $attr){
-      if(in_array("filter".$attr,$this->multi_boxes)){
+      if(in_array_strict("filter".$attr,$this->multi_boxes)){
         $smarty->assign("use_filter".$attr,TRUE);
       }else{
         $smarty->assign("use_filter".$attr,FALSE);
@@ -156,7 +156,7 @@ class proxyAccount extends plugin
       $smarty->assign('proxyAccountACL', $this->getacl("",$this->ReadOnly));
     }
 
-    $smarty->assign("use_proxy",in_array("proxy",$this->multi_boxes));
+    $smarty->assign("use_proxy",in_array_strict("proxy",$this->multi_boxes));
     $smarty->assign("multiple_support",$this->multiple_support_active);
     $display.= $smarty->fetch(get_template_path('proxy.tpl', TRUE, dirname(__FILE__)));
     return($display);
@@ -376,22 +376,22 @@ class proxyAccount extends plugin
   public function get_multi_edit_values()
   {
     $ret = plugin::get_multi_edit_values();
-    if(in_array("proxy",$this->multi_boxes)){
+    if(in_array_strict("proxy",$this->multi_boxes)){
       $ret['is_account'] = $this->is_account;
     }
 
-    if(in_array("filterT",$this->multi_boxes)){
+    if(in_array_strict("filterT",$this->multi_boxes)){
       $ret['gosaProxyWorkingStart']  = $this->gosaProxyWorkingStart;
       $ret['gosaProxyWorkingStop']   = $this->gosaProxyWorkingStop;
     }
-    if(in_array("filterB",$this->multi_boxes)){
+    if(in_array_strict("filterB",$this->multi_boxes)){
       $ret['gosaProxyQuota']        = $this->gosaProxyQuota;
       $ret['gosaProxyQuotaPeriod']  = $this->gosaProxyQuotaPeriod;
     }
 
     foreach(array("B","T","F") as $attr){
       $name = "filter".$attr;
-      if(in_array($name,$this->multi_boxes)){
+      if(in_array_strict($name,$this->multi_boxes)){
         $ret[$name] = preg_match("/".$attr."/",$this->gosaProxyAcctFlags);
       }
     }
@@ -432,7 +432,7 @@ class proxyAccount extends plugin
   public function init_multiple_support($attrs,$all)
   {
     plugin::init_multiple_support($attrs,$all);
-    if(isset($attrs['objectClass']) && in_array("gosaProxyAccount",$attrs['objectClass'])){
+    if(isset($attrs['objectClass']) && in_array_strict("gosaProxyAccount",$attrs['objectClass'])){
       $this->is_account = TRUE;
     }
   }
index 1213e3f8f176fc8d35651c7191322471c8c20d4e..d52deed8416541e566e1044e473a3c34417d3238 100644 (file)
@@ -159,12 +159,12 @@ class sudo extends plugin
         if(isset($_POST['userGroupSelect_save']) && $this->dialog instanceof userGroupSelect){
             if($this->acl_is_writeable("sudoUser")){
                 foreach($this->dialog->save() as $entry){
-                    if(in_array("posixGroup",$entry['objectClass'])){
+                    if(in_array_strict("posixGroup",$entry['objectClass'])){
                         $name = trim("%".$entry['cn'][0]);
                     }elseif(isset($entry['uid'][0])){
                         $name = trim($entry['uid'][0]);
                     }
-                    if(!in_array($name,$this->sudoUser) && !in_array("!".$name,$this->sudoUser)){
+                    if(!in_array_strict($name,$this->sudoUser) && !in_array_strict("!".$name,$this->sudoUser)){
                         $this->sudoUser[] = $name;
                     }
                 }   
@@ -209,7 +209,7 @@ class sudo extends plugin
             if($this->acl_is_writeable("sudoHost")){
                 foreach($this->dialog->save() as $entry){
                     $cn = trim($entry['cn'][0]);
-                    if(!in_array($cn,$this->sudoHost) && !in_array("!".$cn,$this->sudoHost)){
+                    if(!in_array_strict($cn,$this->sudoHost) && !in_array_strict("!".$cn,$this->sudoHost)){
                         $this->sudoHost[] = $cn;
                     }
                 }   
index a9a33c1e4540ada30d6afd79e9fe50e33142caea..e33e2f74876c5f3cf3d1f0b13b5e3b7252515ba6 100644 (file)
@@ -166,7 +166,7 @@ class sudoOption extends plugin
                     Some attributes like (BOOL_INTEGER) can be TRUE/FALSE and INTEGER.
                     This means, if the value is empty it is BOOL and $negation defines its boolean value.
                  */
-                if(in_array($this->options[$opt]['TYPE'],array("BOOL_INTEGER","STRING_BOOL"))){
+                if(in_array_strict($this->options[$opt]['TYPE'],array("BOOL_INTEGER","STRING_BOOL"))){
                     if(empty($value)){
                         $option['NEGATE'] = FALSE;
                         if($negation){
@@ -178,7 +178,7 @@ class sudoOption extends plugin
                 }
 
                 /* Special handling for BOOLEAN values */
-                if(in_array($this->options[$opt]['TYPE'],array("BOOLEAN"))){
+                if(in_array_strict($this->options[$opt]['TYPE'],array("BOOLEAN"))){
                     $option['NEGATE'] = FALSE;
                     if($negation){
                         $option['VALUE'] = "FALSE";
@@ -223,8 +223,8 @@ class sudoOption extends plugin
                         /*****
                           Negate STRING_BOOL && BOOL_INTEGER
                          *****/
-                        if(in_array($this->options[$opt]['TYPE'],array('STRING_BOOL','BOOL_INTEGER'))){
-                            if(in_array($val, array("TRUE","FALSE"))){
+                        if(in_array_strict($this->options[$opt]['TYPE'],array('STRING_BOOL','BOOL_INTEGER'))){
+                            if(in_array_strict($val, array("TRUE","FALSE"))){
                                 if($val == "TRUE"){
                                     $this->sudoOption[$opt][$id]["VALUE"] = "FALSE";
                                 }else{
@@ -238,14 +238,14 @@ class sudoOption extends plugin
                         /*****
                           Negate STRING / INTEGER
                          *****/
-                        if(in_array($this->options[$opt]['TYPE'],array('STRING','INTEGER','LISTS'))){
+                        if(in_array_strict($this->options[$opt]['TYPE'],array('STRING','INTEGER','LISTS'))){
                             $this->sudoOption[$opt][$id]['NEGATE'] = !$this->sudoOption[$opt][$id]['NEGATE']; 
                         }
 
                         /*****
                           Negate BOOLEAN
                          *****/
-                        if(in_array($this->options[$opt]['TYPE'],array('BOOLEAN'))){
+                        if(in_array_strict($this->options[$opt]['TYPE'],array('BOOLEAN'))){
                             if($val == "TRUE"){
                                 $this->sudoOption[$opt][$id]["VALUE"] = "FALSE";
                             }else{
@@ -337,7 +337,7 @@ class sudoOption extends plugin
                     /****
                       Get posted value for BOOLEAN
                      ****/
-                    if(in_array($this->options[$name]['TYPE'],array("BOOLEAN"))){
+                    if(in_array_strict($this->options[$name]['TYPE'],array("BOOLEAN"))){
                         if(isset($_POST['option_value__'.$name.'_'.$id])){
                             $this->sudoOption[$name][$id]["VALUE"] = get_post('option_value__'.$name.'_'.$id);
                         }
@@ -346,7 +346,7 @@ class sudoOption extends plugin
                     /****
                       Get posted value for STRING / INTEGER
                      ****/
-                    if(in_array($this->options[$name]['TYPE'],array("STRING","INTEGER"))){
+                    if(in_array_strict($this->options[$name]['TYPE'],array("STRING","INTEGER"))){
                         if(isset($_POST['option_value__'.$name.'_'.$id])){
                             $this->sudoOption[$name][$id]["VALUE"] = get_post('option_value__'.$name.'_'.$id);
                         }
@@ -355,7 +355,7 @@ class sudoOption extends plugin
                     /****
                       Get posted value for STRING_BOOL / BOOL_INTEGER
                      ****/
-                    if(in_array($this->options[$name]['TYPE'],array("BOOL_INTEGER","STRING_BOOL"))){
+                    if(in_array_strict($this->options[$name]['TYPE'],array("BOOL_INTEGER","STRING_BOOL"))){
                         if(isset($_POST['option_selection__'.$name.'_'.$id])){
                             $sel = get_post('option_selection__'.$name.'_'.$id);
                             $val = "";
@@ -375,7 +375,7 @@ class sudoOption extends plugin
                     /****
                       Get posted value for LISTS
                      ****/
-                    if(in_array($this->options[$name]['TYPE'],array("LISTS"))){
+                    if(in_array_strict($this->options[$name]['TYPE'],array("LISTS"))){
                         foreach($this->sudoOption[$name] as $entry_key => $entry){
                             if(isset($_POST['list_value__'.$name.'_'.$entry_key])){
                                 $val = get_post('list_value__'.$name.'_'.$entry_key);
@@ -424,7 +424,7 @@ class sudoOption extends plugin
                 /****
                   Save BOOLEAN
                  ****/
-                if(in_array($type,array("BOOLEAN"))){ 
+                if(in_array_strict($type,array("BOOLEAN"))){ 
                     $option = $name;
                     if($value == "FALSE"){
                         $option = "!".$option;
@@ -434,7 +434,7 @@ class sudoOption extends plugin
                 /****
                   Save STRING / INTEGER
                  ****/
-                if(in_array($type,array("STRING","INTEGER"))){ 
+                if(in_array_strict($type,array("STRING","INTEGER"))){ 
                     if($value != ""){
                         $option = $name."=".$value;
                     }else{
@@ -448,7 +448,7 @@ class sudoOption extends plugin
                 /****
                   Save STRING_BOOL / BOOL_INTEGER
                  ****/
-                if(in_array($type,array("STRING_BOOL","BOOL_INTEGER"))){
+                if(in_array_strict($type,array("STRING_BOOL","BOOL_INTEGER"))){
                     if($value == "FALSE"){
                         $option = "!".$name;
                     }elseif($value == "TRUE"){
index c16558ed8755fca83d6536ce74bbebe78d90c424..a086d8cdb71b312144fcb1509a3a500493695c53 100644 (file)
@@ -18,49 +18,49 @@ class filterSYSTEMS {
                 preg_match("/".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN"),'/')."/i", $entry['dn'])){
 
                 // Detect incoming types
-                if(in_array('gotoWorkstation', $entry['objectClass'])){
+                if(in_array_strict('gotoWorkstation', $entry['objectClass'])){
                     $entries[$key]['objectClass'][] = 'FAKE_OC_NewWorkstation';
                     $entries[$key]['cn'][0].= " <i>("._("New workstation").")</i>";
-                }elseif(in_array('gotoTerminal', $entry['objectClass'])){
+                }elseif(in_array_strict('gotoTerminal', $entry['objectClass'])){
                     $entries[$key]['objectClass'][] = 'FAKE_OC_NewTerminal';
                     $entries[$key]['cn'][0].= " <i>("._("New terminal").")</i>";
                 }elseif($arp_handling_active && 
-                        in_array('GOhard', $entry['objectClass']) && 
+                        in_array_strict('GOhard', $entry['objectClass']) && 
                         !isset($entry['gotoMode'][0])){ 
                     $entries[$key]['objectClass'][] = 'FAKE_OC_ArpNewDevice';
                     $entries[$key]['cn'][0].= " <i>("._("New unknown device").")</i>";
-                }elseif(in_array('GOhard', $entry['objectClass'])){
+                }elseif(in_array_strict('GOhard', $entry['objectClass'])){
                     $entries[$key]['objectClass'][] = 'FAKE_OC_NewDevice';
                     $entries[$key]['cn'][0].= " <i>("._("New device").")</i>";
                 }
 
                 // Detect SAMBA machines
-            }elseif(in_array('sambaSamAccount', $entry['objectClass']) && preg_match("/\$$/", $entry['cn'][0])){
+            }elseif(in_array_strict('sambaSamAccount', $entry['objectClass']) && preg_match("/\$$/", $entry['cn'][0])){
                 $entries[$key]['objectClass'][] = 'FAKE_OC_winstation';
 
                 // Detect Workstation & templates
-            }elseif(in_array('gotoWorkstation', $entry['objectClass'])){
+            }elseif(in_array_strict('gotoWorkstation', $entry['objectClass'])){
                 $pwd_acl = $ui->get_permissions($entry['dn'],'workstation/workgeneric','userPassword');
                 if(preg_match("/w/",$pwd_acl)){
                     $entries[$key]['objectClass'][] = 'FAKE_OC_PWD_changeAble';
                 }
 
                 // Detect Terminal & templates
-            }elseif(in_array('gotoTerminal', $entry['objectClass'])){
+            }elseif(in_array_strict('gotoTerminal', $entry['objectClass'])){
                 $pwd_acl = $ui->get_permissions($entry['dn'],'terminal/termgeneric','userPassword');
                 if(preg_match("/w/",$pwd_acl)){
                     $entries[$key]['objectClass'][] = 'FAKE_OC_PWD_changeAble';
                 }
 
                 // Detect Server & templates
-            }elseif(in_array('goServer', $entry['objectClass'])){
+            }elseif(in_array_strict('goServer', $entry['objectClass'])){
                 $pwd_acl = $ui->get_permissions($entry['dn'],'server/servgeneric','userPassword');
                 if(preg_match("/w/",$pwd_acl)){
                     $entries[$key]['objectClass'][] = 'FAKE_OC_PWD_changeAble';
                 }
 
                 // Detect ieee802Device
-            }elseif(in_array('ieee802Device', $entry['objectClass'])){
+            }elseif(in_array_strict('ieee802Device', $entry['objectClass'])){
                 $pwd_acl = $ui->get_permissions($entry['dn'],'component/componentGeneric','userPassword');
                 if(preg_match("/w/",$pwd_acl)){
                     $entries[$key]['objectClass'][] = 'FAKE_OC_PWD_changeAble';
@@ -70,7 +70,7 @@ class filterSYSTEMS {
             // Detect object states
             $state = 'none';
             foreach(array('gotoWorkstation','gotoTerminal','goServer') as $type){
-                if(in_array($type, $entry['objectClass'])){
+                if(in_array_strict($type, $entry['objectClass'])){
 
                     if(isset($entry['FAIstate'][0])){
                         switch (preg_replace('/:.*$/', '', $entry['FAIstate'][0])) {
index a56fbe7f98455e70bfd5df1dc7332c5148616192..39835f2275e1d0819fc96b759934d2b43b9d3444 100644 (file)
@@ -165,7 +165,7 @@ class systemManagement extends management
             $entry = $headpage->getEntry($dn);
             $ui       = get_userinfo();
             $smarty = get_smarty();
-            if(in_array("FAKE_OC_PWD_changeAble", $entry['objectClass'])){
+            if(in_array_strict("FAKE_OC_PWD_changeAble", $entry['objectClass'])){
                 $acl = $tDefs[$type]['aclCategory'].'/'.$tDefs[$type]['aclClass'];
                 $tabacl   = $ui->get_permissions($dn,$acl,"userPassword");
                 if(preg_match("/w/",$tabacl)){
@@ -268,7 +268,7 @@ class systemManagement extends management
         $ui       = get_userinfo();
         $smarty = get_smarty();
 
-        if(!in_array('FAKE_OC_PWD_changeAble', $entry['objectClass'])){
+        if(!in_array_strict('FAKE_OC_PWD_changeAble', $entry['objectClass'])){
             trigger_error("Tried to change pwd, for invalid object!");
         }elseif (get_post('new_password') != get_post('repeated_password')){
             msg_dialog::display(_("Error"), 
@@ -292,7 +292,7 @@ class systemManagement extends management
 
                     /* Remove password attribute
                      */
-                    if(in_array("simpleSecurityObject",$old_attrs['objectClass'])){
+                    if(in_array_strict("simpleSecurityObject",$old_attrs['objectClass'])){
                         $attrs['objectClass'] = array();
                         for($i = 0 ; $i < $old_attrs['objectClass']['count'] ; $i ++){
                             if(!preg_match("/simpleSecurityObject/i",$old_attrs['objectClass'][$i])){
@@ -305,7 +305,7 @@ class systemManagement extends management
 
                     /* Add/modify password attribute
                      */
-                    if(!in_array("simpleSecurityObject",$old_attrs['objectClass'])){
+                    if(!in_array_strict("simpleSecurityObject",$old_attrs['objectClass'])){
                         $attrs['objectClass'] = array();
                         for($i = 0 ; $i < $old_attrs['objectClass']['count'] ; $i ++){
                             $attrs['objectClass'][] = $old_attrs['objectClass'][$i];
@@ -490,13 +490,13 @@ class systemManagement extends management
             /* Skip installation or update trigerred events,
              *  if this entry is currently processing.
              */
-            if($triggered && in_array($event,array("DaemonEvent_reinstall","DaemonEvent_update"))){
+            if($triggered && in_array_strict($event,array("DaemonEvent_reinstall","DaemonEvent_update"))){
                 foreach($mac as $key => $mac_address){
                     foreach($o_queue->get_entries_by_mac(array($mac_address)) as $entry){
                         $entry['STATUS'] = strtoupper($entry['STATUS']);
                         if($entry['STATUS'] == "PROCESSING" &&
                                 isset($events['QUEUED'][$entry['HEADERTAG']]) &&
-                                in_array($events['QUEUED'][$entry['HEADERTAG']],array("DaemonEvent_reinstall","DaemonEvent_update"))){
+                                in_array_strict($events['QUEUED'][$entry['HEADERTAG']],array("DaemonEvent_reinstall","DaemonEvent_update"))){
                             unset($mac[$key]);
 
                             new log("security","systems/".get_class($this),"",array(),"Skip adding 'DaemonEvent::".$type."' for mac '".$mac_address."', there is already a job in progress.");
@@ -1075,7 +1075,7 @@ class systemManagement extends management
                 $ocs = $attrs['objectClass'];
                 unset($ocs['count']);
                 $new_attrs = array();
-                if(!in_array("FAIobject",$ocs)){
+                if(!in_array_strict("FAIobject",$ocs)){
                     $ocs[] = "FAIobject";
                     $new_attrs['objectClass'] = $ocs;
                 }
index 2f8f55fc0a353d96b7ed00faf139d8aa3de0e6e4..b4db0038b2e3f99823d75b2e638ef026a603e9d3 100644 (file)
@@ -636,12 +636,12 @@ class termDNS extends plugin
         /* Check if mac and ip are already used */
         if(!empty($this->ipHostNumber) && $this->DNS_is_account && 
                 $this->ipHostNumber != $this->orig_ipHostNumber && 
-                in_array("ip:".$this->ipHostNumber,$this->used_ip_mac)){
+                in_array_strict("ip:".$this->ipHostNumber,$this->used_ip_mac)){
             $message[]= msgPool::duplicated(_("IP address"));
         }
         if(!empty($this->macAddress) && $this->dhcp_is_Account && 
                 $this->macAddress != $this->orig_macAddress && 
-                in_array("mac:".$this->macAddress,$this->used_ip_mac)){
+                in_array_strict("mac:".$this->macAddress,$this->used_ip_mac)){
             $message[]= msgPool::duplicated(_("MAC address"));
         }
 
@@ -1174,7 +1174,7 @@ class termDNS extends plugin
             }
 
             // Search the next free and valid ip.
-            while(in_array(implode(".",$ip_data),$list) || $ip_data[3] <= 1){
+            while(in_array_strict(implode(".",$ip_data),$list) || $ip_data[3] <= 1){
                 $ip_data[3] ++ ;
                 if($ip_data[3] > 255){
                     $ip_data[3] = 1 ;
index 2c64b981a3c4415e3ebda3c404a2c7c95c0a89a9..d4ae749931470857e6707cb065f359e441c61eea 100644 (file)
@@ -73,7 +73,7 @@ class servtabs extends 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,NULL,$this);
         $baseobject->enable_CSN_check();
index a14ab48abe884eae125239a5d9dc963152e0a8a6..b4f2007c9c7870814eba4c8c69b454e34d0b2647 100644 (file)
@@ -61,7 +61,7 @@ class webdavAccount extends plugin
       $smarty->assign('webdavAccountACL', $this->getacl("",$this->ReadOnly));
     }
 
-    $smarty->assign("use_webdav",in_array("webdav",$this->multi_boxes));
+    $smarty->assign("use_webdav",in_array_strict("webdav",$this->multi_boxes));
     $smarty->assign("multiple_support",$this->multiple_support_active);
     $display.= $smarty->fetch (get_template_path('webdav.tpl', TRUE, dirname(__FILE__)));
     return ($display);
@@ -204,7 +204,7 @@ class webdavAccount extends plugin
   function get_multi_edit_values()
   {
     $ret = plugin::get_multi_edit_values();
-    if(in_array("webdav",$this->multi_boxes)){
+    if(in_array_strict("webdav",$this->multi_boxes)){
       $ret['is_account'] = $this->is_account;
     }
     return($ret);
@@ -221,7 +221,7 @@ class webdavAccount extends plugin
   function init_multiple_support($attrs,$all)
   {
     plugin::init_multiple_support($attrs,$all);
-    if(isset($attrs['objectClass']) && in_array("gosaWebdavAccount",$attrs['objectClass'])){
+    if(isset($attrs['objectClass']) && in_array_strict("gosaWebdavAccount",$attrs['objectClass'])){
       $this->is_account = TRUE;
     }
   }