summaryrefslogtreecommitdiff
path: root/account/security.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-12-09 01:43:12 +0500
committerilotterytea <iltsu@alright.party>2025-12-09 01:43:12 +0500
commit29477e67ede12347b153e2255325327374e1b073 (patch)
treebe9170a20d332eab1fcc8b380f70f231921aac45 /account/security.php
parent28bb4f3618e2e947d14a05a24e99d826c26c0ce3 (diff)
feat: new configuration
Diffstat (limited to 'account/security.php')
-rw-r--r--account/security.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/account/security.php b/account/security.php
index a0210b5..11738dc 100644
--- a/account/security.php
+++ b/account/security.php
@@ -10,7 +10,7 @@ if ($_SERVER["REQUEST_METHOD"] != "POST" || !authorize_user(true)) {
exit;
}
-$db = new PDO(DB_URL, DB_USER, DB_PASS);
+$db = new PDO(CONFIG['database']['url'], CONFIG['database']['user'], CONFIG['database']['pass']);
$stmt = $db->prepare("SELECT * FROM users WHERE id = ?");
$stmt->execute([$_SESSION["user_id"]]);
@@ -25,8 +25,8 @@ if ($user["password"] != null && !password_verify($current_password, $user["pass
if (!empty($_POST["password-new"])) {
$password = $_POST["password-new"];
- if (ACCOUNT_PASSWORD_MIN_LENGTH > strlen($password)) {
- generate_alert("/account", "Your password must be at least " . ACCOUNT_PASSWORD_MIN_LENGTH . " characters");
+ if (CONFIG['account']['minpasswordlength'] > strlen($password)) {
+ generate_alert("/account", "Your password must be at least " . CONFIG['account']['minpasswordlength'] . " characters");
exit;
}