private function build_response(View $view) { $response = new SiteDisplayResponse($view); $graphical_environment = $response->get_graphical_environment(); $graphical_environment->set_page_title($this->lang['forget-password'], $this->lang['user']); $breadcrumb = $graphical_environment->get_breadcrumb(); $breadcrumb->add($this->lang['user'], UserUrlBuilder::home()->rel()); $breadcrumb->add($this->lang['forget-password'], UserUrlBuilder::forget_password()->rel()); return $response; }
private function build_response(View $view) { $title = $this->lang['messages']; $response = new SiteDisplayResponse($view); $graphical_environment = $response->get_graphical_environment(); $graphical_environment->set_page_title($title); $breadcrumb = $graphical_environment->get_breadcrumb(); $breadcrumb->add($this->lang['user'], UserUrlBuilder::home()->rel()); $breadcrumb->add($title, UserUrlBuilder::messages($this->user->get_id())->rel()); return $response; }
public function execute(HTTPRequestCustom $request) { $general_config = GeneralConfig::load(); $other_home_page = $general_config->get_other_home_page(); if (strpos($other_home_page, '/index.php') !== false) { AppContext::get_response()->redirect(UserUrlBuilder::home()); } else { if (!empty($other_home_page)) { AppContext::get_response()->redirect($other_home_page); } else { try { $module = AppContext::get_extension_provider_service()->get_provider($general_config->get_module_home_page()); if ($module->has_extension_point(HomePageExtensionPoint::EXTENSION_POINT)) { $home_page = $module->get_extension_point(HomePageExtensionPoint::EXTENSION_POINT)->get_home_page(); return $this->build_response($home_page->get_view(), $home_page->get_title()); } else { AppContext::get_response()->redirect(UserUrlBuilder::home()); } } catch (UnexistingExtensionPointProviderException $e) { AppContext::get_response()->redirect(UserUrlBuilder::home()); } } } }
} else { AppContext::get_response()->redirect(UserUrlBuilder::contribution_panel()); } } elseif ($id_to_delete > 0) { //Vérification de la validité du jeton AppContext::get_session()->csrf_get_protect(); $contribution = new Contribution(); //Loading the contribution into an object from the database and checking if the user is authorizes to read it if (($contribution = ContributionService::find_by_id($id_to_delete)) == null || !AppContext::get_current_user()->check_auth($contribution->get_auth(), Contribution::CONTRIBUTION_AUTH_BIT)) { $error_controller = PHPBoostErrors::unexisting_page(); DispatchManager::redirect($error_controller); } ContributionService::delete_contribution($contribution); AppContext::get_response()->redirect(UserUrlBuilder::contribution_panel()); } else { $Bread_crumb->add($LANG['member_area'], UserUrlBuilder::home()->rel()); $Bread_crumb->add($LANG['contribution_panel'], url('contribution_panel.php')); define('TITLE', $LANG['contribution_panel']); } require_once '../kernel/header.php'; $template = new FileTemplate('user/contribution_panel.tpl'); if ($contribution_id > 0) { $template->put_all(array('C_CONSULT_CONTRIBUTION' => true)); $comments_topic = new UserEventsCommentsTopic(); $comments_topic->set_id_in_module($contribution_id); $comments_topic->set_url(new Url('/user/contribution_panel.php?id=' . $contribution_id)); //For PHP 4 :( $contribution_creation_date = $contribution->get_creation_date(); $contribution_fixing_date = $contribution->get_fixing_date(); $contributor = PersistenceContext::get_querier()->select('SELECT * FROM ' . DB_TABLE_MEMBER . ' member
private function build_response(View $view, $user_id) { $response = new SiteDisplayResponse($view); $graphical_environment = $response->get_graphical_environment(); $graphical_environment->set_page_title(StringVars::replace_vars($this->lang['profile_of'], array('name' => $this->user_infos['display_name']), $this->lang['user'])); $breadcrumb = $graphical_environment->get_breadcrumb(); $breadcrumb->add($this->lang['user'], UserUrlBuilder::home()->rel()); $breadcrumb->add(StringVars::replace_vars($this->lang['profile_of'], array('name' => $this->user_infos['display_name'])), UserUrlBuilder::profile($user_id)->rel()); return $response; }
/** * @desc Adds to the site map all the kernel links. * @param int $mode USER_MODE ou SEARCH_ENGINE_MODE, it depends on if you want to show it to a user in particular or to anybody * @param int $auth_mode AUTH_GUEST or AUTH_USERS, it depends if you want to display only the public pages or also the private ones. */ private function build_kernel_map($mode = self::USER_MODE, $auth_mode = self::AUTH_PUBLIC) { global $LANG; //We consider the kernel as a module $kernel_map = new ModuleMap(new SitemapLink($LANG['home'], new Url(Environment::get_home_page()))); //The site description $kernel_map->set_description(nl2br(GeneralConfig::load()->get_site_description())); //All the links which not need to be present in the search engine results. if ($mode == self::USER_MODE) { if (AppContext::get_current_user()->check_auth(UserAccountsConfig::load()->get_auth_read_members(), UserAccountsConfig::AUTH_READ_MEMBERS_BIT)) { $kernel_map->add(new SitemapLink(LangLoader::get_message('members-list', 'user-common'), UserUrlBuilder::home())); } //Member space if ($auth_mode == self::AUTH_USER && AppContext::get_current_user()->check_level(User::MEMBER_LEVEL)) { //We create a section for that $member_space_section = new SitemapSection(new SitemapLink($LANG['my_private_profile'], UserUrlBuilder::profile(AppContext::get_current_user()->get_id()))); //Profile edition $member_space_section->add(new SitemapLink(LangLoader::get_message('profile.edit', 'user-common'), UserUrlBuilder::edit_profile(AppContext::get_current_user()->get_id()))); //Private messaging $member_space_section->add(new SitemapLink($LANG['private_messaging'], UserUrlBuilder::personnal_message(AppContext::get_current_user()->get_id()))); //Contribution panel $member_space_section->add(new SitemapLink($LANG['contribution_panel'], UserUrlBuilder::contribution_panel())); //Administration panel if (AppContext::get_current_user()->check_level(User::ADMIN_LEVEL)) { $member_space_section->add(new SitemapLink($LANG['admin_panel'], UserUrlBuilder::administration())); } //We add it to the kernel map $kernel_map->add($member_space_section); } } //The kernel map is added to the site map $this->add($kernel_map); }
public static function load_distribution_properties($prefered_lang) { global $DISTRIBUTION_MODULES; //If the distribution properties exist in the prefered language if (is_file('distribution/' . $prefered_lang . '.php')) { //We load them include 'distribution/' . $prefered_lang . '.php'; } else { //We try to load another lang $distribution_folder = new Folder('distribution'); $distribution_files = $distribution_folder->get_files('`distribution_[a-z_-]+\\.php`i'); if (count($distribution_files) > 0) { include 'distribution/distribution_' . $distribution_files[0]->get_name() . '.php'; } else { //We couldn't load anything, we just have to define them to default values //Name of the distribution (localized) define('DISTRIBUTION_NAME', 'Default distribution'); //Description of the distribution (localized) define('DISTRIBUTION_DESCRIPTION', 'This distribution is the default distribution. You will manage to install PHPBoost with the default configuration but it will install only the kernel without any module.'); //Distribution default theme define('DISTRIBUTION_THEME', 'base'); //Home page define('DISTRIBUTION_START_PAGE', UserUrlBuilder::home()->rel()); //Can people register? define('DISTRIBUTION_ENABLE_USER', false); //Debug mode? define('DISTRIBUTION_ENABLE_DEBUG_MODE', true); //Enable bench? define('DISTRIBUTION_ENABLE_BENCH', false); //Modules list $DISTRIBUTION_MODULES = array(); } } }
private function build_response() { $response = new SiteDisplayResponse($this->tpl); $graphical_environment = $response->get_graphical_environment(); $graphical_environment->set_page_title($this->lang['comments']); $breadcrumb = $graphical_environment->get_breadcrumb(); if ($this->user !== null) { $breadcrumb->add($this->user->get_display_name(), UserUrlBuilder::profile($this->user->get_id())->rel()); $breadcrumb->add(LangLoader::get_message('messages', 'user-common'), UserUrlBuilder::messages($this->user->get_id())->rel()); $breadcrumb->add($this->lang['comments'], UserUrlBuilder::comments('', $this->user->get_id())->rel()); } else { $breadcrumb->add(LangLoader::get_message('users', 'user-common'), UserUrlBuilder::home()->rel()); $breadcrumb->add($this->lang['comments'], UserUrlBuilder::comments()->rel()); } return $response; }