summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 20f2ae4)
raw | patch | inline | side by side (parent: 20f2ae4)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 19 Jul 2007 13:29:48 +0000 (13:29 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 19 Jul 2007 13:29:48 +0000 (13:29 +0000) |
This ensures that we can save an entry with having database connections.
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6923 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6923 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/gofon/phoneaccount/class_phoneAccount.inc | patch | blob | history |
diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc
index 3a985f37cede9f0309785ba887ebd5840eecb85b..ba00dbf23821050911858ca373af9de98e0efe5a 100644 (file)
$r_con = @mysql_pconnect($cur_cfg['SERVER'],$cur_cfg['LOGIN'],$cur_cfg['PASSWORD']);
if(!$r_con){
- print_red( sprintf(_("The MySQL Server '%s' isn't reachable as user '%s', check GOsa log for mysql error."),
- $cur_cfg['SERVER'],$cur_cfg['LOGIN']));
+# print_red( sprintf(_("The MySQL Server '%s' isn't reachable as user '%s', check GOsa log for mysql error."),
+# $cur_cfg['SERVER'],$cur_cfg['LOGIN']));
gosa_log(mysql_error());
}
$db = @mysql_select_db($cur_cfg['DB'],$r_con);
if(!$db){
- print_red(sprintf(_("Can't select database %s on %s."),$cur_cfg['DB'],$cur_cfg['SERVER']));
+# print_red(sprintf(_("Can't select database %s on %s."),$cur_cfg['DB'],$cur_cfg['SERVER']));
gosa_log(mysql_error());
}
ksort($this->hardware_list);
$this->a_old_telenums = $this->phoneNumbers;
- if($this->is_account){
- $this->is_modified = true;
- }
-
-
/* Get voicemail PIN from MySQL DB
* Because every user can change his PIN directly from the phone
* without any update to the ldap
function save_object()
{
if (isset($_POST["phoneTab"])){
+
plugin::save_object();
/* Save checkbox */
$this->macrostillavailable=true;
}
+ if(isset($_POST['macro']) && $_POST['macro'] != $this->macro){
+ $this->is_modified =true;
+ }
+
if(is_array($this->phoneNumbers)){
foreach($this->phoneNumbers as $telenumms) {
$nummsinorder[]=$telenumms;
}
/* get all Postvars */
- if(isset($this->macroarray[$this->macro])){
+ if(isset($this->macroarray[$this->macro])){
+
foreach($this->macroarray[$this->macro] as $key => $paras){
+
+ $backup = $this->macroarray[$this->macro][$key];
+
if(isset($_POST[$paras['var']])){
$this->macroarray[$this->macro][$key]['choosen'] = $_POST[$paras['var']];
}
}
}
}
+ if(count(array_diff($this->macroarray[$this->macro][$key],$backup))){
+ $this->modified = TRUE;
+ }
}
}
}
}
}
- if(!$this->generate_mysql_entension_entries()){
- $message[] = $this->generate_error;
+ if ($this->initially_was_account != $this->is_account || $this->is_modified){
+ if(!$this->generate_mysql_entension_entries()){
+ $message[] = $this->generate_error;
+ }
}
/* We need at least one phone number */
$this->attrs['goFonForwarding']=array();
- $str = $this->generate_mysql_entension_entries(true);
- if(empty($str)){
- print_red($str);
+ if ($this->initially_was_account != $this->is_account || $this->is_modified){
+ $str = $this->generate_mysql_entension_entries(true);
+ if(empty($str)){
+ print_red($str);
+ }
}
if($this->attrs['goFonMacro']==""){