From 50a6780614fad69fc040700dcf73745e4201d8b8 Mon Sep 17 00:00:00 2001 From: anuko Date: Sun, 5 Feb 2017 15:29:36 +0000 Subject: [PATCH] Refactored ActionErrors.class.php. --- WEB-INF/lib/auth/Auth_ldap.class.php | 2 +- WEB-INF/lib/form/ActionErrors.class.php | 50 ++++++++++++------------- WEB-INF/templates/footer.tpl | 2 +- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/WEB-INF/lib/auth/Auth_ldap.class.php b/WEB-INF/lib/auth/Auth_ldap.class.php index 625c4782..37101678 100644 --- a/WEB-INF/lib/auth/Auth_ldap.class.php +++ b/WEB-INF/lib/auth/Auth_ldap.class.php @@ -262,7 +262,7 @@ class Auth_ldap extends Auth { if (defined('AUTH_DEBUG') && isTrue(AUTH_DEBUG)) { echo '$member_of'; var_dump($member_of); echo '
'; - }; + } // check for group membership foreach ($member_of as $check_grp) { diff --git a/WEB-INF/lib/form/ActionErrors.class.php b/WEB-INF/lib/form/ActionErrors.class.php index 1f8aceb3..3eaf6872 100644 --- a/WEB-INF/lib/form/ActionErrors.class.php +++ b/WEB-INF/lib/form/ActionErrors.class.php @@ -27,35 +27,31 @@ // +----------------------------------------------------------------------+ class ActionErrors { - var $errors = array(); + var $errors = array(); - function __construct() { - } + function __construct() { + } - function no() { - return (count($this->errors)>0 ? false : true); - } + function no() { + return (count($this->errors) > 0 ? false : true); + } - function yes() { - return (count($this->errors)>0 ? true : false); - } + function yes() { + return (count($this->errors) > 0 ? true : false); + } - function add($message, $arg0 = '', $arg1 = '') { - $patterns = array ("/\{0\}/","/\{1\}/"); - $replace = array ($arg0, $arg1); - $message = preg_replace ($patterns, $replace, $message); - $this->errors[]["message"] = $message; - } - - function get($key) { - return $this->errors["$key"]["message"]; - } - - function dump() { - print_r($this->errors); - } - - function getErrors() { - return $this->errors; - } + function add($message, $arg0 = '', $arg1 = '') { + $patterns = array ('/\{0\}/','/\{1\}/'); + $replace = array($arg0, $arg1); + $message = preg_replace ($patterns, $replace, $message); + $this->errors[]['message'] = $message; + } + + function dump() { + print_r($this->errors); + } + + function getErrors() { + return $this->errors; + } } diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 3a12372f..65062b90 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.9.36.3561 | Copyright © Anuko | +  Anuko Time Tracker 1.9.36.3562 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1