/** * Override Execute Method * * @return void */ public function execute() { //get the cname, active tab, and action for plugins $this->cn = Request::getVar('cn', ''); $this->active = Request::getVar('active', ''); $this->action = Request::getVar('action', ''); // Check if they're logged in if (User::isGuest()) { $this->loginTask(Lang::txt('COM_GROUPS_ERROR_MUST_BE_LOGGED_IN')); return; } //check to make sure we have cname if (!$this->cn) { $this->_errorHandler(400, Lang::txt('COM_GROUPS_ERROR_NO_ID')); } // Load the group page $this->group = Group::getInstance($this->cn); // Ensure we found the group info if (!$this->group || !$this->group->get('gidNumber')) { $this->_errorHandler(404, Lang::txt('COM_GROUPS_ERROR_NOT_FOUND')); } // Check authorization if ($this->_authorize() != 'manager' && !$this->_authorizedForTask('group.pages')) { $this->_errorHandler(403, Lang::txt('COM_GROUPS_ERROR_NOT_AUTH')); } //continue with parent execute method parent::execute(); }
/** * Override Execute Method * * @return void */ public function execute() { // disable default task $this->disableDefaultTask(); // Check if they're logged in if (User::isGuest()) { $this->loginTask(Lang::txt('COM_GROUPS_MEDIA_MUST_BE_LOGGED_IN')); return; } //get request vars $this->cn = Request::getVar('cn', ''); //check to make sure we have cname if (!$this->cn) { $this->_errorHandler(400, Lang::txt('COM_GROUPS_ERROR_NO_ID')); } // Load the group page $this->group = Group::getInstance($this->cn); // Ensure we found the group info if (!$this->group || !$this->group->get('gidNumber')) { $this->_errorHandler(404, Lang::txt('COM_GROUPS_ERROR_NOT_FOUND')); } // Check authorization //if ($this->_authorize() != 'manager' && !$this->_authorizedForTask('group.edit') && !$this->_authorizedForTask('group.pages')) if (!in_array(User::get('id'), $this->group->get('members'))) { $this->_errorHandler(403, Lang::txt('COM_GROUPS_ERROR_NOT_AUTH')); } //build path to the group folder $this->path = PATH_APP . DS . trim($this->config->get('uploadpath', '/site/groups'), DS) . DS . $this->group->get('gidNumber'); //continue with parent execute method parent::execute(); }
/** * Override Execute Method * * @return void */ public function execute() { //get the cname, active tab, and action for plugins $this->cn = Request::getVar('cn', ''); $this->active = Request::getVar('active', ''); $this->action = Request::getVar('action', ''); //are we serving up a file $uri = $_SERVER['REQUEST_URI']; if (strstr($uri, 'Image:')) { $file = strstr($uri, 'Image:'); } elseif (strstr($uri, 'File:')) { $file = strstr($uri, 'File:'); } //if we have a file if (isset($file)) { return $this->downloadTask($file); } // check in for user Helpers\Pages::checkinForUser(); //continue with parent execute method parent::execute(); }
/** * Override Execute Method * * @return void */ public function execute() { //get the cname $this->cn = Request::getVar('cn', ''); parent::execute(); }
/** * Override Execute Method * * @return void */ public function execute() { // disable default task $this->disableDefaultTask(); //get request vars $this->cn = Request::getVar('cn', ''); //check to make sure we have cname if (!$this->cn) { $this->_errorHandler(400, Lang::txt('COM_GROUPS_ERROR_NO_ID')); } // Load the group page $this->group = Group::getInstance($this->cn); // Load plugin access groups $pluginAccess = \Hubzero\User\Group\Helper::getPluginAccess($this->group); // Ensure we found the group info if (!$this->group || !$this->group->get('gidNumber')) { $this->_errorHandler(404, Lang::txt('COM_GROUPS_ERROR_NOT_FOUND')); } // Kick user out if not logged in and should be if (User::isGuest() && $pluginAccess['files'] == 'registered') { $this->_errorHandler(403, Lang::txt('COM_GROUPS_ERROR_NOT_AUTH')); } // Check if they're logged in and not everyone can view files if (User::isGuest() && $pluginAccess['files'] != 'anyone') { $this->loginTask(Lang::txt('COM_GROUPS_MEDIA_MUST_BE_LOGGED_IN')); return; } // Check authorization if (!in_array(User::get('id'), $this->group->get('members')) && $pluginAccess['files'] == 'members') { $this->_errorHandler(403, Lang::txt('COM_GROUPS_ERROR_NOT_AUTH')); } //build path to the group folder $this->path = PATH_APP . DS . trim($this->config->get('uploadpath', '/site/groups'), DS) . DS . $this->group->get('gidNumber'); //continue with parent execute method parent::execute(); }
/** * Override Execute Method * * @return void */ public function execute() { //get the cname, active tab, and action for plugins $this->cn = Request::getVar('cn', ''); $this->active = Request::getVar('active', ''); $this->action = Request::getVar('action', ''); $this->task = Request::getVar('task', ''); // Handles misrouted request if ($this->task == 'pages') { App::redirect(Route::url('index.php?option=' . $this->_option . '&cn=' . $this->cn . '&controller=pages')); } //are we serving up a file $uri = $_SERVER['REQUEST_URI']; if (strstr($uri, 'Image:')) { $file = strstr($uri, 'Image:'); } elseif (strstr($uri, 'File:')) { $file = strstr($uri, 'File:'); } //if we have a file if (isset($file)) { return $this->downloadTask($file); } // check in for user Helpers\Pages::checkinForUser(); //continue with parent execute method parent::execute(); }