From d989bee07974ade3ae7cebb5b167103133c45365 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 7 May 2008 06:53:32 +0000 Subject: [PATCH] Added additional checks for policies git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10798 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../services/kerberos/class_krb5_policy.inc | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_krb5_policy.inc b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_krb5_policy.inc index 24df26203..e52889aea 100644 --- a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_krb5_policy.inc +++ b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_krb5_policy.inc @@ -82,19 +82,40 @@ class krb5_policy extends plugin $message[] = msgPool::toosmall(_("Password history")); } - /* Check password */ + /* Check password minimum length */ if(!is_numeric($this->data['PW_MIN_LENGTH'])){ $message[] = msgPool::invalid(_("Password minimum length")); }elseif($this->data['PW_MIN_LENGTH'] <= 0){ $message[] = msgPool::toosmall(_("Password minimum length")); } - /* Check password history */ - if(!is_numeric($this->data['PW_MIN_LENGTH'])){ - $message[] = msgPool::invalid(_("Password minimum length")); - }elseif($this->data['PW_MIN_LENGTH'] <= 0){ - $message[] = msgPool::toosmall(_("Password minimum length")); + /* Check password different character classes */ + if(!is_numeric($this->data['PW_MIN_CLASSES'])){ + $message[] = msgPool::invalid(_("Password min characters")); + }elseif($this->data['PW_MIN_CLASSES'] <= 0){ + $message[] = msgPool::toosmall(_("Password min characters")); + }elseif($this->data['PW_MIN_CLASSES'] > $this->data['PW_MIN_LENGTH']){ + $message[] = sprintf(_("The value specified for '%s' must be smaller than the value specified for '%s'."), + _("Password min characters"),_("Password minimum length")); } + + /* Check password min lifetime */ + if(!is_numeric($this->data['PW_MIN_LIFE'])){ + $message[] = msgPool::invalid(_("Password minimum lifetime")); + }elseif($this->data['PW_MIN_LIFE'] <= 0){ + $message[] = msgPool::toosmall(_("Password minimum lifetime")); + } + + /* Check password lifetime */ + if(!is_numeric($this->data['PW_MAX_LIFE'])){ + $message[] = msgPool::invalid(_("Password lifetime")); + }elseif($this->data['PW_MAX_LIFE'] <= 0){ + $message[] = msgPool::toosmall(_("Password lifetime")); + }elseif($this->data['PW_MAX_LIFE'] < $this->data['PW_MIN_LIFE']){ + $message[] = sprintf(_("The value specified for '%s' must be smaller than the value specified for '%s'."), + _("Password minimum lifetime"),_("Password lifetime")); + } + return($message); } -- 2.30.2