コード例 #1
0
ファイル: GuestUser.php プロジェクト: Clansuite/Clansuite
 public function __construct()
 {
     $this->config = \Clansuite\CMS::getInjector()->instantiate('Koch\\Config\\Config');
     /**
      * Fill $_SESSION[user] with Guest-User-infos
      */
     $_SESSION['user']['authed'] = 0;
     // a guest is not authed
     $_SESSION['user']['user_id'] = 0;
     // a guest has the user_id 0
     $_SESSION['user']['nick'] = _('Guest');
     // a guest has the nickname "Guest"
     $_SESSION['user']['passwordhash'] = '';
     $_SESSION['user']['email'] = '';
     $_SESSION['user']['disabled'] = 0;
     $_SESSION['user']['activated'] = 0;
     /**
      * Language for Guests
      *
      * This sets the default locale as defined by the main configuration value ([language][locale]).
      * The value is set as session value [user][language] for the user,
      * if another language was not set via the GET request (URL),
      * and processed in the filter (like "index.php?lang=fr").
      */
     if (!isset($_SESSION['user']['language_via_url']) and isset($this->config['locale']['locale']) === true) {
         $_SESSION['user']['language'] = $this->config['locale']['locale'];
     }
     /**
      * Theme for Guests
      *
      * Sets the Default Theme for all Guest Visitors, if not already set via a GET request.
      * Theme for Guest Users as defined by config['template']['frontend_theme']
      */
     if (empty($_SESSION['user']['frontend_theme']) and isset($this->config['template']['frontend_theme']) === true) {
         $_SESSION['user']['frontend_theme'] = $this->config['template']['frontend_theme'];
     }
     // @todo remove this line, when user login is reactivated
     $_SESSION['user']['backendend_theme'] = 'admin';
     /**
      * Permissions for Guests
      */
     $_SESSION['user']['group'] = 1;
     // @todo hardcoded for now
     $_SESSION['user']['role'] = 3;
     #$_SESSION['user']['rights'] = Koch_ACL::createRightSession( $_SESSION['user']['role'] );
     #Koch_Debug::printR($_SESSION);
     #Koch_Debug::firebug($_SESSION);
 }
コード例 #2
0
ファイル: Controller.php プロジェクト: Clansuite/Clansuite
 /**
  * Get the dependency injector
  *
  * @return Returns a static reference to the Dependency Injector
  */
 public static function getInjector()
 {
     return \Clansuite\CMS::getInjector();
 }