removed double error messages when no domains are found

This commit is contained in:
Roland Gruber 2010-10-22 17:52:22 +00:00
parent 8e8efef77a
commit 249fcd5541
2 changed files with 18 additions and 22 deletions

View File

@ -77,21 +77,6 @@ class sambaGroupMapping extends baseModule {
$this->autoAddObjectClasses = false; $this->autoAddObjectClasses = false;
} }
/**
* Initializes the module after it became part of an accountContainer
*
* @param string $base the name of the accountContainer object ($_SESSION[$base])
*/
function init($base) {
// call parent init
parent::init($base);
$sambaDomains = search_domains();
if (sizeof($sambaDomains) == 0) {
StatusMessage("ERROR", _('No Samba 3 domains found in LDAP! Please create one first.'), '');
return;
}
}
/** /**
* Gets the GID number from the Unix group module. * Gets the GID number from the Unix group module.
* *
@ -441,6 +426,22 @@ class sambaGroupMapping extends baseModule {
return true; return true;
} }
/**
* This function is used to check if all settings for this module have been made.
*
* @see baseModule::module_complete
*
* @return boolean true, if settings are complete
*/
public function module_complete() {
if (!in_array('sambaGroupMapping', $this->attributes['objectClass'])) {
return true;
}
if (!isset($this->attributes['sambaSID']) || ($this->attributes['sambaSID'] == '')) {
return false;
}
return true;
}
/** /**
* Processes user input of the primary module page. * Processes user input of the primary module page.
@ -455,7 +456,7 @@ class sambaGroupMapping extends baseModule {
$errors = array(); $errors = array();
$sambaDomains = search_domains(); $sambaDomains = search_domains();
if (sizeof($sambaDomains) == 0) { if (sizeof($sambaDomains) == 0) {
return array(array(array("ERROR", _('No Samba 3 domains found in LDAP! Please create one first.')))); return array();
} }
// Save attributes // Save attributes
$this->attributes['displayName'][0] = $_POST['displayName']; $this->attributes['displayName'][0] = $_POST['displayName'];

View File

@ -584,11 +584,6 @@ class sambaSamAccount extends baseModule implements passwordService {
$this->noexpire = true; $this->noexpire = true;
$this->nopwd = false; $this->nopwd = false;
$this->deactivated = false; $this->deactivated = false;
$sambaDomains = search_domains();
if (sizeof($sambaDomains) == 0) {
StatusMessage("ERROR", _('No Samba 3 domains found in LDAP! Please create one first.'), '');
return;
}
} }
/** /**
@ -715,7 +710,7 @@ class sambaSamAccount extends baseModule implements passwordService {
$errors = array(); $errors = array();
$sambaDomains = search_domains(); $sambaDomains = search_domains();
if (sizeof($sambaDomains) == 0) { if (sizeof($sambaDomains) == 0) {
return array(array(array("ERROR", _('No Samba 3 domains found in LDAP! Please create one first.')))); return array();
} }
$attrs = $this->getAccountContainer()->getAccountModule('posixAccount')->getAttributes(); $attrs = $this->getAccountContainer()->getAccountModule('posixAccount')->getAttributes();
// Save attributes // Save attributes