added new error handling

This commit is contained in:
katagia 2004-09-21 10:43:29 +00:00
parent 0aa6874931
commit 3755ef4bb8
1 changed files with 7 additions and 1 deletions

View File

@ -106,6 +106,12 @@ class sambaGroupMapping extends baseModule {
return $return; return $return;
} }
/** this functin fills the error message array with messages
**/
function loadErrorMessages() {
$this->errormessages['sambaSID'][0] = array('ERROR', _('Special Group'),sprintf( _('There can be only one group %s.'), $rids[$i]), 'sambaSID');
}
// Constructor // Constructor
function init($base) { function init($base) {
// call parent init // call parent init
@ -220,7 +226,7 @@ class sambaGroupMapping extends baseModule {
$this->attributes['sambaSID'][0] = $SID."-".$this->rids[$rids[$i]]; $this->attributes['sambaSID'][0] = $SID."-".$this->rids[$rids[$i]];
// Do a check if special grou pis unique // Do a check if special grou pis unique
if ($_SESSION['cache']->in_cache($SID."-".$this->rids[$rids[$i]], 'sambaSID', 'group')) if ($_SESSION['cache']->in_cache($SID."-".$this->rids[$rids[$i]], 'sambaSID', 'group'))
$errors[] = array('ERROR', _('Special Group'),sprintf( _('There can be only one group %s.'), $rids[$i]), 'sambaSID'); $errors[] = $this->errormessages['sambaSID'][0];
} }
} }
if (!$wrid) $this->attributes['sambaSID'][0] = $SID . "-" . ($_SESSION[$this->base]->module['posixGroup']->attributes['gidNumber'][0]*2+$RIDbase+1); if (!$wrid) $this->attributes['sambaSID'][0] = $SID . "-" . ($_SESSION[$this->base]->module['posixGroup']->attributes['gidNumber'][0]*2+$RIDbase+1);