From dac19d87b1c69bb046ad33a5bbd560df3fde144e Mon Sep 17 00:00:00 2001 From: cajus Date: Mon, 1 Feb 2010 10:01:04 +0000 Subject: [PATCH] Added base checks git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15526 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_listing.inc | 4 ++++ gosa-core/plugins/admin/acl/class_aclRole.inc | 5 +++++ .../plugins/admin/departments/class_department.inc | 5 +++++ gosa-core/plugins/admin/groups/class_group.inc | 10 ++++++++++ gosa-core/plugins/personal/generic/class_user.inc | 5 +++++ 5 files changed, 29 insertions(+) diff --git a/gosa-core/include/class_listing.inc b/gosa-core/include/class_listing.inc index d1a2d3d13..d939882cf 100644 --- a/gosa-core/include/class_listing.inc +++ b/gosa-core/include/class_listing.inc @@ -472,6 +472,10 @@ class listing { // Take care of base selector if ($this->baseMode) { $this->baseSelector->update(); + // Check if a wrong base was supplied + if(!$this->baseSelector->checkLastBaseUpdate()){ + msg_dialog::display(_("Error"), msgPool::check_base(), ERROR_DIALOG); + } } // Save base diff --git a/gosa-core/plugins/admin/acl/class_aclRole.inc b/gosa-core/plugins/admin/acl/class_aclRole.inc index cc94aedb9..91881e570 100644 --- a/gosa-core/plugins/admin/acl/class_aclRole.inc +++ b/gosa-core/plugins/admin/acl/class_aclRole.inc @@ -761,6 +761,11 @@ class aclrole extends acl if(!count($this->gosaAclTemplate)){ $message[] = msgPool::required(_("ACL")); } + + // Check if a wrong base was supplied + if(!$this->baseSelector->checkLastBaseUpdate()){ + $message[]= msgPool::check_base();; + } /* Check if we are allowed to create or move this object */ diff --git a/gosa-core/plugins/admin/departments/class_department.inc b/gosa-core/plugins/admin/departments/class_department.inc index 685564bf5..ba0cc5709 100644 --- a/gosa-core/plugins/admin/departments/class_department.inc +++ b/gosa-core/plugins/admin/departments/class_department.inc @@ -312,6 +312,11 @@ class department extends plugin $message[]= msgPool::invalid(_("Fax"), $this->facsimileTelephoneNumber, "/[\/0-9 ()+*-]/"); } + // Check if a wrong base was supplied + if(!$this->baseSelector->checkLastBaseUpdate()){ + $message[]= msgPool::check_base();; + } + /* Check if we are allowed to create or move this object */ if($this->orig_dn == "new" && !$this->acl_is_createable($this->base)){ diff --git a/gosa-core/plugins/admin/groups/class_group.inc b/gosa-core/plugins/admin/groups/class_group.inc index d63a6965b..fa2e63cdb 100644 --- a/gosa-core/plugins/admin/groups/class_group.inc +++ b/gosa-core/plugins/admin/groups/class_group.inc @@ -1054,6 +1054,11 @@ class group extends plugin $message[]= msgPool::required(_("Name")); } + // Check if a wrong base was supplied + if(!$this->baseSelector->checkLastBaseUpdate()){ + $message[]= msgPool::check_base();; + } + /* Check for valid input */ if (!tests::is_uid($this->cn)){ if (strict_uid_mode()){ @@ -1063,6 +1068,11 @@ class group extends plugin } } + // Check if a wrong base was supplied + if(!$this->baseSelector->checkLastBaseUpdate()){ + $message[]= msgPool::check_base();; + } + if($this->allowGroupsWithSameNameInOtherSubtrees == true){ /* Check for used 'cn' */ diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc index 4ceb1dc2a..4eeadb7a5 100644 --- a/gosa-core/plugins/personal/generic/class_user.inc +++ b/gosa-core/plugins/personal/generic/class_user.inc @@ -1271,6 +1271,11 @@ class user extends plugin $message[]= msgPool::required(_("Name")); } + // Check if a wrong base was supplied + if(!$this->baseSelector->checkLastBaseUpdate()){ + $message[]= msgPool::check_base();; + } + if (!$this->is_template){ if ($this->givenName == ""){ $message[]= msgPool::required(_("Given name")); -- 2.30.2