mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
Api auth bearer token working
This commit is contained in:
parent
af800fa886
commit
88aed19d30
@ -168,6 +168,9 @@ function process_user_login_local($login, $pass, $api=false, $passAlreadyEncrypt
|
|||||||
|
|
||||||
$row = db_get_row_sql($sql);
|
$row = db_get_row_sql($sql);
|
||||||
|
|
||||||
|
if ($passAlreadyEncrypted) {
|
||||||
|
$credentials_check = $pass === $row['password'];
|
||||||
|
} else {
|
||||||
// Perform password check whether it is MD5-hashed (old hashing) or Bcrypt-hashed.
|
// Perform password check whether it is MD5-hashed (old hashing) or Bcrypt-hashed.
|
||||||
if (strlen($row['password']) === 32) {
|
if (strlen($row['password']) === 32) {
|
||||||
// MD5.
|
// MD5.
|
||||||
@ -176,6 +179,7 @@ function process_user_login_local($login, $pass, $api=false, $passAlreadyEncrypt
|
|||||||
// Bcrypt.
|
// Bcrypt.
|
||||||
$credentials_check = password_verify($pass, $row['password']);
|
$credentials_check = password_verify($pass, $row['password']);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($credentials_check === true) {
|
if ($credentials_check === true) {
|
||||||
// Login OK
|
// Login OK
|
||||||
|
@ -269,6 +269,7 @@ $user_id = '<div class="label_select_simple"><p class="edit_user_labels">'.__('U
|
|||||||
$user_id .= '<span>'.$id.'</span></div>';
|
$user_id .= '<span>'.$id.'</span></div>';
|
||||||
|
|
||||||
$user_id .= '<div class="label_select_simple"><p class="edit_user_labels">'.__('API Token').'</p>';
|
$user_id .= '<div class="label_select_simple"><p class="edit_user_labels">'.__('API Token').'</p>';
|
||||||
|
if (is_management_allowed()) {
|
||||||
$user_id .= html_print_anchor(
|
$user_id .= html_print_anchor(
|
||||||
[
|
[
|
||||||
'onClick' => sprintf(
|
'onClick' => sprintf(
|
||||||
@ -289,6 +290,8 @@ $user_id .= html_print_anchor(
|
|||||||
],
|
],
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check php conf for header auth.
|
// Check php conf for header auth.
|
||||||
$lines = file('/etc/httpd/conf.d/php.conf');
|
$lines = file('/etc/httpd/conf.d/php.conf');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user