-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
The deactivate user action soft-deletes users in the DB. This allows the `attemptActivation()` method to restore users who were deactivated this way. Fixes #382.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,9 +75,18 @@ class User extends UserBase | |
*/ | ||
public function attemptActivation($code) | ||
{ | ||
$result = parent::attemptActivation($code); | ||
if ($result === false) { | ||
return false; | ||
if ($this->trashed()) { | ||
if ($code == $this->activation_code) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
bennothommo
Author
Contributor
|
||
$this->restore(); | ||
} else { | ||
return false; | ||
} | ||
} else { | ||
$result = parent::attemptActivation($code); | ||
|
||
if ($result === false) { | ||
return false; | ||
} | ||
} | ||
|
||
Event::fire('rainlab.user.activate', [$this]); | ||
|
@bennothommo what's the reason for the double equals here instead of a triple?