/** * @param \anlutro\Core\Auth\UserManager $users */ public function __construct(UserManager $users) { $this->debug = (bool) Config::get('app.debug'); $this->users = $users; $this->beforeFilter(function () { if (!$this->users->activationsEnabled()) { throw new \RuntimeException('Activation/registration is not enabled'); } }, ['only' => ['attemptRegistration', 'activate']]); $this->beforeFilter(function () { if (!$this->users->remindersEnabled()) { throw new \RuntimeException('Reminders are not enabled'); } }, ['only' => ['sendReminder', 'attemptReset']]); }
/** * Check if password reminders are enabled. * * @return boolean */ private function remindersEnabled() { return $this->users->remindersEnabled(); }