Exemplo n.º 1
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     $newUser = User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
     $admins = usersModel::where('admin', '=', 1)->get();
     foreach ($admins as $admin) {
         $data = ['name' => $data['name'], 'email' => $data['email']];
         Mail::queue('ast.email', $data, function ($message) use($admin) {
             $message->from($admin->email, ' ')->to($admin->email, ' ')->subject('New user for The Asterisk App requires your approval.');
         });
     }
     return $newUser;
 }
Exemplo n.º 2
0
 /**
  * Disapprove Users
  */
 public function disapprove()
 {
     $userIds = Input::get('email');
     foreach ($userIds as $userId) {
         $user = usersModel::where('id', '=', $userId)->get();
         $user = $user[0];
         $user->access = '0';
         $user->save();
     }
     $approvedUsers = usersModel::where('access', '=', '1')->get();
     $unapprovedUsers = usersModel::where('access', '=', '0')->get();
     return View::make('ast.administrator')->with('approvedUsers', $approvedUsers)->with('unapprovedUsers', $unapprovedUsers);
 }