/** * Returns an instance of class (singleton pattern implementation). * * @return UserSuspendDao */ public static function getInstance() { if (self::$classInstance === null) { self::$classInstance = new self(); } return self::$classInstance; }
* */ //$app = new \Slim\Slim(); $app = new \Slim\Slim(); //$baseJsDir = OW::getPluginManager()->getPlugin("base")->getStaticJsUrl(); $BOL_UserDao = BOL_UserDao::getInstance(); $ow_user = OW::getUser(); $OW_Auth_inst = OW_Auth::getInstance(); $Userservice = BOL_UserService::getInstance(); $EmailVerifyService = BOL_EmailVerifyService::getInstance(); $BOL_AvatarService_inst = BOL_AvatarService::getInstance(); $SKAPI_BOL_Service_inst = SKAPI_BOL_Service::getInstance(); $PHOTO_BOL_PhotoService_inst = PHOTO_BOL_PhotoService::getInstance(); $PHOTO_BOL_PhotoAlbumService = PHOTO_BOL_PhotoAlbumService::getInstance(); $PHOTO_BOL_PhotoTemporaryService = PHOTO_BOL_PhotoTemporaryService::getInstance(); $UserResetPassword = BOL_UserResetPasswordDao::getInstance(); $QuestionService = BOL_QuestionService::getInstance(); $AccountTypeToGenderService = SKADATE_BOL_AccountTypeToGenderService::getInstance(); $BOL_AuthorizationService = BOL_AuthorizationService::getInstance(); $BOL_UserOnlineDao = BOL_UserOnlineDao::getInstance(); $USEARCH_BOL_Service = USEARCH_BOL_Service::getInstance(); $BOL_SearchService = BOL_SearchService::getInstance(); $getPluginManager = OW::getPluginManager(); $CONTACTUS_BOL_Service = CONTACTUS_BOL_Service::getInstance(); $PHOTO_BOL_PhotoService = PHOTO_BOL_PhotoService::getInstance(); $PHOTO_BOL_PhotoAlbumCoverDao = PHOTO_BOL_PhotoAlbumCoverDao::getInstance(); $PHOTO_BOL_PhotoDao = PHOTO_BOL_PhotoDao::getInstance(); $getRouter = OW::getRouter(); $language = OW::getLanguage(); $getMailer = OW::getMailer(); $getConfig = OW::getConfig();
public function processResetForm($data) { $language = OW::getLanguage(); $email = trim($data['email']); $user = $this->findByEmail($email); if ($user === null) { throw new LogicException($language->text('base', 'forgot_password_no_user_error_message')); } $resetPassword = $this->findResetPasswordByUserId($user->getId()); if ($resetPassword !== null) { if ($resetPassword->getUpdateTimeStamp() > time()) { throw new LogicException($language->text('base', 'forgot_password_request_exists_error_message')); } else { $resetPassword->setUpdateTimeStamp($resetPassword->getUpdateTimeStamp() + self::PASSWORD_RESET_CODE_UPDATE_TIME); $this->resetPasswordDao->save($resetPassword); } } else { $resetPassword = $this->getNewResetPassword($user->getId()); } $vars = array('code' => $resetPassword->getCode(), 'username' => $user->getUsername(), 'requestUrl' => OW::getRouter()->urlForRoute('base.reset_user_password_request'), 'resetUrl' => OW::getRouter()->urlForRoute('base.reset_user_password', array('code' => $resetPassword->getCode()))); $mail = OW::getMailer()->createMail(); $mail->addRecipientEmail($email); $mail->setSubject($language->text('base', 'reset_password_mail_template_subject')); $mail->setTextContent($language->text('base', 'reset_password_mail_template_content_txt', $vars)); $mail->setHtmlContent($language->text('base', 'reset_password_mail_template_content_html', $vars)); OW::getMailer()->send($mail); }
public function deleteResetCode($resetCodeId) { $this->resetPasswordDao->deleteById($resetCodeId); }