<?php include_once "common/base.php"; if (!empty($_POST['username']) && $_POST['action'] == 'testinput') { include_once "inc/class.users.inc.php"; $users = new SpinnereyeUsers($db); echo $users->checkUsername(); } elseif ($_POST['action'] == 'testinputtag') { error_log($_POST['action']); include_once "inc/class.users.inc.php"; $users = new SpinnereyeUsers($db); echo $users->checkUserTag(); }
if ($userObj->confirmAccount() === TRUE) { switch ($_POST['action']) { case 'changeemail': $status = $userObj->updateEmail() ? "changed" : "failed"; header("Location: /account.php?email={$status}"); break; case 'changepassword': $status = $userObj->updatePassword() ? "changed" : "nomatch"; header("Location: /account.php?password={$status}"); break; case 'deleteaccount': $userObj->deleteAccount(); break; case 'testinput': error_log('testinput'); $userObj->checkUsername(); break; default: header("Location: /"); break; } } else { $status = 'failed'; header("Location: /account.php?password={$status}"); } } elseif ($_POST['action'] == "resetpassword") { if ($resp = $userObj->resetPassword() === TRUE) { header("Location: /resetpending.php"); } else { echo $resp; }