summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9574354)
raw | patch | inline | side by side (parent: 9574354)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 8 Aug 2005 07:25:59 +0000 (07:25 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 8 Aug 2005 07:25:59 +0000 (07:25 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1071 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/gofon/phoneaccount/class_phoneAccount.inc | patch | blob | history | |
plugins/gofon/phoneaccount/generic.tpl | patch | blob | history |
diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc
index 48feaa2db8798fe104f339d5bba15332078be3a7..3965507f6092b87b8c201ac731312e9c24a9a51f 100644 (file)
function execute()
{
+ /* force postmodify event, to restart phones */
+
+ $this->parent->by_object['user']->is_modified=TRUE;
+ $this->is_modified=TRUE;
+
/* Do we need to flip is_account state? */
if (isset($_POST['modify_state'])){
$this->is_account= !$this->is_account;
$macrotab.= "</td></tr>";
}
- $macrotab.="</table>";
+ $macrotab.="</table><input name='post_success' type='hidden' value='1'>";
}//is_array()
/* Give smarty the table */
$this->macrostillavailable=true;
}
+
/* get all Postvars */
if(isset($this->macroarray[$this->macro])){
foreach($this->macroarray[$this->macro] as $key => $paras){
/* Checkboxes are special, they are not Posted if they are not selected, so the won't be changed with the above code
We need this code below to read and save checkboxes correct
*/
- if($this->macroarray[$this->macro][$key]['type']=="bool"){
- if(isset($_POST[$this->macroarray[$this->macro][$key]['var']])) {
- $this->macroarray[$this->macro][$key]['choosen']=$_POST[$paras['var']];
- }else{
- $this->macroarray[$this->macro][$key]['choosen']=false;
+
+ if(isset($_POST['post_success'])){
+ if($this->macroarray[$this->macro][$key]['type']=="bool"){
+ if(isset($_POST[$this->macroarray[$this->macro][$key]['var']])) {
+ $this->macroarray[$this->macro][$key]['choosen']=$_POST[$paras['var']];
+ }else{
+ $this->macroarray[$this->macro][$key]['choosen']=false;
+ }
}
}
}
}
}
-
-
}
function check()
}
if(($this->goFonPIN)==""){
- $this->goFonPIN = array();
+ $message[]= sprintf(_("You need to specify a Phone PIN."));
}else{
if(strcmp ((int)($this->goFonPIN),($this->goFonPIN))){
$message[] = sprintf(_("The given PIN is not valid, only numbers are allowed for this type."));
show_ldap_error($ldap->get_error());
/* Optionally execute a command after we're done */
+
if ($this->initially_was_account == $this->is_account){
if ($this->is_modified){
$this->handle_post_events("modify");
+ /* This function checks if the given phonenumbers are available or already in use*/
function is_number_used()
{
$ldap= $this->config->get_ldap_link();
- $ldap->search("(objectClass=goFonAccount)", array("telephoneNumber","uid","cn"));
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->search("(|(objectClass=goFonAccount)(objectClass=goFonQueue))", array("telephoneNumber","cn","uid"));
while($attrs = $ldap->fetch()) {
unset($attrs['telephoneNumber']['count']);
- $usednumber[$attrs['uid'][0]]= $attrs['telephoneNumber'];
foreach($attrs['telephoneNumber'] as $tele){
+ if(!isset($attrs['cn'][0])) $attrs['cn'][0]=$attrs['dn'];
+ if(!isset($attrs['uid'][0])) $attrs['uid'][0]=$attrs['dn'];
$numbers[$tele]=$attrs;
}
}
index 8c2ca493724fb899e5a933b21a22c6c0567655ce..0f7329943bc3c19697c501e392e4089774dacc7b 100644 (file)
<table summary="">
<tr>
<td>
- <LABEL for="goFonPIN">{t}Phone PIN{/t}</LABEL>
+ <LABEL for="goFonPIN">{t}Phone PIN{/t}{$must}</LABEL>
</td>
<td>
<input type="password" id="goFonPIN" name="goFonPIN" value="{$goFonPIN}" {$goFonPINACL}>