Skip to content
This repository has been archived by the owner on May 28, 2020. It is now read-only.

Commit

Permalink
forgot username change fail to save to db.
Browse files Browse the repository at this point in the history
  • Loading branch information
iLexN committed Dec 30, 2016
1 parent 3332337 commit 613bfff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Controller/User/ForgotUsername.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ public function __invoke(ServerRequestInterface $request, Response $response, ar

$data = $v->data();
if (!$this->userMatch($data)) {
$this->UserModule->saveForgotUsername($user, $data);
return $this->ViewHelper->toJson($response, ['errors' => $this->msgCode[2010]]);
}

$this->UserModule->saveForgotUsername($user, $data);
// success send email not need log to db
//$this->UserModule->saveForgotUsername($user, $data);
$this->sendForgotUsernameEmail();

return $this->ViewHelper->toJson($response, ['data' => $this->msgCode[2550],
Expand Down
4 changes: 2 additions & 2 deletions src/Module/UserModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ public function saveForgotUsername(ForgotUsername $user, $data)
$user->name = $data['name'];
$user->phone = $data['phone'];
$user->email = $data['email'];
$user->status = 'Pending';
$user->ppmid = $this->user->ppmid;
$user->status = 'Fail';
//$user->ppmid = $this->user->ppmid;
$user->save();
}

Expand Down

0 comments on commit 613bfff

Please sign in to comment.