summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 25c6cde)
raw | patch | inline | side by side (parent: 25c6cde)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 Jul 2011 07:45:15 +0000 (07:45 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 Jul 2011 07:45:15 +0000 (07:45 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@20960 594d385d-05f5-0310-b6e9-bd551577e9d8
108 files changed:
diff --git a/gosa-plugins/connectivity/personal/connectivity/class_intranetAccount.inc b/gosa-plugins/connectivity/personal/connectivity/class_intranetAccount.inc
index 6d34d1a94f369895657ac157c154273842987b94..0bb9bfcc8d335ea2ec0ea25faa622e669d59a975 100644 (file)
$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);
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);
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;
}
}
diff --git a/gosa-plugins/dak/addons/dak/class_dakkeyring.inc b/gosa-plugins/dak/addons/dak/class_dakkeyring.inc
index 6b029f7ed5fcc8d3e52ec044b2f842a637fcb16f..9f8fbac57e5b5b3c1bc73a8c23cea507f62a2546 100644 (file)
$tmp = DAK::list_keys($this->Servers[$this->selected_Server]['MAC']);
$this->list = array();
foreach($tmp as $entry){
- if(isset($entry['ATTRIBUTES']['UID']) && in_array($entry['ATTRIBUTES']['UID'],$details)){
+ if(isset($entry['ATTRIBUTES']['UID']) && in_array_strict($entry['ATTRIBUTES']['UID'],$details)){
$entry['DETAILS'] = TRUE;
}
$this->list[] = $entry;
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpAdvanced.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpAdvanced.inc
index 1f40f9a6e3d2c28c0a856a10c212fc53c22e6ecf..28ebd68a79cd722ddfafcbe7107b2c08601c34ae 100644 (file)
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);
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);
/* 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")."]";
}
/* 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")."]";
}
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc
index fe9b8f33f63d7adfc5318399c2797f42aa375420..39708a571b848ca680cd6f0bf5622f27e641016b 100644 (file)
} 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));
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPool.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpPool.inc
index 96870e7c583d3bb4c0e301c4590b7fb267813af1..bdeb94e578b41d80f27cb618018cdb5029245084 100644 (file)
"dhcpGroup", "dhcpPool", "dhcpSubnet", "dhcpSharedNetwork");
foreach ($cache[$dn]['objectClass'] as $oc){
- if (in_array($oc, $types)){
+ if (in_array_strict($oc, $types)){
$type= $oc;
break;
}
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc
index b57cd44f1f862e42fbb4d5d9236e56ad06c381ab..0d31a3e61f9441c68ffa5d6159963225de3b96fb 100644 (file)
"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,"");
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc
index d6614fd2f758ffe5045e71ecf545829448405832..c818ac2541938a019866d6add8f296c83e859b09 100644 (file)
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;
}
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;
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);
}
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."\"";
}
}
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;
}
foreach ($this->types as $key => $val){
- if (in_array("$key", $attrs['objectClass'])){
+ if (in_array_strict("$key", $attrs['objectClass'])){
$type= $val;
break;
}
"dhcpGroup", "dhcpPool", "dhcpSubnet", "dhcpSharedNetwork", "dhcpTSigKey", "dhcpDnsZone");
foreach ($this->dhcpObjectCache[$dn]['objectClass'] as $oc){
- if (in_array($oc, $types)){
+ if (in_array_strict($oc, $types)){
$type= $oc;
break;
}
diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_DNS.inc b/gosa-plugins/dns/admin/systems/services/dns/class_DNS.inc
index ec5ce83c8d2ec963c6d31ad3a5815d534f0b4237..61e492c9ab8f4377cba91b5aa7c1e5ed11a44810 100644 (file)
/* Skip some attributes
*/
- if(in_array($name,$SkipRecords)) continue;
+ if(in_array_strict($name,$SkipRecords)) continue;
/* If there is a record attribute
*/
* 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;
}
}
/* 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] = "";
}
diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc
index b1a2f38b63a6ebe2a2fda82a364c1219442148ed..057c3556d85f924472cb69ff4e78d200c2a3b629 100644 (file)
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;
}
}
diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc
index 674ad057f05c912538576030ea35caabe9e05b5b..201a61ee0b6f675294f2d5f0e5b0bcd2d9819904 100644 (file)
/* 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;
}
/* 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{
diff --git a/gosa-plugins/fai/admin/fai/classSelect/class_classSelect.inc b/gosa-plugins/fai/admin/fai/classSelect/class_classSelect.inc
index 99b40f4e5f46ddabfc903628ef9631fd826c424a..6a43e018ad9d66d777381b25c528a285af8c3412 100644 (file)
$str = "";
foreach($objTypes as $class => $img){
- if(in_array($class, $classes)){
+ if(in_array_strict($class, $classes)){
$str .= $img;
}else{
$str .= "<img src='images/empty.png'> ";
diff --git a/gosa-plugins/fai/admin/fai/classSelect/class_filterFAIClass.inc b/gosa-plugins/fai/admin/fai/classSelect/class_filterFAIClass.inc
index db3ea8c5e0e879016a46e222d8c781f249d9f30f..76d30ef3f3962b108e48838f1dc6376d6c46b389 100644 (file)
/* Only use objects which have cn set */
if(isset($attrs['cn'][0]) && preg_match("/".preg_quote($filter,'/')."/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 ;
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 37a06c14fd4dcb5d9308ba3c1a523ba2431166de..b71b6499eb03eccaa3e1287aec5720accfaad4a2 100644 (file)
}
/* 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){
$ou = $attrs['ou'][0];
}
- if((in_array("FAIbranch",$attrs['objectClass'])) || ($ou == "fai")){
+ if((in_array_strict("FAIbranch",$attrs['objectClass'])) || ($ou == "fai")){
return($attrs['dn']);
}
}
/* 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);
*/
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)){
}
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;
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);
}
}
diff --git a/gosa-plugins/fai/admin/fai/class_askClassName.inc b/gosa-plugins/fai/admin/fai/class_askClassName.inc
index 945c0d54f4a3dd7c23e43592494a3c756580b7c3..ee5e1284ea61ca6dfc9cc1547a76ec4b50237ee3 100644 (file)
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;
}
}
/* 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];
}
$message[]= msgPool::required(_("Name"));
}
- if(in_array($this->ClassName,$this->forbidden)){
+ if(in_array_strict($this->ClassName,$this->forbidden)){
$message[]= msgPool::duplicated(_("Name"));
}
diff --git a/gosa-plugins/fai/admin/fai/class_debconfTemplate.inc b/gosa-plugins/fai/admin/fai/class_debconfTemplate.inc
index 6791eaf12dbebedda38e8d8e40413fb9365f9415..581bf371a254a1237bb4dc1f28625cdaa350f041 100644 (file)
$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='".htmlentities($value)."' checked>".$value."<br>";
}else{
$result.="\n<input name='".$post_name."-multi-".$value."' type='checkbox' value='".htmlentities($value)."'>".$value."<br>";
diff --git a/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc b/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc
index d0c041fd6ac6e4db8e6c57b4442c0d7f1b8e1482..2203daf5f42a2abf098441350f8ad0b18a3aa1f1 100644 (file)
// 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;
}
}
$used[$key] = $part['FAIpartitionNr'];
}
$id = 1;
- while(in_array($id,$used) && $id < 16 ){
+ while(in_array_strict($id,$used) && $id < 16 ){
$id++;
}
return($id);
diff --git a/gosa-plugins/fai/admin/fai/class_faiGroupHandle.inc b/gosa-plugins/fai/admin/fai/class_faiGroupHandle.inc
index eb31295ad968ea011760147a6dde4dedeccd5daf..e959387339b7a34ad95ac449e0290a8b49ea1b24 100644 (file)
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."'.");
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;
diff --git a/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc b/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc
index fc909132eb3d763eb4b8715978ea89ba03f69ae8..e75e247daa2f8474df4af9a0f41bbce59e63800e 100644 (file)
$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]);
}
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc
index 0190af614fe5814d104343e9a69ae710d00190df..01568431ae66e4a6659f7f2358250628625acaad 100644 (file)
$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);
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);
$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);
}
$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");
}
}
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());
$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);
$icon_list = "";
foreach($objects as $type => $type_data){
- if(in_array($type, $classes)){
+ if(in_array_strict($type, $classes)){
$icon_list .= "<input type='image' src='".$type_data['IMG']."' title='".$type_data['NAME']."'
alt='".$type_data['KZL']."' class='center' name='edit_".$row."_".$type."'>\n";
}else{
$headpage = $this->getHeadpage();
$entry = $headpage->entries[$id];
- if(in_array('FAKE_OC_FAI', $entry['objectClass'])){
+ if(in_array_strict('FAKE_OC_FAI', $entry['objectClass'])){
if(isset($headpage->entries[$id]['GROUPS'][$tab])){
$data =$headpage->entries[$id]['GROUPS'][$tab];
$type = $this->get_type($data);
diff --git a/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/gosa-plugins/fai/admin/fai/class_faiPackage.inc
index d32f26a64d41e27de24dc2c150bd47363a5deaee..9eca4708d0fa31566980f7c06ca40a96961df098 100644 (file)
$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();
/* 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.");
$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();
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartition.inc b/gosa-plugins/fai/admin/fai/class_faiPartition.inc
index 9d83e2bb510af0e90310d3aad58bc938d2dde1ee..17a4ea79fcc55cd58c436df984a8a0b734a732ea 100644 (file)
// 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;
}
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
index 3b902c00ff74fe364e55f4354eb031ca188c21bf..9ed849507a86cef41340c67ce77f003287dfcf89 100644 (file)
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']);
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc
index a5adc2f1c65b6dbe3df9c1e0176be5ebb4387a8c..be131cd9134d4f7ff474ec1956c1fd6579d564eb 100644 (file)
$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"));
}
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));
}
}
}
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);
}
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiProfile.inc b/gosa-plugins/fai/admin/fai/class_faiProfile.inc
index db587ac06f055f69019b88dab17e8760664771e2..3259e88f9af2b685eea2cfaa4d83f5d8f1e7ae6e 100644 (file)
/* 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;
diff --git a/gosa-plugins/fai/admin/fai/class_faiProfileEntry.inc b/gosa-plugins/fai/admin/fai/class_faiProfileEntry.inc
index 652b36052540a3590076686481e3a7fa2372c9d1..632bcd7fc8c5b8b2728767a50d4153206db86a45 100644 (file)
$attrs = $ldap->fetch();
/* Only use objects which have cn set */
- if((isset($attrs['cn'][0]))&&(!in_array($attrs['cn'][0],$used))){
+ if((isset($attrs['cn'][0]))&&(!in_array_strict($attrs['cn'][0],$used))){
foreach($categories as $cat => $acl){
- if(in_array($cat,$attrs['objectClass'])){
+ if(in_array_strict($cat,$attrs['objectClass'])){
$acl = $this->ui->get_permissions($attrs['dn'],"fai/".$acl);
diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc
index dc8359d929496a39098201dc74fc53dd58cdebf7..0fe10bee0492b64295ebe6c4d9915160157e2859 100644 (file)
}
/* 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";
diff --git a/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc b/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc
index 5887e932ec98863ab9913bd23d8f32cfc23086ae..78899bbd789e88f11dee0f39b1cd6d77ca9fc24d 100644 (file)
$str .= "<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();
}
/* 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." ".$data['cn'][0];
}
/* 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;'>";
}
/* 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." ".$data['name'];
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;
diff --git a/gosa-plugins/fai/admin/fai/class_filterFAI.inc b/gosa-plugins/fai/admin/fai/class_filterFAI.inc
index be378932114be091126c6e0cc11539265b2ec1a2..7a05f68d174f0641c4c5194ddc02f6faa63f0fd3 100644 (file)
$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']);
diff --git a/gosa-plugins/fai/admin/fai/packageSelect/class_filterFAIPackages.inc b/gosa-plugins/fai/admin/fai/packageSelect/class_filterFAIPackages.inc
index 74545febffa3d9537640eb08714bc6d63ba1cba3..2bea3659c8dc46181525f0577b206d008eb0c34f 100644 (file)
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]);
}
}
}
diff --git a/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiAccount.inc b/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiAccount.inc
index 398d9a5c865ef191b81723aa545d08b1132d3d0d..facc2e6f60c44a4c10fadce81eb978a04377a8e7 100644 (file)
*/
if((isset($_POST['add_type']))&&(!empty($_POST['type_string'])) && $this->acl_is_writeable("type")){
$attr = $this->handle->getSystemTypes();
- if(in_array(trim($_POST['type_string']),$attr)){
+ if(in_array_strict(trim($_POST['type_string']),$attr)){
print_red(_("Adding new sytem type failed, this system type name is already used.")) ;
}else{
$this->handle->addSystemType(trim($_POST['type_string']));
*/
if(isset($_POST['Rename_type_OK'])){
$attr = $this->handle->getSystemTypes();
- if(in_array(trim($_POST['string']),$attr)){
+ if(in_array_strict(trim($_POST['string']),$attr)){
print_red(_("Rename failed, this system type name is already used.")) ;
}else{
$this->renameTypeDialog = false;
*/
if((isset($_POST['add_os']))&&(!empty($_POST['is_string'])) && $this->acl_is_writeable("os")){
$attr = $this->handle->getOSTypes();
- if(in_array(trim($_POST['is_string']),$attr)){
+ if(in_array_strict(trim($_POST['is_string']),$attr)){
print_red(_("Adding new operating system failed, specifed name is already used.")) ;
}else{
$this->handle->addOS(trim($_POST['is_string']));
*/
if(isset($_POST['Rename_os_OK']) && $this->acl_is_writeable("os")){
$attr = $this->handle->getOSTypes();
- if(in_array(trim($_POST['string']),$attr)){
+ if(in_array_strict(trim($_POST['string']),$attr)){
print_red(_("Updating operating system failed, specifed name is already used.")) ;
}else{
$this->handle->updateOS($_POST['string'],$this->select_type);
$id = base64_decode($_GET['id']);
/* Check if user is already created in glpi database */
- if(!in_array($id,$users)){
+ if(!in_array_strict($id,$users)){
/* If this user doesn't exists in glpi db, we must create him */
$ldap->cat($id, array('cn', 'mail', 'telephoneNumber'));
$atts =$this->handle->getAttachments();
$ret = array();
foreach($atts as $entry){
- if(in_array($entry['ID'],$this->usedAttachments)){
+ if(in_array_strict($entry['ID'],$this->usedAttachments)){
if($divlist){
$ret[$entry['ID']] = $entry;
}else{
diff --git a/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiAttachmentPool.inc b/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiAttachmentPool.inc
index 9d5570f2b5bdf71c183235a85403c963de2f5b24..489ea8b4c9d9ac7a402435d751d212617f54f9d9 100644 (file)
$chkbox = "<input type='hidden' name='wasOnPage_%s'>".
"<input type='checkbox' name='useMe_%s' value='%s' %CHECKED%>";
- if(in_array($entry['ID'],$this->Selected)){
+ if(in_array_strict($entry['ID'],$this->Selected)){
$chkbox = preg_replace("/%CHECKED%/"," checked ",$chkbox);
}else {
$chkbox = preg_replace("/%CHECKED%/"," ",$chkbox);
diff --git a/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiDeviceManagement.inc b/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiDeviceManagement.inc
index 699d598dbed429fa774bc0102f0d12b8ad44ee93..a5153c05f64bb0847e9986011b7bae7a2f5f3ad1 100644 (file)
/* Check if type is allowed, and create empty entry */
$tmp = array();
- if((!isset($this->DeviceAttrs[$deviceType]))||((!in_array($deviceType,$this->AllowedDevices)))){
+ if((!isset($this->DeviceAttrs[$deviceType]))||((!in_array_strict($deviceType,$this->AllowedDevices)))){
print_red(sprintf(_("Internal Error can't create device of type '%s'"),$deviceType));
}else{
foreach($this->DeviceAttrs[$deviceType] as $attr){
diff --git a/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiManufacturer.inc b/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiManufacturer.inc
index 3afa261c03a695b232107c57d312b47a1add7faf..19e359b7dd65b1d3fa9c9de5cec6c127b8104372 100644 (file)
$attr = $this->parent->handle->getEnterprises();
if($this->ID == -1 ){
- if(in_array($tmp['name'],$attr)){
+ if(in_array_strict($tmp['name'],$attr)){
$allok = false;
print_red(_("Specified name is already in use, please choose another one."));
}
}else{
unset($attr[$this->ID]);
- if(in_array($tmp['name'],$attr)){
+ if(in_array_strict($tmp['name'],$attr)){
$allok = false;
print_red(_("Specified name is already in use, please choose another one."));
}
diff --git a/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiPrinterAccount.inc b/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiPrinterAccount.inc
index 5e2779ace36bbd9c78aa7b653d7d45fd982482ca..42b208efff970f7dcf28cb17198df504f34e4d14 100644 (file)
$id = base64_decode($_GET['id']);
/* Check if user is already created in glpi database */
- if(!in_array($id,$users)){
+ if(!in_array_strict($id,$users)){
/* If this user doesn't exists in glpi db, we must create him */
$ldap->cat($id, array('cn', 'mail', 'telephoneNumber'));
$atts =$this->handle->getAttachments();
$ret = array();
foreach($atts as $entry){
- if(in_array($entry['ID'],$this->usedAttachments)){
+ if(in_array_strict($entry['ID'],$this->usedAttachments)){
if($divlist){
$ret[$entry['ID']] = $entry;
}else{
diff --git a/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiPrinterCartridgesEdit.inc b/gosa-plugins/glpi/admin/systems/services/glpi/class_glpiPrinterCartridgesEdit.inc
index 765f2e96f511749d459519a4989bba6539a2412e..b5683feda11da2a04c979a2a55e9c093202b42a1 100644 (file)
$id = base64_decode($_GET['id']);
/* Check if user is already created in glpi database */
- if(!in_array($id,$users)){
+ if(!in_array_strict($id,$users)){
/* If this user doesn't exists in glpi db, we must create him */
$ldap->cat($id, array('cn', 'mail', 'telephoneNumber'));
diff --git a/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc b/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc
index 35ce992f681f52ddfc5254537a5362d7eb20265c..e6d3272c77192ae3ff6803b724fdc33a24084ade 100644 (file)
$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];
$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 = $_POST[$attr];
/* Add number */
function addNumber($number)
{
- if (!in_array($number, $this->goFaxBlocklist)){
+ if (!in_array_strict($number, $this->goFaxBlocklist)){
$this->goFaxBlocklist[]= $number;
sort($this->goFaxBlocklist);
}
{
$tmp= array();
foreach ($this->goFaxBlocklist as $val){
- if (!in_array($val, $numbers)){
+ if (!in_array_strict($val, $numbers)){
$tmp[]= $val;
}
}
$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];
diff --git a/gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc b/gosa-plugins/gofax/gofax/faxaccount/class_gofaxAccount.inc
index d3aa616399257cc8df8baf4de2ec7244a7c72fdf..6e71b1ae2ef26b519fb0e04e53ee314eab1c76bc 100644 (file)
}
/* Set up has_mailAccount */
- if (in_array("gosaMailAccount", $this->attrs['objectClass'])){
+ if (in_array_strict("gosaMailAccount", $this->attrs['objectClass'])){
$this->has_mailAccount= TRUE;
}
}
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;
}
}
}
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);
foreach (array("goFaxRBlocklist", "goFaxRBlockgroups", "goFaxSBlocklist",
"goFaxSBlockgroups", "facsimileAlternateTelephoneNumber") as $val){
- if (in_array($val, $skip)){
+ if (in_array_strict($val, $skip)){
continue;
}
}
$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){
} 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= $_POST['mail'];
}
}
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;
}
diff --git a/gosa-plugins/gofon/admin/ogroups/gofon/class_phonequeue.inc b/gosa-plugins/gofon/admin/ogroups/gofon/class_phonequeue.inc
index d72eb47ccbb30135dce2c4e82fe455f05607c11f..b6b79411f3e3a48021012ea9c43302c716b5f532 100644 (file)
/* 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[]=$_POST['phonenumber'];
}
}
$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,
diff --git a/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc b/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc
index 8ae2117006f45451f0d97a400af985b5e1fee152..33afe4dbedd1543f9badfa253daf1db45e3e30d7 100644 (file)
/* deativate all fields that are not used by the specified type */
foreach($this->attributes as $att){
- if((!in_array($att,$this->usedattrs[$this->selected_categorie]))){
+ if((!in_array_strict($att,$this->usedattrs[$this->selected_categorie]))){
$smarty->assign($att."USED", "disabled" );
$smarty->assign($att, "");
}else{
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();
}
}
diff --git a/gosa-plugins/gofon/admin/systems/services/gofon/class_goFonServer.inc b/gosa-plugins/gofon/admin/systems/services/gofon/class_goFonServer.inc
index bfdb7b6464b7eba2cac23b97c91b7fac3a98c23f..54bb989857edee2c9d5b09b16e9eee1435e519ef 100644 (file)
/* 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']);
diff --git a/gosa-plugins/gofon/gofon/macro/class_gofonMacroParameters.inc b/gosa-plugins/gofon/gofon/macro/class_gofonMacroParameters.inc
index a8c1f73bc935e5793ec52865fd8ab1b6e978f16b..5e7f9d2185ed3ebc7d6cf8ab7a06f581df0a6767 100644 (file)
}
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' :
diff --git a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc
index d8250055f9c101f11393ae9994e3fc93635097e8..703fba380c34f3a62812e88314cfc9e5c171cd8c 100644 (file)
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("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);
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;
$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]);
{
$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[]=(_("Voicemail 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[]=(_("Voicemail 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']);
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;
diff --git a/gosa-plugins/goto/addons/goto/class_filterGotoEvents.inc b/gosa-plugins/goto/addons/goto/class_filterGotoEvents.inc
index 0aef2fe9392ac660df882973e75e0825d425fc27..950b70f0d885778f4f9261731eedbb66d5be0dd6 100644 (file)
/* 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";
/* 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";
}
/* 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";
}
# /* 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;
diff --git a/gosa-plugins/goto/addons/goto/class_gotoLogView.inc b/gosa-plugins/goto/addons/goto/class_gotoLogView.inc
index a5e166ff2dcd61663e69b432a26046c0cd6ffc32..e7b0bb1e8ac3833baae7723530e457f84b7179af 100644 (file)
$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;
}
diff --git a/gosa-plugins/goto/addons/goto/class_goto_import_file.inc b/gosa-plugins/goto/addons/goto/class_goto_import_file.inc
index 7c328d788d6614b450c090fca57451076a5c8bac..d4aaca249699d020a28b7a6b2768a0164e116bb6 100644 (file)
$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>";
}
}
diff --git a/gosa-plugins/goto/addons/goto/class_gotomasses.inc b/gosa-plugins/goto/addons/goto/class_gotomasses.inc
index 9eb5c51b72d7c84f1af915212edc92fc16de1442..6c338fa731dc2ce134f2718e853a1d22077af8ad 100644 (file)
}
/* 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;
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'];
}
}
diff --git a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc
index 15185ee73be555b859e8c75d7e6a0df692562244..5dc1d254d956f6c082a76d3cc77fe95bc5699a87 100644 (file)
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;
}
}
diff --git a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_notify.inc b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent_notify.inc
index 3765b2f1bf6b1d5a0f2fed715aead4a8993b2291..f7119941d271e33fc70364d7710558f575318f5d 100644 (file)
$add = array($add);
}
foreach($add as $target){
- if(!in_array($target,$this->user)){
+ if(!in_array_strict($target,$this->user)){
$this->user[] = $target;
}
}
$add = array($add);
}
foreach($add as $target){
- if(!in_array($target,$this->group)){
+ if(!in_array_strict($target,$this->group)){
$this->group[] = $target;
}
}
diff --git a/gosa-plugins/goto/addons/goto/events/class_EventAddSystemDialog.inc b/gosa-plugins/goto/addons/goto/events/class_EventAddSystemDialog.inc
index c84f6f7bdad6a10fe7330b9db75d509d564e2b3d..2d885a64ab73ebe5f40228db913fadb8db880e2a 100644 (file)
if(isset($entry['macAddress'][0])){
$macs[] = $entry['macAddress'][0];
}
- if(in_array("gosaGroupOfNames", $entry['objectClass'])){
+ if(in_array_strict("gosaGroupOfNames", $entry['objectClass'])){
$ldap->cat($entry['dn']);
if($ldap->count()){
$attrs = $ldap->fetch();
diff --git a/gosa-plugins/goto/addons/goto/events/class_EventAddUserDialog.inc b/gosa-plugins/goto/addons/goto/events/class_EventAddUserDialog.inc
index a93a7230f6dce630e68fa0e297053ed1c7052b1c..f77b82497092904a532118a160c443d263017213 100644 (file)
$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];
}
}
diff --git a/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc b/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc
index a711a7df428cf9e326c4f966a9fc43ad69aa2347..7591467c775fff511f6e0740003822dd15a8b201 100644 (file)
/* Add a menu folder
*/
- if(in_array("gotoSubmenuEntry",$attrs['objectClass'])){
+ if(in_array_strict("gotoSubmenuEntry",$attrs['objectClass'])){
$type = "FOLDER";
$data['ICON'] = "";
/* Add a menu entry
*/
- }elseif(in_array("gotoMenuEntry",$attrs['objectClass'])){
+ }elseif(in_array_strict("gotoMenuEntry",$attrs['objectClass'])){
$type = "ENTRY";
$data['INFO'] = "";
/* 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];
/* 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)){
+ if(in_array_strict($app['cn'][0],$used_apps)){
continue;
}
if(!preg_match("/".get_ou('applicationRDN').preg_quote($this->curbase, '/')."$/",$app['dn'])){
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++;
}
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']);
}
$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']);
$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);
}
}
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;
}
}
{
$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;
diff --git a/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc b/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc
index bd8f4cae6a082ecf4da9fc3aaf88e35a92209592..76ae925e5e9df578b663fb365a0ff3b1c0738ee1 100644 (file)
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;
}
}
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;
}
}
diff --git a/gosa-plugins/goto/admin/ogroups/goto/class_termgroup.inc b/gosa-plugins/goto/admin/ogroups/goto/class_termgroup.inc
index f1d48439646ee49978495941c36cb06b87342816..bf4b4139e0c2596c1dfe6e79b260a571c82f54dd 100644 (file)
$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 {
$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();
}
$tmp = array();
foreach($this->gotoNtpServers as $server){
- if(!in_array($server,$this->gotoNtpServer)){
+ if(!in_array_strict($server,$this->gotoNtpServer)){
$tmp[$server] = $server;
}
}
}
/* Set inherit checkbox state */
- if(in_array("default",$this->gotoNtpServer)){
+ if(in_array_strict("default",$this->gotoNtpServer)){
$this->inheritTimeServer = true;
$this->gotoNtpServer=array();
}
diff --git a/gosa-plugins/goto/admin/systems/goto/class_gotoLpdEnabled.inc b/gosa-plugins/goto/admin/systems/goto/class_gotoLpdEnabled.inc
index c327b2b7ac62eafb3612c43ba4c251e3fae85708..44b106a2a56ba74d4ad8c48c2cfd4454efa39c89 100644 (file)
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].":";
diff --git a/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc
index bd7531c9243d46e94037cf6bfe465215e918b4bb..9fe62c0dddcef95684d21943c277d69d05010003 100644 (file)
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{
$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';
/* 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;
}
diff --git a/gosa-plugins/goto/admin/systems/goto/class_selectUserToPrinterDialog.inc b/gosa-plugins/goto/admin/systems/goto/class_selectUserToPrinterDialog.inc
index 246f21516c061099a248dd52bfb80962240af2a6..5ef357985212919abff05ebe7da998f0f545dc82 100644 (file)
foreach($res as $printer){
/* Skip already used entries */
- if(in_array($printer['dn'],$this->dns_used)) {
+ if(in_array_strict($printer['dn'],$this->dns_used)) {
continue;
}
diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc
index e26287a52dea5ac0665590366f32324b427f6983..be20302d1747639d5b8f47f2223df716dc1aea95 100644 (file)
}
/* 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();
}
$tmp = array();
foreach($this->gotoNtpServers as $server){
- if(!in_array($server,$this->gotoNtpServer)){
+ if(!in_array_strict($server,$this->gotoNtpServer)){
$tmp[$server] = $server;
}
}
}
/* 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();
}
diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc
index c99b83c49e4c13d105e4074e0a7f4129532a54c7..878d6e505a891755dab40ddee90ae128c596e1cb 100644 (file)
}
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[] = $_POST['gotoXdmcpServer_add'];
}
}
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;
}
}
$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;
}
}
*/
$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." - "._("Unsupported");
$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;
}
diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc
index 15cd3bdfe762397aeb7844867d1c71e0a2bd3694..ac5f13715bc2c16c72387536fa682cd992c0fd2e 100644 (file)
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;
}
}
/* Add Entries
*/
foreach($this->gotoLdapServers as $key => $server){
- if(!in_array($server,$this->gotoLdapServerList)){
+ if(!in_array_strict($server,$this->gotoLdapServerList)){
$server = $server." <font style='color:red'>(missing)</font>";
}
$list = array();
foreach($this->gotoLdapServerList as $key => $entry){
- if(!in_array($entry,$this->gotoLdapServers)){
+ if(!in_array_strict($entry,$this->gotoLdapServers)){
$list[$key] = $entry;
}
}
{
$tmp= array();
foreach ($array as $mod){
- if (!in_array($mod, $list)){
+ if (!in_array_strict($mod, $list)){
$tmp[]= $mod;
}
}
diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc
index 89e601e6cd1fd44caeb87275c6f6bb6d060c89d7..0a373ce8ec550d20636b8c4940e272ed070d8a65 100644 (file)
}
/* 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();
}
$tmp = array();
foreach($this->gotoNtpServers as $server){
- if(!in_array($server,$this->gotoNtpServer)){
+ if(!in_array_strict($server,$this->gotoNtpServer)){
$tmp[$server] = $server;
}
}
$ntpser = array();
foreach($this->gotoNtpServers as $server){
- if(!in_array($server,$this->gotoNtpServer)){
+ if(!in_array_strict($server,$this->gotoNtpServer)){
$ntpser[$server] = $server;
}
}
}
/* 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();
}
diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc
index 32524695f7f3270872215284db3eac1517ab1b4b..62922fd3f19a7a0179c9128367fa4a6a856aa1ff 100644 (file)
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;
}
}
foreach($this->gotoLdapServers as $key => $server){
/* Announce missing entries */
- if(!in_array($server,$this->gotoLdapServerList)){
+ if(!in_array_strict($server,$this->gotoLdapServerList)){
$server = $server." <font style='color:red'>(missing)</font>";
}
$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)){
{
$tmp= array();
foreach ($array as $mod){
- if (!in_array($mod, $list)){
+ if (!in_array_strict($mod, $list)){
$tmp[]= $mod;
}
}
$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)){
diff --git a/gosa-plugins/goto/admin/systems/goto/tabs_printers.inc b/gosa-plugins/goto/admin/systems/goto/tabs_printers.inc
index 8ab23c8d3548c1cd19f261c7b4a38e0fde01cc33..68990742e4a68cfcb82ec41bbee84928fa6c9a94 100644 (file)
$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();
diff --git a/gosa-plugins/goto/admin/systems/goto/tabs_terminal.inc b/gosa-plugins/goto/admin/systems/goto/tabs_terminal.inc
index 95457217a7ac75d4afdfc79797ba484a3ad5106f..25bac58d142317e5f99b579439034676297d9cf3 100644 (file)
$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();
diff --git a/gosa-plugins/goto/admin/systems/goto/tabs_workstation.inc b/gosa-plugins/goto/admin/systems/goto/tabs_workstation.inc
index 5086602cf04e0ec21690a6004568f04e3fdb8e8e..1bc461afc2d57bdf34a80562ef415f9c86968a72 100644 (file)
$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();
diff --git a/gosa-plugins/goto/admin/systems/ppd/class_ppdManager.inc b/gosa-plugins/goto/admin/systems/ppd/class_ppdManager.inc
index bae18536a97e46a1db319b41b05eec50452d40c4..c7dc77f06725678a0b5ccf1fad5b2cf9e5fcf92c 100644 (file)
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;
}
diff --git a/gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc b/gosa-plugins/goto/admin/systems/services/nfs/class_servNfs.inc
index 14bd2677e4a58c0ff4d1bfee7197d2bde1240f63..a35ecc81764a3dea762e8500c0f2b1844d037cc4 100644 (file)
}
}
- if(!in_array($this->type,$this->types)){
+ if(!in_array_strict($this->type,$this->types)){
$message[]= msgPool::required(_("Type"));
}
diff --git a/gosa-plugins/goto/admin/systems/services/terminal/class_goTerminalServer.inc b/gosa-plugins/goto/admin/systems/services/terminal/class_goTerminalServer.inc
index ffe3b2cb1f60d486146963a1a1aea137379199be..e001d6399f7c48ee9c5f758a42e6d6ad2747dd8e 100644 (file)
$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;
diff --git a/gosa-plugins/goto/personal/environment/class_environment.inc b/gosa-plugins/goto/personal/environment/class_environment.inc
index bf8550a3aa5a6220e7b6c1e902a1401f476f789b..5467adece3cac7b37d8fdc44c56b0f1c72445c71 100644 (file)
$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)){
/* 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);
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(_("Environment")),
msgPool::featuresDisabled(_("Environment")));
return $display;
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);
}
if(isset($_POST['kiosk_profile'])){
$tmp = $_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 = $_POST['kiosk_profile'];
}
}
plugin::save_object();
foreach($this->attributes as $s_attr){
if((!isset($_POST[$s_attr])) ||
- in_array($s_attr,array("gosaDefaultPrinter","gotoShares","gotoHotplugDevices","gotoPrinter","gotoLogonScripts","uid"))) continue;
+ in_array_strict($s_attr,array("gosaDefaultPrinter","gotoShares","gotoHotplugDevices","gotoPrinter","gotoLogonScripts","uid"))) continue;
if(!$this->acl_is_writeable($s_attr)){
continue;
}else{
$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"));
}
}
$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;
$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;
}
$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);
}
if(isset($_POST['kiosk_profile'])){
$tmp = $_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 = $_POST['kiosk_profile'];
}
}
diff --git a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_goKrbServer.inc b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_goKrbServer.inc
index 5f153e67e753a16ba3150a845dc6986295a87744..43db540702b76c92a5abd93cdce7f91802f85a26 100644 (file)
/* 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);
}
/* 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);
}
diff --git a/gosa-plugins/kolab/personal/connectivity/kolab/class_kolabAccount.inc b/gosa-plugins/kolab/personal/connectivity/kolab/class_kolabAccount.inc
index f817ce7d6620f30040a8a04df70358b31cb7efbc..ced859daad0b4e1504ceef8d4430707764b7ad5c 100644 (file)
$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){
/* 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";
}
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);
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;
}
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;
}
diff --git a/gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab.inc b/gosa-plugins/kolab/personal/mail/kolab/class_mail-methods-kolab.inc
index d70d1d62816f04310c70596067a2eb76b927fc68..9a2726f0bc010aa5d8f907cca66e2a0864d78dc0 100644 (file)
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);
}
diff --git a/gosa-plugins/mail/addons/mailqueue/class_mailqueue.inc b/gosa-plugins/mail/addons/mailqueue/class_mailqueue.inc
index 47612b903fcc1971fdf5c04f6170122a0f4f63d6..6fa0e2f221c13c9eaafe5736b7b589e11ac41324 100644 (file)
}
/* 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);
}
diff --git a/gosa-plugins/mail/addons/mailqueue/class_si_mailqueue.inc b/gosa-plugins/mail/addons/mailqueue/class_si_mailqueue.inc
index 3eb055bde5f576fed9d53d28dc24c389fdf9df65..ca4dd0c4279c580fcb5d6d16d9c1f1154a065bd3 100644 (file)
/* 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);
}
diff --git a/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc b/gosa-plugins/mail/admin/groups/mail/class_groupMail.inc
index 31d47a81d006354d2845e5d68df2fb67816e10e9..95acdd231d7b109120ea8721aae0585c3c2a826f 100644 (file)
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;
}
}
$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){
$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]);
}
}
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];
}
}
$list = $this->mailAddressSelect->save();
foreach ($list as $entry){
$val = $entry['mail'][0];
- if (!in_array ($val, $this->gosaMailAlternateAddress) && $val != $this->mail){
+ if (!in_array_strict($val, $this->gosaMailAlternateAddress) && $val != $this->mail){
$this->addForwarder($val);
$this->is_modified= TRUE;
}
}
}
} 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;
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);
/* 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);
/* 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');
}
}
foreach (array("gosaMailAlternateAddress", "gosaMailForwardingAddress") as $val){
- if (in_array($val, $skip)){
+ if (in_array_strict($val, $skip)){
continue;
}
$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];
}
}
$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);
{
$forward = array();
foreach($attrs['Forward_some'] as $addr){
- if(in_array($addr,$this->gosaMailForwardingAddress)){
+ if(in_array_strict($addr,$this->gosaMailForwardingAddress)){
$forward[] = $addr;
}
}
}
/* Add to list of alternates */
- if (!in_array($address, $this->gosaMailAlternateAddress)){
+ if (!in_array_strict($address, $this->gosaMailAlternateAddress)){
$this->gosaMailAlternateAddress[]= $address;
}
diff --git a/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc b/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc
index ee58548763aebefc3f2d8286c4f58d21d5bd473c..0df2c97c481ccbef1b8589082e8661e63ae3e6ea 100644 (file)
*/
$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 ,
diff --git a/gosa-plugins/mail/personal/mail/class_mail-methods.inc b/gosa-plugins/mail/personal/mail/class_mail-methods.inc
index 5c96f674b88838c5af5a9101b2efb08be3b3c9f8..e4cad3f1eba27dc79cbb324e4d5e281902e76eec 100644 (file)
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;
*/
if($this->config->get_cfg_value("mailAttribute","mail") != ""){
$new_uattrib= strtolower($this->config->get_cfg_value("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>",
$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;
}
}
diff --git a/gosa-plugins/mail/personal/mail/class_mailAccount.inc b/gosa-plugins/mail/personal/mail/class_mailAccount.inc
index 09de8c346ad553f5a918196c9bbe7c356996fbc7..ef85799d295d9c2b0ba72adc9293e9d9624903dd 100644 (file)
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;
}
}
$list = $this->mailAddressSelect->save();
foreach ($list as $entry){
$val = $entry['mail'][0];
- if (!in_array ($val, $this->gosaMailAlternateAddress) && $val != $this->mail){
+ if (!in_array_strict($val, $this->gosaMailAlternateAddress) && $val != $this->mail){
$this->addForwarder($val);
$this->is_modified= TRUE;
}
}
}
} 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;
/* _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));
}
/* 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');
}
}
}
return ($attrs["uid"][0]);
}
- if (!in_array($address, $this->gosaMailAlternateAddress)){
+ if (!in_array_strict($address, $this->gosaMailAlternateAddress)){
$this->gosaMailAlternateAddress[]= $address;
$this->is_modified= TRUE;
}
foreach (array("gosaMailAlternateAddress", "gosaMailForwardingAddress") as $val){
- if (in_array($val, $skip)){
+ if (in_array_strict($val, $skip)){
continue;
}
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;
}
}
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;
}
}
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();
"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{
$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 = $_POST['gosaVacationStart'];
$ret['gosaVacationStop'] = $this->gosaVacationStop = $_POST['gosaVacationStop'];
}
{
$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 {
}
/* 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 {
}
}
- 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"));
}
diff --git a/gosa-plugins/mail/personal/mail/sieve/class_My_Tree.inc b/gosa-plugins/mail/personal/mail/sieve/class_My_Tree.inc
index 0f18cecc74f9638480f0f31b6466f6ed4ae3085e..82f152206755100e923c26df58d60476c9977bb0 100644 (file)
$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_'>";
$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;
}
/* 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']);
}
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",
}
$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);
/* 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);
$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",
/* 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]);
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 --;
}
}
$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);
}
}
}
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 --;
}
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);
}
}
diff --git a/gosa-plugins/mail/personal/mail/sieve/class_parser.inc b/gosa-plugins/mail/personal/mail/sieve/class_parser.inc
index 5326c2b37628e133d50cec03c838d22830e8b639..94a48ff1ffe8c4bb7bc5c0b2fec9090bfb2d61ec 100644 (file)
{
$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);
function isExtensionRegistered_($extension)
{
- return (in_array($extension, $this->registeredExtensions_) ? true : false);
+ return (in_array_strict($extension, $this->registeredExtensions_) ? true : false);
}
function success_($text = null)
diff --git a/gosa-plugins/mail/personal/mail/sieve/class_scanner.inc b/gosa-plugins/mail/personal/mail/sieve/class_scanner.inc
index 3e22bb1d0ee8c6a3a2aae7b6662fa35da5e54a50..b00ffd1c50bf45d312037c195c211853e51a6f0d 100644 (file)
if (is_array($class))
{
- return in_array($next, $class);
+ return in_array_strict($next, $class);
}
else if (is_string($class))
{
diff --git a/gosa-plugins/mail/personal/mail/sieve/class_sieveElement_If.inc b/gosa-plugins/mail/personal/mail/sieve/class_sieveElement_If.inc
index 19dc0fb4fcde584ec4c4e06c3919127203454c1f..44e534df4cb7bad38a87bc2c618917f4c45dbeaa 100644 (file)
$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'])." ";
}
$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'])." ";
}
$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'])." ";
}
/* 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];
$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];
/* 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];
}
$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 --;
}
}
diff --git a/gosa-plugins/mail/personal/mail/sieve/class_sieveElement_Require.inc b/gosa-plugins/mail/personal/mail/sieve/class_sieveElement_Require.inc
index bd8fe9ae9cb43a992fa0809bdf45fbd1daad8207..cbec547c7c6aaa1cc9d2bde23109c00a29f6de41 100644 (file)
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);
diff --git a/gosa-plugins/mail/personal/mail/sieve/class_sieveElement_Vacation.inc b/gosa-plugins/mail/personal/mail/sieve/class_sieveElement_Vacation.inc
index a8ba251c6946cae21d13cca0b88db3f48c1b7b16..efb51934dfcb6e7634b9ad31661f72e31be43d8a 100644 (file)
$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'];
}
/* 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'];
diff --git a/gosa-plugins/mail/personal/mail/sieve/class_sieveManagement.inc b/gosa-plugins/mail/personal/mail/sieve/class_sieveManagement.inc
index c4c76b70becc1eb904703981ed4f62563f518369..aea15f1f91662399524ea4a2377472b5b96dfebf 100644 (file)
/* 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'];
}
*/
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);
*/
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);
}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");
}
}
$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;
}
}
}
- 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);
diff --git a/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_goKrbServer.inc b/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_goKrbServer.inc
index 70ae2244fdc4459bedf1961abb7ee5f36ce86849..0b931320322634b6ab3ae69b129d6501dbd3005e 100644 (file)
/* 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);
}
/* 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);
}
diff --git a/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_krb5_policy.inc b/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_krb5_policy.inc
index b3e5b6d922b0654be906ccce769b7ea3c26d2c1e..ba95267a26966120e0590b5d3d3a2d9d1c9d3aa5 100644 (file)
{
$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)){
diff --git a/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_password-methods-MIT.inc b/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_password-methods-MIT.inc
index 66b8128be2fb5ba9db92cb5ac31b736cd079adcd..0a65aea84f7891155dc8b559a919d3d89a5a27e7 100644 (file)
/* 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;
}
diff --git a/gosa-plugins/nagios/personal/nagios/class_nagiosAccount.inc b/gosa-plugins/nagios/personal/nagios/class_nagiosAccount.inc
index 1a3e15edc4b5da1bf45adec9317b3959b436662b..0a413d60ca6d44ca11adbdd36f1414602206a912 100644 (file)
/* Assign attributes an ACL to smarty */
foreach($this->attributes as $val) {
$smarty->assign("$val", $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{
diff --git a/gosa-plugins/opengroupware/personal/connectivity/opengroupware/class_opengw.inc b/gosa-plugins/opengroupware/personal/connectivity/opengroupware/class_opengw.inc
index de50ef93690e6d277524bdc528515372df4d8132..ffc41db65051ec02925e41258510ccdd037b9fac 100644 (file)
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{
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);
}
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);
}
}
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);
}
diff --git a/gosa-plugins/opengroupware/personal/connectivity/opengroupware/class_opengwAccount.inc b/gosa-plugins/opengroupware/personal/connectivity/opengroupware/class_opengwAccount.inc
index e3396c6e9e821b9523877b9a987706ae3442ae6a..fdb503b656265cfdd8b469ba0292936690bfecd4 100644 (file)
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{
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;
}
}
diff --git a/gosa-plugins/opsi/admin/opsiLicenses/class_licenseGeneric.inc b/gosa-plugins/opsi/admin/opsiLicenses/class_licenseGeneric.inc
index 21f5a3f8d08e43ad04323d3db5d16de44588c8b1..1a2a0c7682b4659df379da6f842bb432c59deb5e 100644 (file)
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;
}
}
diff --git a/gosa-plugins/opsi/admin/opsiLicenses/class_licensePoolGeneric.inc b/gosa-plugins/opsi/admin/opsiLicenses/class_licensePoolGeneric.inc
index eef2354fe4d3166f840461bcdc68acde73c35b53..615974293a61167f34c937a6c6a849190ddaf538 100644 (file)
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];
}
}
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;
}
}
diff --git a/gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsageByHost.inc b/gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsageByHost.inc
index 746d2b9d8b248ef4b832b04b670dd976f565e8a9..3808cd8c3d43a35ac2b9429474dc60dc93898100 100644 (file)
// 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]."]";
}
}
// 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];
}
}
diff --git a/gosa-plugins/phpgw/personal/connectivity/phpgw/class_phpgwAccount.inc b/gosa-plugins/phpgw/personal/connectivity/phpgw/class_phpgwAccount.inc
index b4fd138f197199ef05730a5006eef874785c4646..f6bc4a4c95f4ba978370225bf4dc70906a0e89a8 100644 (file)
$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);
}
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);
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;
}
}
diff --git a/gosa-plugins/pureftpd/personal/connectivity/pureftpd/class_pureftpdAccount.inc b/gosa-plugins/pureftpd/personal/connectivity/pureftpd/class_pureftpdAccount.inc
index 2042f8a4014bc601dff1ca7c99a36627f81bc792..41d5d8d03077c40243fddcb9158c45c8bc6fc8a5 100644 (file)
}
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));
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);
diff --git a/gosa-plugins/rsyslog/addons/rsyslog/class_rsyslog.inc b/gosa-plugins/rsyslog/addons/rsyslog/class_rsyslog.inc
index c965149ccc125f0dd9d0c25285e68f963af4ae01..269130ad22fd2d3dd8d08511a70afbdc082202ef 100644 (file)
// 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 = $_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 = $_POST['selected_priority'];
}
}
// 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){
diff --git a/gosa-plugins/rsyslog/admin/systems/services/rsyslog/class_rSyslogServer.inc b/gosa-plugins/rsyslog/admin/systems/services/rsyslog/class_rSyslogServer.inc
index a69b21f8ebbe1f6f885866573385717b67d38db9..2147933c2dc1d8a37c50bcd27df4860f62fbecbc 100644 (file)
{
goService::goService($config,$dn);
$this->DisplayName = _("Logging");
- $this->initial_use_database = $this->use_database = isset($this->attrs['objectClass']) &&in_array("goLogDBServer", $this->attrs['objectClass']);
+ $this->initial_use_database = $this->use_database = isset($this->attrs['objectClass']) &&in_array_strict("goLogDBServer", $this->attrs['objectClass']);
if($this->use_database){
foreach($this->db_attributes as $attr){
diff --git a/gosa-plugins/samba/personal/samba/class_sambaAccount.inc b/gosa-plugins/samba/personal/samba/class_sambaAccount.inc
index 41cd6b0fb273fa82bbd1df615ee0605de2080239..443bd2e54381aa169104b2d46df8dcb8a97d918c 100644 (file)
$smarty->assign("$attr", $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", "");
}
// 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);
"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);
$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);
}
/* 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);
}
}
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);
}
- 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){
$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'];
}
/* 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();
}
$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;
}
diff --git a/gosa-plugins/samba/personal/samba/class_sambaMungedDial.inc b/gosa-plugins/samba/personal/samba/class_sambaMungedDial.inc
index 788dcc2e5c7e325cb1533ddf0e9f5cf3cd086055..f4616d54b3b2fc11e67ba8b5add75ee151d97dc8 100644 (file)
$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 {
}
/* Time parameter? */
- if (in_array($paramName, $this->timeParams)){
+ if (in_array_strict($paramName, $this->timeParams)){
$paramValue= sambaMungedDial::genTime($paramValue);
}
$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);
}
diff --git a/gosa-plugins/scalix/personal/scalix/class_scalixAccount.inc b/gosa-plugins/scalix/personal/scalix/class_scalixAccount.inc
index 0f8cc811ee932bbdbf50428a8a6d3bceb6f75090..6d66851ad1c951ca2d168cc52e5cc0bd88dff2ee 100644 (file)
foreach (array("scalixEmailAddress") as $val){
- if (in_array($val, $skip)){
+ if (in_array_strict($val, $skip)){
continue;
}
}
/* 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;
}
diff --git a/gosa-plugins/squid/personal/connectivity/squid/class_proxyAccount.inc b/gosa-plugins/squid/personal/connectivity/squid/class_proxyAccount.inc
index 89497ead1820ed372b6f0f34f64e1bbdfca02245..10537a6f8478f0e4858ff2bbefcd01a32dc26f26 100644 (file)
/* 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);
$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);
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);
}
}
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;
}
}
diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc
index cb241e439588030a5d8c2ac2fe74394eb7984e79..e53fd53227766e6668931c7c6a56fb8229d08dd1 100644 (file)
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;
}
}
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;
}
}
diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoOption.inc b/gosa-plugins/sudo/admin/sudo/class_sudoOption.inc
index cf8d6bd1f98a9d5f3b0512cbb696b0030b2a2dc6..f73356586dfdf37d36484a58c7e4867bab05eed4 100644 (file)
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){
}
/* 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";
/*****
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{
/*****
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{
/****
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);
}
/****
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);
}
/****
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 = "";
/****
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);
/****
Save BOOLEAN
****/
- if(in_array($type,array("BOOLEAN"))){
+ if(in_array_strict($type,array("BOOLEAN"))){
$option = $name;
if($value == "FALSE"){
$option = "!".$option;
/****
Save STRING / INTEGER
****/
- if(in_array($type,array("STRING","INTEGER"))){
+ if(in_array_strict($type,array("STRING","INTEGER"))){
if($value != ""){
$option = $name."=".$value;
}else{
/****
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"){
diff --git a/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc b/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc
index 603dd1319a4c125907dc3ada674656eb5979a999..184456a889b3ac2e4370d855db72b2038636230a 100644 (file)
if(preg_match("/".preg_quote(get_ou('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'][] = 'sambaSamAccount';
// Detect Workstation & templates
- }elseif(in_array('gotoWorkstation', $entry['objectClass'])){
+ }elseif(in_array_strict('gotoWorkstation', $entry['objectClass'])){
if(!isset($entry['macAddress'][0]) || $entry['macAddress'][0] == "-"){
continue; // We do not need templates anymore, we've ogroups now.
//$entries[$key]['objectClass'][] = 'FAKE_OC_WorkstationTemplate';
}
// Detect Terminal & templates
- }elseif(in_array('gotoTerminal', $entry['objectClass'])){
+ }elseif(in_array_strict('gotoTerminal', $entry['objectClass'])){
if(!isset($entry['macAddress'][0]) || $entry['macAddress'][0] == "-"){
continue; // We do not need templates anymore, we've ogroups now.
//$entries[$key]['objectClass'][] = 'FAKE_OC_TerminalTemplate';
}
// Detect Server & templates
- }elseif(in_array('goServer', $entry['objectClass'])){
+ }elseif(in_array_strict('goServer', $entry['objectClass'])){
if(!isset($entry['macAddress'][0]) || $entry['macAddress'][0] == "-"){
continue; // We do not need templates anymore, we've ogroups now.
//$entries[$key]['objectClass'][] = 'FAKE_OC_ServerTemplate';
}
// 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';
// Detect object states
foreach(array('gotoWorkstation','gotoTerminal','goServer') as $type){
- if(in_array($type, $entry['objectClass'])){
+ if(in_array_strict($type, $entry['objectClass'])){
if(isset($entry['gotoMode'][0]) && preg_match("/locked/i", $entry['gotoMode'][0])){
$entries[$key]['objectClass'][] = $type."__IS_LOCKED";
diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc
index fee234b9f8250ef182046de5fca4966af490fc96..3a4d0067abe700bfef51f021535d9b3c75943bc9 100644 (file)
$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)){
$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 ($_POST['new_password'] != $_POST['repeated_password']){
msg_dialog::display(_("Error"),
/* 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])){
/* 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];
/* 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.");
$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;
}
diff --git a/gosa-plugins/systems/admin/systems/class_termDNS.inc b/gosa-plugins/systems/admin/systems/class_termDNS.inc
index 7582e3c4c1c6b74cc9483382cf0d36b1d3f431db..23bfb40585810f3434b83f5a159e8c4aa0b56f56 100644 (file)
/* 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"));
}
}
// 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 ;
diff --git a/gosa-plugins/systems/admin/systems/tabs_server.inc b/gosa-plugins/systems/admin/systems/tabs_server.inc
index af7da365ff90f3cc7b684659087bfcc8e8b65aa7..7ca43d828c04a36795490bb0b25f36b3da203995 100644 (file)
$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();
diff --git a/gosa-plugins/webdav/personal/connectivity/webdav/class_webdavAccount.inc b/gosa-plugins/webdav/personal/connectivity/webdav/class_webdavAccount.inc
index 9cf3a2765d99f5c4f3d3a4b654844561e9e85c78..6f7aca9a9ec54ed67d4285bf97552dc398ab8165 100644 (file)
$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);
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);
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;
}
}