/** * * @param WOOOF $wo * @param array $in * @return [ 'changeOk' => bool, 'changePass' => boolean, 'errors' => array ] */ public static function changePassword(WOOOF $wo, $in) { $place = __CLASS__ . '::' . __FUNCTION__; if ($wo->userData['id'] == '0123456789') { $wo->handleShowStopperError('505'); } $errors = []; if ($in['newPass'] !== $in['newPassConfirm']) { $errors[] = "Passwords given do not match."; $out = ['changeOk' => false, 'errors' => $errors]; return $out; } $res = VO_Users::passwordChange($wo, $in); if ($res === FALSE) { $out = ['changeOk' => false, 'errors' => $wo->getErrorsAsArrayAndClear()]; $wo->db->rollback(); } else { $out = ['changeOk' => true, 'changePass' => $res]; $wo->db->commit(); } return $out; }
/** * * @param WOOOF $wo * @param array $in * @return false | id * Returns actually saved $obj */ public static function saveMainInfo(WOOOF $wo, $in) { $place = __CLASS__ . '::' . __FUNCTION__; $wo->debug("{$place}: "); if (!$wo->hasContent($in['firstName'])) { $wo->logError(self::_ECP . "0012 No value for first name"); return false; } if (!$wo->hasContent($in['lastName'])) { $wo->logError(self::_ECP . "0014 No value for last name"); return false; } $movieRamaUser = $wo->db->getRowByColumn('movierama_users', 'userId', $wo->userData['id']); //fernei olo to row if ($movieRamaUser === FALSE) { return false; } $movieRamaUserProfile = $wo->db->getRow('person_profiles', $movieRamaUser['personProfileId']); //fernei olo to row if ($movieRamaUserProfile === FALSE) { return false; } $tblProfile = new VO_TblPersonProfile($movieRamaUserProfile); $tblProfile->firstName = $in['firstName']; $tblProfile->lastName = $in['lastName']; $res = VO_Users::savePersonProfile($wo, $tblProfile); if ($res === FALSE) { return false; } return $res; }
/** * * @param WOOOF $wo * @param array $in * @return boolean */ public static function tokenResend(WOOOF $wo, $in) { $place = __CLASS__ . '::' . __FUNCTION__; $wo->debug("{$place}: ReseendVerificationToken"); $movieramaUserRec = $wo->db->getRowByColumn('movierama_users', 'username', $in['email']); if ($movieramaUserRec === FALSE) { return false; } if ($movieramaUserRec === NULL) { $wo->logError(self::_ECP . "2370 No such user found."); return false; } if ($wo->hasContent($movieramaUserRec['verificationToken'])) { $succ = VO_Users::handleVerificationToken($wo, $movieramaUserRec['id'], $movieramaUserRec['username'], $movieramaUserRec['verificationToken']); if ($succ === FALSE) { return FALSE; } } else { $wo->logError(self::_ECP . "2380 It seems you have already been verified."); return false; } return $succ; }