Example #1
0
 /**
  * Callback function being called before an action is executed.
  */
 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     // AJAX request, so no page layout.
     if (Request::isXhr()) {
         $this->via_ajax = true;
         $this->set_layout(null);
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
         // Open base layout for normal view
     } else {
         $layout = $GLOBALS['template_factory']->open('layouts/base');
         $this->set_layout($layout);
     }
     $this->set_content_type('text/html;charset=windows-1252');
     $this->help_admin = $GLOBALS['perm']->have_perm('root') || RolePersistence::isAssignedRole($GLOBALS['user']->id, 'Hilfe-Administrator(in)');
 }
Example #2
0
 /**
  * Returns whether the user was assigned a certain role.
  *
  * @param string $role         The role to check
  * @param string $institute_id An optional institute_id
  * @return bool True if the user was assigned this role, false otherwise
  */
 public function hasRole($role, $institute_id = '')
 {
     return RolePersistence::isAssignedRole($this->user_id, $role, $institute_id);
 }
Example #3
0
 /**
  * Enter description here...
  *
  * @param string $assignedrole
  * @return boolean
  */
 public function isAssignedRole($assignedrole = '')
 {
     return RolePersistence::isAssignedRole($this->userid, $assignedrole);
 }
Example #4
0
 public function __construct()
 {
     parent::__construct();
     $this->json_directory = $GLOBALS['STUDIP_BASE_PATH'] . '/doc/helpbar';
     $this->help_admin = isset($GLOBALS['perm']) && ($GLOBALS['perm']->have_perm('root') || RolePersistence::isAssignedRole($GLOBALS['user']->id, 'Hilfe-Administrator(in)'));
 }