fixed loading of errormessages, moved config messages to errormessages

This commit is contained in:
Roland Gruber 2004-09-25 10:02:56 +00:00
parent 187f537a08
commit 9afa90dacc
1 changed files with 22 additions and 13 deletions

View File

@ -35,10 +35,8 @@ class posixGroup extends baseModule {
* Creates a new posixGroup object.
*/
function posixGroup($scope) {
// error messages for input checks
$this->messages['minGID'] = array('ERROR', _('Minimum GID number'), _('Minimum GID number is invalid or empty!'));
$this->messages['maxGID'] = array('ERROR', _('Maximum GID number'), _('Maximum GID number is invalid or empty!'));
$this->messages['cmpGID'] = array('ERROR', _('Maximum GID number'), _('Maximum GID number must be greater than minimum GID number!'));
// load error messages
$this->load_errorMessages();
// call parent constructor
parent::baseModule($scope);
}
@ -254,12 +252,23 @@ class posixGroup extends baseModule {
)
);
// configuration checks
$return['config_checks']['group']['posixGroup_minGID'] = array('type' => 'regex', 'regex' => '^[0-9]+$',
'required' => true, 'required_message' => $this->messages['minGID'], 'error_message' => $this->messages['minGID']);
$return['config_checks']['group']['posixGroup_maxGID'] = array('type' => 'regex', 'regex' => '^[0-9]+$',
'required' => true, 'required_message' => $this->messages['maxGID'], 'error_message' => $this->messages['maxGID']);
$return['config_checks']['group']['cmpGID'] = array('type' => 'int_greater', 'cmp_name1' => 'posixGroup_maxGID',
'cmp_name2' => 'posixGroup_minGID', 'error_message' => $this->messages['cmpGID']);
$return['config_checks']['group']['posixGroup_minGID'] = array(
'type' => 'regex',
'regex' => '^[0-9]+$',
'required' => true,
'required_message' => $this->errormessages['gidNumber'][5],
'error_message' => $this->errormessages['gidNumber'][5]);
$return['config_checks']['group']['posixGroup_maxGID'] = array(
'type' => 'regex',
'regex' => '^[0-9]+$',
'required' => true,
'required_message' => $this->errormessages['gidNumber'][6],
'error_message' => $this->errormessages['gidNumber'][6]);
$return['config_checks']['group']['cmpGID'] = array(
'type' => 'int_greater',
'cmp_name1' => 'posixGroup_maxGID',
'cmp_name2' => 'posixGroup_minGID',
'error_message' => $this->errormessages['gidNumber'][7]);
// available PDF fields
$return['PDF_fields'] = array( 'cn',
'gidNumber',
@ -348,15 +357,15 @@ class posixGroup extends baseModule {
/** this functin fills the error message array with messages
**/
function load_errorMessages() {
$this->errormessages['minGID'][0] = array('ERROR', _('Minimum GID number'), _('Minimum GID number is invalid or empty!'));
$this->errormessages['maxGID'][0] = array('ERROR', _('Maximum GID number'), _('Maximum GID number is invalid or empty!'));
$this->errormessages['cmpGID'][0] = array('ERROR', _('Maximum GID number'), _('Maximum GID number must be greater than minimum GID number!'));
$this->errormessages['userPassword'][0] = array('ERROR', _('Password'), _('Please enter the same password in both password-fields.'));
$this->errormessages['userPassword'][1] = array('ERROR', _('Password'), _('Password contains invalid characters. Valid characters are: a-z, A-Z, 0-9 and #*,.;:_-+!$%&/|?{[()]}= !'));
$this->errormessages['gidNumber'][0] = array('INFO', _('GID number'), _('GID number has changed. Please select checkbox to change GID number of users and hosts.'));
$this->errormessages['gidNumber'][2] = array('WARN', _('ID-Number'), _('It is possible that this ID-number is reused. This can cause several problems because files with old permissions might still exist. To avoid this warning set maxUID to a higher value.'));
$this->errormessages['gidNumber'][3] = array('ERROR', _('ID-Number'), _('No free ID-Number!'));
$this->errormessages['gidNumber'][4] = array('ERROR', _('ID-Number'), _('ID is already in use'));
$this->errormessages['gidNumber'][5] = array('ERROR', _('Minimum GID number'), _('Minimum GID number is invalid or empty!'));
$this->errormessages['gidNumber'][6] = array('ERROR', _('Maximum GID number'), _('Maximum GID number is invalid or empty!'));
$this->errormessages['gidNumber'][7] = array('ERROR', _('Maximum GID number'), _('Maximum GID number must be greater than minimum GID number!'));
$this->errormessages['cn'][0] = array('WARN', _('Groupname'), _('You are using a capital letters. This can cause problems because windows isn\'t case-sensitive.'));
$this->errormessages['cn'][1] = array('WARN', _('Groupname'), _('Groupname in use. Selected next free groupname.'));
$this->errormessages['cn'][2] = array('ERROR', _('Groupname'), _('Groupname contains invalid characters. Valid characters are: a-z, A-Z, 0-9 and .-_ !'));