本文整理汇总了PHP中HTTPRequest::get方法的典型用法代码示例。如果您正苦于以下问题:PHP HTTPRequest::get方法的具体用法?PHP HTTPRequest::get怎么用?PHP HTTPRequest::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTPRequest
的用法示例。
在下文中一共展示了HTTPRequest::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processReminder
/**
* Process date reminder requests
*
* @param TrackerManager $trackerManager
* @param HTTPRequest $request
* @param PFUser $currentUser
*
* @return Void
*/
public function processReminder(TrackerManager $trackerManager, HTTPRequest $request, $currentUser)
{
$action = $request->get('action');
$do_redirect = false;
$feedback = false;
try {
if ($request->get('submit') && $action == 'new_reminder') {
$this->getDateReminderRenderer()->getDateReminderFactory()->addNewReminder($request);
$feedback = 'tracker_date_reminder_added';
$do_redirect = true;
} elseif ($request->get('submit') && $action == 'update_reminder') {
$this->getDateReminderRenderer()->getDateReminderFactory()->editTrackerReminder($request);
$feedback = 'tracker_date_reminder_updated';
$do_redirect = true;
} elseif ($request->get('confirm_delete') && $action == 'confirm_delete_reminder') {
$this->getDateReminderRenderer()->getDateReminderFactory()->deleteTrackerReminder($request->get('reminder_id'));
$feedback = 'tracker_date_reminder_deleted';
}
if ($feedback) {
$GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_tracker_date_reminder', $feedback));
}
} catch (Tracker_DateReminderException $e) {
$GLOBALS['Response']->addFeedback('error', $e->getMessage());
}
if ($do_redirect || $request->get('cancel_delete_reminder')) {
$GLOBALS['Response']->redirect(TRACKER_BASE_URL . '/?func=admin-notifications&tracker=' . $this->getTracker()->getId());
}
}
示例2: getPostData
function getPostData()
{
$var = new HTTPRequest();
$username = $var->get('username');
$password = $var->get('password');
//$option=$var->get('option');
$this->check($username, $password);
}
示例3: updateProject
public function updateProject(HTTPRequest $request)
{
$token = new CSRFSynchronizerToken('/admin/svn/svn_tokens.php?action=update_project');
$token->check();
$project_to_add = $request->get('project-to-allow');
if ($request->get('allow-project') && !empty($project_to_add)) {
$this->allowSVNTokensForProject($project_to_add);
}
$project_ids_to_remove = $request->get('project-ids-to-revoke');
if ($request->get('revoke-project') && !empty($project_ids_to_remove)) {
$this->revokeProjectsAuthorization($project_ids_to_remove);
}
$GLOBALS['Response']->redirect('/admin/svn/svn_tokens.php?action=index');
}
示例4: getPostData
function getPostData()
{
$var = new HTTPRequest();
$user_id = $var->get('user_id');
//var_dump($user_id);
//$password=$var->get('password');
//$option=$var->get('option');
$this->vehicleDetails($user_id);
}
示例5: displayHeader
public function displayHeader(HTTPRequest $request, $title)
{
$toolbar = array();
if ($this->userIsAdmin($request->getCurrentUser())) {
$toolbar[] = array('title' => $GLOBALS['Language']->getText('global', 'Administration'), 'url' => MEDIAWIKI_BASE_URL . '/forge_admin?' . http_build_query(array('group_id' => $request->get('group_id'))));
}
$title = $title . ' - ' . $GLOBALS['Language']->getText('plugin_mediawiki', 'service_lbl_key');
$breadcrumbs = array();
parent::displayHeader($title, $breadcrumbs, $toolbar);
}
示例6: return_to
public function return_to()
{
$request_uri = $_SERVER['REQUEST_URI'];
if ($this->isUserTryingToLogIn($request_uri)) {
return urlencode($this->request->get('return_to'));
}
if ($this->isUserTryingToRegister($request_uri)) {
return false;
}
return $request_uri;
}
示例7: route
public function route(HTTPRequest $request, Layout $response)
{
$valid_route = new Valid_WhiteList('func', $this->routes);
$valid_route->required();
if ($request->valid($valid_route)) {
$route = $request->get('func');
$controller = new OpenId_LoginController($this->logger, new OpenId_AccountManager(new Openid_Dao(), UserManager::instance()), $request, $response);
$controller->{$route}();
} else {
$response->addFeedback(Feedback::ERROR, 'Invalid request for ' . __CLASS__);
$response->redirect('/');
}
}
示例8: lilina_version_check
/**
* Checks to see if a new version of Lilina is available
* @author WordPress
*/
function lilina_version_check()
{
if (strpos($_SERVER['REQUEST_URI'], 'install.php') !== false || defined('LILINA_INSTALLING') || !is_admin()) {
return;
}
$lilina_version = LILINA_CORE_VERSION;
$php_version = phpversion();
// We need this for unique identification of installations, but we take the hash of it
$id = sha1(get_option('baseurl'));
$data = new DataHandler();
$current = $data->load('core-update-check.data');
if ($current !== null) {
$current = unserialize($current);
}
$locale = get_option('locale');
if (isset($current->last_checked) && 43200 > time() - $current->last_checked && $current->version_checked == $lilina_version) {
return false;
}
$new_option = '';
$new_option->last_checked = time();
// this gets set whether we get a response or not, so if something is down or misconfigured it won't delay the page load for more than 3 seconds, twice a day
$new_option->version_checked = $lilina_version;
try {
$headers = apply_filters('update_http_headers', array('X-Install-ID' => $id));
$request = new HTTPRequest('', 2);
$response = $request->get("http://api.getlilina.org/core/version-check/1.2/?version={$lilina_version}&php={$php_version}&locale={$locale}", $headers);
} catch (Exception $e) {
$response = (object) array('success' => false);
}
if (!$response->success) {
// Save it anyway
$data->save('core-update-check.data', serialize($new_option));
return false;
}
$body = trim($response->body);
$body = str_replace(array("\r\n", "\r"), "\n", $body);
$returns = explode("\n", $body);
$new_option->response = $returns[0];
if (isset($returns[1])) {
$new_option->url = $returns[1];
}
if (isset($returns[2])) {
$new_option->download = $returns[2];
}
if (isset($returns[3])) {
$new_option->version = $returns[3];
}
$data->save('core-update-check.data', serialize($new_option));
return $new_option;
}
示例9: processEditMonitoringAction
/**
* Process the monitoring request
*
* @param HTTPRequest $request HTTP request
* @param PFUser $currentUser Current user
* @param Integer $groupId Id of the project
* @param Integer $fileModuleId Id of the package
* @param UserManager $um UserManager instance
* @param UserHelper $userHelper UserHelper instance
*
* @return String
*/
public function processEditMonitoringAction($request, $currentUser, $groupId, $fileModuleId, $um, $userHelper)
{
$frspf = new FRSPackageFactory();
$package = $frspf->getFRSPackageFromDb($fileModuleId);
if ($frspf->userCanAdmin($currentUser, $groupId)) {
if ($request->valid(new Valid_WhiteList('action', array('add_monitoring', 'delete_monitoring')))) {
$action = $request->get('action');
switch ($action) {
case 'add_monitoring':
$users = array_map('trim', preg_split('/[,;]/', $request->get('listeners_to_add')));
foreach ($users as $userName) {
if (!empty($userName)) {
$user = $um->findUser($userName);
$this->addUserMonitoring($user, $groupId, $fileModuleId, $package, $frspf, $userHelper);
}
}
break;
case 'delete_monitoring':
$users = $request->get('delete_user');
$this->stopMonitoringForUsers($users, $groupId, $fileModuleId, $package, $um, $userHelper);
break;
default:
break;
}
}
}
}
示例10: processAdmin
public function processAdmin(HTTPRequest $request)
{
$wiki = new PHPWikiServiceAdmin($request->get('group_id'));
$wiki->process();
}
示例11: validateRequest
/**
* Validate the HTTP request for the user members pane
*
* @param Integer $groupId Id of the project
* @param HTTPRequest $request HTTP request
*
* @return Array
*/
public function validateRequest($groupId, $request)
{
$userDao = new UserDao();
$res = $userDao->firstUsernamesLetters();
$allowedBeginValues = array();
foreach ($res as $data) {
$allowedBeginValues[] = $data['capital'];
}
$result['allowed_begin_values'] = $allowedBeginValues;
$validBegin = new Valid_WhiteList('begin', $allowedBeginValues);
$validBegin->required();
$validInProject = new Valid_UInt('in_project');
$validInProject->required();
$result['offset'] = $request->exist('browse') ? 0 : $request->getValidated('offset', 'uint', 0);
$result['number_per_page'] = $request->exist('number_per_page') ? $request->getValidated('number_per_page', 'uint', 0) : 15;
$result['search'] = $request->getValidated('search', 'string', '');
$result['begin'] = $request->getValidated('begin', $validBegin, '');
$result['in_project'] = $request->getValidated('in_project', $validInProject, $groupId);
$result['user'] = $request->get('user');
$result['add_user_name'] = $request->get('add_user_name');
return $result;
}
示例12: displayDateReminders
/**
* Display date reminders
*
* @param HTTPRequest $request HTTP request
*
* @return Void
*/
public function displayDateReminders(HTTPRequest $request)
{
$output = '<h2>' . $GLOBALS['Language']->getText('project_admin_utils', 'tracker_date_reminder_title') . '</h2>';
$output .= '<fieldset>';
if ($request->get('action') == 'delete_reminder') {
$output .= $this->displayConfirmDelete($request->get('reminder_id'));
}
$output .= $this->displayAllReminders();
$output .= '<div id="tracker_reminder" style="display:none;"><p><label for="New Reminder">' . $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'tracker_date_reminder_add_title') . '<input type="image" src="' . util_get_image_theme('ic/add.png') . '" id="add_reminder" value="' . (int) $this->tracker->id . '"></label></div>';
$output .= '<noscript>
<p><a href="?func=admin-notifications&tracker=' . (int) $this->tracker->id . '&action=add_reminder" id="add_reminder">' . $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'tracker_date_reminder_add_title') . '</a>
</noscript>';
if ($request->get('action') == 'add_reminder') {
$output .= $this->getNewDateReminderForm();
} elseif ($request->get('action') == 'update_reminder') {
$output .= '<div id="update_reminder"></div>';
$output .= $this->editDateReminder($request->get('reminder_id'));
}
$output .= '</fieldset>';
echo $output;
}
示例13: requestIsRestore
private function requestIsRestore(HTTPRequest $request)
{
return $request->get('restore') != null;
}
示例14: validateRequest
/**
* Validate request values
*
* @param HTTPRequest $request request containing form values
*
* @return Array
*/
function validateRequest($request)
{
$status = true;
$invalid = array();
$valid = new Valid_String('request_summary');
$valid->required();
$summary = trim($request->get('request_summary'));
if ($request->valid($valid) && strlen($summary) < self::MAX_SUMMARY_LENGTH && $summary != '') {
$params['summary'] = $summary;
} else {
$status = false;
$invalid[] = $GLOBALS['Language']->getText('plugin_requesthelp', 'summary');
}
$valid = new Valid_Text('request_description');
$valid->required();
$description = trim($request->get('request_description'));
$defaultDescription = $GLOBALS['Language']->getText('plugin_requesthelp', 'requesthelp_default_description');
if ($request->valid($valid) && strlen($description) < self::MAX_DESCRIPTION_LENGTH && $description != '' && $description != $defaultDescription) {
$params['description'] = $description;
} else {
$status = false;
$invalid[] = 'Description';
}
$valid = new Valid_UInt('type');
$valid->required();
if ($request->valid($valid)) {
$requestType = $request->get('type');
$params['type'] = $requestType;
switch ($requestType) {
case RequestHelp::TYPE_SUPPORT:
$params['text_type'] = $this->_getPluginProperty('support_request');
break;
case RequestHelp::TYPE_ENHANCEMENT:
$params['text_type'] = $this->_getPluginProperty('enhancement_request');
break;
default:
$status = false;
$invalid[] = 'Type';
break;
}
} else {
$status = false;
$invalid[] = 'Type';
}
$valid = new Valid_UInt('severity');
$valid->required();
if ($request->valid($valid)) {
$severity = $request->get('severity');
$params['severity'] = $severity;
switch ($severity) {
case RequestHelp::SEVERITY_MINOR:
$params['text_severity'] = 'Minor';
break;
case RequestHelp::SEVERITY_SERIOUS:
$params['text_severity'] = 'Serious';
break;
case RequestHelp::SEVERITY_CRITICAL:
$params['text_severity'] = 'Critical';
break;
default:
$status = false;
$invalid[] = $GLOBALS['Language']->getText('plugin_requesthelp', 'severity');
break;
}
} else {
$status = false;
$invalid[] = $GLOBALS['Language']->getText('plugin_requesthelp', 'severity');
}
$cc = array();
$mails = array_map('trim', preg_split('/[,;]/', $request->get('cc')));
$rule = new Rule_Email();
$um = $this->_getUserManager();
$invalidCc = array();
foreach ($mails as $mail) {
if ($rule->isValid($mail)) {
$cc[] = $mail;
} else {
if (trim($mail) != '') {
$user = $um->findUser($mail);
if ($user) {
$mail = $user->getUserName();
if ($mail) {
$cc[] = $mail;
} else {
$invalidCc[] = $mail;
}
} else {
$invalidCc[] = $mail;
}
}
}
}
if (!empty($invalidCc)) {
//.........这里部分代码省略.........
示例15: userAskedForHTTP
private function userAskedForHTTP(HTTPRequest $request)
{
return !$request->get('stay_in_ssl');
}