From 2c991d9075c2427519c67cef5bd56f31eed77cce Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 26 Sep 2004 15:55:29 +0000 Subject: [PATCH] use preg-checks --- lam/lib/modules/inetOrgPerson.inc | 10 +++++++--- lam/lib/modules/sambaAccount.inc | 10 +++++----- lam/lib/modules/sambaSamAccount.inc | 16 ++++++++++++---- lam/lib/modules/shadowAccount.inc | 23 +++++++++++++++++------ 4 files changed, 41 insertions(+), 18 deletions(-) diff --git a/lam/lib/modules/inetOrgPerson.inc b/lam/lib/modules/inetOrgPerson.inc index 04f81775..c15c5db4 100644 --- a/lam/lib/modules/inetOrgPerson.inc +++ b/lam/lib/modules/inetOrgPerson.inc @@ -87,10 +87,14 @@ class inetOrgPerson extends baseModule { 2 => array('kind' => 'help', 'value' => 'TODO')) ); // profile checks - $return['profile_checks']['inetOrgPerson_title'] = array('type' => 'regex_i', 'regex' => 'title', + $return['profile_checks']['inetOrgPerson_title'] = array( + 'type' => 'ext_preg', + 'regex' => 'title', 'error_message' => $this->messages['title'][0]); - $return['profile_checks']['inetOrgPerson_employeeType'] = array('type' => 'regex_i', - 'regex' => 'employeeType', 'error_message' => $this->messages['employeeType'][0]); + $return['profile_checks']['inetOrgPerson_employeeType'] = array( + 'type' => 'ext_preg', + 'regex' => 'employeeType', + 'error_message' => $this->messages['employeeType'][0]); // available PDF fields $return['PDF_fields'] = array( 'description', 'host', diff --git a/lam/lib/modules/sambaAccount.inc b/lam/lib/modules/sambaAccount.inc index 25ef53e7..4f710618 100644 --- a/lam/lib/modules/sambaAccount.inc +++ b/lam/lib/modules/sambaAccount.inc @@ -136,15 +136,15 @@ class sambaAccount extends baseModule { 2 => array('kind' => 'help', 'value' => 'TODO') ); // profile checks - $return['profile_checks']['sambaAccount_smbhome'] = array('type' => 'regex_i', 'regex' => 'UNC', + $return['profile_checks']['sambaAccount_smbhome'] = array('type' => 'ext_preg', 'regex' => 'UNC', 'error_message' => $this->messages['homePath'][0]); - $return['profile_checks']['sambaAccount_profilePath'] = array('type' => 'regex_i', 'regex' => 'UNC', + $return['profile_checks']['sambaAccount_profilePath'] = array('type' => 'ext_preg', 'regex' => 'UNC', 'error_message' => $this->messages['profilePath'][0]); - $return['profile_checks']['sambaAccount_scriptPath'] = array('type' => 'regex_i', 'regex' => 'logonScript', + $return['profile_checks']['sambaAccount_scriptPath'] = array('type' => 'ext_preg', 'regex' => 'logonScript', 'error_message' => $this->messages['logonScript'][0]); - $return['profile_checks']['sambaAccount_userWorkstations'] = array('type' => 'regex_i', 'regex' => 'unixhost', + $return['profile_checks']['sambaAccount_userWorkstations'] = array('type' => 'ext_preg', 'regex' => 'unixhost', 'error_message' => $this->messages['workstations'][0]); - $return['profile_checks']['sambaAccount_domain'] = array('type' => 'regex_i', 'regex' => 'domainname', + $return['profile_checks']['sambaAccount_domain'] = array('type' => 'ext_preg', 'regex' => 'domainname', 'error_message' => $this->messages['domain'][0]); // available PDF fields $return['PDF_fields'] = array( 'displayName', diff --git a/lam/lib/modules/sambaSamAccount.inc b/lam/lib/modules/sambaSamAccount.inc index ab0df2c9..82f522c8 100644 --- a/lam/lib/modules/sambaSamAccount.inc +++ b/lam/lib/modules/sambaSamAccount.inc @@ -69,13 +69,21 @@ class sambaSamAccount extends baseModule { // module dependencies $return['dependencies'] = array('depends' => array('posixAccount'), 'conflicts' => array()); // profile checks - $return['profile_checks']['sambaSamAccount_smbhome'] = array('type' => 'regex_i', 'regex' => 'UNC', + $return['profile_checks']['sambaSamAccount_smbhome'] = array( + 'type' => 'ext_preg', + 'regex' => 'UNC', 'error_message' => $this->messages['homePath'][0]); - $return['profile_checks']['sambaSamAccount_profilePath'] = array('type' => 'regex_i', 'regex' => 'UNC', + $return['profile_checks']['sambaSamAccount_profilePath'] = array( + 'type' => 'ext_preg', + 'regex' => 'UNC', 'error_message' => $this->messages['profilePath'][0]); - $return['profile_checks']['sambaSamAccount_logonScript'] = array('type' => 'regex_i', 'regex' => 'logonscript', + $return['profile_checks']['sambaSamAccount_logonScript'] = array( + 'type' => 'ext_preg', + 'regex' => 'logonscript', 'error_message' => $this->messages['logonScript'][0]); - $return['profile_checks']['sambaSamAccount_userWorkstations'] = array('type' => 'regex_i', 'regex' => 'unixhost', + $return['profile_checks']['sambaSamAccount_userWorkstations'] = array( + 'type' => 'ext_preg', + 'regex' => 'unixhost', 'error_message' => $this->messages['workstations'][0]); // available PDF fields $return['PDF_fields'] = array( 'displayName', diff --git a/lam/lib/modules/shadowAccount.inc b/lam/lib/modules/shadowAccount.inc index 43b94411..291db891 100644 --- a/lam/lib/modules/shadowAccount.inc +++ b/lam/lib/modules/shadowAccount.inc @@ -98,15 +98,26 @@ class shadowAccount extends baseModule { 2 => array('kind' => 'help', 'value' => 'TODO')) ); // profile checks - $return['profile_checks']['shadowAccount_shadowMin'] = array('type' => 'regex', 'regex' => 'digit', + $return['profile_checks']['shadowAccount_shadowMin'] = array( + 'type' => 'ext_preg', + 'regex' => 'digit', 'error_message' => $this->messages['shadowMin'][0]); - $return['profile_checks']['shadowAccount_shadowMax'] = array('type' => 'regex', 'regex' => 'digit', + $return['profile_checks']['shadowAccount_shadowMax'] = array( + 'type' => 'ext_preg', + 'regex' => 'digit', 'error_message' => $this->messages['shadowMax'][0]); - $return['profile_checks']['shadowAccount_cmp'] = array('type' => 'int_greater', 'cmp_name1' => 'shadowAccount_shadowMax', - 'cmp_name2' => 'shadowAccount_shadowMin', 'error_message' => $this->messages['shadow_cmp'][0]); - $return['profile_checks']['shadowAccount_shadowInactive'] = array('type' => 'regex', 'regex' => 'digit2', + $return['profile_checks']['shadowAccount_cmp'] = array( + 'type' => 'int_greater', + 'cmp_name1' => 'shadowAccount_shadowMax', + 'cmp_name2' => 'shadowAccount_shadowMin', + 'error_message' => $this->messages['shadow_cmp'][0]); + $return['profile_checks']['shadowAccount_shadowInactive'] = array( + 'type' => 'ext_preg', + 'regex' => 'digit2', 'error_message' => $this->messages['inactive'][0]); - $return['profile_checks']['shadowAccount_shadowWarning'] = array('type' => 'regex', 'regex' => 'digit', + $return['profile_checks']['shadowAccount_shadowWarning'] = array( + 'type' => 'ext_preg', + 'regex' => 'digit', 'error_message' => $this->messages['shadowWarning'][0]); // available PDF fields $return['PDF_fields'] = array( 'shadowLastChange',