/** * @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 activationEnabled() { return $this->users->activationsEnabled(); }
/** * Show the create new user form. * * @return \Illuminate\View\View */ public function create() { return $this->view('c::user.form', ['pageTitle' => Lang::get('c::user.admin-newuser'), 'user' => $this->users->getNew(), 'userTypes' => $this->getUserTypes(), 'formAction' => $this->url('store'), 'backUrl' => $this->url('index'), 'activate' => $this->users->activationsEnabled()]); }