ACL\Login move public var to private: login

the former public var $login is now private and if it is set can be
checked with loginActionSet (true if login_login was in _POST as login
action.

Some info update for phpUnit ACL\Login test file
This commit is contained in:
Clemens Schwaighofer
2022-06-23 09:12:46 +09:00
parent b61152f10e
commit d97b173ee7
3 changed files with 34 additions and 15 deletions

View File

@@ -108,7 +108,7 @@ $data = [
];
// log action
// no log if login
if (!$login->login) {
if (!$login->loginActionRun()) {
$cms->adbEditLog('Submit', $data, 'BINARY');
}
//------------------------------ logging end

View File

@@ -79,12 +79,12 @@ class Login
/** @var string source, either _GET or _POST or empty */
private $login_user_id_source = '';
/** @var bool set to true if illegal characters where found in the login user id string */
private $login_unclear = false;
private $login_user_id_unclear = false;
// is set to one if login okay, or EUID is set and user is okay to access this page
/** @var bool */
private $permission_okay = false;
/** @var string pressed login */
public $login;
private $login = '';
/** @var string master action command */
private $action;
/** @var string login name */
@@ -1564,7 +1564,7 @@ EOM;
);
// flag unclean input data
if ($login_user_id_changed > 0) {
$this->login_unclear = true;
$this->login_user_id_unclear = true;
// error for invalid user id?
$this->log->debug('LOGIN USER ID', 'Invalid characters: '
. $login_user_id_changed . ' in loginUserId: '
@@ -2139,6 +2139,16 @@ EOM;
return false;
}
/**
* Returns true if login button was pressed
*
* @return bool If login action was run, return true
*/
public function loginActionRun(): bool
{
return empty($this->login) ? false : true;
}
/**
* Returns current set loginUserId or empty if unset
*
@@ -2167,7 +2177,7 @@ EOM;
*/
public function loginGetLoginUserIdUnclean(): bool
{
return $this->login_unclear;
return $this->login_user_id_unclear;
}
/**