Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • ActivateOperation
  • AvailableSitesBlock
  • ConfigBlock
  • ConfigOperation
  • DeactivateOperation
  • DeleteBlock
  • DeleteOperation
  • EditBlock
  • Hooks
  • IsUniqueOperation
  • LoginComboElement
  • LoginForm
  • LoginOperation
  • LogoutOperation
  • ManageBlock
  • Model
  • Module
  • OwnershipResolver
  • PermissionResolver
  • ProfileController
  • QueryOperationOperation
  • SaveOperation
  • UnlockLoginOperation
  • Update20131021
  • User
  • ViewProvider

Interfaces

  • OwnershipResolverInterface
  • PermissionResolverInterface

Traits

  • LoggedAtProperty

Exceptions

  • WebsiteAdminNotAccessible
 1 <?php
 2 
 3 /*
 4  * This file is part of the Icybee package.
 5  *
 6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
 7  *
 8  * For the full copyright and license information, please view the LICENSE
 9  * file that was distributed with this source code.
10  */
11 
12 namespace Icybee\Modules\Users;
13 
14 /**
15  * Log the user out of the system.
16  *
17  * @property-read User $record The active record representing the user that was logged out. This
18  * property is still available after the user was logged out, unlike the {@link $user} property of
19  * the `$core` object.
20  */
21 class LogoutOperation extends \ICanBoogie\Operation
22 {
23     /**
24      * Returns the record of the user to logout.
25      *
26      * The current user is returned.
27      */
28     protected function lazy_get_record()
29     {
30         global $core;
31 
32         return $core->user;
33     }
34 
35     /**
36      * Adds the {@link CONTROL_RECORD} control.
37      */
38     protected function get_controls()
39     {
40         return [
41 
42             self::CONTROL_RECORD => true
43 
44         ] + parent::get_controls();
45     }
46 
47     /**
48      * Always returns `true`.
49      */
50     protected function validate(\ICanboogie\Errors $errors)
51     {
52         return true;
53     }
54 
55     /**
56      * Logs out the user.
57      *
58      * The {@link logout()} method of the user is invoked to log the user out.
59      *
60      * The location of the response can be defined by the `continue` request parameter or the request referer, or '/'.
61      */
62     protected function process()
63     {
64         $this->record->logout();
65 
66         $request = $this->request;
67         $this->response->location = ($request['redirect_to'] ?: $request['continue']) ?: ($request->referer ?: '/');
68 
69         return true;
70     }
71 }
Autodoc API documentation generated by ApiGen 2.8.0