From 98e16e6143c50924d1a2529458cb3bb26c74d3d3 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Fri, 14 Dec 2018 13:07:10 +0900 Subject: [PATCH] Some minor updates for test files --- www/admin/class_test.php | 22 ++++++++++--------- www/admin/error_test.php | 2 +- www/admin/l10n_test.php | 17 ++++++++++++++ www/lib/CoreLibs/ACL/Login.inc | 15 ++++++++----- www/lib/CoreLibs/DB/IO.inc | 2 ++ .../CoreLibs/Language/Core/GetTextReader.inc | 2 +- www/lib/CoreLibs/Language/L10n.inc | 3 ++- 7 files changed, 45 insertions(+), 18 deletions(-) create mode 100755 www/admin/l10n_test.php diff --git a/www/admin/class_test.php b/www/admin/class_test.php index 3a95e779..9f2ee147 100644 --- a/www/admin/class_test.php +++ b/www/admin/class_test.php @@ -32,7 +32,7 @@ ob_end_flush(); // set + check edit access id $edit_access_id = 3; -if (array_key_exists('unit', $login->acl)) { +if (isset($login) && is_object($login) && isset($login->acl['unit'])) { print "ACL UNIT: ".print_r(array_keys($login->acl['unit']), 1)."
"; print "ACCESS CHECK: ".$login->loginCheckEditAccess($edit_access_id)."
"; if ($login->loginCheckEditAccess($edit_access_id)) { @@ -68,14 +68,16 @@ print "CALLER BACKTRACE: ".$basic->getCallerMethod()."
"; $basic->debug('SOME MARK', 'Some error output'); print "EDIT ACCESS ID: ".$basic->edit_access_id."
"; -// print "ACL:
".$basic->print_ar($login->acl)."
"; -$basic->debug('ACL', "ACL: ".$basic->printAr($login->acl)); -// print "DEFAULT ACL:
".$basic->print_ar($login->default_acl_list)."
"; -// print "DEFAULT ACL:
".$basic->print_ar($login->default_acl_list)."
"; -// $result = array_flip(array_filter(array_flip($login->default_acl_list), function ($key) { if (is_numeric($key)) return $key; })); -// print "DEFAULT ACL:
".$basic->print_ar($result)."
"; -// DEPRICATED CALL -// $basic->adbSetACL($login->acl); +if (isset($login)) { + // print "ACL:
".$basic->print_ar($login->acl)."
"; + $basic->debug('ACL', "ACL: ".$basic->printAr($login->acl)); + // print "DEFAULT ACL:
".$basic->print_ar($login->default_acl_list)."
"; + // print "DEFAULT ACL:
".$basic->print_ar($login->default_acl_list)."
"; + // $result = array_flip(array_filter(array_flip($login->default_acl_list), function ($key) { if (is_numeric($key)) return $key; })); + // print "DEFAULT ACL:
".$basic->print_ar($result)."
"; + // DEPRICATED CALL + // $basic->adbSetACL($login->acl); +} // DB client encoding print "DB Client encoding: ".$basic->dbGetEncoding()."
"; @@ -210,7 +212,7 @@ print "COMPARE DATE: ".$basic->compareDate($date_1, $date_2)."
"; // array re // print error messages -print $login->printErrorMsg(); +// print $login->printErrorMsg(); print $basic->printErrorMsg(); print ""; diff --git a/www/admin/error_test.php b/www/admin/error_test.php index 5abf6593..2a57a571 100644 --- a/www/admin/error_test.php +++ b/www/admin/error_test.php @@ -10,7 +10,7 @@ if ($DEBUG_ALL) { } // sample config -require("config.inc"); +require 'config.php'; echo "FILE: ".BASE.LIB."Error.Handling.inc
"; require(BASE.LIB."Error.Handling.inc"); diff --git a/www/admin/l10n_test.php b/www/admin/l10n_test.php new file mode 100755 index 00000000..7368d003 --- /dev/null +++ b/www/admin/l10n_test.php @@ -0,0 +1,17 @@ +"; + +ob_end_flush(); +// __END__ diff --git a/www/lib/CoreLibs/ACL/Login.inc b/www/lib/CoreLibs/ACL/Login.inc index 1804d9d8..9f614e17 100644 --- a/www/lib/CoreLibs/ACL/Login.inc +++ b/www/lib/CoreLibs/ACL/Login.inc @@ -72,6 +72,11 @@ class Login extends \CoreLibs\DB\IO private $password_change_ok = false; // password change was successful private $password_forgot = false; // can we reset password and mail to user with new password set screen private $password_forgot_ok = false; // password forgot mail send ok + private $change_password; + private $pw_username; + private $pw_old_password; + private $pw_new_password; + private $pw_new_password_confirm; private $pw_change_deny_users = array (); // array of users for which the password change is forbidden // if we have password change we need to define some rules @@ -179,12 +184,12 @@ class Login extends \CoreLibs\DB\IO $_POST['pw_new_password_confirm'] = ''; } // pass on vars to Object vars - $this->login = $_POST["login_login"]; - $this->username = $_POST["login_username"]; - $this->password = $_POST["login_password"]; - $this->logout = $_POST["login_logout"]; + $this->login = $_POST['login_login']; + $this->username = $_POST['login_username']; + $this->password = $_POST['login_password']; + $this->logout = $_POST['login_logout']; // password change vars - $this->change_password = $_POST["change_password"]; + $this->change_password = $_POST['change_password']; $this->pw_username = $_POST['pw_username']; $this->pw_old_password = $_POST['pw_old_password']; $this->pw_new_password = $_POST['pw_new_password']; diff --git a/www/lib/CoreLibs/DB/IO.inc b/www/lib/CoreLibs/DB/IO.inc index 81ccd06d..26dca161 100644 --- a/www/lib/CoreLibs/DB/IO.inc +++ b/www/lib/CoreLibs/DB/IO.inc @@ -2117,3 +2117,5 @@ class IO extends \CoreLibs\Basic return $this->dbSqlEscape($value, $kbn); } } // end if db class + +// __END__ diff --git a/www/lib/CoreLibs/Language/Core/GetTextReader.inc b/www/lib/CoreLibs/Language/Core/GetTextReader.inc index f0f77eaa..beca2118 100755 --- a/www/lib/CoreLibs/Language/Core/GetTextReader.inc +++ b/www/lib/CoreLibs/Language/Core/GetTextReader.inc @@ -457,4 +457,4 @@ class GetTextReader } } -# __END__ \ No newline at end of file +# __END__ diff --git a/www/lib/CoreLibs/Language/L10n.inc b/www/lib/CoreLibs/Language/L10n.inc index 43061be8..6475a49c 100644 --- a/www/lib/CoreLibs/Language/L10n.inc +++ b/www/lib/CoreLibs/Language/L10n.inc @@ -57,7 +57,6 @@ class L10n extends \CoreLibs\Basic } else { $this->input = false; } - $this->l10n = new GetTextReader($this->input); } @@ -114,3 +113,5 @@ class L10n extends \CoreLibs\Basic return $this->mofile; } } + +// __END__