From be4f83cd2a17a0ec05f5bce50c91befaafaa6e0c Mon Sep 17 00:00:00 2001 From: jhunkeler Date: Sun, 20 Dec 2009 18:38:08 +0000 Subject: Test. git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@376 c5b2fb0a-d05d-0410-98c8-828840a80ff6 --- admin/settings/functions.php | 77 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 admin/settings/functions.php (limited to 'admin/settings/functions.php') diff --git a/admin/settings/functions.php b/admin/settings/functions.php new file mode 100644 index 0000000..910a312 --- /dev/null +++ b/admin/settings/functions.php @@ -0,0 +1,77 @@ +. + */ + +/** + * Note to anyone feeling the need to edit this file... + * You MUST declare $db as global inside your functions in order access MySQL from here. + */ + + +function changePassword(){ + + global $db; + + if(isset($_POST['processed'])) + { + $password = $_POST['password']; + $confirm = $_POST['confirm']; + + if($password != $confirm){ + ReportError("The passwords you entered did not match."); + PageRedirect(3, "?op=settings&change=password"); + return; + }else if(strlen($password)<6){ + ReportError("The password you entered is less than 6 characters."); + PageRedirect(3, "?op=settings&change=password"); + return; + } + $newpassword = crypt(md5($password),'iamnotadirtywhorebitch'); + $username = $_SESSION['username']; + $db->Query("UPDATE `bayonet_users` SET `password` = '$newpassword' WHERE `username` = '$username' LIMIT 1"); + + echo "Your password has successfully been changed."; + PageRedirect(3,"?op=settings"); + return; + } +?> +
+
+

Change Your Password

+ + + + + + + + + + + + +
Password: + + + +
Password Strength:
+
Minimum of 6 Characters
Confirm Password:
+
+
+