public function execute(HTTPRequestCustom $request) { $module_id = $request->get_getstring('module_id', ''); if (empty($module_id)) { AppContext::get_response()->redirect(Environment::get_home_page()); } $this->init(); $module_category_id = $request->get_getint('module_category_id', 0); $feed_name = $request->get_getstring('feed_name', Feed::DEFAULT_FEED_NAME); $feed = new ATOM($module_id, $feed_name, $module_category_id); if ($feed !== null && $feed->is_in_cache()) { $this->tpl->put('SYNDICATION', $feed->read()); } else { $eps = AppContext::get_extension_provider_service(); if ($eps->provider_exists($module_id, FeedProvider::EXTENSION_POINT)) { $provider = $eps->get_provider($module_id); $feeds = $provider->feeds(); $data = $feeds->get_feed_data_struct($module_category_id, $feed_name); if ($data === null) { AppContext::get_response()->set_header('content-type', 'text/html'); DispatchManager::redirect(PHPBoostErrors::unexisting_element()); } else { $feed->load_data($data); $feed->cache(); $this->tpl->put('SYNDICATION', $feed->export()); } } else { DispatchManager::redirect(PHPBoostErrors::module_not_installed()); } } return $this->build_response($this->tpl); }
public final function get_right_controller_regarding_authorizations() { if (ModulesManager::is_module_installed(Environment::get_running_module_name())) { $module = ModulesManager::get_module(Environment::get_running_module_name()); if (!$module->is_activated()) { return PHPBoostErrors::module_not_activated(); } } else { return PHPBoostErrors::module_not_installed(); } return $this; }
public final function get_right_controller_regarding_authorizations() { if (!AppContext::get_current_user()->is_admin()) { return new UserLoginController(UserLoginController::ADMIN_LOGIN, substr(REWRITED_SCRIPT, strlen(GeneralConfig::load()->get_site_path()))); } else { if (ModulesManager::is_module_installed(Environment::get_running_module_name())) { $module = ModulesManager::get_module(Environment::get_running_module_name()); if (!$module->is_activated()) { return PHPBoostErrors::module_not_activated(); } } else { return PHPBoostErrors::module_not_installed(); } } return $this; }
public function execute(HTTPRequestCustom $request) { $this->init(); $this->module_id = $request->get_string('id_module', null); if ($this->module_installed()) { $this->build_form(); if ($this->submit_button->has_been_submited() && $this->form->validate()) { $drop_files = $this->form->get_value('drop_files')->get_raw_value(); $this->delete_module($drop_files); } $this->tpl->put('FORM', $this->form->display()); return new AdminModulesDisplayResponse($this->tpl, $this->lang['modules.delete_module']); } else { $error_controller = PHPBoostErrors::module_not_installed(); DispatchManager::redirect($error_controller); } }
* * ################################################### * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ###################################################*/ require_once 'init.php'; $running_module_name = Environment::get_running_module_name(); if (!in_array($running_module_name, array('user', 'admin', 'kernel'))) { if (ModulesManager::is_module_installed($running_module_name)) { $module = ModulesManager::get_module($running_module_name); if (!$module->is_activated()) { DispatchManager::redirect(PHPBoostErrors::module_not_activated()); } } else { DispatchManager::redirect(PHPBoostErrors::module_not_installed()); } }