Пример #1
2
 public function store(LocationRequest $request)
 {
     $location = Location::create($request->all());
     Session::flash('success', true);
     Session::flash('message', 'Aðgerð tókst: Ný staðsetning');
     return Redirect::back();
 }
Пример #2
1
 public function handleFbCallback()
 {
     $fb_user = Socialite::driver('facebook')->user();
     $user = User::firstOrCreate(['firstname' => $fb_user->user['first_name'], 'lastname' => $fb_user->user['last_name'], 'email' => $fb_user->email]);
     Auth::login($user, true);
     return Redirect::to('/books');
 }
Пример #3
0
 public function logout()
 {
     $seguranca = new DPRFSeguranca(config("PRF.siglaSistema"), config("PRF.producao"));
     $seguranca->auditoria(Auth::user()->cpf, "LOGOUT", "Logout", array());
     Auth::logout();
     return Redirect::to("/");
 }
Пример #4
0
 public function update()
 {
     $profile = Profile::where('user_id', Auth::user()->id)->first();
     $profile->fill(Input::all());
     $profile->save();
     return Redirect::to("/edit_profile");
 }
Пример #5
0
 public function logar(Request $request)
 {
     $regras = array('email' => 'required|string', 'password' => 'required');
     $mensagens = array('required' => 'O campo :attribute deve ser preenchido.');
     $this->validate($request, $regras, $mensagens);
     $email = $request['email'];
     $senha = $request['password'];
     $condicao = ['email' => $email];
     $remember = !empty($request['remember']) ? true : false;
     if (Auth::attempt(['email' => $email, 'password' => $senha], $remember)) {
         if ($this->authorize('logar', $email, $senha)) {
             return Redirect::action('LoginController@index');
         }
     }
     //        if(!empty($usuario) && Hash::check($senha,$usuario->password))
     //        {
     //                Auth::loginUsingId($usuario->id);
     //
     //            if($this->authorize('logar',$email,$senha))
     //            {
     //                return redirect('Empresa');
     //            }
     //        }
     return redirect()->back()->withErrors('Usuário inválido.');
 }
Пример #6
0
 public function destroy($id)
 {
     $user = $this->model->findOrFail($id);
     $this->userRepository->deleteUser($user);
     flash()->success(trans('LaravelAdmin::laravel-admin.userDeleted'));
     return Redirect::back();
 }
Пример #7
0
 public function restore($id)
 {
     $specificUser = User::withTrashed()->find($id);
     $specificUser->restore();
     $users = User::where('admin1_user0', '=', 0)->withTrashed()->get();
     return Redirect::to('dashboard')->with('users', $users);
 }
Пример #8
0
 public function select($ticketId, $commentId)
 {
     $ticket = $this->ticketRepository->findOrFail($ticketId);
     $this->authorize('selectResource', $ticket);
     $ticket->assignResource($commentId);
     return Redirect::back();
 }
Пример #9
0
 public function switchLang($lang)
 {
     if (array_key_exists($lang, Config::get('languages'))) {
         Session::set('applocale', $lang);
     }
     return Redirect::back();
 }
 public function postIndex()
 {
     $imagem = Input::file('imagem');
     if (is_null($imagem)) {
         throw new Exception('Você não selecionou um arquivo');
     }
     $destinationPath = public_path() . DIRECTORY_SEPARATOR . 'uploads';
     $filename = date('YmdHis') . '_' . $imagem->getClientOriginalName();
     if ($imagem->move($destinationPath, $filename)) {
         //Load view laravel paths
         $paths = Config::get('view.paths');
         //Load file view
         $file = $paths[0] . DIRECTORY_SEPARATOR . Input::get('view') . '.blade.php';
         $html = file_get_contents($file);
         //Init crawler
         $crawler = new HtmlPageCrawler($html);
         //Set filter
         $filter = '#' . Input::get('id');
         //Edit node
         $crawler->filter($filter)->setAttribute('src', '/uploads/' . $filename);
         $newHTML = html_entity_decode($crawler->saveHTML());
         $newHTML = str_replace('%7B%7B', '{{', $newHTML);
         $newHTML = str_replace('%7D%7D', '}}', $newHTML);
         $newHTML = str_replace('%24', '$', $newHTML);
         $newHTML = str_replace('%20', ' ', $newHTML);
         $newHTML = str_replace('%7C', '|', $newHTML);
         //write file
         file_put_contents($file, $newHTML);
         return Redirect::back()->with('alert', 'Banner enviado com sucesso!');
     }
 }
Пример #11
0
 /**
  * Handle an incoming request, check to see if we have a redirect in place for the requested URL
  * and then redirect if we do have a match
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     // Get the full URL that has been requested, minus the protocol
     $full_url = str_replace($request->getScheme() . "://", "", $request->url());
     // Check for any results matching the full domain request
     $results = Redirect::where("type", "domain")->where("from", $full_url)->where("status", "active");
     if ($results->exists()) {
         // Get the first result back
         $redirect = $results->first();
         // Grab the URL before we increment
         $url = $redirect->to;
         // Increment the hit count
         $redirect->increment('hits');
         // Redirect off to where we're going
         return RedirectFacade::to($url);
     }
     // Check for any results matching the path only
     $results = Redirect::where("type", "path")->where("from", "/" . $request->path())->where("status", "active");
     // If a redirect exists for this, process it and redirect
     if ($results->exists()) {
         // Get the first result back
         $redirect = $results->first();
         // Grab the URL before we increment
         $url = $redirect->to;
         // Increment the hit count
         $redirect->increment('hits');
         // Redirect off to where we're going
         return RedirectFacade::to($url, 301);
     }
     // By default, continue afterwards and bail out
     return $next($request);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateTratamientoRequest $request)
 {
     $tratamiento = Tratamiento::create($request->all());
     $message = $tratamiento->nombre_tratamiento . ' fue creado correctamente';
     Session::flash('message', $message);
     return Redirect::route('admin.tratamiento.index');
 }
Пример #13
0
 protected function login()
 {
     if (auth()->attempt(array('email' => Input::get('email'), 'password' => Input::get('password')), true) || auth()->attempt(array('name' => Input::get('email'), 'password' => Input::get('password')), true)) {
         return Redirect::intended('/');
     }
     return back()->withInput()->with('message', 'Неверное имя пользователя и/или пароль!');
 }
 public function TambahJadwal()
 {
     $rules = array('unit_id' => 'required', 'kategori' => 'required', 'tglstart' => 'required', 'tglases' => 'required', 'tglfinish' => 'required', 'detail' => 'required');
     $messages = array('unit_id.required' => 'Nama Jabatan Harus Terisi', 'kategori.required' => 'Kategori Harus Dipilih', 'tglstart.required' => 'Tanggal Mulai Harus Terisi', 'tglases.required' => 'Tanggal Asessment Harus Terisi', 'tglfinish.required' => 'Tanggal Selesai Harus Terisi', 'detail.required' => 'Detail Harus terisi');
     $validasi = validator::make(Input::all(), $rules, $messages);
     if ($validasi->fails()) {
         return Redirect::back()->withErrors($validasi)->withInput();
     } else {
         $kat = Input::get('kategori');
         if ($kat == 'internal') {
             $aa = "in";
         } else {
             $aa = "ex";
         }
         DB::transaction(function ($aa) use($aa) {
             //asesment promosi
             $jadwal = KandidatPromote::create(['unit_staf_id' => Input::get('unit_id'), 'tgl_awal' => Input::get('tglstart'), 'tgl_asesment' => Input::get('tglases'), 'tgl_selesai' => Input::get('tglfinish'), 'detail' => Input::get('detail')]);
             //rekrutmen rekap header
             $rekap_header = HeaderRekap::create(['id_asesmen' => $jadwal->id, 'kategori' => Input::get('kategori'), 'nama' => Input::get('jabatan'), 'tanggal_awal' => Input::get('tglstart'), 'tanggal_akhir' => Input::get('tglfinish'), 'deksripsi' => Input::get('detail')]);
             //asessment promosi daftar
             $daftar = KandidatPromosiDaftar::create(['asesment_promosi_id' => $jadwal->id, 'nip' => Input::get('nip'), 'detail' => Input::get('detail')]);
             //rekrutment rekap profiling
             $profil = ProfilingRekap::create(['id_rekap' => $rekap_header->id, 'kategori' => $aa, 'nip' => $daftar->nip, 'id_jabatan' => $jadwal->unit_staf_id]);
         });
         Session::flash('message', 'Berhasil Menambahkan Jadwal Asessment');
         return Redirect::to('career/jadwal/lihat/asessment');
     }
 }
Пример #15
0
 public function permissionsDelete($id, $permission)
 {
     $role = $this->model->findOrFail($id);
     $role->perms()->detach($permission);
     flash()->success(trans('LaravelAdmin::laravel-admin.permissionsDetachedSuccess'));
     return Redirect::back();
 }
Пример #16
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\CreateCitaRequest $request)
 {
     $datos = HorasAgendadas::create($request->all());
     $message = 'Hora agendada por: ' . $datos->userUsuario->first_name . ' ' . $datos->userUsuario->last_name . ' para el día:' . $datos->fecha . ' y a la hora: ' . date("H:i", $qwerty = strtotime($datos->obtenerHora->hora));
     Session::flash('message', $message);
     return Redirect::route('horas-agendadas');
 }
Пример #17
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\CreatePagoRequest $request)
 {
     $pago = Pagos::create($request->all());
     $message = 'Pago efectuado de: ' . $pago->monto . ' al usuario: ' . $pago->user->first_name . ' ' . $pago->user->last_name;
     Session::flash('message', $message);
     return Redirect::route('admin.users.index');
 }
Пример #18
0
 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle(\Illuminate\Http\Request $request, Closure $next)
 {
     if (Auth::user()->cannot('isSuperAdmin', Auth::user())) {
         return Redirect::to('auth/login')->with('danger', "Vous n'etes pas authoriser a acéder à cette partie :(");
     }
     return $next($request);
 }
Пример #19
0
 public function emptyLogs()
 {
     ActionLog::truncate();
     $message['result'] = 1;
     $message['content'] = $message['result'] ? '清空日志成功' : '清空日志失败';
     return Redirect::to('admin/actionLogs/')->with('message', $message);
 }
Пример #20
0
 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, \Closure $next)
 {
     if (Setting::get('core::enable-registration')) {
         return $next($request);
     }
     return Redirect::route(config('society.user.config.redirect_route_after_login'));
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $input = Input::only('first_name', 'last_name', 'email', 'password');
     $command = new CreateNewUserCommand($input['email'], $input['first_name'], $input['last_name'], $input['password']);
     $this->commandBus->execute($command);
     return Redirect::to('/profile');
 }
Пример #22
0
 public function excel(Request $request)
 {
     try {
         Log::info(Input::file('input_excel'));
         Excel::load($request->file('input_excel'), function ($reader) {
             $array = $reader->toArray();
             Log::info($array);
             $banqueId = $this->gestSession->addBanqueByExcel($array[0]);
             Log::info("IdBanque1 " . $banqueId);
             $i = 1;
             while ($i < sizeof($array)) {
                 Log::info($array);
                 $titreIdGItem = $this->gestSession->addTitreGItemByExcel($array[$i]);
                 Log::info("IdTitreGItem " . $titreIdGItem);
                 $i++;
                 while ($i < sizeof($array) && $array[$i]["label_item"] != null) {
                     $this->gestSession->addItemByExcel($array[$i], $banqueId, $titreIdGItem);
                     $i++;
                 }
             }
         });
         return Redirect::back();
     } catch (\Exception $e) {
         echo "Format Incorrect";
     }
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $template = new Template($request->all());
     $template->user_id = Auth::user()->id;
     $template->save();
     return Redirect::route('templates.index');
 }
 function post()
 {
     $att = Attachment::find(Request::route('id3'));
     $pageId = Request::route('id1');
     $att->delete();
     return Redirect::to("/admin/manage-pages/{$pageId}/content");
 }
Пример #25
0
 /**
  * search in Flickr API for a specific set of keywords
  *
  * @param SearchRequest $request
  * @param int $id
  * @return mixed
  */
 public function search(SearchRequest $request, $id = 1)
 {
     $photoSearch = $request->all();
     $query = $photoSearch['photoSearch'];
     $data = $this->flickrRepository->search($query, $id);
     return Redirect::route('search.page', [$query, $id])->with($data);
 }
Пример #26
0
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  * @return mixed
  */
 public function handle($request, \Closure $next)
 {
     if ($this->auth->check()) {
         return Redirect::route(config('asgard.user.users.redirect_route_after_login'));
     }
     return $next($request);
 }
Пример #27
0
 /**
  * Handle an incoming request.
  *
  * @param Request $request The current request.
  * @param Closure $next    The handler to receive the request.
  *
  * @return mixed
  */
 public function handle(Request $request, Closure $next)
 {
     if ($this->auth->check()) {
         return Redirect::route('home');
     }
     return $next($request);
 }
 public function generate()
 {
     $input = Input::get('number');
     $birthday = Input::get('bd');
     $location = Input::get('l');
     if (!ctype_digit($input)) {
         return Redirect::back()->with('message', 'You did not enter a number!');
     }
     $input = intval($input);
     if ($input < 0 || $input > 99) {
         return Redirect::back()->with('message', 'You have to enter number between 1 to 99!');
     }
     $faker = \Faker\Factory::create();
     $users = array();
     for ($i = 0; $i < $input; $i++) {
         if (is_null($birthday) && is_null($location)) {
             $users[$i] = "<p>" . $faker->userName . "</p>";
         } elseif (isset($birthday) && !isset($location)) {
             $users[$i] = "<p>" . $faker->userName . "</br>" . $faker->dateTimeThisCentury->format('Y-m-d') . "</p>";
         } elseif (!isset($birthday) && isset($location)) {
             $users[$i] = $faker->userName . "</br>" . $faker->city;
         } else {
             $users[$i] = "<p>" . $faker->userName . "</br>" . $faker->dateTimeThisCentury->format('Y-m-d') . "</br>" . $faker->city . "</p>";
         }
     }
     $generated = implode('<br>', $users);
     return view('randomuser')->with('generated', $generated);
 }
 /**
  * Traitement du formulaire de validation
  *
  * @return Redirect
  */
 public function postEntrepriseValidation(ValidationEntrepriseRequest $request)
 {
     $user = User::find(Input::get('_id'));
     $user->valide = 1;
     $user->save();
     return Redirect::refresh()->with('flash_success', 'L\'entreprise a bien été validée');
 }
Пример #30
0
 /**
  * Render an exception into an HTTP response.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Exception  $e
  * @return \Illuminate\Http\Response
  */
 public function render($request, Exception $e)
 {
     if ($e instanceof ChainNoResultException || $e instanceof ArticleGeolocalizeException) {
         return Redirect::back()->withErrors([$e->getMessage()]);
     }
     return parent::render($request, $e);
 }