Code

Fixed save_vars problem when beeing on the references tab
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 May 2005 12:19:07 +0000 (12:19 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 May 2005 12:19:07 +0000 (12:19 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@227 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/departments/class_departmentGeneric.inc

index a540a15576b12174f6e6c6eb401ec027292b5e23..b31594617dce3532a83f0624b9ba0bfd5e5bc22f 100644 (file)
@@ -105,11 +105,13 @@ class department extends plugin
   /* Save data to object */
   function save_object()
   {
-       plugin::save_object();
+       if (isset($_POST['base'])){
+               plugin::save_object();
 
-       /* Save base, since this is no LDAP attribute */
-       if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){
-               $this->base= $_POST['base'];
+               /* Save base, since this is no LDAP attribute */
+               if (chkacl($this->acl, "create") == ""){
+                       $this->base= $_POST['base'];
+               }
        }
   }
 
@@ -137,25 +139,25 @@ class department extends plugin
        }
 
        /* All required fields are set? */
-       if ($_POST["ou"] == ""){
+       if ($this->ou == ""){
                $message[]= _("Required field 'Name' is not set.");
        }
-       if ($_POST["description"] == ""){
+       if ($this->description == ""){
                $message[]= _("Required field 'Description' is not set.");
        }
 
        /* Validate and modify - or: spaghetti rules! */
-       if ($_POST['ou'] == "incoming"){
+       if ($this->ou == "incoming"){
                $message[]= _("The field 'Name' contains the reserved word 'incoming'.".
                                " Please choose another name.");
        }
-       if (preg_match ('/[,#+:=>\\\\]/', $_POST['ou'])){
+       if (preg_match ('/[,#+:=>\\\\]/', $this->ou)){
                $message[]= _("The field 'Name' contains invalid characters.");
        }
-       if (!is_phone_nr($_POST['telephoneNumber'])){
+       if (!is_phone_nr($this->telephoneNumber)){
                $message[]= _("The field 'Phone' contains an invalid phone number.");
        }
-       if (!is_phone_nr($_POST['facsimileTelephoneNumber'])){
+       if (!is_phone_nr($this->facsimileTelephoneNumber)){
                $message[]= _("The field 'Fax' contains an invalid phone number.");
        }