Example #1
0
 /**
  * Parse the settings for the authenticated user
  */
 private function parseAuthenticatedUser()
 {
     // check if the current user is authenticated
     if (Authentication::getUser()->isAuthenticated()) {
         // show stuff that only should be visible if authenticated
         $this->assign('isAuthenticated', true);
         // get authenticated user-settings
         $settings = (array) Authentication::getUser()->getSettings();
         foreach ($settings as $key => $setting) {
             // redefine setting
             $setting = $setting === null ? '' : $setting;
             // assign setting
             $this->assign('authenticatedUser' . \SpoonFilter::toCamelCase($key), $setting);
         }
         // check if this action is allowed
         if (Authentication::isAllowedAction('Edit', 'Users')) {
             // assign special vars
             $this->assign('authenticatedUserEditUrl', Model::createURLForAction('Edit', 'Users', null, array('id' => Authentication::getUser()->getUserId())));
         }
     }
 }