本文整理汇总了PHP中getRequest函数的典型用法代码示例。如果您正苦于以下问题:PHP getRequest函数的具体用法?PHP getRequest怎么用?PHP getRequest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getRequest函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Start
/**
* Старт сессии
*
*/
protected function Start()
{
session_name(Config::Get('sys.session.name'));
session_set_cookie_params(Config::Get('sys.session.timeout'), Config::Get('sys.session.path'), Config::Get('sys.session.host'));
if (!session_id()) {
/**
* Попытка подменить идентификатор имени сессии через куку
*/
if (isset($_COOKIE[Config::Get('sys.session.name')]) and !is_string($_COOKIE[Config::Get('sys.session.name')])) {
die("Hacking attemp! Please check cookie PHP session name.");
}
/**
* Попытка подменить идентификатор имени сессии в реквесте
*/
$aRequest = array_merge($_GET, $_POST);
// Исключаем попадаение $_COOKIE в реквест
if (@ini_get('session.use_only_cookies') === "0" and isset($aRequest[Config::Get('sys.session.name')]) and !is_string($aRequest[Config::Get('sys.session.name')])) {
die("Hacking attemp! Please check cookie PHP session name.");
}
/**
* Даем возможность флешу задавать id сессии
*/
$sUserAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
if ($sUserAgent and (in_array($sUserAgent, $this->aFlashUserAgent) or strpos($sUserAgent, "Adobe Flash Player") === 0) and is_string(getRequest('SSID')) and preg_match("/^[\\w\\d]{5,40}\$/", getRequest('SSID'))) {
session_id(getRequest('SSID'));
} else {
session_regenerate_id();
}
session_start();
}
}
示例2: _network_settings
public function _network_settings($network) {
$this->setHeaderLabel(getLabel("header-social_networks-settings") . $network->getName());
$mode = getRequest("param0");
$cmsController = cmsController::getInstance();
$type = $network->getCodeName();
$module = $cmsController->getCurrentModule();
$method = $cmsController->getCurrentMethod();
$config = mainConfiguration::getInstance();
$templateId = $config->get("templates", "{$module}.{$method}");
$inputData = array(
'object' => $network->getObject(),
'type' => $type
);
if($mode == "do") {
$config->set("templates", "{$module}.{$method}", getRequest('template-id'));
$object = $this->saveEditedObjectData($inputData);
$this->chooseRedirect($this->pre_lang . '/admin/social_networks/' . $type . '/');
}
$this->setDataType("form");
$this->setActionType("modify");
$data = $this->prepareData($inputData, "object");
$data['template-id'] = array('@id' => $templateId);
$this->setData($data);
return $this->doData();
}
示例3: onModifyObject
public function onModifyObject(iUmiEventPoint $event) {
static $modifiedCache = array();
$object = $event->getRef("object");
$typeId = umiObjectTypesCollection::getInstance()->getBaseType('emarket', 'order');
if($object->getTypeId() != $typeId) return;
if($event->getMode() == "before") {
$data = getRequest("data");
$id = $object->getId();
$newOrderStatus = getArrayKey($data[$id], 'status_id');
$newPaymentStatus = getArrayKey($data[$id], 'payment_status_id');
$newDeliveryStatus = getArrayKey($data[$id], 'delivery_status_id');
switch(true) {
case ($newOrderStatus != $object->getValue("status_id") ) : $modifiedCache[$object->getId()] = "status_id"; break;
case ($newDeliveryStatus != $object->getValue("delivery_status_id")) : $modifiedCache[$object->getId()] = "delivery_status_id"; break;
case ($newPaymentStatus != $object->getValue("payment_status_id") ) : $modifiedCache[$object->getId()] = "payment_status_id"; break;
}
} else {
if(isset($modifiedCache[$object->getId()])) {
if ($modifiedCache[$object->getId()] == 'payment_status_id' && $object->getValue("payment_status_id") == order::getStatusByCode('accepted', 'order_payment_status')) {
self::addBonus($object->getId());
}
if ($modifiedCache[$object->getId()] == 'status_id' && ($object->getValue("status_id") == order::getStatusByCode('canceled') || $object->getValue("status_id") == order::getStatusByCode('rejected'))) {
self::returnBonus($object->getId());
}
$this->notifyOrderStatusChange(order::get($object->getId()), $modifiedCache[$object->getId()]);
}
}
}
示例4: reportList
public function reportList()
{
if ($this->isLogin()) {
if (!$this->isPost()) {
import('ORG.Util.Page');
//导入分页类
$count = $this->model->where()->count();
$Page = new Page($count, 5);
$show = $Page->show();
$list = $this->model->where()->order('createtime desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
$this->assign('list', $list);
$this->assign('page', $show);
$this->display();
} else {
import('ORG.Util.Page');
//导入分页类
$account = getRequest('account');
$count = $this->model->where(array('account' => $account))->count();
$Page = new Page($count, 5);
$show = $Page->show();
if (!$account) {
$this->error('请填写查询条件');
}
$list = $this->model->where(array('account' => $account))->order('createtime desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
$this->assign('page', $show);
$this->assign('list', $list);
$this->display();
}
} else {
$this->error('请先登录', U('/Manager/login'));
}
}
示例5: service
/**
* @desc Отображение сервисной информации
* @return string
*/
public function service()
{
$event = strtoupper(getRequest('param0'));
$autoupdates_disabled = (bool) regedit::getInstance()->getVal("//modules/autoupdate/autoupdates_disabled");
if ($autoupdates_disabled) {
$this->flush('DISABLED', "text/plain");
}
$this->checkIsValidSender();
switch ($event) {
case "STATUS":
$result = $this->returnStatus();
break;
case "VERSION":
$result = $this->returnVersions();
break;
case "LAST_UPDATED":
$result = $this->returnLastUpdated();
break;
case "MODULES":
$result = $this->getModules();
break;
case "DOMAINS":
$result = $this->getDomains();
break;
default:
$result = "UNHANDLED_EVENT";
break;
}
$this->flush($result, "text/plain");
}
示例6: poll
public function poll() {
$buffer = outputBuffer::current();
$buffer->clear();
$buffer->contentType('text/plain');
$buffer->push('Sorry, but this payment system doesn\'t support server polling.' . getRequest('param0'));
$buffer->end();
}
示例7: edit
public function edit()
{
if ($this->isLogin()) {
$id = getRequest('id');
$cont = $this->model->getById($id);
if (empty($cont)) {
$this->error('没有该菜单!');
}
$cont['text'] = stripslashes($cont['text']);
if (!$this->isPost()) {
$pid = $cont['parentid'] ? $cont['parentid'] : $id;
$parent_menus = $this->model->getParentMenus($pid);
$menus = $this->model->getChildrenMenus($pid, $id);
$this->assign('addhref', U('/Richtext/add/pid/' . $pid));
$this->assign('cont', $cont);
$this->assign('parent_menus', $parent_menus);
$this->assign('menus', $menus);
$this->display();
die;
}
$data = array('title' => getRequest('title'), 'text' => getRequest('text'));
if ($this->model->checkData($data, false)) {
$ret = $this->model->where(array('id' => $id))->data($data)->save();
if ($ret) {
$this->success('修改成功!', $_SERVER['HTTP_REFERER']);
} else {
$this->error('内容没有更改或保存数据库失败!');
}
} else {
$this->error($this->model->getError());
}
} else {
$this->error('请先登录', U('/Manager/login'));
}
}
示例8: partialReindex
public function partialReindex() {
$this->setDataType("settings");
$this->setActionType("view");
$lastId = (int) getRequest("lastId");
$search = searchModel::getInstance();
$total = (int) $search->getAllIndexablePages();
$limit = regedit::getInstance()->getVal("//modules/search/one_iteration_index");
if ($limit==0) {
$limit = 5;
}
$result = $search->index_all($limit, $lastId);
$data = Array(
'index-status' => Array(
'attribute:current' => $result['current'],
'attribute:total' => $total,
'attribute:lastId' => $result['lastId']
)
);
$this->setData($data);
return $this->doData();
}
示例9: rss_list
public function rss_list() {
$typesCollection = umiObjectTypesCollection::getInstance();
$objectsCollection = umiObjectsCollection::getInstance();
$type_id = $typesCollection->getTypeIdByGUID('12c6fc06c99a462375eeb3f43dfd832b08ca9e17');
$result = $objectsCollection->getGuidedItems($type_id);
$mode = (string) getRequest('param0');
if($mode == "do") {
$params = Array(
"type_id" => $type_id
);
$this->saveEditedList("objects", $params);
try {
$this->import_feeds();
}catch(publicException $e) {}
$this->chooseRedirect();
}
// $type_id = 21;
$result = array_keys($result);
$total = sizeof($result);
$this->setDataType("list");
$this->setActionType("modify");
$this->setDataRange($total, 0);
$data = $this->prepareData($result, "objects");
$this->setData($data, $total);
return $this->doData();
}
示例10: EventIndex
protected function EventIndex()
{
/**
* Обработка удаления плагинов
*/
if (isPost('submit_plugins_del')) {
$this->Security_ValidateSendForm();
$aPluginsDelete = getRequest('plugins_del');
if (is_array($aPluginsDelete)) {
$this->Plugin_Delete(array_keys($aPluginsDelete));
}
}
if ($sPlugin = getRequest('plugin', null, 'get') and $sAction = getRequest('action', null, 'get')) {
return $this->SubmitManagePlugin($sPlugin, $sAction);
}
/**
* Передан ли номер страницы
*/
$iPage = preg_match("/^\\d+\$/i", $this->GetEventMatch(2)) ? $this->GetEventMatch(2) : 1;
/**
* Получаем список блогов
*/
$aPlugins = $this->Plugin_GetList();
/**
* Загружаем переменные в шаблон
*/
$this->Viewer_Assign("aPlugins", $aPlugins);
$this->Viewer_AddHtmlTitle($this->Lang_Get('plugins_administartion_title'));
/**
* Устанавливаем шаблон вывода
*/
$this->SetTemplateAction('index');
}
示例11: getChildren
public function getChildren()
{
$upid = getRequest('upid');
$level = getRequest('level');
$html = $this->model->getChildren($upid, $level);
echo $html;
}
示例12: json_get_referer_pages
public function json_get_referer_pages() {
$this->updateFilter();
$requestId = (int) $_REQUEST['requestId'];
if($host = getRequest('host')) {
$_SERVER['HTTP_HOST'] = $host;
}
$domain_url = "http://" . $_SERVER['HTTP_HOST'];
$referer_uri = str_replace($domain_url, "", $_SERVER['HTTP_REFERER']);
$factory = new statisticFactory(dirname(__FILE__) . '/classes');
$factory->isValid('pageNext');
$report = $factory->get('pageNext');
$report->setStart(time() - 3600*24*7); //TODO: Fix to real dates
$report->setFinish(time() + 3600*24); //TODO: Fix to real dates
if(!$referer_uri) $referer_uri = "/";
$report->setParams( Array("page_uri" => $referer_uri) );
$result = $report->get();
$res = <<<END
var response = new lLibResponse({$requestId});
response.links = new Array();
END;
$total = 0;
foreach($result as $r_item) {
$total += (int) $r_item['abs'];
$res .= <<<END
response.links[response.links.length] = {"uri": "{$r_item['uri']}", "abs": "{$r_item['abs']}"};
END;
}
$res .= <<<END
response.total = '{$total}';
END;
$res .= <<<END
lLib.getInstance().makeResponse(response);
END;
$this->flush($res);
}
示例13: readDataBlock
protected function readDataBlock()
{
$v9a09b4dfda82e3e665e31092d1c3ec8d = parent::readDataBlock();
if ($v9a09b4dfda82e3e665e31092d1c3ec8d->getElementsByTagName('domains')->length) {
$ve4e46deb7f9cc58c7abfb32e5570b6f3 = $v9a09b4dfda82e3e665e31092d1c3ec8d->getElementsByTagName('domains')->item(0);
if ($ve4e46deb7f9cc58c7abfb32e5570b6f3->getElementsByTagName('domain')->length) {
$vad5f82e879a9c5d6b5b442eb37e50551 = $ve4e46deb7f9cc58c7abfb32e5570b6f3->getElementsByTagName('domain')->item(0);
$vfc4dd24e8dcaab0826b9ab09db0da5bf = false;
$v72ee76c5c29383b7c9f9225c1fa4d10b = false;
$v495a73fe6d3367859f634a689771d209 = getRequest('param0');
if ($v495a73fe6d3367859f634a689771d209) {
$v6a7f245843454cf4f28ad7c5e2572aa2 = umiObjectsCollection::getInstance()->getObject($v495a73fe6d3367859f634a689771d209)->elements;
if (is_array($v6a7f245843454cf4f28ad7c5e2572aa2) && count($v6a7f245843454cf4f28ad7c5e2572aa2)) {
$v72ee76c5c29383b7c9f9225c1fa4d10b = $v6a7f245843454cf4f28ad7c5e2572aa2[0]->getDomainId();
}
}
if ($v72ee76c5c29383b7c9f9225c1fa4d10b) {
$vfc4dd24e8dcaab0826b9ab09db0da5bf = domainsCollection::getInstance()->getDomain($v72ee76c5c29383b7c9f9225c1fa4d10b);
} else {
$vfc4dd24e8dcaab0826b9ab09db0da5bf = domainsCollection::getInstance()->getDefaultDomain();
}
if ($vfc4dd24e8dcaab0826b9ab09db0da5bf instanceof domain) {
$v9b98b21540033f68b145fb236bd91a73 = $vfc4dd24e8dcaab0826b9ab09db0da5bf->getHost();
$vad5f82e879a9c5d6b5b442eb37e50551->setAttribute('host', $v9b98b21540033f68b145fb236bd91a73);
}
}
}
return $v9a09b4dfda82e3e665e31092d1c3ec8d;
}
示例14: AddValuesToObject
public function AddValuesToObject($data)
{
$data['oTopic']->setFixedStatus(0);
if ($this->checkUserRights($data['oBlog'])) {
$data['oTopic']->setFixedStatus(getRequest('topic_fixed') ? 1 : 0);
}
}
示例15: onAddTopicToDispatch
public function onAddTopicToDispatch(iUmiEventPoint $oEvent)
{
$iDispatchId = regedit::getInstance()->getVal("//modules/forum/dispatch_id");
if (!$iDispatchId) {
return false;
}
$dispatches_module = cmsController::getInstance()->getModule('dispatches');
if (!$dispatches_module) {
return false;
}
$iTopicId = (int) $oEvent->getParam('topic_id');
$oTopicElement = umiHierarchy::getInstance()->getElement($iTopicId);
if ($oTopicElement instanceof umiHierarchyElement) {
$sTitle = (string) getRequest('title');
$sMessage = (string) getRequest('body');
$iHierarchyTypeId = umiHierarchyTypesCollection::getInstance()->getTypeByName("dispatches", "message")->getId();
$iMsgTypeId = umiObjectTypesCollection::getInstance()->getTypeByHierarchyTypeId($iHierarchyTypeId);
$oMsgType = umiObjectTypesCollection::getInstance()->getType($iMsgTypeId);
$iMsgObjId = umiObjectsCollection::getInstance()->addObject($sTitle, $iMsgTypeId);
$oMsgObj = umiObjectsCollection::getInstance()->getObject($iMsgObjId);
if ($oMsgObj instanceof umiObject) {
$iReleaseId = $dispatches_module->getNewReleaseInstanceId($iDispatchId);
$oMsgObj->setValue('release_reference', $iReleaseId);
$oMsgObj->setValue('header', $sTitle);
$oMsgObj->setValue('body', $sMessage);
$oMsgObj->commit();
return true;
} else {
return false;
}
} else {
return false;
}
}