diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc
index f3b8a76b8370d00e624d1203d3903f2ab1de42f3..a3a489ba6e94da317d9bc46cbaa534d0ef885e82 100644 (file)
$str= "<select name='".$var."' ".chkacl($this->acl, "goFonMacro").">";
foreach(split(":",$default) as $choice){
if($choosen==$choice){
- $str.= "\n<option value='".$choice."' selected>".$choice."</option>";
+ $str.= "\n<option value='".$choice."' selected>".$choice." </option>";
}else{
- $str.= "\n<option value='".$choice."'>".$choice."</option>";
+ $str.= "\n<option value='".$choice."'>".$choice." </option>";
}
}
$str.="</select>";
/* Transfer ACL's */
foreach($this->attributes as $val){
$smarty->assign($val."ACL", chkacl($this->acl, "$val"));
+ $smarty->assign($val,$this->$val);
}
/* Fill arrays */
} else {
$color= "";
}
- $hl.= " <option $color label=\"$cn\" value=\"$cn\" $selected>$description</option>\n";
+ $hl.= " <option $color label=\"$cn\" value=\"$cn\" $selected>$description </option>\n";
}
$hl.= "</select>\n";
$smarty->assign ("hardware_list", $hl);
$message[]= sprintf(_("You need to specify at least one phone number!"));
}
+ if(($this->goFonPIN)==""){
+ $this->goFonPIN = array();
+ }else{
+ if(strcmp ((int)($this->goFonPIN),($this->goFonPIN))){
+ $message[] = sprintf(_("The given PIN is not valid, only numbers are allowed for this type."));
+ }elseif(strlen($this->goFonPIN) < 4){
+ $message[] = sprintf(_("The given PIN is too short"));
+ }
+
+ }
/* Check timestamps and phonenumbers */
foreach ($this->forwarders as $fw){
}
unset($this->attrs['macro']) ;
+ if($this->attrs['goFonMacro']==""){
+ $this->attrs['goFonMacro']=array();
+ }
/* Write back to ldap */
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->dn);
function remove_from_parent()
{
+ /* unset macro attr, it will cause an error */
+ $tmp = array_flip($this->attributes);
+ unset($tmp['macro']);
+ $this->attributes=array_flip($tmp);
+
/* Cancel if there's nothing to do here */
if (!$this->initially_was_account){
return;