示例#1
0
 public function __construct(Request $request, &$session = null)
 {
     // Attempt to load a Person object from the session cookie
     if ($accessToken = $request->cookie(self::COOKIE)) {
         $person = new Model\Person();
         if ($person->loadByAccess_Token($accessToken)) {
             // Cache the logged in user object
             $this->user = $person;
         }
     }
     parent::__construct($request, $session);
     // Set backto from querystring
     if ($backto = $this->request->get('backto')) {
         $this->set('backto', $backto);
     }
 }