本文整理汇总了PHP中_request函数的典型用法代码示例。如果您正苦于以下问题:PHP _request函数的具体用法?PHP _request怎么用?PHP _request使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_request函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: trace_query_chrono
function trace_query_chrono($m1, $m2, $query, $result, $serveur='')
{
static $tt = 0, $nb=0;
global $tableau_des_temps;
$x = _request('var_mode_objet');
if (isset($GLOBALS['debug']['aucasou'])) {
list(, $boucle, $serveur, $contexte) = $GLOBALS['debug']['aucasou'];
if ($x AND !preg_match("/$boucle\$/", $x))
return;
if ($serveur) $boucle .= " ($serveur)";
$boucle = "<b>$boucle</b>";
} else {
if ($x) return;
$boucle = $contexte = '';
}
list($usec, $sec) = explode(" ", $m1);
list($usec2, $sec2) = explode(" ", $m2);
$dt = $sec2 + $usec2 - $sec - $usec;
$tt += $dt;
$nb++;
$q = preg_replace('/([a-z)`])\s+([A-Z])/', "$1\n<br />$2",htmlentities($query));
$e = sql_explain($query, $serveur);
$r = str_replace('Resource id ','',(is_object($result)?get_class($result):$result));
$tableau_des_temps[] = array($dt, $nb, $boucle, $q, $e, $r, $contexte);
}
示例2: formulaires_configurer_bank_paiement_verifier_dist
function formulaires_configurer_bank_paiement_verifier_dist()
{
$erreurs = array();
if ($e = _request('email_ticket_admin') and !email_valide($e)) {
$erreurs['email_ticket_admin'] = _T('form_prop_indiquer_email');
}
if (!count($erreurs)) {
if ($dels = _request('action_del') and count($dels)) {
set_request('action_del');
foreach ($dels as $del => $v) {
set_request($del, null);
}
}
if ($ups = _request('action_up') and count($ups)) {
set_request('action_up');
foreach ($ups as $up => $v) {
bank_deplacer_config($up, "up");
}
}
if ($downs = _request('action_down') and count($downs)) {
set_request('action_down');
foreach ($downs as $down => $v) {
bank_deplacer_config($down, "down");
}
}
if (_request('action_append') and $presta = _request('action_append_presta') and in_array($presta, bank_lister_prestas())) {
set_request('action_append');
set_request('action_append_presta');
bank_ajouter_config($presta);
}
}
return $erreurs;
}
示例3: action_skeleditor_new_from_dist
/**
* Plugin SkelEditor
* Editeur de squelette en ligne
* (c) 2007-2010 erational
* Licence GPL-v3
*
*/
function action_skeleditor_new_from_dist(){
$securiser_action = charger_fonction('securiser_action','inc');
$arg = $securiser_action();
// $arg est le fichier que l'on veut personaliser
if (strncmp($arg,_DIR_RACINE,strlen(_DIR_RACINE)!==0))
$arg = _DIR_RACINE.$arg;
include_spip('inc/skeleditor');
$file = skeleditor_nom_copie($arg);
if ($file){
include_spip('inc/skeleditor');
$path_base = skeleditor_path_editable();
list($chemin,) = skeleditor_cree_chemin($path_base, $file);
if ($chemin){
$file = basename($file);
if (!file_exists($chemin . $file)) {
lire_fichier($arg, $contenu);
ecrire_fichier($chemin . $file, skeleditor_commente_copie($arg,$contenu));
}
if (file_exists($f=$chemin.$file))
$GLOBALS['redirect'] = parametre_url(_request('redirect'),'f',$f);
}
}
}
示例4: player_affiche_config_form
function player_affiche_config_form ($exec_page){
global $spip_lang_right, $spip_lang_left;
if ($player = _request('player')) {
ecrire_meta('player', $player);
if(version_compare($GLOBALS['spip_version_code'],'1.9300','<')) {
include_spip("inc/meta");
ecrire_metas();
}
}
$player_ = $GLOBALS['meta']['player'];
$out = ""
. debut_cadre_trait_couleur(_DIR_PLUGIN_PLAYER_IMAGES."player-son-24.png", true, "", "Player Audio")
. "<form action='".generer_url_ecrire($exec_page)."' method='post' class='verdana2'><div>"
. bouton_radio("player", "neoplayer", "Neolao player", $player_ == "neoplayer")
. "<br />"
. bouton_radio("player", "dewplayer", "Dew player", $player_ == "dewplayer")
. "<br />"
. bouton_radio("player", "pixplayer", "One pixel out player", $player_ == "pixplayer")
. "<br />"
. bouton_radio("player", "eraplayer", "Erational player", $player_ == "eraplayer")
. "<div style='text-align:$spip_lang_right'><input type='submit' name='Valider' value='"._T('bouton_valider')."' class='fondo' /></div>"
. "</div></form>"
. fin_cadre_trait_couleur(true)
;
return ($out);
}
示例5: formulaires_configurer_transcodeur_traiter_dist
function formulaires_configurer_transcodeur_traiter_dist()
{
$res = array('editable' => true);
ecrire_meta('charset', _request('charset'));
$res['message_ok'] = _T('config_info_enregistree');
return $res;
}
示例6: action_instituer_langue_rubrique_dist
function action_instituer_langue_rubrique_dist() {
$securiser_action = charger_fonction('securiser_action', 'inc');
$arg = $securiser_action();
$changer_lang = _request('changer_lang');
list($id_rubrique, $id_parent) = preg_split('/\W/', $arg);
if ($changer_lang
AND $id_rubrique>0
AND $GLOBALS['meta']['multi_rubriques'] == 'oui'
AND ($GLOBALS['meta']['multi_secteurs'] == 'non' OR $id_parent == 0)) {
if ($changer_lang != "herit")
sql_updateq('spip_rubriques', array('lang'=>$changer_lang, 'langue_choisie'=>'oui'), "id_rubrique=$id_rubrique");
else {
if ($id_parent == 0)
$langue_parent = $GLOBALS['meta']['langue_site'];
else {
$langue_parent = sql_getfetsel("lang", "spip_rubriques", "id_rubrique=$id_parent");
}
sql_updateq('spip_rubriques', array('lang'=>$langue_parent, 'langue_choisie'=>'non'), "id_rubrique=$id_rubrique");
}
include_spip('inc/rubriques');
calculer_langues_rubriques();
// invalider les caches marques de cette rubrique
include_spip('inc/invalideur');
suivre_invalideur("id='id_rubrique/$id_rubrique'");
}
}
示例7: processDefault
/**
* Admins
*
* Affiche la liste des administrateurs
*
* @package Comptes
* @author Frédéric Mossmann <fmossmann@cap-tic.fr>
*/
public function processDefault()
{
if (!Kernel::isAdmin()) {
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('||'));
}
$roles = _request('role');
$new_admin = _request('new_admins');
if ($roles) {
$sql = "\n SELECT dbuser.*, kernel_link_bu2user.*\n FROM dbuser\n JOIN kernel_link_bu2user ON dbuser.id_dbuser=kernel_link_bu2user.user_id\n WHERE dbuser.id_dbuser IN (" . implode(',', array_keys($roles)) . ")\n ";
$admins_mod = _doQuery($sql);
foreach ($admins_mod as $admins_mod_item) {
$sql = "\n DELETE FROM kernel_link_user2node\n WHERE node_type='ROOT' AND node_id=0\n AND user_type=:bu_type AND user_id=:bu_id\n ";
_doQuery($sql, array(':bu_type' => $admins_mod_item->bu_type, ':bu_id' => $admins_mod_item->bu_id));
$sql = "\n DELETE FROM dbgroup_users\n WHERE id_dbgroup=:id_dbgroup AND userhandler_dbgroup=:userhandler_dbgroup AND user_dbgroup=:user_dbgroup";
$params = array(':id_dbgroup' => 1, ':userhandler_dbgroup' => 'auth|dbuserhandler', ':user_dbgroup' => $admins_mod_item->id_dbuser);
_doQuery($sql, $params);
if ($roles[$admins_mod_item->id_dbuser]) {
$sql = "\n INSERT INTO kernel_link_user2node\n ( user_type, user_id, node_type, node_id, droit)\n VALUES\n (:user_type, :user_id, :node_type, :node_id, :droit)\n ";
$params = array(':user_type' => $admins_mod_item->bu_type, ':user_id' => $admins_mod_item->bu_id, ':node_type' => 'ROOT', ':node_id' => 0, ':droit' => $roles[$admins_mod_item->id_dbuser]);
_doQuery($sql, $params);
$sql = "\n INSERT INTO dbgroup_users\n ( id_dbgroup, userhandler_dbgroup, user_dbgroup)\n VALUES\n (:id_dbgroup, :userhandler_dbgroup, :user_dbgroup)\n ";
$params = array(':id_dbgroup' => 1, ':userhandler_dbgroup' => 'auth|dbuserhandler', ':user_dbgroup' => $admins_mod_item->id_dbuser);
_doQuery($sql, $params);
}
}
}
if ($new_admin) {
$new_admin_array = split(',', $new_admin);
$new_admin_array_clean = array_map('trim', $new_admin_array);
$sql_newadmins = "OR dbuser.login_dbuser IN (";
$first = true;
foreach ($new_admin_array_clean as $new_admin_array_item) {
$sql_newadmins .= (!$first ? ", " : "") . "'" . addslashes($new_admin_array_item) . "'";
$first = false;
}
$sql_newadmins .= ")";
} else {
$sql_newadmins = '';
}
$sql = "\n SELECT dbuser.*, kernel_link_bu2user.*, kernel_link_user2node.*\n FROM dbuser\n JOIN kernel_link_bu2user ON dbuser.id_dbuser=kernel_link_bu2user.user_id\n LEFT JOIN kernel_link_user2node ON kernel_link_bu2user.bu_type=kernel_link_user2node.user_type AND kernel_link_bu2user.bu_id=kernel_link_user2node.user_id AND kernel_link_user2node.node_type='ROOT' AND kernel_link_user2node.node_id=0\n WHERE (node_type='ROOT' AND node_id=0)\n " . $sql_newadmins . "\n ORDER BY kernel_link_user2node.droit DESC,dbuser.login_dbuser\n ";
$admins = _doQuery($sql);
foreach ($admins as &$admin) {
$admin->user_infos = Kernel::getUserInfo($admin->bu_type, $admin->bu_id);
}
/*
dbuser : id_dbuser login_dbuser password_dbuser email_dbuser enabled_dbuser
kernel_link_bu2user : user_id bu_type bu_id
kernel_link_user2node : user_type user_id node_type node_id droit debut fin
*/
$tpl = new CopixTpl();
$tplListe = new CopixTpl();
$tplListe->assign("admins", $admins);
$tplListe->assign("user_id", _currentUser()->getExtra('user_id'));
$tplListe->assign("admin_fonctionnel", Kernel::isAdminFonctionnel());
$main = $tplListe->fetch("admins-list.tpl");
$tpl->assign('TITLE_PAGE', CopixI18N::get('comptes.moduleDescription') . " » " . CopixI18N::get('comptes.title.admins'));
$tpl->assign('MAIN', $main);
$tpl->assign('MENU', $this->menu);
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
示例8: action_menu_rubriques_dist
/**
* Action d'affichage en ajax du navigateur de rubrique du bandeau
*
* @uses gen_liste_rubriques()
* @uses menu_rubriques()
*
* @return string
* Code HTML présentant la liste des rubriques
**/
function action_menu_rubriques_dist()
{
// si pas acces a ecrire, pas acces au menu
// on renvoi un 401 qui fait echouer la requete ajax silencieusement
if (!autoriser('ecrire')) {
$retour = "<ul class='cols_1'><li class='toutsite'><a href='" . generer_url_ecrire('accueil') . "'>" . _T('public:lien_connecter') . "</a></li></ul>";
include_spip('inc/actions');
ajax_retour($retour);
exit;
}
if ($date = intval(_request('date'))) {
header("Last-Modified: " . gmdate("D, d M Y H:i:s", $date) . " GMT");
}
$r = gen_liste_rubriques();
if (!$r and isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) and !strstr($_SERVER['SERVER_SOFTWARE'], 'IIS/')) {
include_spip('inc/headers');
header('Content-Type: text/html; charset=' . $GLOBALS['meta']['charset']);
http_status(304);
exit;
} else {
include_spip('inc/actions');
$ret = menu_rubriques();
ajax_retour($ret);
}
}
示例9: nospam_verifier_formulaire_ecrire_auteur_dist
/**
* Verification supplementaire antispam sur le formulaire_ecrire_auteur
*
* @param array $flux
* @return array
*/
function nospam_verifier_formulaire_ecrire_auteur_dist($flux)
{
$form = $flux['args']['form'];
if (!isset($flux['data']['texte_message_auteur'])) {
include_spip("inc/nospam");
include_spip("inc/texte");
// regarder si il y a du contenu en dehors des liens !
$texte_message_auteur = _request('texte_message_auteur');
$caracteres = compter_caracteres_utiles($texte_message_auteur);
if ($caracteres < 10) {
$flux['data']['texte_message_auteur'] = _T('forum_attention_dix_caracteres');
unset($flux['data']['previsu']);
}
// on analyse le sujet
$infos_sujet = analyser_spams(_request('sujet_message_auteur'));
// si un lien dans le sujet = spam !
if ($infos_sujet['nombre_liens'] > 0) {
$flux['data']['sujet_message_auteur'] = _T('nospam:erreur_spam');
unset($flux['data']['previsu']);
}
// on analyse le texte
$infos_texte = analyser_spams($texte_message_auteur);
if ($infos_texte['nombre_liens'] > 0) {
// si un lien a un titre de moins de 3 caracteres = spam !
if ($infos_texte['caracteres_texte_lien_min'] < 3) {
$flux['data']['texte_message_auteur'] = _T('nospam:erreur_spam');
}
// si le texte contient plus de trois liens = spam !
if ($infos_texte['nombre_liens'] >= 3) {
$flux['data']['texte_message_auteur'] = _T('nospam:erreur_spam');
}
}
}
return $flux;
}
示例10: exec_articles_args
function exec_articles_args($id_article)
{
pipeline('exec_init',array('args'=>array('exec'=>'articles','id_article'=>$id_article),'data'=>''));
$row = sql_fetsel("*", "spip_articles", "id_article=$id_article");
if (!$row
OR !autoriser('voir', 'article', $id_article)) {
include_spip('inc/minipres');
echo minipres(_T('public:aucun_article'));
} else {
$row['titre'] = sinon($row["titre"],_T('info_sans_titre'));
$res = debut_gauche('accueil',true)
. articles_affiche($id_article, $row, _request('cherche_auteur'), _request('ids'), _request('cherche_mot'), _request('select_groupe'), _request('trad_err'), _request('debut'))
. "<br /><br /><div class='centered'>"
. "</div>"
. fin_gauche();
$commencer_page = charger_fonction('commencer_page', 'inc');
echo $commencer_page("« ". $row['titre'] ." »", "naviguer", "articles", $row['id_rubrique']);
echo debut_grand_cadre(true),
afficher_hierarchie($row['id_rubrique'],_T('titre_cadre_interieur_rubrique'),$id_article,'article',$row['id_secteur'],($row['statut'] == 'publie')),
fin_grand_cadre(true),
$res,
fin_page();
}
}
示例11: informer_auteur
function informer_auteur($bof)
{
include_spip('inc/json');
include_spip('formulaires/login');
include_spip('inc/auth');
$login = strval(_request('var_login'));
$row = auth_informer_login($login);
if ($row AND is_array($row))
unset($row['id_auteur']);
else {
// generer de fausses infos, mais credibles, pour eviter une attaque
// http://core.spip.org/issues/1758
include_spip('inc/securiser_action');
$fauxalea1 = md5('fauxalea'.secret_du_site().$login.floor(date('U')/86400));
$fauxalea2 = md5('fauxalea'.secret_du_site().$login.ceil(date('U')/86400));
$row = array('login' => $login,
'cnx' => 0,
'logo' => "",
'alea_actuel' => substr_replace($fauxalea1,'.',24,0),
'alea_futur' => substr_replace($fauxalea2,'.',24,0)
);
}
return json_export($row);
}
示例12: plugins_afficher_plugin_dist
function plugins_afficher_plugin_dist($url_page, $plug_file, $checked, $actif, $expose = false, $class_li = "item", $dir_plugins = _DIR_PLUGINS)
{
static $id_input = 0;
static $versions = array();
$force_reload = _request('var_mode') == 'recalcul';
$get_infos = charger_fonction('get_infos', 'plugins');
$info = $get_infos($plug_file, $force_reload, $dir_plugins);
$prefix = $info['prefix'];
$cfg = "";
$checkable = $dir_plugins !== _DIR_PLUGINS_DIST;
$nom = plugin_nom($info, $dir_plugins, $plug_file);
if (!plugin_version_compatible($info['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
$info['slogan'] = _T('plugin_info_non_compatible_spip');
$erreur = http_img_pack("plugin-dis-32.png", _T('plugin_info_non_compatible_spip'), " class='picto_err'", _T('plugin_info_non_compatible_spip'));
$class_li .= " disabled";
$checkable = false;
} elseif (isset($info['erreur'])) {
$class_li .= " error";
$erreur = http_img_pack("plugin-err-32.png", _T('plugin_info_erreur_xml'), " class='picto_err'", _T('plugin_info_erreur_xml')) . "<div class='erreur'>" . join('<br >', $info['erreur']) . "</div>";
$checkable = false;
} elseif (isset($GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file])) {
$class_li .= " error";
$erreur = http_img_pack("plugin-err-32.png", _T('plugin_impossible_activer', array('plugin' => $nom)), " class='picto_err'", _T('plugin_impossible_activer', array('plugin' => $nom))) . "<div class='erreur'>" . implode("<br />", $GLOBALS['erreurs_activation_raw'][$dir_plugins . $plug_file]) . "</div>";
} else {
$cfg = $actif ? plugin_bouton_config($plug_file, $info, $dir_plugins) : "";
}
// numerotons les occurrences d'un meme prefix
$versions[$prefix] = $id = isset($versions[$prefix]) ? $versions[$prefix] + 1 : '';
$class_li .= ($actif ? " actif" : "") . ($expose ? " on" : "");
return "<li id='{$prefix}{$id}' class='{$class_li}'>" . ((!$checkable and !$checked) ? '' : plugin_checkbox(++$id_input, $plug_file, $checked)) . plugin_resume($info, $dir_plugins, $plug_file, $url_page) . $cfg . $erreur . (($dir_plugins !== _DIR_PLUGINS_DIST and plugin_est_installe($plug_file)) ? plugin_desintalle($plug_file, $nom) : '') . "<div class='details'>" . (!$expose ? '' : affiche_bloc_plugin($plug_file, $info)) . "</div>" . "</li>";
}
示例13: cvtautosave_formulaire_traiter
/**
* Quand on poste definitivement un formulaire autosave,
* on peut vider la session autosave
* et on vide aussi toutes les autosave de plus de 72H (delai par defaut) ou sans __timestamp (vieilles sessions)
* @param $flux
* @return
*/
function cvtautosave_formulaire_traiter($flux)
{
// si on poste 'autosave' c'est qu'on n'a plus besoin de sauvegarder :
// on elimine les donnees de la session
if ($cle_autosave = _request('autosave')) {
include_spip('inc/session');
session_set('session_autosave_' . $cle_autosave, null);
// delai par defaut avant purge d'un backup de form : 72H
if (!defined('_AUTOSAVE_GB_DELAY')) {
define('_AUTOSAVE_GB_DELAY', 72 * 3600);
}
$time_too_old = time() - _AUTOSAVE_GB_DELAY;
// purger aussi toutes les vieilles autosave
$session = $GLOBALS['visiteur_session'];
foreach ($session as $k => $v) {
if (strncmp($k, 'session_autosave_', 17) == 0) {
$timestamp = 0;
if (preg_match(",&__timestamp=(\\d+)\$,", $v, $m)) {
$timestamp = intval($m[1]);
}
if ($timestamp < $time_too_old) {
session_set($k, null);
}
}
}
}
return $flux;
}
示例14: action_bank_response_dist
function action_bank_response_dist($cancel = null, $auto = null)
{
if (isset($GLOBALS['meta']['bank_paiement']) and $prestas = unserialize($GLOBALS['meta']['bank_paiement']) and count($prestas = $prestas['presta'])) {
$auto = $auto ? "auto" : "";
$result = false;
// intercepter les retours depuis un presta actif
if ($p = _request('bankp') and (isset($prestas[$p]) and $prestas[$p] or $p == 'gratuit')) {
$call_response = charger_fonction('response', "presta/{$p}/call");
spip_log('call_' . $auto . 'response : ' . $_SERVER['REQUEST_URI'], "{$p}{$auto}");
list($id_transaction, $result) = $call_response();
spip_log('call_' . $auto . 'response : ' . "{$id_transaction}/{$result}", "{$p}{$auto}");
} else {
spip_log("Prestataire {$p} inconnu ou inactif", 'bank_response');
}
// fall back si le presta n'a rien renvoye de lisible
// et qu'on a bien id=id_transaction;hash dans l'url
if (!$result and !$id_transaction and $id = _request('id') and $id = explode(';', $id) and count($id) == 2 and $id_transaction = reset($id) and $hash = end($id)) {
$id_transaction = sql_getfetsel("id_transaction", "spip_transactions", "id_transaction=" . intval($id_transaction) . " AND transaction_hash=" . sql_quote($hash));
if ($id_transaction) {
sql_updateq("spip_transactions", array('message' => 'Transaction annulée', 'statut' => 'echec', 'mode' => $p), 'id_transaction=' . intval($id_transaction) . " AND statut='commande'");
}
}
if (!$auto) {
redirige_apres_retour_transaction($p, 'acte', $cancel ? false : $result, $id_transaction);
}
die;
// mourir silencieusement
} else {
spip_log('Aucun prestataire de paiement configure', 'bank_response');
}
die;
}
示例15: balise_ECATALOGUE_SORTING_dyn
function balise_ECATALOGUE_SORTING_dyn($type = '')
{
if ($type) {
$type = '_' . $type;
}
return array("balise/ecatalogue_sorting" . $type, 0, array('sort_by' => _request('sort_by'), 'sort_order' => _request('sort_order')));
}