Exemplo n.º 1
0
 /**
  * 
  */
 public function postPassword($id)
 {
     try {
         $rules = array('oldPwd' => 'required', 'newPwd' => 'required', 'newPwd2' => 'required|same:newPwd');
         $validation = Validator::make(Input::all(), $rules);
         if ($validation->fails()) {
             return Redirect::back()->withInput()->withErrors($validation->messages());
         }
         $user = User::find($id);
         $user->password = Input::get('newPwd');
         if ($user->save()) {
             return Redirect::back()->with('message', 'A jelszó módosítása sikerült!');
         } else {
             return Redirect::back()->withInput()->withErrors('A jelszó módosítása nem sikerült!');
         }
     } catch (Exception $e) {
         if (Config::get('app.debug')) {
             return Redirect::back()->withInput()->withErrors($e->getMessage());
         } else {
             return Redirect::back()->withInput()->withErrors('A jelszó módosítása nem sikerült!');
         }
     }
 }
Exemplo n.º 2
0
 | application. Here you may also register your custom route filters.
 |
*/
App::before(function ($request) {
    Event::fire('clockwork.controller.start');
    /**
     * A láblévben megjelenő cikkek objektumát hozza létre.
     */
    if (!Request::is('admin') && !Request::is('admin/*')) {
        View::share('articleFooter', \Divide\CMS\Article::orderBy('created_at', 'desc')->take('3')->get(['id', 'title', 'author_id', 'created_at']));
    }
    /**
     * A felhasználó objektumát hozza létre!.
     */
    if ((Request::is('admin') || Request::is('admin/*')) && Sentry::check()) {
        View::share('user', \Divide\CMS\User::find(\Sentry::getUser()->id));
    }
    /* if(Request::path()!='/')
       {
       return Redirect::to('/');
       } */
    /* if( ! Request::secure() && FALSE)
       {
       return Redirect::secure(Request::path());
       } */
});
App::after(function ($request, $response) {
    Event::fire('clockwork.controller.end');
});
/*
 |--------------------------------------------------------------------------