function tryLogin($Email, $Password) { //TODO: do we want to prevent re-log-in attempts? Right now we just overwrite the old login info. if ($temp = checkPasswordForLogin($Email, $Password)) { $this->userID = $temp; //use the temp variable to avoid destroying current login information return true; } return false; }
function onSetProfilePost() { $user = getUser(); if ($user->isLoggedIn()) { $data = $user->getData(); $id = $data["UserID"]; // TODO: Check all required fields are set if (!empty($_POST["Password"])) { if (checkPasswordForLogin($data["EmailAddress"], $_POST["Password"])) { setProfile($id, $_POST["FirstName"], $_POST["MiddleName"], $_POST["LastName"], $_POST["EmailAddress"], $_POST["Website"], $_POST["MailingAddress"], $_POST["Phone"]); } else { die("Incorrect Password"); // TODO: make message on original page - highligh field red? } $_POST["Password"] = NULL; } } }