public static function register($id, $password) { $user = new UserQuizFinal(); $user->userName = $id; $user->userPass = $password; //$user->userMail=$mail; $user->score = 0; $user->isAdmin = false; $user->save(); }
public static function updateProfile() { $cdm = UserQuizFinal::find($_POST['username']); if ($_POST['currentPassword'] != '') { if ($_POST['newPassword'] != $_POST['newPasswordCompare']) { return 'New password dif Retype password'; } else { $cdm->userPass = $_POST['newPassword']; } } if ($_POST['name'] != '') { $cdm->name = $_POST['name']; } $cdm->save(); return 'Okay'; }