summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9100eed)
raw | patch | inline | side by side (parent: 9100eed)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 1 Mar 2006 05:45:50 +0000 (05:45 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 1 Mar 2006 05:45:50 +0000 (05:45 +0000) |
display lock message
Detect correct list type
prevent reload errors
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2785 594d385d-05f5-0310-b6e9-bd551577e9d8
Detect correct list type
prevent reload errors
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2785 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/gofax/blocklists/class_blocklistManagement.inc | patch | blob | history |
diff --git a/plugins/gofax/blocklists/class_blocklistManagement.inc b/plugins/gofax/blocklists/class_blocklistManagement.inc
index 79b5b3c72ef0352c581f6417945b9cf94e9f4815..978732ccf89444d598db637547973d9f55eb552c 100644 (file)
$this->reload();
}
+ /* Cancel dialog */
+ if (isset($_POST['edit_cancel']) || isset($_POST['delete_blocklist_cancel']) ||
+ isset($_POST['delete_blocklist_confirm']) || isset($_POST['delete_lock'])){
+
+ del_lock ($this->dn);
+ $this->clear_fields();
+ unset($_SESSION['objectinfo']);
+ }
+
/* Test Posts */
foreach($_POST as $key => $val){
// Post for delete
}
/* Edit selected blocklist? */
- if ($s_action=="edit"){
+ if (($s_action=="edit") && (empty($this->dn))){
$this->clear_fields();
$this->dn=$this->blocklists[$s_entry]['dn'];
- plugin::plugin ($this->config, $this->dn);
+ if (($user= get_lock($this->dn)) != ""){
+ $_SESSION['dn']= $this->dn;
+ //$this->dn ="";
+ return(gen_locked_message($user, $this->dn));
+ } else {
+# Lock this dn for editing
+ add_lock ($this->dn, $this->ui->dn);
- /* Load missing lists */
- if (isset($this->attrs["goFaxSBlocklist"])){
- for ($i= 0; $i<$this->attrs["goFaxSBlocklist"]["count"]; $i++){
- $this->goFaxBlocklist[]= $this->attrs["goFaxSBlocklist"][$i];
- }
- $this->type= 0;
- } elseif (isset($this->attrs["goFaxRBlocklist"])){
- for ($i= 0; $i<$this->attrs["goFaxRBlocklist"]["count"]; $i++){
- $this->goFaxBlocklist[]= $this->attrs["goFaxRBlocklist"][$i];
+ plugin::plugin ($this->config, $this->dn);
+
+ /* Load missing lists */
+ if (in_array("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= 0;
+ } elseif (in_array("goFaxRBlock",$this->attrs['objectClass'])){
+ if(isset($this->attrs["goFaxRBlocklist"])){
+ for ($i= 0; $i<$this->attrs["goFaxRBlocklist"]["count"]; $i++){
+ $this->goFaxBlocklist[]= $this->attrs["goFaxRBlocklist"][$i];
+ }
+ }
+ $this->type= 1;
}
- $this->type= 1;
+ $_SESSION['objectinfo']= trim($this->dn);
}
- $_SESSION['objectinfo']= trim($this->dn);
}
/* Delete blocklist requested */
}
}
- /* Cancel dialog */
- if (isset($_POST['edit_cancel']) || isset($_POST['delete_blocklist_cancel']) ||
- isset($_POST['delete_blocklist_confirm']) || isset($_POST['delete_lock'])){
-
- del_lock ($this->dn);
- $this->clear_fields();
- unset($_SESSION['objectinfo']);
- }
/* Handle interactions: add */
if (isset($_POST['add_number']) && $_POST['number'] != ""){
}
/* What about finish? */
- if (isset($_POST['edit_finish'])){
+ if ((isset($_POST['edit_finish'])) && (!empty($this->dn))){
$message= $this->check();
+ $this->remove_lock();
/* No errors, save object */
if (count ($message) == 0){
if ($this->dn == "new"){
$this->dn= "cn=$this->cn,ou=gofax,ou=systems,".$this->base;
}
-
+
$this->save ();
gosa_log ("Blocklist object'".$this->dn."' has been saved");
$this->dn= "";