summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2022-06-10 13:39:00 +0300
committerAndrew Dolgov <[email protected]>2022-06-10 13:39:00 +0300
commitcf1eaeedf3026948cf2210af1c747bdc3522d6ff (patch)
tree31780f12fb075b6b37be7a8f2fb813ba9db4980a /plugins
parent2975c7297b680e486f326939b9fba82d8cf18035 (diff)
* add UserHelper methods to manipulate user database (add, modify, delete)
* expose said methods via CLI (update.php) * fix several invocations of deprecated functions * set stricter type hints on several method arguments
Diffstat (limited to 'plugins')
-rw-r--r--plugins/auth_internal/init.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/auth_internal/init.php b/plugins/auth_internal/init.php
index 688a0f5d8..882b5506a 100644
--- a/plugins/auth_internal/init.php
+++ b/plugins/auth_internal/init.php
@@ -18,14 +18,14 @@ class Auth_Internal extends Auth_Base {
$otp = (int) ($_REQUEST["otp"] ?? 0);
// don't bother with null/null logins for auth_external etc
- if ($login && get_schema_version() > 96) {
+ if ($login && Config::get_schema_version() > 96) {
$user_id = UserHelper::find_user_by_login($login);
if ($user_id && UserHelper::is_otp_enabled($user_id)) {
// only allow app passwords for service logins if OTP is enabled
- if ($service && get_schema_version() > 138) {
+ if ($service && Config::get_schema_version() > 138) {
return $this->check_app_password($login, $password, $service);
}
@@ -106,7 +106,7 @@ class Auth_Internal extends Auth_Base {
// service logins: check app passwords first but allow regular password
// as a fallback if OTP is not enabled
- if ($service && get_schema_version() > 138) {
+ if ($service && Config::get_schema_version() > 138) {
$user_id = $this->check_app_password($login, $password, $service);
if ($user_id)
@@ -119,7 +119,7 @@ class Auth_Internal extends Auth_Base {
->find_one();
if ($user) {
- if (get_schema_version() >= 145) {
+ if (Config::get_schema_version() >= 145) {
if ($user->last_auth_attempt) {
$last_auth_attempt = strtotime($user->last_auth_attempt);
@@ -145,7 +145,7 @@ class Auth_Internal extends Auth_Base {
if ($auth_result) {
return $auth_result;
} else {
- if (get_schema_version() >= 145) {
+ if (Config::get_schema_version() >= 145) {
$user->last_auth_attempt = Db::NOW();
$user->save();
}
@@ -176,7 +176,7 @@ class Auth_Internal extends Auth_Base {
list ($pwd_algo, $raw_hash) = explode(":", $pwd_hash, 2);
// check app password only if service is specified
- if ($service && get_schema_version() > 138) {
+ if ($service && Config::get_schema_version() > 138) {
return $this->check_app_password($login, $password, $service);
}