Beispiel #1
0
$lang['profile.edit'] = 'Edition du profil';
$lang['messages'] = 'Messages de l\'utilisateur';
$lang['maintain'] = 'Maintenance';
$lang['welcome'] = 'Bienvenue';
$lang['members-list'] = 'Liste des membres';
$lang['member-management'] = 'Gestion du membre';
$lang['punishment-management'] = 'Gestion des sanctions';
$lang['profile.edit.password.error'] = 'Le mot de passe que vous avez entré n\'est pas correct';
$lang['external-auth.account-exists'] = 'Pour associer votre compte avec la connexion externe vous devez vous connecter sur le site et vous rendre dans l\'édition de votre profil';
//Contribution
$lang['contribution'] = 'Contribution';
$lang['contribution.explain'] = 'Votre contribution suivra le parcours classique et sera traitée dans le panneau de contribution. Vous pouvez, dans le champ suivant, justifier votre contribution de façon à expliquer votre démarche à un approbateur.';
$lang['contribution.description'] = 'Complément de contribution';
$lang['contribution.description.explain'] = 'Expliquez les raisons de votre contribution. Ce champ est facultatif mais il peut aider un approbateur à prendre sa décision.';
$lang['contribution.confirmed'] = 'Votre contribution a bien été enregistrée.';
$lang['contribution.confirmed.messages'] = '<p>Vous pourrez la suivre dans le <a href="' . UserUrlBuilder::contribution_panel()->rel() . '">panneau de contribution</a> 
et éventuellement discuter avec les validateurs si leur choix n\'est pas franc.</p><p>Merci d\'avoir participé à la vie du site !</p>';
//User fields
$lang['display_name'] = 'Nom d\'affichage';
$lang['display_name.explain'] = 'Nom affiché sur chacun des éléments que vous ajoutez.';
$lang['login'] = '******';
$lang['login.explain'] = 'Adresse email ou votre login personnalisé si vous en avez choisi un.';
$lang['login.custom'] = 'Choisir un identifiant de connexion';
$lang['login.custom.explain'] = 'Par défaut, vous devez vous connecter avec votre adresse email.';
$lang['password'] = '******';
$lang['password.new'] = 'Nouveau mot de passe';
$lang['password.old'] = 'Ancien mot de passe';
$lang['password.old.explain'] = 'Remplir seulement en cas de modification';
$lang['password.confirm'] = 'Confirmer le mot de passe';
$lang['password.explain'] = 'Longueur minimale du mot de passe : :number caractères';
$lang['email'] = 'Email';
        ContributionService::save_contribution($contribution);
        AppContext::get_response()->redirect(UserUrlBuilder::contribution_panel($contribution->get_id()));
    } 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();
Beispiel #3
0
 /**
  * @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);
 }
Beispiel #4
0
$lang['profile.edit'] = 'Edit profile';
$lang['messages'] = 'User messages';
$lang['maintain'] = 'Maintain';
$lang['welcome'] = 'Welcome';
$lang['members-list'] = 'Members list';
$lang['member-management'] = 'Member management';
$lang['punishment-management'] = 'Pnishments management';
$lang['profile.edit.password.error'] = 'The new password is not correct';
$lang['external-auth.account-exists'] = 'To associate your account with external connection you must connect to the site and go to edit your profile';
//Contribution
$lang['contribution'] = 'Contribution';
$lang['contribution.explain'] = 'Your contribution will be treated in the contribution panel. In the next field, you can justify your contribution to explain your demarche to a moderator.';
$lang['contribution.description'] = 'Contribution counterpart';
$lang['contribution.description.explain'] = 'Explain the reasons of your contribution. This field is not required but it may help the moderator to make his decision.';
$lang['contribution.confirmed'] = 'Your contribution has been saved.';
$lang['contribution.confirmed.messages'] = '<p>You can follow it into the <a href="' . UserUrlBuilder::contribution_panel()->rel() . '">contribution panel</a> 
and possibly discuss with the validators if their choice is not straightforward.</p><p>Thank you for participating in the life of the site!</p>';
//User fields
$lang['display_name'] = 'Display name';
$lang['display_name.explain'] = 'Display name on each item you add.';
$lang['login'] = '******';
$lang['login.custom'] = 'Choose a login';
$lang['login.custom.explain'] = 'Default, you must log in with your email address.';
$lang['password'] = '******';
$lang['password.new'] = 'New password';
$lang['password.old'] = 'Old password';
$lang['password.old.explain'] = 'Complete only if amended';
$lang['password.confirm'] = 'Confirm the password';
$lang['password.explain'] = 'Minimum length of password: :number characters';
$lang['email'] = 'Email';
$lang['email.hide'] = 'Hide email';
 private function build_form()
 {
     $contribution_number = $this->get_unread_contributions_number();
     $is_authorized_files_panel = $this->user->check_auth(FileUploadConfig::load()->get_authorization_enable_interface_files(), FileUploadConfig::AUTH_FILES_BIT);
     $this->tpl->put_all(array('C_USER_AUTH_FILES' => $is_authorized_files_panel, 'C_USER_INDEX' => true, 'C_IS_MODERATOR' => $this->user->get_level() >= User::MODERATOR_LEVEL, 'C_UNREAD_CONTRIBUTION' => $contribution_number != 0, 'C_KNOWN_NUMBER_OF_UNREAD_CONTRIBUTION' => $contribution_number > 0, 'C_UNREAD_ALERT' => (bool) AdministratorAlertService::get_number_unread_alerts(), 'C_HAS_PM' => $this->user->get_unread_pm() > 0, 'COLSPAN' => $is_authorized_files_panel ? 3 : 2, 'PSEUDO' => $this->user->get_display_name(), 'NUMBER_UNREAD_ALERTS' => AdministratorAlertService::get_number_unread_alerts(), 'NUMBER_UNREAD_CONTRIBUTIONS' => $contribution_number, 'NUMBER_PM' => $this->user->get_unread_pm(), 'MSG_MBR' => FormatingHelper::second_parse(UserAccountsConfig::load()->get_welcome_message()), 'U_USER_ID' => UserUrlBuilder::profile($this->user->get_id())->rel(), 'U_USER_PM' => UserUrlBuilder::personnal_message($this->user->get_id())->rel(), 'U_CONTRIBUTION_PANEL' => UserUrlBuilder::contribution_panel()->rel(), 'U_MODERATION_PANEL' => UserUrlBuilder::moderation_panel()->rel(), 'U_UPLOAD' => UserUrlBuilder::upload_files_panel()->rel(), 'U_VIEW_PROFILE' => UserUrlBuilder::profile($this->user->get_id())->rel()));
 }