Beispiel #1
0
 /**
  * Execute a task
  *
  * @return     void
  */
 public function execute()
 {
     $this->warehouse = new Warehouse();
     $user = User::getRoot();
     $this->warehouse->addAccessLevels($user->getAuthorisedViewLevels());
     // Get the task
     $this->_task = Request::getCmd('task', '');
     if (empty($this->_task)) {
         $this->_task = 'home';
         $this->registerTask('__default', $this->_task);
     }
     $executed = false;
     if (!method_exists($this, $this->_task . 'Task')) {
         // Try to find a corresponding collection
         $cId = $this->warehouse->collectionExists($this->_task);
         if ($cId) {
             // if match is found -- browse collection
             $executed = true;
             $this->browseCollection($cId);
         } else {
             App::abort(404, Lang::txt('Collection Not Found'));
         }
     }
     if (!$executed) {
         parent::execute();
     }
 }
Beispiel #2
0
 /**
  * Determines task being called and attempts to execute it
  *
  * @return  void
  */
 public function execute()
 {
     // Set configs
     $this->_setConfigs();
     // Incoming
     $this->_incoming();
     // Resource map
     if (strrpos(strtolower($this->_alias), '.rdf') > 0) {
         $this->_resourceMap();
         return;
     }
     // Set the default task
     $this->registerTask('__default', 'intro');
     // Register tasks
     $this->registerTask('view', 'page');
     $this->registerTask('download', 'serve');
     $this->registerTask('video', 'serve');
     $this->registerTask('play', 'serve');
     $this->registerTask('watch', 'serve');
     $this->registerTask('wiki', 'wikipage');
     $this->registerTask('submit', 'contribute');
     $this->registerTask('edit', 'contribute');
     $this->registerTask('start', 'contribute');
     $this->registerTask('publication', 'contribute');
     $this->_task = trim(Request::getVar('task', ''));
     if (($this->_id || $this->_alias) && !$this->_task) {
         $this->_task = 'page';
     } elseif (!$this->_task) {
         $this->_task = 'intro';
     }
     parent::execute();
 }
Beispiel #3
0
 /**
  * Execute a task
  *
  * @return     void
  */
 public function execute()
 {
     $this->gid = Request::getVar('gid', '');
     if (!$this->gid) {
         App::redirect('index.php?option=' . $this->_option);
         return;
     }
     // Load the course page
     $this->course = Models\Course::getInstance($this->gid);
     // Ensure we found the course info
     if (!$this->course->exists() || $this->course->isDeleted() || $this->course->isUnpublished()) {
         return App::abort(404, Lang::txt('COM_COURSES_NO_COURSE_FOUND'));
     }
     // No offering provided
     if (!($offering = Request::getVar('offering', ''))) {
         App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=course&gid=' . $this->course->get('alias')));
         return;
     }
     // Ensure we found the course info
     if (!$this->course->offering($offering)->exists() || $this->course->offering($offering)->isDeleted() || !$this->course->offering($offering)->access('manage', 'section') && $this->course->offering($offering)->isUnpublished()) {
         return App::abort(404, Lang::txt('COM_COURSES_NO_OFFERING_FOUND'));
     }
     // Ensure the course has been published or has been approved
     if (!$this->course->offering()->access('manage', 'section') && !$this->course->isAvailable()) {
         return App::abort(404, Lang::txt('COM_COURSES_NOT_PUBLISHED'));
     }
     parent::execute();
 }
Beispiel #4
0
 /**
  * Execute a task
  *
  * @return  void
  */
 public function execute()
 {
     // Load the course page
     $this->course = Models\Course::getInstance(Request::getVar('gid', ''));
     $this->registerTask('edit', 'display');
     parent::execute();
 }
Beispiel #5
0
 /**
  * Override execute method to init developer model
  * 
  * @return  void
  */
 public function execute()
 {
     // authorize application usage
     $this->_authorize('application', Request::getInt('id', null));
     // call parent execute
     parent::execute();
 }
Beispiel #6
0
 /**
  * Execute a task
  *
  * @return     void
  */
 public function execute()
 {
     $this->warehouse = new Warehouse();
     $user = User::getRoot();
     $this->warehouse->addAccessLevels($user->getAuthorisedViewLevels());
     parent::execute();
 }
Beispiel #7
0
 /**
  * Execute function
  *
  * @return  void
  */
 public function execute()
 {
     // Is component on?
     if (!$this->config->get('component_on', 0)) {
         App::redirect('/');
         return;
     }
     // Publishing enabled?
     $this->_publishing = Plugin::isEnabled('projects', 'publications') ? 1 : 0;
     // Setup complete?
     $this->_setupComplete = $this->config->get('confirm_step', 0) ? 3 : 2;
     // Include scripts
     $this->_includeScripts();
     // Incoming project identifier
     $id = Request::getInt('id', 0);
     $alias = Request::getVar('alias', '');
     $this->_identifier = $id ? $id : $alias;
     // Incoming
     $this->_task = strtolower(Request::getWord('task', ''));
     $this->_gid = Request::getVar('gid', 0);
     // Model
     $this->model = new Models\Project($this->_identifier);
     // Execute the task
     parent::execute();
 }
Beispiel #8
0
 /**
  * Execute a task
  *
  * @return     void
  */
 public function execute()
 {
     // Get the component parameters
     $aconfig = Component::params('com_answers');
     $this->infolink = $aconfig->get('infolink', '/kb/points/');
     parent::execute();
 }
Beispiel #9
0
 /**
  * Determines task being called and attempts to execute it
  *
  * @return  void
  */
 public function execute()
 {
     if (User::isGuest()) {
         App::abort(403, Lang::txt('COM_RESOURCES_ALERTLOGIN_REQUIRED'));
     }
     parent::execute();
 }
Beispiel #10
0
 /**
  * Constructor
  *
  * @return  void
  */
 public function __construct()
 {
     // create our oauth server
     $this->server = new \Hubzero\Oauth\Server(new MysqlStorage());
     // do the rest of setup
     $this->disableDefaultTask();
     parent::__construct();
 }
Beispiel #11
0
 /**
  * Execute a task
  *
  * @return	void
  */
 public function execute()
 {
     $this->model = new Manager('site', 0);
     $this->registerTask('latest', 'feed');
     $this->registerTask('latest', 'feed.rss');
     $this->registerTask('latest', 'latest.rss');
     parent::execute();
 }
Beispiel #12
0
 /**
  * Determines task being called and attempts to execute it
  *
  * @return     void
  */
 public function execute()
 {
     $this->_authorize();
     // Load the com_resources component config
     $rconfig = Component::params('com_resources');
     $this->rconfig = $rconfig;
     parent::execute();
 }
 /**
  * Determines task being called and attempts to execute it
  *
  * @return	void
  */
 public function execute()
 {
     $this->_authorize('collection');
     $this->_authorize('item');
     $this->registerTask('__default', 'posts');
     $this->registerTask('all', 'collections');
     parent::execute();
 }
Beispiel #14
0
 /**
  * Execute a task
  *
  * @return  void
  */
 public function execute()
 {
     $this->config->set('banking', \Component::params('com_members')->get('bankAccounts'));
     $this->registerTask('__default', 'search');
     $this->registerTask('display', 'search');
     $this->registerTask('latest', 'latest.rss');
     parent::execute();
 }
 /**
  * Determines task being called and attempts to execute it
  *
  * @return     void
  */
 public function execute()
 {
     // Check if they are logged in
     if (User::isGuest()) {
         App::abort(403, Lang::txt('You must be logged in to access.'));
         return;
     }
     parent::execute();
 }
Beispiel #16
0
 /**
  * Execute a task
  *
  * @return  void
  */
 public function execute()
 {
     $parts = explode('/', $_SERVER['REQUEST_URI']);
     $file = array_pop($parts);
     if (substr(strtolower($file), 0, 5) == 'image' || substr(strtolower($file), 0, 4) == 'file') {
         Request::setVar('task', 'download');
     }
     parent::execute();
 }
 /**
  * Override execute method to init developer model
  * 
  * @return  void
  */
 public function execute()
 {
     // create new developer model
     $this->developer = new Models\Developer();
     // authorize application usage
     $this->_authorize('application', Request::getInt('id', null));
     // call parent execute
     parent::execute();
 }
Beispiel #18
0
 /**
  * Execute a task
  *
  * @return  void
  */
 public function execute()
 {
     // disable default task - stop fallback when user enters bad task
     $this->disableDefaultTask();
     // register empty task and intro as the main display task
     $this->registerTask('', 'display');
     $this->registerTask('intro', 'display');
     // execute parent function
     parent::execute();
 }
Beispiel #19
0
 /**
  * Execute a task
  *
  * @return     void
  */
 public function execute()
 {
     $this->warehouse = new Warehouse();
     $this->warehouse->addAccessLevels(User::getAuthorisedViewLevels());
     $this->warehouse->addAccessGroups(User::getAuthorisedGroups());
     if (is_numeric(User::get('id'))) {
         $this->warehouse->addUserScope(User::get('id'));
     }
     parent::execute();
 }
Beispiel #20
0
 /**
  * Override parent execute method
  *
  */
 public function execute()
 {
     //get request vars
     $this->id = Request::getInt('id', 0);
     //disable default task
     $this->disableDefaultTask();
     //register task when no newsletter is passed in
     $this->registerTask('', 'view');
     //call parent
     parent::execute();
 }
Beispiel #21
0
 /**
  * Determines task being called and attempts to execute it
  *
  * @return     void
  */
 public function execute()
 {
     if (User::isGuest()) {
         App::abort(403, Lang::txt('You must be logged in to access.'));
         return;
     }
     // Load the com_resources component config
     $rconfig = Component::params('com_resources');
     $this->rconfig = $rconfig;
     parent::execute();
 }
Beispiel #22
0
 /**
  * Execute a task
  *
  * @return     void
  */
 public function execute()
 {
     $this->warehouse = new Warehouse();
     $this->juser = User::getInstance();
     // Check if they're logged in
     if ($this->juser->get('guest')) {
         $this->login('Please login to continue');
         return;
     }
     parent::execute();
 }
Beispiel #23
0
 /**
  * Determine task and execute it
  *
  * @return     void
  */
 public function execute()
 {
     // Make sure we're using a secure connection
     if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') {
         App::redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], '', 'message', true);
         die('insecure connection and redirection failed');
     }
     $this->baseURL = rtrim(Request::base(), '/');
     $this->registerTask('__default', 'create');
     parent::execute();
 }
Beispiel #24
0
 /**
  * Determine task and execute
  *
  * @return  void
  */
 public function execute()
 {
     $upconfig = Component::params('com_members');
     $this->banking = $this->config->get('banking', $upconfig->get('bankAccounts', 0));
     $this->registerTask('__default', 'wishlist');
     $this->registerTask('editprivacy', 'editwish');
     $this->registerTask('grantwish', 'editwish');
     $this->registerTask('withdraw', 'deletewish');
     $this->registerTask('add', 'addwish');
     parent::execute();
 }
Beispiel #25
0
 /**
  * Execute a task
  *
  * @return  void
  */
 public function execute()
 {
     $this->_authorize();
     $this->registerTask('feed.rss', 'feed');
     $this->registerTask('feedrss', 'feed');
     if ($tagstring = urldecode(trim(Request::getVar('tag', '', 'request', 'none', 2)))) {
         if (!Request::getVar('task', '')) {
             Request::setVar('task', 'view');
         }
     }
     parent::execute();
 }
Beispiel #26
0
 /**
  * Determines task being called and attempts to execute it
  *
  * @return  void
  */
 public function execute()
 {
     if (User::isGuest()) {
         // Redirect to home page
         App::redirect($this->config->get('contribtool_redirect', '/home'));
         return;
     }
     // Load the com_resources component config
     $rconfig = Component::params('com_resources');
     $this->rconfig = $rconfig;
     parent::execute();
 }
Beispiel #27
0
 /**
  * Execute a task
  *
  * @return     void
  */
 public function execute()
 {
     include_once dirname(dirname(__DIR__)) . DS . 'models' . DS . 'Warehouse.php';
     $this->warehouse = new StorefrontModelWarehouse();
     // Get the task
     $this->_task = Request::getVar('task', '');
     if (empty($this->_task)) {
         $this->_task = 'home';
         $this->registerTask('__default', $this->_task);
     }
     parent::execute();
 }
Beispiel #28
0
 /**
  * Redirect to login form
  *
  * @return  void
  */
 public function execute()
 {
     if (User::isGuest()) {
         App::redirect(Route::url('index.php?option=com_users&view=login&return=' . base64_encode(Route::url('index.php?option=' . $this->_option . '&task=import', false, true))), Lang::txt('COM_CITATIONS_NOT_LOGGEDIN'), 'warning');
         return;
     }
     $this->importer = new Importer(App::get('db'), App::get('filesystem'), App::get('config')->get('tmp_path') . DS . 'citations', App::get('session')->getId());
     $this->registerTask('import_upload', 'upload');
     $this->registerTask('import_review', 'review');
     $this->registerTask('import_save', 'save');
     $this->registerTask('import_saved', 'saved');
     parent::execute();
 }
Beispiel #29
0
 /**
  * Execute a task
  *
  * @return     void
  */
 public function execute()
 {
     $this->_authorize();
     // Get the task
     $task = Request::getVar('task', 'display');
     // Check if middleware is enabled
     if ($task != 'image' && $task != 'css' && $task != 'assets' && (!$this->config->get('mw_on') || $this->config->get('mw_on') > 1 && !$this->config->get('access-admin-component'))) {
         // Redirect to home page
         App::redirect($this->config->get('mw_redirect', '/home'));
         return;
     }
     parent::execute();
 }
Beispiel #30
0
 /**
  * Determines task being called and attempts to execute it
  *
  * @return  void
  */
 public function execute()
 {
     $this->_task = Request::getVar('task', '');
     $this->_id = Request::getInt('id', 0);
     $this->_pub = NULL;
     // View individual curation
     if ($this->_id && !$this->_task) {
         $this->_task = 'view';
     }
     // Get language
     Lang::load('plg_projects_publications');
     //continue with parent execute method
     parent::execute();
 }