本文整理汇总了PHP中util_getRequestParameter函数的典型用法代码示例。如果您正苦于以下问题:PHP util_getRequestParameter函数的具体用法?PHP util_getRequestParameter怎么用?PHP util_getRequestParameter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了util_getRequestParameter函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: util_assertNotMirror
<?php
require_once "../../phplib/util.php";
util_assertNotMirror();
util_assertNotLoggedIn();
$token = util_getRequestParameter('token');
$identity = util_getRequestParameter('identity');
$pt = PasswordToken::get_by_token($token);
$data = FileCache::get($identity);
if (!$pt) {
FlashMessage::add('Ați introdus un cod de recuperare incorect.');
} else {
if ($pt->createDate < time() - 24 * 3600) {
FlashMessage::add('Codul de recuperare introdus a expirat.');
} else {
if (!$data) {
FlashMessage::add('Ați introdus o identitate incorectă.');
} else {
$user = User::get_by_id($pt->userId);
if (!$user) {
FlashMessage::add('Ați introdus un cod de recuperare incorect.');
} else {
if ($user->identity) {
FlashMessage::add('Acest cont a fost deja revendicat de o identitate OpenID.');
} else {
FlashMessage::add('Contul dumneavoastră a fost recuperat și unificat cu identitatea OpenID.', 'info');
session_login($user, $data);
}
}
}
}
示例2: util_getRequestParameter
<?php
require_once "../phplib/util.php";
$submitButton = util_getRequestParameter('submitButton');
if ($submitButton) {
util_assertModerator(PRIV_ADMIN);
$order = 1;
$ids = util_getRequestParameter("ids");
foreach ($ids as $id) {
$src = Source::get_by_id($id);
$src->displayOrder = $order++;
$src->save();
}
FlashMessage::add('Ordinea a fost salvată.', 'info');
util_redirect('surse');
}
$sources = util_isModerator(PRIV_VIEW_HIDDEN) ? Model::factory('Source')->order_by_asc('displayOrder')->find_many() : Model::factory('Source')->where_not_equal('isOfficial', SOURCE_TYPE_HIDDEN)->order_by_asc('displayOrder')->find_many();
smarty_assign('sources', $sources);
smarty_assign('page_title', 'Surse');
smarty_displayCommonPageWithSkin('surse.ihtml');
示例3: util_assertModerator
<?php
require_once "../../phplib/util.php";
util_assertModerator(PRIV_ADMIN);
util_assertNotMirror();
$MAX_AFFECTED = 1000;
$search = util_getRequestParameter('search');
$replace = util_getRequestParameter('replace');
$sourceId = util_getRequestParameter('source');
$realRun = util_getRequestParameter('realRun');
$sourceClause = $sourceId ? "and sourceId = {$sourceId}" : '';
$count = Model::factory('Definition')->where_raw("status = 0 {$sourceClause} and binary internalRep like '%{$search}%'")->count();
if ($count > $MAX_AFFECTED) {
if ($realRun) {
FlashMessage::add("{$count} definiții se potrivesc, numai {$MAX_AFFECTED} au fost modificate.", 'info');
} else {
FlashMessage::add("{$count} definiții se potrivesc, maxim {$MAX_AFFECTED} vor fi modificate.");
}
}
$defs = Model::factory('Definition')->where_raw("status = 0 {$sourceClause} and binary internalRep like '%{$search}%'")->order_by_asc('id')->limit($MAX_AFFECTED)->find_many();
$searchResults = SearchResult::mapDefinitionArray($defs);
foreach ($defs as $def) {
$def->internalRep = str_replace($search, $replace, $def->internalRep);
$ambiguousMatches = array();
$def->internalRep = AdminStringUtil::internalizeDefinition($def->internalRep, $def->sourceId, $ambiguousMatches);
$def->htmlRep = AdminStringUtil::htmlize($def->internalRep, $def->sourceId);
// Complete or un-complete the abbreviation review
if (!count($ambiguousMatches) && $def->abbrevReview == ABBREV_AMBIGUOUS) {
$def->abbrevReview = ABBREV_REVIEW_COMPLETE;
} else {
if (count($ambiguousMatches) && $def->abbrevReview == ABBREV_REVIEW_COMPLETE) {
示例4: util_getRequestParameter
<?php
require_once "../phplib/util.php";
// Parse or initialize the GET/POST arguments
$nick = util_getRequestParameter('n');
$medalSaveButton = util_getRequestParameter('medalSaveButton');
$userId = util_getRequestParameter('userId');
$medalsGranted = util_getRequestParameter('medalsGranted');
if ($medalSaveButton) {
util_assertModerator(PRIV_ADMIN);
$user = User::get_by_id($userId);
$user->medalMask = Medal::getCanonicalMask(array_sum($medalsGranted));
$user->save();
util_redirect(util_getWwwRoot() . "utilizator/{$user->nick}");
}
$user = User::get_by_nick($nick);
if (!$user) {
FlashMessage::add('Utilizatorul ' . htmlspecialchars($nick) . ' nu există.');
util_redirect(util_getWwwRoot());
}
$userData = array();
$user->email = StringUtil::scrambleEmail($user->email);
// Find the rank of this user by number of words and number of characters
$topWords = TopEntry::getTopData(CRIT_WORDS, SORT_DESC, true);
$numUsers = count($topWords);
$rankWords = 0;
while ($rankWords < $numUsers && $topWords[$rankWords]->userNick != $nick) {
$rankWords++;
}
$userData['rank_words'] = $rankWords + 1;
if ($rankWords < $numUsers) {
示例5: util_getRequestParameter
<?php
require_once "../../phplib/util.php";
$query = util_getRequestParameter('query');
$field = StringUtil::hasDiacritics($query) ? 'formNoAccent' : 'formUtf8General';
$dbResults = Model::factory('InflectedForm')->table_alias('iff')->select('iff.id')->select('iff.form')->select('l.form', 'baseForm')->select('lm.modelType')->select('lm.modelNumber')->select('lm.restriction')->select('i.description')->join('LexemModel', ['iff.lexemModelId', '=', 'lm.id'], 'lm')->join('Lexem', ['lm.lexemId', '=', 'l.id'], 'l')->join('Inflection', ['iff.inflectionId', '=', 'i.id'], 'i')->where_like("iff.{$field}", "{$query}%")->order_by_asc('iff.formNoAccent')->limit(20)->find_many();
$resp = array('results' => array());
foreach ($dbResults as $rec) {
$resp['results'][] = ['id' => $rec->id, 'form' => $rec->form, 'baseForm' => $rec->baseForm, 'model' => "{$rec->modelType}{$rec->modelNumber}{$rec->restriction}", 'inflection' => $rec->description];
}
print json_encode($resp);
示例6: util_assertModerator
<?php
require_once "../../phplib/util.php";
util_assertModerator(PRIV_EDIT);
util_assertNotMirror();
$typoId = util_getRequestParameter('id');
$typo = Typo::get_by_id($typoId);
if ($typo) {
$typo->delete();
}
示例7: setlocale
<?php
require_once "../phplib/util.php";
setlocale(LC_ALL, "ro_RO.utf8");
DebugInfo::disable();
$locVersion = util_getRequestParameter('locVersion');
$modelType = util_getRequestParameter('modelType');
$modelNumber = util_getRequestParameter('modelNumber');
$locVersions = pref_getLocVersions();
if ($locVersion && $modelType && $modelNumber) {
smarty_assign('selectedLocVersion', $locVersion);
smarty_assign('selectedModelType', $modelType);
smarty_assign('selectedModelNumber', $modelNumber);
LocVersion::changeDatabase($locVersion);
if ($modelNumber == -1) {
$modelsToDisplay = FlexModel::loadByType($modelType);
} else {
$modelsToDisplay = array(Model::factory('FlexModel')->where('modelType', $modelType)->where('number', $modelNumber)->find_one());
}
$lexems = array();
$paradigms = array();
foreach ($modelsToDisplay as $m) {
// Load by canonical model, so if $modelType is V, look for a lexem with type V or VT.
$l = Model::factory('Lexem')->select('Lexem.*')->join('ModelType', 'modelType = code')->where('canonical', $modelType)->where('modelNumber', $m->number)->where('form', $m->exponent)->limit(1)->find_one();
if ($l) {
$paradigm = getExistingForms($l->id, $locVersion);
} else {
$l = Lexem::create($m->exponent, $modelType, $m->number, '');
$l->isLoc = true;
$paradigm = getNewForms($l, $locVersion);
}
示例8: util_getRequestParameter
<?php
require_once "../phplib/util.php";
require_once "../phplib/ads/adsModule.php";
$cuv = util_getRequestParameter('cuv');
$lexemId = util_getRequestParameter('lexemId');
$defId = util_getRequestParameter('defId');
$sourceUrlName = util_getRequestParameter('source');
$text = util_getRequestIntParameter('text');
$showParadigm = util_getRequestParameter('showParadigm');
$xml = util_getRequestParameter('xml');
$redirect = session_getWithDefault('redirect', false);
$redirectFrom = session_getWithDefault('init_word', '');
session_unsetVariable('redirect');
session_unsetVariable('init_word');
if ($cuv) {
$cuv = StringUtil::cleanupQuery($cuv);
}
util_redirectToFriendlyUrl($cuv, $sourceUrlName, $text, $showParadigm, $xml);
$searchType = SEARCH_INFLECTED;
$hasDiacritics = session_user_prefers('FORCE_DIACRITICS');
$exclude_unofficial = session_user_prefers('EXCLUDE_UNOFFICIAL');
$hasRegexp = FALSE;
$isAllDigits = FALSE;
$showParadigm = $showParadigm || session_user_prefers('SHOW_PARADIGM');
$paradigmLink = $_SERVER['REQUEST_URI'] . ($showParadigm ? '' : '/paradigma');
$source = $sourceUrlName ? Source::get_by_urlName($sourceUrlName) : null;
$sourceId = $source ? $source->id : null;
if ($cuv) {
smarty_assign('cuv', $cuv);
$arr = StringUtil::analyzeQuery($cuv);
示例9: util_getRequestParameter
<?php
require_once "../../phplib/util.php";
$lexemId = util_getRequestParameter('lexemId');
$defs = Definition::loadByLexemId($lexemId);
$results = array();
foreach ($defs as $def) {
$htmlRep = str_replace("\n", ' ', $def->htmlRep);
$source = Source::get_by_id($def->sourceId);
$results[] = array('id' => $def->id, 'shortName' => $source->shortName, 'status' => $def->getStatusName(), 'htmlRep' => $htmlRep);
}
SmartyWrap::assign('results', $results);
SmartyWrap::displayWithoutSkin('ajax/getDefinitionsForLexem.tpl');
示例10: ini_set
<?php
require_once "../phplib/util.php";
ini_set('max_execution_time', '3600');
define('DB_QUERY', 'select * from Lexem where isLoc order by formNoAccent');
$locVersion = util_getRequestParameter('locVersion');
$newLocVersion = util_getRequestParameter('newLocVersion');
if ($newLocVersion) {
if ($locVersion == $newLocVersion) {
FlashMessage::add('Ați selectat aceeași versiune LOC de două ori');
util_redirect('scrabble-loc');
}
$file1 = tempnam('/tmp', 'loc_diff_');
$file2 = tempnam('/tmp', 'loc_diff_');
writeLexems($locVersion, $file1);
writeLexems($newLocVersion, $file2);
$diff = OS::executeAndReturnOutput("diff {$file1} {$file2} || true");
print "<pre>\n";
foreach ($diff as $line) {
if (StringUtil::startsWith($line, '< ')) {
print sprintf("<span style=\"color: red\">%s: %s</span>\n", $locVersion, substr($line, 2));
} else {
if (StringUtil::startsWith($line, '> ')) {
print sprintf("<span style=\"color: green\">%s: %s</span>\n", $newLocVersion, substr($line, 2));
}
}
}
print "</pre>\n";
util_deleteFile($file1);
util_deleteFile($file2);
exit;
示例11: array
$ifs = $lexem->generateParadigm();
$mdMap = ModelDescription::getByModelIdMapByInflectionIdVariantApplOrder($model->id);
$forms = array();
foreach ($inflections as $infl) {
$forms[$infl->id] = array();
}
foreach ($ifs as $if) {
$forms[$if->inflectionId][] = array('form' => $if->form, 'isLoc' => $mdMap[$if->inflectionId][$if->variant][0]->isLoc, 'recommended' => $mdMap[$if->inflectionId][$if->variant][0]->recommended);
}
$participleNumber = $modelType == 'V' ? ParticipleModel::loadByVerbModel($modelNumber)->adjectiveModel : '';
if ($previewButton || $confirmButton) {
// Load the new forms and exponent;
$newModelNumber = util_getRequestParameter('newModelNumber');
$newExponent = util_getRequestParameter('newExponent');
$newDescription = util_getRequestParameter('newDescription');
$newParticipleNumber = util_getRequestParameter('newParticipleNumber');
$newForms = array();
foreach ($inflections as $infl) {
$newForms[$infl->id] = array();
}
readRequest($newForms);
} else {
$newModelNumber = $modelNumber;
$newExponent = $exponent;
$newDescription = $model->description;
$newParticipleNumber = $participleNumber;
$newForms = $forms;
}
$exponentAccentAdded = $exponent != $newExponent && str_replace("'", '', $newExponent) == $exponent;
$exponentChanged = $exponent != $newExponent && !$exponentAccentAdded;
$errorMessage = array();
示例12: util_assertNotMirror
<?php
require_once "../../phplib/util.php";
util_assertNotMirror();
util_assertNotLoggedIn();
$loginType = util_getRequestParameter('loginType');
$nickOrEmail = util_getRequestParameter('nickOrEmail');
$password = util_getRequestParameter('password');
$nick = util_getRequestParameter('nick');
$randString = util_getRequestParameter('randString');
$data = FileCache::get($randString);
if (!$data) {
FlashMessage::add('A apărut o eroare la autentificare. Vă rugăm încercați din nou.');
} else {
if ($loginType == 0) {
$user = Model::factory('User')->where('password', md5($password))->where_raw("(email = '{$nickOrEmail}' or nick = '{$nickOrEmail}')")->find_one();
if (!$user) {
FlashMessage::add('Numele de utilizator sau parola sunt incorecte.');
} else {
if ($user->identity) {
FlashMessage::add('Acest utilizator a fost deja revendicat de un alt OpenID.');
} else {
session_login($user, $data);
}
}
} else {
$openidNick = $loginType == 1 ? $data['fullname'] : ($loginType == 2 ? $data['nickname'] : $nick);
$user = User::get_by_nick($openidNick);
if ($user) {
FlashMessage::add('Acest nume de utilizator este deja luat.');
} else {
示例13: set_time_limit
<?php
require_once "../../phplib/util.php";
set_time_limit(0);
// If no GET arguments are set, print usage and return.
if (count($_GET) == 0) {
SmartyWrap::addCss('polar');
SmartyWrap::displayWithoutSkin('update3Instructions.tpl');
return;
}
util_enforceGzipEncoding();
header('Content-type: text/xml');
$export = util_getRequestParameter('export');
$timestamp = util_getRequestIntParameter('timestamp');
$version = util_getRequestParameterWithDefault('version', '3.0');
if ($export && util_isDesktopBrowser() && !session_getUser()) {
SmartyWrap::display('bits/updateError.tpl');
exit;
}
if ($export == 'sources') {
SmartyWrap::assign('sources', Model::factory('Source')->find_many());
SmartyWrap::displayWithoutSkin('xml/update3Sources.tpl');
} else {
if ($export == 'inflections') {
SmartyWrap::assign('inflections', Model::factory('Inflection')->order_by_asc('id')->find_many());
SmartyWrap::displayWithoutSkin('xml/update3Inflections.tpl');
} else {
if ($export == 'abbrev') {
SmartyWrap::assign('abbrev', AdminStringUtil::loadRawAbbreviations());
SmartyWrap::displayWithoutSkin('xml/update3Abbrev.tpl');
} else {
示例14: util_assertModerator
<?php
require_once "../../phplib/util.php";
util_assertModerator(PRIV_EDIT);
util_assertNotMirror();
$submitButton = util_getRequestParameter('submitButton');
if ($submitButton) {
foreach ($_REQUEST as $name => $position) {
if (StringUtil::startsWith($name, 'position_')) {
$parts = preg_split('/_/', $name);
assert(count($parts) == 2);
assert($parts[0] == 'position');
$lexem = Lexem::get_by_id($parts[1]);
$noAccent = util_getRequestParameter('noAccent_' . $lexem->id);
if ($noAccent) {
$lexem->noAccent = 1;
$lexem->save();
} else {
if ($position != -1) {
$lexem->form = mb_substr($lexem->form, 0, $position) . "'" . mb_substr($lexem->form, $position);
$lexem->save();
foreach ($lexem->getLexemModels() as $lm) {
$lm->regenerateParadigm();
}
}
}
}
}
util_redirect("placeAccents.php");
}
$chars = array();
示例15: util_assertNotMirror
<?php
require_once "../../phplib/util.php";
util_assertNotMirror();
util_assertNotLoggedIn();
$error = util_getRequestParameter('error');
$errorDescription = util_getRequestParameter('error_description');
$code = util_getRequestParameter('code');
$state = util_getRequestParameter('state');
$provider = session_get('openid_connect_provider');
try {
$oidc = new OpenIDConnect($provider);
if ($error) {
throw new OpenIDException($errorDescription);
}
if (!$code || !$state || $state != session_get('openid_connect_state')) {
throw new OpenIDException('Răspuns incorect de la server');
}
if (!$provider) {
throw new OpenIDException('Sesiune coruptă');
}
$token = $oidc->requestToken($code);
$data = $oidc->getUserInfo($token);
if (!isset($data['sub'])) {
throw new OpenIDException('Date incorecte de la furnizor');
}
} catch (OpenIDException $e) {
FlashMessage::add('Eroare la autentificare: ' . $e->getMessage());
util_redirect('login.php');
}
// With OpenID connect, the user is uniquely identified by (provider, sub).