public function __construct(CSRFSynchronizerToken $csrf, $project_id, array $repositories) { $are_mirrors_defined = true; parent::__construct($project_id, $are_mirrors_defined); $this->csrf_input = $csrf->fetchHTMLInput(); $this->manage_mass_update_select_repositories = true; $this->repositories = $repositories; }
public function __construct(CSRFSynchronizerToken $csrf, $project_id, array $repositories, GitPresenters_AdminMassUdpdateMirroringPresenter $mirroring_presenter) { $allow_mass_update = true; parent::__construct($project_id, $allow_mass_update); $this->csrf_input = $csrf->fetchHTMLInput(); $this->manage_mass_update = true; $this->repositories = $repositories; $this->mirroring_presenter = $mirroring_presenter; }
public function __construct(CSRFSynchronizerToken $token, $title, $action) { $this->submit_button = $GLOBALS['Language']->getText('global', 'btn_submit'); $this->close_button = $GLOBALS['Language']->getText('global', 'btn_cancel'); $this->subject_label = $GLOBALS['Language']->getText('my_index', 'subject_label'); $this->body_label = $GLOBALS['Language']->getText('my_index', 'body_label'); $this->title = $title; $this->action = $action; $this->csrf_token = $token->fetchHTMLInput(); }
public function displayAdminOnTop(Tracker_IDisplayTrackerLayout $layout, CSRFSynchronizerToken $token, Cardwall_OnTop_Config $config) { $column_definition_view = $config->getDashboardColumns()->accept($this, $config); $checked = $config->isEnabled() ? 'checked="checked"' : ''; $freestyle_checked = $config->isFreestyleEnabled() ? 'checked="checked"' : ''; $token_html = $token->fetchHTMLInput(); $formview = new Cardwall_View_Admin_Form($column_definition_view); $config->getTracker()->displayAdminItemHeader($layout, 'plugin_cardwall'); $formview->displayAdminForm($token_html, $checked, $freestyle_checked, $config->getTracker()->getId()); $config->getTracker()->displayFooter($layout); }
public function __construct($project_id, CSRFSynchronizerToken $token, $subject_label, $action, $subject_content, $body_content) { $this->project_id = $project_id; $this->action = $action; $this->csrf_token = $token->fetchHTMLInput(); $this->subject_content = $subject_content; $this->body_content = $body_content; $this->title = $subject_label; $this->submit_button = $GLOBALS['Language']->getText('global', 'btn_submit'); $this->close_button = $GLOBALS['Language']->getText('global', 'btn_cancel'); $this->subject_label = $GLOBALS['Language']->getText('my_index', 'subject_label'); $this->body_label = $GLOBALS['Language']->getText('my_index', 'body_label'); }
public function __construct(CSRFSynchronizerToken $csrf, $project_id, array $repositories, GitPresenters_AdminMassUdpdateMirroringPresenter $mirroring_presenter) { $allow_mass_update = true; parent::__construct($project_id, $allow_mass_update); $this->csrf_input = $csrf->fetchHTMLInput(); $this->manage_mass_update = true; $this->mirroring_presenter = $mirroring_presenter; $nb_mirrors = count($mirroring_presenter->mirror_presenters); $max_input_vars = (int) ini_get('max_input_vars'); $this->is_exceeding_max_input_vars = count($repositories) * $nb_mirrors >= $max_input_vars; if ($this->is_exceeding_max_input_vars) { $nb_to_keep = ceil($max_input_vars / ($nb_mirrors + 1)); $this->repositories = array_slice($repositories, 0, $nb_to_keep); } else { $this->repositories = $repositories; } }
public function __construct(CSRFSynchronizerToken $csrf, $title, $use_standard_homepage, array $headlines) { $this->title = $title; $this->headlines = $headlines; $this->csrf_token = $csrf->fetchHTMLInput(); $this->use_standard_homepage = $use_standard_homepage; $this->path_logo = Admin_Homepage_LogoFinder::getCurrentUrl(); $this->use_custom_logo = Admin_Homepage_LogoFinder::isCustomLogoUsed(); $this->save = $GLOBALS['Language']->getText('admin_main', 'save_conf'); $this->logo = $GLOBALS['Language']->getText('admin_main', 'homepage_logo'); $this->upload = $GLOBALS['Language']->getText('admin_main', 'homepage_upload_logo'); $this->headline = $GLOBALS['Language']->getText('admin_main', 'headline'); $this->logo_help = $GLOBALS['Language']->getText('admin_main', 'homepage_logo_help'); $this->headline_help = $GLOBALS['Language']->getText('admin_main', 'headline_help'); $this->placeholder_headline = $GLOBALS['Language']->getText('admin_main', 'placeholder_headline'); $this->use_standard_homepage_help = $GLOBALS['Language']->getText('admin_main', 'use_standard_homepage_help'); $this->use_standard_homepage_label = $GLOBALS['Language']->getText('admin_main', 'use_standard_homepage_label'); }
public function __construct(CSRFSynchronizerToken $csrf, $title, $localinc_path, TrackerPluginConfig $config) { $this->title = $title; $this->csrf_token = $csrf->fetchHTMLInput(); $this->is_insecure_emailgateway_enabled = $config->isInsecureEmailgatewayEnabled(); $this->is_token_based_emailgateway_enabled = $config->isTokenBasedEmailgatewayEnabled(); $this->is_emailgateway_disabled = $config->isEmailgatewayDisabled(); $this->email_gateway = $GLOBALS['Language']->getText('plugin_tracker_config', 'email_gateway'); $this->email_gateway_desc = $GLOBALS['Language']->getText('plugin_tracker_config', 'email_gateway_desc'); $this->disable = $GLOBALS['Language']->getText('plugin_tracker_config', 'disable'); $this->disable_desc = $GLOBALS['Language']->getText('plugin_tracker_config', 'disable_desc'); $this->token = $GLOBALS['Language']->getText('plugin_tracker_config', 'token'); $this->token_desc = $GLOBALS['Language']->getText('plugin_tracker_config', 'token_desc'); $this->insecure = $GLOBALS['Language']->getText('plugin_tracker_config', 'insecure'); $this->insecure_desc = $GLOBALS['Language']->getText('plugin_tracker_config', 'insecure_desc'); $this->save_conf = $GLOBALS['Language']->getText('admin_main', 'save_conf'); $this->is_localinc_obsolete = $this->isLocalIncObsolete($localinc_path); $this->localinc_obsolete_message = $GLOBALS['Language']->getText('plugin_tracker_config', 'localinc_obsolete_message', $localinc_path); }
public function __construct(CSRFSynchronizerToken $csrf, $title, $localinc_path, $current_access_mode, $nb_restricted_users, $ugroup_authenticated_users, $ugroup_registered_users, $project_admin_can_choose, $reverse_proxy_regexp) { $this->title = $title; $this->csrf_token = $csrf->fetchHTMLInput(); $this->localinc_path = $localinc_path; $this->current_access_mode = $current_access_mode; $this->nb_restricted_users = $nb_restricted_users; $this->reverse_proxy_regexp = $reverse_proxy_regexp; $this->project_admin_can_choose = $project_admin_can_choose; $this->is_localinc_obsolete = $this->isLocalIncObsolete(); $this->access_anonymous = $current_access_mode === ForgeAccess::ANONYMOUS; $this->access_regular = $current_access_mode === ForgeAccess::REGULAR; $this->access_restricted = $current_access_mode === ForgeAccess::RESTRICTED; $this->access_anonymous_except_reverse_proxy = $current_access_mode === ForgeAccess::ANONYMOUS && !empty($reverse_proxy_regexp); $this->btn_submit = $GLOBALS['Language']->getText('admin_main', 'save_conf'); $this->localinc_obsolete_message = $GLOBALS['Language']->getText('admin_main', 'localinc_obsolete_message', $this->localinc_path); $this->access_anonymous_label = $GLOBALS['Language']->getText('admin_main', 'access_anonymous_label'); $this->access_anonymous_desc = $GLOBALS['Language']->getText('admin_main', 'access_anonymous_desc'); $this->access_regular_label = $GLOBALS['Language']->getText('admin_main', 'access_regular_label'); $this->access_regular_desc = $GLOBALS['Language']->getText('admin_main', 'access_regular_desc'); $this->access_restricted_label = $GLOBALS['Language']->getText('admin_main', 'access_restrited_label'); $this->access_restricted_desc = $GLOBALS['Language']->getText('admin_main', 'access_restrited_desc'); $this->current_restricted_users_message = $GLOBALS['Language']->getText('admin_main', 'current_restricted_users_message', $this->nb_restricted_users); $this->access_anonymous_except_proxy_label = $GLOBALS['Language']->getText('admin_main', 'access_anonymous_except_proxy_label'); $this->access_anonymous_except_proxy_desc = $GLOBALS['Language']->getText('admin_main', 'access_anonymous_except_proxy_desc'); $this->reverse_proxy_regexp_title = $GLOBALS['Language']->getText('admin_main', 'reverse_proxy_regexp_title'); if ($ugroup_authenticated_users != false) { $this->ugroup_authenticated_users = $ugroup_authenticated_users; } if ($ugroup_registered_users != false) { $this->ugroup_registered_users = $ugroup_registered_users; } $this->ugroup_authenticated_users_placeholder = $GLOBALS['Language']->getText('admin_main', 'ugroup_authenticated_users_placeholder', array(ForgeConfig::get('sys_org_name'))); $this->ugroup_registered_users_placeholder = $GLOBALS['Language']->getText('admin_main', 'ugroup_registered_users_placeholder', array(ForgeConfig::get('sys_org_name'))); $this->ugroup_authenticated_users_label = $GLOBALS['Language']->getText('admin_main', 'ugroup_authenticated_users_label'); $this->ugroup_registered_users_label = $GLOBALS['Language']->getText('admin_main', 'ugroup_registered_users_label'); $this->customize_ugroups_label_info = $GLOBALS['Language']->getText('admin_main', 'customize_ugroups_label_info'); $this->who_can_access = $GLOBALS['Language']->getText('admin_main', 'who_can_access'); $this->projects_visibility = $GLOBALS['Language']->getText('admin_main', 'projects_visibility'); $this->projects_visibility_label = $GLOBALS['Language']->getText('admin_main', 'projects_visibility_label'); $this->projects_visibility_help = $GLOBALS['Language']->getText('admin_main', 'projects_visibility_help'); }
/** * @return string */ public function getDeprecatedMessage() { if ($this->user->getPreference(PFUser::PREFERENCE_DISABLE_IE7_WARNING)) { return; } $warning_message = $GLOBALS['Language']->getText('include_browser', 'ie7_deprecated'); if ($this->user->isAnonymous()) { return $warning_message; } $url = '/account/disable_ie7_warning.php'; $csrf = new CSRFSynchronizerToken($url); $form = '<form action="' . $url . '" method="POST" style="margin: 0">'; $form .= $csrf->fetchHTMLInput(); $form .= $warning_message; $form .= '<button type="submit" class="btn btn-small btn-inverse" > ' . $GLOBALS['Language']->getText('include_browser', 'ie7_deprecated_button') . ' </button> </form>'; return $form; }
?> <FORM METHOD="POST"> <?php echo $Language->getText('bookmark_add', 'bkm_url'); ?> :<br> <input type="text" name="bookmark_url" size="60" value="<?php echo $purifier->purify($bookmark_url); ?> "> <p> <?php echo $Language->getText('bookmark_add', 'bkm_title'); ?> :<br> <input type="text" name="bookmark_title" size="60" value="<?php echo $purifier->purify($bookmark_title); ?> "> <p> <?php echo $csrf_token->fetchHTMLInput(); ?> <input type="submit" value="<?php echo $Language->getText('global', 'btn_submit'); ?> "> </form> <?php print "<P><A HREF=\"/my/\">[" . $Language->getText('global', 'back_home') . "]</A>"; $HTML->footer(array());
$handle->file_force_extension = false; $handle->file_new_name_ext = ''; $handle->allowed = 'image/*'; $handle->file_overwrite = true; if ($handle->uploaded && Config::get('sys_enable_avatars', true)) { $csrf->check(); $user_id = (string) $user->getId(); $avatar_path = Config::get('sys_avatar_path', Config::get('sys_data_dir') . '/user/avatar/'); $path = "{$avatar_path}/" . substr($user_id, -2, 1) . '/' . substr($user_id, -1, 1) . "/{$user_id}"; $handle->process($path); if ($handle->processed) { $user->sethasAvatar(); $user_manager->updateDb($user); $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('account_change_avatar', 'success')); $GLOBALS['Response']->redirect('/account/'); } else { $GLOBALS['Response']->addFeedback('error', $handle->error); } } } $title = $Language->getText('account_change_avatar', 'title'); $HTML->header(array('title' => $title)); echo '<h2>' . $title . '</h2>'; echo '<form action="/account/change_avatar.php" method="POST" enctype="multipart/form-data">'; echo '<input type="hidden" name="MAX_FILE_SIZE" value="300000" />'; echo $csrf->fetchHTMLInput(); echo $user->fetchHtmlAvatar(); echo '<input type="file" name="avatar" />'; echo '<p><input type="submit" value="' . $Language->getText('global', 'btn_update') . '" /></p>'; echo '</form>'; $HTML->footer(array());
protected function forkRepositories() { $params = $this->getData(); $this->_getBreadCrumb(); echo '<h2>' . $this->getText('fork_repositories') . '</h2>'; echo $this->getText('fork_repositories_desc'); if (!empty($params['repository_list'])) { echo '<form action="" method="POST">'; echo '<input type="hidden" name="group_id" value="' . (int) $this->groupId . '" />'; echo '<input type="hidden" name="action" value="do_fork_repositories" />'; $token = new CSRFSynchronizerToken('/plugins/git/?group_id=' . (int) $this->groupId . '&action=fork_repositories'); echo $token->fetchHTMLInput(); echo '<table id="fork_repositories" cellspacing="0">'; echo '<thead>'; echo '<tr valign="top">'; echo '<td class="first">'; echo '<label style="font-weight: bold;">' . $this->getText('fork_repositories_select') . '</label>'; echo '</td>'; echo '<td>'; echo '<label style="font-weight: bold;">' . $this->getText('fork_destination_project') . '</label>'; echo '</td>'; echo '<td>'; echo '<label style="font-weight: bold;">' . $this->getText('fork_repositories_path') . '</label>'; echo '</td>'; echo '<td class="last"> </td>'; echo '</tr>'; echo '</thead>'; echo '<tbody><tr valign="top">'; echo '<td class="first">'; $strategy = new GitViewsRepositoriesTraversalStrategy_Selectbox($this); echo $strategy->fetch($params['repository_list'], $this->user); echo '</td>'; echo '<td>'; echo '<div> <input id="choose_personal" type="radio" name="choose_destination" value="personal" checked="true" /> <label for="choose_personal">' . $this->getText('fork_choose_destination_personal') . '</label> </div>'; echo $this->fetchCopyToAnotherProject(); echo '</td>'; echo '<td>'; $placeholder = $this->getText('fork_repositories_placeholder'); echo '<input type="text" title="' . $placeholder . '" placeholder="' . $placeholder . '" id="fork_repositories_path" name="path" />'; echo '<input type="hidden" id="fork_repositories_prefix" value="u/' . $this->user->getName() . '" />'; echo '</td>'; echo '<td class="last">'; echo '<input type="submit" value="' . $this->getText('fork_repositories') . '" />'; echo '</td>'; echo '</tr></tbody></table>'; echo '</form>'; } echo '<br />'; }
public function token() { $token = new CSRFSynchronizerToken('/plugins/agiledashboard/?action=admin'); return $token->fetchHTMLInput(); }
public function displayAdminConfirmDelete(Tracker_IDisplayTrackerLayout $layout, Tracker_Artifact $artifact) { $token = new CSRFSynchronizerToken(TRACKER_BASE_URL . '/?tracker=' . (int) $this->id . '&func=admin-delete-artifact'); $this->displayAdminItemHeader($layout, 'clean'); echo '<div class="tracker_confirm_delete">'; echo '<form name="delete_artifact" method="post" action="' . TRACKER_BASE_URL . '/?tracker=' . (int) $this->id . '&func=admin-delete-artifact">'; echo $token->fetchHTMLInput(); echo $GLOBALS['Language']->getText('plugin_tracker_admin', 'clean_confirm_text', array($artifact->getXRefAndTitle())); echo '<div class="tracker_confirm_delete_preview">'; echo $this->fetchFormElementsReadOnly($artifact); echo '</div>'; echo '<div class="tracker_confirm_delete_buttons">'; echo '<input type="submit" tabindex="2" name="confirm" value="' . $GLOBALS['Language']->getText('plugin_tracker_admin', 'clean_confirm') . '" />'; echo '<input type="submit" tabindex="1" name="cancel" value="' . $GLOBALS['Language']->getText('plugin_tracker_admin', 'clean_cancel') . '" />'; echo '</div>'; echo '<input type="hidden" name="id" value="' . $artifact->getId() . '" />'; echo '</form>'; echo '</div>'; $this->displayFooter($layout); }
public function update_allowed_projects_action_csrf() { $csrf = new CSRFSynchronizerToken('/plugins/pluginsadministration/?action=update-allowed-project-list&plugin_id=' . $this->plugin->getId()); return $csrf->fetchHTMLInput(); }
/** * Fetch the html code to display permissions form when forking repositories * * @param Array $params Request params * @param Integer $groupId Project Id * @param String $userName User name * * @return String */ public function displayRepositoriesPermissionsForm($params, $groupId, $userName) { $sourceReposHTML = $this->displayForkSourceRepositories($params['repos']); $form = '<h2>' . $GLOBALS['Language']->getText('plugin_git', 'fork_repositories') . '</h2>'; $form .= $GLOBALS['Language']->getText('plugin_git', 'fork_repository_message', array($sourceReposHTML)); $form .= $this->displayForkDestinationMessage($params); $form .= '<h3>Set permissions for the repository to be created</h3>'; $form .= '<form action="" method="POST">'; $form .= '<input type="hidden" name="group_id" value="' . (int) $groupId . '" />'; $form .= '<input type="hidden" name="action" value="do_fork_repositories" />'; $token = new CSRFSynchronizerToken('/plugins/git/?group_id=' . (int) $groupId . '&action=fork_repositories'); $form .= $token->fetchHTMLInput(); $form .= '<input id="fork_repositories_repo" type="hidden" name="repos" value="' . $this->getPurifier()->purify($params['repos']) . '" />'; $form .= '<input id="choose_personal" type="hidden" name="choose_destination" value="' . $this->getPurifier()->purify($params['scope']) . '" />'; $form .= '<input id="to_project" type="hidden" name="to_project" value="' . $this->getPurifier()->purify($params['group_id']) . '" />'; $form .= '<input type="hidden" id="fork_repositories_path" name="path" value="' . $this->getPurifier()->purify($params['namespace']) . '" />'; $form .= '<input type="hidden" id="fork_repositories_prefix" value="u/' . $userName . '" />'; $form .= $this->displayAccessControl($groupId); $form .= '<input type="submit" class="btn btn-primary" value="' . $GLOBALS['Language']->getText('plugin_git', 'fork_repositories') . '" />'; $form .= '</form>'; return $form; }
} } } /* Fill in the info to create a job */ people_header(array('title' => $Language->getText('people_editprofile', 'edit_your_profile'))); //for security, include group_id $sql = "SELECT * FROM user WHERE user_id='" . user_getid() . "'"; $result = db_query($sql); if (!$result || db_numrows($result) < 1) { echo db_error(); $feedback .= ' ' . $Language->getText('people_editprofile', 'user_fetch_failed') . ' '; echo '<H2>' . $Language->getText('people_editprofile', 'no_such_user') . '</H2>'; } else { $csrfToken = $csrf->fetchHTMLInput(); echo ' <H2>' . $Language->getText('people_editprofile', 'edit_your_profile') . '</H2> <P> ' . $Language->getText('people_editprofile', 'skill_explain') . ' <P> <FORM ACTION="?" METHOD="POST">' . $csrfToken . ' <P> ' . $Language->getText('people_editprofile', 'public_view_explain') . ' <P> <B>' . $Language->getText('people_editprofile', 'publicly_viewable') . ':</B><BR> <INPUT TYPE="RADIO" NAME="people_view_skills" VALUE="0" ' . (db_result($result, 0, 'people_view_skills') == 0 ? 'CHECKED' : '') . '> <B>' . $Language->getText('global', 'no') . '</B><BR> <INPUT TYPE="RADIO" NAME="people_view_skills" VALUE="1" ' . (db_result($result, 0, 'people_view_skills') == 1 ? 'CHECKED' : '') . '> <B>' . $Language->getText('global', 'yes') . '</B><BR> <P> ' . $Language->getText('people_editprofile', 'give_us_info') . ' <P>
public function update_allowed_projects_action_csrf() { $csrf = new CSRFSynchronizerToken('/plugins/git/admin/?pane=mirrors_admin&action=update-allowed-project-list&mirror_id=' . $this->mirror->id); return $csrf->fetchHTMLInput(); }
$generic_user->setPassword($password); } $generic_user->setEmail($email); if ($user_manager->updateDb($generic_user)) { $GLOBALS['Response']->addFeedback('info', $Language->getText('project_admin', 'generic_member_updated')); } else { $GLOBALS['Response']->addFeedback('warning', $Language->getText('project_admin', 'generic_member_not_changed')); } $GLOBALS['HTML']->redirect($redirect_url); } $hp = Codendi_HTMLPurifier::instance(); $title = $Language->getText('project_admin', 'generic_member_settings'); project_admin_header(array('title' => $title, 'group' => $group_id, 'help' => 'project-admin.html')); echo '<h2>' . $title . '</h2>'; echo '<form method="POST" action="">'; echo $token->fetchHTMLInput(); echo '<input type="hidden" name="group_id" value="' . (int) $group_id . '" /> <p> <label for="newtracker_login"><b>' . $Language->getText('account_login', 'name') . '</b>:<br /> ' . $generic_user->getUserName() . ' </p> <p> <label for="newtracker_real_name"><b>' . $Language->getText('account_register', 'realname') . '</b>:</label><br /> ' . $generic_user->getRealName() . ' </p> <p> <label for="generic_user_email"><b>' . $Language->getText('account_change_email', 'title') . '</b>:</label><br /> <input type="email" name="email" id="generic_user_email" value="' . $hp->purify($generic_user->getEmail(), CODENDI_PURIFIER_CONVERT_HTML) . '" /> </p> <p> <label for="generic_user_password"><b>' . $Language->getText('admin_user_changepw', 'new_passwd') . '</b>:</label><br />
public function update_allowed_projects_action_csrf() { $csrf = new CSRFSynchronizerToken($this->update_allowed_projects_action()); return $csrf->fetchHTMLInput(); }
public function triggers_synch_token() { return $this->token->fetchHTMLInput(); }
$is_default = $theme === $GLOBALS['sys_themedefault']; $is_selected = $is_default; if ($user->getTheme()) { $is_selected = $theme === $user->getTheme(); } $all_themes[] = array('theme_name' => $theme, 'is_selected' => $is_selected, 'is_default' => $is_default); } $languages_html = array(); foreach ($GLOBALS['Language']->getLanguages() as $code => $lang) { $languages_html[] = array('lang' => $lang, 'code' => $code, 'is_selected' => $user->getLocale() === $code); } $user_helper_preferences = array(array('preference_name' => UserHelper::PREFERENCES_NAME_AND_LOGIN, 'preference_label' => $Language->getText('account_options', 'tuleap_name_and_login'), 'is_selected' => (int) user_get_preference("username_display") === UserHelper::PREFERENCES_NAME_AND_LOGIN), array('preference_name' => UserHelper::PREFERENCES_LOGIN_AND_NAME, 'preference_label' => $Language->getText('account_options', 'tuleap_login_and_name'), 'is_selected' => (int) user_get_preference("username_display") === UserHelper::PREFERENCES_LOGIN_AND_NAME), array('preference_name' => UserHelper::PREFERENCES_LOGIN, 'preference_label' => $Language->getText('account_options', 'tuleap_login'), 'is_selected' => (int) user_get_preference("username_display") === UserHelper::PREFERENCES_LOGIN), array('preference_name' => UserHelper::PREFERENCES_REAL_NAME, 'preference_label' => $Language->getText('account_options', 'real_name'), 'is_selected' => (int) user_get_preference("username_display") === UserHelper::PREFERENCES_REAL_NAME)); $plugins_prefs = array(); $em->processEvent('user_preferences_appearance', array('preferences' => &$plugins_prefs)); $all_csv_separator = array(); foreach (PFUser::$csv_separators as $separator) { $all_csv_separator[] = array('separator_name' => $separator, 'separator_label' => $Language->getText('account_options', $separator), 'is_selected' => $separator === user_get_preference("user_csv_separator")); } $all_csv_dateformat = array(); foreach (PFUser::$csv_dateformats as $dateformat) { $all_csv_dateformat[] = array('dateformat_name' => $dateformat, 'dateformat_label' => $Language->getText('account_preferences', $dateformat), 'is_selected' => $dateformat === user_get_preference("user_csv_dateformat")); } $user_access_info = $um->getUserAccessInfo($user); if (!$user_access_info) { $user_access_info = array('last_auth_success' => false, 'last_auth_failure' => false, 'nb_auth_failure' => false, 'prev_auth_success' => false); } $presenter = new User_PreferencesPresenter($user, $can_change_realname, $can_change_email, $can_change_password, $extra_user_info, $user_access_info, $ssh_keys_extra_html, $third_paty_html, $csrf->fetchHTMLInput(), $tracker_formats, $all_themes, $languages_html, $user_helper_preferences, $plugins_prefs, $all_csv_separator, $all_csv_dateformat); $HTML->header(array('title' => $Language->getText('account_options', 'title'), 'body_class' => array('account-maintenance'))); $renderer = TemplateRendererFactory::build()->getRenderer(dirname(__FILE__) . '/../../templates/user'); $renderer->renderToPage('account-maintenance', $presenter); $HTML->footer(array());
public function token_input() { return $this->token->fetchHTMLInput(); }
public function __construct($title, CSRFSynchronizerToken $csrf) { $this->title = $title; $this->csrf_input = $csrf->fetchHTMLInput(); }
// Copyright 1999-2000 (c) The SourceForge Crew // http://sourceforge.net // require_once 'pre.php'; require_once 'bookmarks.php'; $request = HTTPRequest::instance(); $HTML->header(array("title" => $Language->getText('bookmark_delete', 'title'))); print "<H3>" . $Language->getText('bookmark_delete', 'title') . "</H3>\n"; $vId = new Valid_UInt('bookmark_id'); $vId->required(); if ($request->valid($vId)) { $bookmark_id = (int) $request->get('bookmark_id'); $csrf_token = new CSRFSynchronizerToken('bookmark_delete'); if ($request->isPost()) { $csrf_token->check('/my/bookmark_delete.php?bookmark_id=' . $bookmark_id); bookmark_delete($bookmark_id); print '<p>' . $Language->getText('bookmark_delete', 'deleted') . '</p>'; } else { print '<form method="post">'; print '<p>' . $Language->getText('my_index', 'del_bookmark') . '</p>'; print '<input type="hidden" name="bookmark_id" value="' . $bookmark_id . '"/>'; print $csrf_token->fetchHTMLInput(); print '<input type="submit" value="' . $Language->getText('global', 'btn_submit') . '">'; print '</form>'; } print "<p><a href=\"/my/\">[" . $Language->getText('global', 'back_home') . "]</a></p>"; } else { $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('global', 'missing_parameters')); $GLOBALS['Response']->redirect('/my'); } $HTML->footer(array());