Code

Code alignment
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Nov 2010 16:09:26 +0000 (16:09 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Nov 2010 16:09:26 +0000 (16:09 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20300 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/departments/class_domain.inc

index 560503a7db072f25d9fd8902410a7ef7aee55070..b72a68d45c64dbe7b6f0522a3099d3c870d14f5d 100644 (file)
 
 class domain extends department
 {
-       /* attribute list for save action */
-       var $attributes     = array( "dc", "ou", "description","gosaUnitTag", "manager");
-       var $objectclasses  = array("top", "domain", "gosaDepartment");
-        var $structuralOC   = array("domain");
-        var $type       = "domain";
-        var $dc         = "";
-        var $orgi_dc    = "";
-        var $namingAttr = "dc";
+    /* attribute list for save action */
+    var $attributes     = array( "dc", "ou", "description","gosaUnitTag", "manager");
+    var $objectclasses  = array("top", "domain", "gosaDepartment");
+    var $structuralOC   = array("domain");
+    var $type       = "domain";
+    var $dc         = "";
+    var $orgi_dc    = "";
+    var $namingAttr = "dc";
 
-  var $manager_enabled = FALSE;
-  var $manager_name ="";
-  var $manager ="";
+    var $manager_enabled = FALSE;
+    var $manager_name ="";
+    var $manager ="";
 
 
-  function check()
-  {
-    $message = plugin::check();
+    function check()
+    {
+        $message = plugin::check();
 
-               /* Check for presence of this department */
-               $ldap= $this->config->get_ldap_link();
-    $ldap->ls ("(&(dc=".$this->dc.")(objectClass=domain))", $this->base, array('dn'));
-    if ($this->orig_dc == "new" && $ldap->count()){
-                       $message[]= msgPool::duplicated(_("Name"));
-               } elseif ($this->orig_dn != $this->dn && $ldap->count()){
-                       $message[]= msgPool::duplicated(_("Name"));
-               }
+        /* Check for presence of this department */
+        $ldap= $this->config->get_ldap_link();
+        $ldap->ls ("(&(dc=".$this->dc.")(objectClass=domain))", $this->base, array('dn'));
+        if ($this->orig_dc == "new" && $ldap->count()){
+            $message[]= msgPool::duplicated(_("Name"));
+        } elseif ($this->orig_dn != $this->dn && $ldap->count()){
+            $message[]= msgPool::duplicated(_("Name"));
+        }
 
-               /* All required fields are set? */
-               if ($this->dc == ""){
-                       $message[]= msgPool::required(_("Name"));
-               }elseif(tests::is_department_name_reserved($this->dc,$this->base)){
-      $message[]= msgPool::reserved(_("Name"));
-    }elseif(!preg_match ('/[a-z0-9 \.,\-_]/i', $this->dc)){
-                       $message[]= msgPool::invalid(_("Name"), $this->dc, "/[a-z0-9 \.,\-_]/");
-               }
+        /* All required fields are set? */
+        if ($this->dc == ""){
+            $message[]= msgPool::required(_("Name"));
+        }elseif(tests::is_department_name_reserved($this->dc,$this->base)){
+            $message[]= msgPool::reserved(_("Name"));
+        }elseif(!preg_match ('/[a-z0-9 \.,\-_]/i', $this->dc)){
+            $message[]= msgPool::invalid(_("Name"), $this->dc, "/[a-z0-9 \.,\-_]/");
+        }
 
-    /* Check description */
-               if ($this->description == ""){
-                       $message[]= msgPool::required(_("Description"));
-               }
+        /* Check description */
+        if ($this->description == ""){
+            $message[]= msgPool::required(_("Description"));
+        }
 
-    /* Check if we are allowed to create or move this object
-     */
-    if($this->orig_dn == "new" && !$this->acl_is_createable($this->base)){
-      $message[] = msgPool::permCreate();
-    }elseif($this->orig_dn != "new" && $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){
-      $message[] = msgPool::permMove();
-    }
+        /* Check if we are allowed to create or move this object
+         */
+        if($this->orig_dn == "new" && !$this->acl_is_createable($this->base)){
+            $message[] = msgPool::permCreate();
+        }elseif($this->orig_dn != "new" && $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){
+            $message[] = msgPool::permMove();
+        }
 
-    return($message);
-  }
+        return($message);
+    }
 
 
-  /* Return plugin informations for acl handling */ 
-  static function plInfo()
-  {
-    return (array("plShortName"   => _("Domain Component"),
-          "plDescription" => _("Domain Component"),
-          "plSelfModify"  => FALSE,
-          "plPriority"    => 4,
-          "plDepends"     => array(),
-          "plSection"     => array("administration"),
-          "plCategory"    => array("department"),
+    /* Return plugin informations for acl handling */ 
+    static function plInfo()
+    {
+        return (array("plShortName"   => _("Domain Component"),
+                    "plDescription" => _("Domain Component"),
+                    "plSelfModify"  => FALSE,
+                    "plPriority"    => 4,
+                    "plDepends"     => array(),
+                    "plSection"     => array("administration"),
+                    "plCategory"    => array("department"),
 
-          "plProvidedAcls" => array(
-            "dc"                => _("Name"),
-            "description"       => _("Description"),
-            "base"              => _("Base"),
-            "manager"                 => _("Manager"),
-            "gosaUnitTag"       => _("Administrative settings"))
-          ));
-  }
+                    "plProvidedAcls" => array(
+                        "dc"                => _("Name"),
+                        "description"       => _("Description"),
+                        "base"              => _("Base"),
+                        "manager"                 => _("Manager"),
+                        "gosaUnitTag"       => _("Administrative settings"))
+                    ));
+    }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: