converted from standard mysqli to mysqli prepared statements for security against sql injection
This commit is contained in:
@@ -26,9 +26,6 @@ if (isset($_POST['form_id'])) {
|
||||
header('Location: user.php?action=view&user_id=' . $_COOKIE['user_id']);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 'login_form':
|
||||
$msg = login(
|
||||
$_POST['username'],
|
||||
@@ -39,9 +36,6 @@ if (isset($_POST['form_id'])) {
|
||||
if ($msg === true)
|
||||
header('Location: .');
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 'reset_pw_form':
|
||||
$msg = reset_password(
|
||||
($_COOKIE['role_id'] <= 2 && $_COOKIE['user_id'] != $_POST['user_id'] ? $_POST['user_id'] : $_COOKIE['user_id']),
|
||||
@@ -50,9 +44,6 @@ if (isset($_POST['form_id'])) {
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 'update_email_form':
|
||||
$msg = update_email(
|
||||
($_COOKIE['role_id'] <= 2 && $_COOKIE['user_id'] != $_POST['user_id'] ? $_POST['user_id'] : $_COOKIE['user_id']),
|
||||
@@ -61,20 +52,13 @@ if (isset($_POST['form_id'])) {
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 'update_username_form':
|
||||
$msg = update_username(
|
||||
($_COOKIE['role_id'] <= 2 && $_COOKIE['user_id'] != $_POST['user_id'] ? $_POST['user_id'] : $_COOKIE['user_id']),
|
||||
$_POST['new_username'],
|
||||
$_POST['verify_new_username']
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 'delete_account_form':
|
||||
$msg = delete_account(
|
||||
($_COOKIE['role_id'] <= 2 && $_COOKIE['user_id'] != $_POST['user_id'] ? $_POST['user_id'] : $_COOKIE['user_id']),
|
||||
|
||||
Reference in New Issue
Block a user