summaryrefslogtreecommitdiff
path: root/includes/sys_auth.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-01-21 23:07:20 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-01-21 23:07:20 +0100
commit8506d6d27e3b926521007064abcdcc2f69c6aa06 (patch)
tree4c0207871b3e9a831f8a619ff095ad71adb66f05 /includes/sys_auth.php
parent740026a9de6cba73c4e77aba78950d0a791b6b62 (diff)
Refactoring: Config cleanup / moved to class
Diffstat (limited to 'includes/sys_auth.php')
-rw-r--r--includes/sys_auth.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/includes/sys_auth.php b/includes/sys_auth.php
index 083c1b8d..856ed4ab 100644
--- a/includes/sys_auth.php
+++ b/includes/sys_auth.php
@@ -59,7 +59,6 @@ function generate_salt($length = 16)
*/
function set_password($uid, $password)
{
- global $crypt_alg;
$result = DB::update('
UPDATE `User`
SET `Passwort` = ?,
@@ -68,7 +67,7 @@ function set_password($uid, $password)
LIMIT 1
',
[
- crypt($password, $crypt_alg . '$' . generate_salt(16) . '$'),
+ crypt($password, config('crypt_alg') . '$' . generate_salt(16) . '$'),
$uid
]
);
@@ -89,7 +88,7 @@ function set_password($uid, $password)
*/
function verify_password($password, $salt, $uid = null)
{
- global $crypt_alg;
+ $crypt_alg = config('crypt_alg');
$correct = false;
if (substr($salt, 0, 1) == '$') { // new-style crypt()
$correct = crypt($password, $salt) == $salt;