当前位置: 首页>>代码示例>>PHP>>正文


PHP Authenticator::user方法代码示例

本文整理汇总了PHP中Authenticator::user方法的典型用法代码示例。如果您正苦于以下问题:PHP Authenticator::user方法的具体用法?PHP Authenticator::user怎么用?PHP Authenticator::user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Authenticator的用法示例。


在下文中一共展示了Authenticator::user方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sendMail

 public function sendMail($id)
 {
     /* $destinatari = 'info@caisse.it';
        $email = "info@caisse.it";
        $cc_address = "ordini@caisse.it";
        $cc_address2 = "holistic@caisse.it";
        $subject = 'Ordine numero ' . $_SESSION['idordine'] . ' Ricevuto';
        //mando prima una mail a info@caisse.it e poi una al cliente
        $message = $mail; */
     $stati = $this->stato->where('cancellato', '=', false)->orderby('id', 'asc')->lists('descrizione', 'id')->all();
     $ordine = $this->ordine->with('prodotti', 'utenti.clienti', 'pagamenti.scontiTipoPagamento', 'stati')->find($id);
     if ($this->auth->check() && ($ordine->utente == $this->auth->user()->id || $this->utente->find($this->auth->user()->id)->ruolo == 1)) {
         $tempTot = $ordine->costo;
         $sconto = $ordine->sconto;
         $speseSpedizione = $ordine->costospedizione;
         $totale = number_format(round($tempTot - $sconto + $speseSpedizione, 2), 2);
         $destination = $this->auth->user()->username;
         Mail::send('email.order', compact('ordine', 'totale', 'stati', 'cartcount', 'sconto'), function ($message) use($ordine, $destination) {
             $message->from('info@caisse.it', 'Holistic Remedies');
             $message->to($destination)->subject('Conferma Ordine ' . $ordine['id']);
         });
         Mail::send('email.order', compact('ordine', 'totale', 'stati', 'cartcount', 'sconto'), function ($message) use($ordine) {
             $message->from('info@caisse.it', 'Holistic Remedies');
             $message->to('info@caisse.it')->cc('ordini@caisse.it')->cc('holistic@caisse.it')->subject('Conferma Ordine ' . $ordine['id']);
         });
     } else {
         return Response::json(array('code' => '401', 'msg' => 'KO', 'error' => "unauthorized"));
     }
 }
开发者ID:bobbylinux,项目名称:HolisticRemedies,代码行数:29,代码来源:OrdiniController.php

示例2: postLogin

 /**
  * Handle a login request to the application.
  *
  * @param  LoginRequest  $request
  * @return Response
  */
 public function postLogin(LoginRequest $request)
 {
     $user = User::where('username', '=', $request->username)->first();
     if (isset($user)) {
         if ($user->password == md5($request->password)) {
             // If their password is still MD5
             $user->password = bcrypt($request->password);
             // Convert to new format
             $user->save();
         }
         if ($user->confermato) {
             $remember = null !== $request->get("remember-me") ? true : false;
             if ($this->auth->attempt($request->only('username', 'password'), $remember)) {
                 if ($request->ajax()) {
                     return Response::json(array('code' => '200', 'msg' => 'OK'));
                 } else {
                     if ($this->auth->user()->ruolo == 1) {
                         return redirect('admin');
                     } else {
                         return redirect('/');
                     }
                 }
             }
         }
     }
     if ($request->ajax()) {
         return Response::json(array('code' => '500', 'msg' => $this->getFailedLoginMessage()));
     } else {
         return redirect('/auth/login')->withErrors(['email' => $this->getFailedLoginMessage()]);
     }
 }
开发者ID:abada,项目名称:HolisticRemedies,代码行数:37,代码来源:AuthController.php

示例3: ClearAuthentication

 /**
  * Forcibly clear all _SESSION variables and destroys the session
  *
  * @param string $guid The GUID of this user
  */
 public static function ClearAuthentication($guid = "CURRENT_USER")
 {
     self::Init();
     self::$user = null;
     unset($_SESSION[$guid]);
     self::UnsetAllSessionVars();
     @session_destroy();
 }
开发者ID:hpazevedo,项目名称:Teste-BDR,代码行数:13,代码来源:Authenticator.php

示例4: postRegister

 protected function postRegister(RegisterRequest $request)
 {
     //$this->user->name = $request->name;
     $this->user->email = $request->email;
     $this->user->password = bcrypt($request->password);
     $this->user->is_admin = 0;
     $this->user->role = 'E';
     $this->user->save();
     //return redirect('laravel_angular/users/login');
     if ($this->auth->attempt($request->only('email', 'password'))) {
         $user = $this->auth->user();
         $employee = new Employee();
         $employee->name = $request->name;
         $employee->email = $request->email;
         //$employee->contact_number = $request->contact_number;
         //$employee->position = $request->position;
         $employee->user_id = $user->id;
         $employee->save();
         return redirect()->route('dashboard')->with('name', $request->name);
     }
 }
开发者ID:subhankarbachchu,项目名称:laravel_angular,代码行数:21,代码来源:AuthController.php


注:本文中的Authenticator::user方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。