本文整理汇总了PHP中get_vars函数的典型用法代码示例。如果您正苦于以下问题:PHP get_vars函数的具体用法?PHP get_vars怎么用?PHP get_vars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_vars函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_categories
function get_categories()
{
global $db;
$cat_info = get_vars("category");
$this->priority = $this->cat_priority;
if (!is_array($cat_info)) {
$cat_info = array();
$db->query("SELECT * FROM " . PREFIX . "_category ORDER BY posi ASC");
while ($row = $db->get_row()) {
$cat_info[$row['id']] = array();
foreach ($row as $key => $value) {
$cat_info[$row['id']][$key] = $value;
}
}
set_vars("category", $cat_info);
$db->free();
}
$xml = "";
$lastmod = date("Y-m-d");
foreach ($cat_info as $cats) {
if ($this->allow_url) {
$loc = $this->home . $this->get_url($cats[id], $cat_info) . "/";
} else {
$loc = $this->home . "index.php?do=cat&category=" . $cats['alt_name'];
}
$xml .= $this->get_xml($loc, $lastmod);
}
return $xml;
}
开发者ID:Gordondalos,项目名称:union,代码行数:29,代码来源:google.class.php
示例2: get_user
function get_user()
{
$arr = get_vars();
if (!in_array('logged_in', $arr) || !in_array('name', $arr)) {
return false;
}
if (!$arr['logged_in']) {
return false;
}
return $arr['name'];
}
开发者ID:arthaud,项目名称:write-ups-2016,代码行数:11,代码来源:function.php
示例3: import_or_new_with
static function import_or_new_with($name, $settings)
{
$me = static::import($name);
if ($me) {
return $me;
}
$me = new static();
$containee = $settings['containee'];
$containee->__no_export = TRUE;
foreach (get_vars($containee) as $key => $value) {
if ($key !== '_cols') {
if (is_object($value)) {
$me->{$key} = $v = clone $value;
} else {
$me->{$key} = $value;
}
}
}
$me->_cols = [];
$ColumnClass = static::$ColumnClass;
foreach ($containee->cols as $ccol) {
$state_arr = [];
foreach (get_vars($ccol) as $key => $value) {
if ($key != '__owner' && is_object($value)) {
$v = ref(clone $value);
$state_arr[$key] = $v;
} else {
$state_arr[$key] = $value;
}
}
$state_arr['__owner'] = ref($me);
$state_arr['__no_export'] = FALSE;
$c = $ColumnClass::__set_state($state_arr);
$c->containee = ref($ccol);
$me->_cols[] = ref($c);
}
$me->containee = ref($containee);
$me->__no_export = FALSE;
return $me;
}
开发者ID:prkeshri,项目名称:getpanel,代码行数:40,代码来源:Table.php
示例4: get_vars
<br /><br />
<label>Senha</label> <input id="login" type="password" name="password" value="<?php
echo get_vars('password');
?>
" class='form-class'/>
<br /><br />
<?php
if (isset($_SESSION["error_message"])) {
$message = trim(htmlspecialchars(isset($_SESSION["error_message"]) ? $_SESSION["error_message"] : null));
echo '<p class="feedback-login">' . $message . '</p>';
unset($_SESSION["error_message"]);
session_destroy();
}
?>
<br /><br />
<input type="submit" class="btn-voltar" value="_" name="back" />
<?php
if (!$default_message) {
?>
<input type="submit" class="btn-cadastro" value="_" name="ok" /> <?php
}
?>
<input type="hidden" name="target_redirect" value="<?php
echo htmlspecialchars(get_vars("target_redirect"));
?>
" />
<br class='clean' />
</div>
</form>
</div>
开发者ID:r4fh4,项目名称:Visita,代码行数:30,代码来源:cadastro.inc.php
示例5: get_vars
* @author Adam Armstrong <[email protected]>
* @copyright (C) 2006-2015 Adam Armstrong
*
*/
$links = 1;
include_once "../includes/defaults.inc.php";
include_once "../config.php";
include_once "../includes/definitions.inc.php";
include $config['install_dir'] . "/includes/functions.inc.php";
include $config['html_dir'] . "/includes/functions.inc.php";
include $config['html_dir'] . "/includes/authenticate.inc.php";
if ($_SESSION['authenticated']) {
// Do various queries which we use in multiple places
include $config['html_dir'] . "/includes/cache-data.inc.php";
}
$vars = get_vars('GET');
if (strpos($_SERVER['REQUEST_URI'], "anon")) {
$anon = 1;
}
if (is_array($config['branding'])) {
if ($config['branding'][$_SERVER['SERVER_NAME']]) {
foreach ($config['branding'][$_SERVER['SERVER_NAME']] as $confitem => $confval) {
eval("\$config['" . $confitem . "'] = \$confval;");
}
} else {
foreach ($config['branding']['default'] as $confitem => $confval) {
eval("\$config['" . $confitem . "'] = \$confval;");
}
}
}
if (isset($vars['device']) && is_numeric($vars['device'])) {
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:31,代码来源:map.php
示例6: ContentBlockFoot
</form>
<?php
ContentBlockFoot();
ContentBlockHead("Profiles");
?>
<center>
<?php
echo ResNavigationRet('ProfilesUpper', 0);
?>
</center>
<form action="profiles.php<?php
echo substr(get_vars(), 0, strlen($get_vars) - 1);
?>
" method="post" name="prf_form">
<table cellspacing="1" cellpadding="0" class="small1" style="border: none; background-color: #eee; width: 590px; text-align: center;">
<?php
if (!$p_num) {
echo "<td class=panel>No profiles available</td>";
} else {
?>
<tr class="panel">
<td> </td>
<td align="center">
<a href="profiles.php?<?php
echo $inc_profiles;
?>
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:31,代码来源:profiles.php
示例7: array
if (!$user_group) {
$user_group = array();
$db->query("SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC");
while ($row = $db->get_row()) {
$user_group[$row['id']] = array();
foreach ($row as $key => $value) {
$user_group[$row['id']][$key] = stripslashes($value);
}
}
set_vars("usergroup", $user_group);
$db->free();
}
//####################################################################################################################
// Определение забаненных пользователей и IP
//####################################################################################################################
$banned_info = get_vars("banned");
if (!is_array($banned_info)) {
$banned_info = array();
$db->query("SELECT * FROM " . USERPREFIX . "_banned");
while ($row = $db->get_row()) {
if ($row['users_id']) {
$banned_info['users_id'][$row['users_id']] = array('users_id' => $row['users_id'], 'descr' => stripslashes($row['descr']), 'date' => $row['date']);
} else {
if (count(explode(".", $row['ip'])) == 4) {
$banned_info['ip'][$row['ip']] = array('ip' => $row['ip'], 'descr' => stripslashes($row['descr']), 'date' => $row['date']);
} elseif (strpos($row['ip'], "@") !== false) {
$banned_info['email'][$row['ip']] = array('email' => $row['ip'], 'descr' => stripslashes($row['descr']), 'date' => $row['date']);
} else {
$banned_info['name'][$row['ip']] = array('name' => $row['ip'], 'descr' => stripslashes($row['descr']), 'date' => $row['date']);
}
}
开发者ID:Hadryan,项目名称:L2LWEB,代码行数:31,代码来源:addcomments.php
示例8: connect_db
<?php
require_once '../../common/php/db.php';
$TABLE_NAME = 'sources';
$DB_NAME = 'uedwardn_clips';
# Get a connection to the database
$conn = connect_db($DB_NAME);
# These are the variables expected via POST
$posted_var_names = array('id');
# Get the POST variables
$posted_vars = get_vars($posted_var_names);
# Make an sql insert statement
$sql = get_sql_select_query($conn, $TABLE_NAME, $posted_vars);
# Query the db
$result = mysqli_query($conn, $sql);
if ($err = mysqli_error($conn)) {
echo '{"success":false, "error":"' . $sql . '"}';
} else {
echo result2json($result);
}
?>
开发者ID:enewe101,项目名称:snips,代码行数:21,代码来源:get_source.php
示例9: connect_db
<?php
require_once '../../common/php/db.php';
$TABLE_NAME = 'sources';
$DB_NAME = 'uedwardn_clips';
# Get a connection to the database
$conn = connect_db($DB_NAME);
# These are the variables expected via POST
$posted_var_names = array('id', 'bib_code', 'doc_name', 'authors', 'create_date', 'modify_date');
# Get the POST variables
$omit_absent = TRUE;
$posted_vars = get_vars($posted_var_names, $omit_absent);
# Make an sql insert statement
$sql = get_sql_select_query($conn, $TABLE_NAME, $posted_vars);
# Query the db
$result = mysqli_query($conn, $sql);
if ($err = mysqli_error($conn)) {
echo '{"success":false, "error":"' . $sql . '"}';
} else {
echo result2json($result);
}
// $link_prefix = 'http://shpow.com/snips/snipper.php?source_id=';
// while($row = mysqli_fetch_assoc($result)) {
// $name = $row['display_name'];
// $id = $row['id'];
// echo "<a href='$link_prefix$id'>$name</a><br />";
// }
?>
开发者ID:enewe101,项目名称:snips,代码行数:28,代码来源:get_sources.php
示例10: ResNavigationRet
function ResNavigationRet($form_name, $short = 0, $function = '', $aVar = '')
{
global $p_num;
global $page;
global $_page;
global $p_per_page;
global $page_first_p;
global $pages_num;
global $logged;
global $oTemplConfig;
global $gallery_view;
$pages_around = 5;
if (!is_array($aVar)) {
$per_page_array = array(10, 15, 20, 30, 50);
} else {
$per_page_array = $aVar;
}
if ($logged['admin']) {
array_push($per_page_array, 100);
}
if (!$function) {
$get_vars_controls = get_vars_controls(1, 0, 1, 1, 1);
$get_vars = get_vars(0, 1, 1, 1, 0);
} else {
$func = create_function('', $function);
$get_vars = $func();
}
$gallery_view = (int) $gallery_view;
ob_start();
if ($p_num) {
?>
<form name="<?php
echo 'NavForm' . $form_name;
?>
" id="<?php
echo 'NavForm' . $form_name;
?>
" method="get" action="<?php
echo $_SERVER['PHP_SELF'];
?>
" style="margin: 0px;">
<?php
echo $get_vars_controls;
?>
<table class="text2" cellpadding="0" cellspacing="0" border="0">
<?php
if (!$short) {
?>
<tr>
<td><?php
echo _t("_Results");
?>
: <b><?php
echo (int) $page_first_p;
?>
</b>-<b><?php
echo min((int) ($page_first_p + $p_per_page - 1), (int) $p_num);
?>
</b> | <?php
echo _t("Total");
?>
: <b><?php
echo (int) $p_num;
?>
</b></td>
<td> | <?php
echo _t("_Results per page");
?>
: </td>
<td>
<select name="p_per_page" onchange="javascript: document.forms['<?php
echo 'NavForm' . $form_name;
?>
'].submit();">
<?php
foreach ($per_page_array as $per_page_elem) {
echo "<option value=\"{$per_page_elem}\" " . ($p_per_page == $per_page_elem ? 'selected="selected"' : '') . ">{$per_page_elem}</option>";
}
?>
</select>
</td>
<td> </td>
</tr>
<?php
}
?>
<tr>
<td align="center" colspan="3">
<?php
echo _t('_Pages');
?>
:
<?php
if ($page > 1) {
echo "\n\t\t\t\t\t\t<a href=\"{$_SERVER['PHP_SELF']}{$get_vars}page=1&gallery_view={$gallery_view}\">" . _t("_First") . "</a> | \n\t\t\t\t\t\t<a href=\"{$_SERVER['PHP_SELF']}{$get_vars}page=" . (int) ($page - 1) . "&gallery_view={$gallery_view}\">" . _t("_Prev") . "</a> | ";
}
// print all previous pages
for ($i = max($page - $pages_around, 1); $i < $page; $i++) {
echo "\n\t\t\t\t\t\t<a href=\"{$_SERVER['PHP_SELF']}{$get_vars}page={$i}&gallery_view={$gallery_view}\">{$i}</a> ";
}
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:101,代码来源:admin.inc.php
示例11: authenticate
/**
* método para autenticar usuário.
*/
public function authenticate()
{
global $secury_key;
// carregar variaveis globais
require ROOT_WEBSITE . "scripts/load_globals.php";
$login = trim(strip_tags(isset($_POST["login"]) ? $_POST["login"] : ""));
$pws = trim(strip_tags(isset($_POST["password"]) ? $_POST["password"] : ""));
$now = date("Y-m-d H:i:s");
// verificar se existe sessão criada
if (isset($_SESSION["login_data_site"])) {
$session_data = $_SESSION["login_data_site"];
if ($session_data["login_key"] == md5($secury_key . $session_data["ip"] . $session_data["user_key"])) {
$SQL = "SELECT * FROM tb_user WHERE id_user = '" . mysql_real_escape_string($session_data["user_key"]) . "' AND active='1' AND verify='1' ";
$results = $connection->execute($SQL, true);
if ($results) {
//calcular tempo do ultimo acesso ao sistema
$diff_last_login = EXPIRATION_TIME;
if ($results[0]["dt_last_login"]) {
$last_login = $results[0]["dt_last_login"];
$diff_last_login = timeDiff($last_login, $now);
}
if ($results[0]["dt_last_login"] && $diff_last_login > EXPIRATION_TIME) {
$this->logout();
}
// alterar status do usuário para logado
$SQL = "UPDATE tb_user SET dt_last_login = '" . $now . "' WHERE id_user = '" . mysql_real_escape_string($session_data["user_key"]) . "' ";
$connection->execute($SQL);
session_regenerate_id();
return true;
}
}
}
//caso não haja sessão, verifica se o acesso foi feito pelo facebook
if ($_POST['facebook-login'] == 1 && !empty($_POST['facebook-name'])) {
//cria senha padrão para usuários facebook
$pws = 'fb#us3r$p455w0rd';
//verifica se já existe o user
$SQL = 'SELECT * FROM tb_user WHERE email = "' . $login . '" ';
$res = $connection->execute($SQL, true);
//caso não exista o usuário, é criado um usuário com dados do facebook
if (!$res) {
$SQL = 'INSERT INTO tb_user(nm_user, email, password, verification_code, active, verify, logged, login)';
$SQL .= ' VALUES("' . $_POST['facebook-name'] . '", "' . mysql_real_escape_string($login) . '", MD5("' . $pws . '"), "f7a4c6e3b8o0o0k2", 1, 1, 0, "' . mysql_real_escape_string($login) . '")';
$connection->execute($SQL);
}
}
// caso não haja sessão pega os dados do form de login.
if (!empty($login) || !empty($pws)) {
$SQL = "SELECT * FROM tb_user WHERE login = '" . mysql_real_escape_string($login) . "' AND active='1' AND verify='1' ";
$results = $connection->execute($SQL, true);
// se encontrou o login digitado verifica a senha
if ($results) {
// verificar senhas
if (!empty($results[0]["password"]) && $results[0]["password"] == md5($pws)) {
// alterar status do usuário para logado
$SQL = "UPDATE tb_user SET logged = '1', dt_last_login = '" . $now . "' WHERE id_user = '" . mysql_real_escape_string($results[0]["id_user"]) . "' ";
$connection->execute($SQL);
// armazenar dados na session
$ip = $_SERVER['REMOTE_ADDR'];
$hora = time();
$secury_key = md5($secury_key . $ip . $results[0]["id_user"]);
$_SESSION["login_data_site"] = array("full_name" => $results[0]["nm_user"], "email" => $results[0]["email"], "login" => $results[0]["login"], "login_key" => $secury_key, "ip" => $ip, "user_key" => $results[0]["id_user"]);
unset($login);
unset($pws);
session_regenerate_id();
$target_redirect = null;
if ($this->target_redirect) {
$target_redirect = $this->target_redirect;
} else {
if (get_vars("target_redirect") && !preg_match("/(\\.\\.|\"|\\'|\\.)+/", get_vars("target_redirect"))) {
$target_redirect = get_vars("target_redirect");
}
}
header("Location: " . $alias . $target_redirect);
header("Content-Length: 0");
exit;
} else {
if (!isset($_SESSION["error_message"])) {
$_SESSION["error_message"] = "Dados de acesso incorretos.";
}
return false;
}
} else {
if (!isset($_SESSION["error_message"])) {
$_SESSION["error_message"] = "Dados de acesso incorretos.";
}
return false;
}
} else {
if (!isset($_SESSION["error_message"])) {
$_SESSION["error_message"] = "Preencha os campos para efetuar o login.";
}
return false;
}
return false;
}
开发者ID:r4fh4,项目名称:Visita,代码行数:99,代码来源:cadastro.class.php
示例12: cadastro_active
public function cadastro_active()
{
// carregar variaveis globais
require ROOT_WEBSITE . "scripts/load_globals.php";
$default_message = '<h3>Cadastro Ativado com sucesso</h3>';
if (get_vars("email") && get_vars("token")) {
$results = $this->model->recover_dados(get_vars("email"), get_vars("token"));
if (!$results) {
header("Location: " . $base_url_site);
header("Content-Length: 0");
exit;
}
$this->model->active_user(get_vars("email"));
} else {
header("Location: " . $base_url_site);
header("Content-Length: 0");
exit;
}
$css_files = write_css_header(array('cadastro'));
$no_footer = true;
include $template_directory . "header.inc.php";
include $template_directory . "ativacao.inc.php";
include $template_directory . "footer.inc.php";
$connection->disconnect();
}
开发者ID:r4fh4,项目名称:Visita,代码行数:25,代码来源:cadastro_controller.class.php
示例13: check_function
/** run tests on a function. the code is passed in $txt */
function check_function($name, $txt, $offset)
{
global $API_params;
if (preg_match_all('/zend_parse_parameters(?:_ex\\s*\\([^,]+,[^,]+|\\s*\\([^,]+),\\s*"([^"]*)"\\s*,\\s*([^{;]*)/S', $txt, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) {
$GLOBALS['current_function'] = $name;
foreach ($matches as $m) {
$GLOBALS['error_few_vars_given'] = false;
update_lineno($offset + $m[2][1]);
$vars = get_vars(substr($txt, 0, $m[0][1]));
// limit var search to current location
$params = get_params($vars, $m[2][0]);
$optional = $varargs = false;
$last_last_char = $last_char = '';
$j = -1;
$len = strlen($m[1][0]);
for ($i = 0; $i < $len; ++$i) {
switch ($char = $m[1][0][$i]) {
// separator for optional parameters
case '|':
if ($optional) {
error("more than one optional separator at char #{$i}");
} else {
$optional = true;
if ($i == $len - 1) {
error("unnecessary optional separator");
}
}
break;
// separate_zval_if_not_ref
// separate_zval_if_not_ref
case '/':
if (!in_array($last_char, array('r', 'z'))) {
error("the '/' specifier cannot be applied to '{$last_char}'");
}
break;
// nullable arguments
// nullable arguments
case '!':
if (!in_array($last_char, array('a', 'C', 'f', 'h', 'o', 'O', 'r', 's', 't', 'z', 'Z'))) {
error("the '!' specifier cannot be applied to '{$last_char}'");
}
break;
case '&':
if (version_compare(VERSION, '6', 'ge')) {
if ($last_char == 's' || $last_last_char == 's' && $last_char == '!') {
check_param($params, ++$j, 'UConverter*', $optional);
} else {
error("the '&' specifier cannot be applied to '{$last_char}'");
}
} else {
error("unknown char ('&') at column {$i}");
}
break;
case '+':
case '*':
if (version_compare(VERSION, '6', 'ge')) {
if ($varargs) {
error("A varargs specifier can only be used once. repeated char at column {$i}");
} else {
check_param($params, ++$j, 'zval****', $optional);
check_param($params, ++$j, 'int*', $optional);
$varargs = true;
}
} else {
error("unknown char ('{$char}') at column {$i}");
}
break;
default:
if (isset($API_params[$char])) {
foreach ($API_params[$char] as $exp) {
check_param($params, ++$j, $exp, $optional);
}
} else {
error("unknown char ('{$char}') at column {$i}");
}
}
$last_last_char = $last_char;
$last_char = $char;
}
}
}
}
开发者ID:garybulin,项目名称:php7,代码行数:83,代码来源:check_parameters.php
示例14: check_function
/** run tests on a function. the code is passed in $txt */
function check_function($name, $txt, $offset)
{
global $API_params;
$regex = '/
(?: zend_parse_parameters(?:_throw)? \\s*\\([^,]+
| zend_parse_(?:parameters_ex|method_parameters) \\s*\\([^,]+,[^,]+
| zend_parse_method_parameters_ex \\s*\\([^,]+,[^,]+,[^,+]
)
,\\s*"([^"]*)"\\s*
,\\s*([^{;]*)
/Sx';
if (preg_match_all($regex, $txt, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) {
$GLOBALS['current_function'] = $name;
foreach ($matches as $m) {
$GLOBALS['error_few_vars_given'] = false;
update_lineno($offset + $m[2][1]);
$vars = get_vars(substr($txt, 0, $m[0][1]));
// limit var search to current location
$params = get_params($vars, $m[2][0]);
$optional = $varargs = false;
$last_char = '';
$j = -1;
$spec = $m[1][0];
$len = strlen($spec);
for ($i = 0; $i < $len; ++$i) {
$char = $spec[$i];
switch ($char = $spec[$i]) {
// separator for optional parameters
case '|':
if ($optional) {
error("more than one optional separator at char #{$i}");
} else {
$optional = true;
if ($i == $len - 1) {
error("unnecessary optional separator");
}
}
break;
// separate_zval_if_not_ref
// separate_zval_if_not_ref
case '/':
if (in_array($last_char, array('l', 'L', 'd', 'b'))) {
error("the '/' specifier should not be applied to '{$last_char}'");
}
break;
// nullable arguments
// nullable arguments
case '!':
if (in_array($last_char, array('l', 'L', 'd', 'b'))) {
check_param($params, ++$j, 'zend_bool*', $optional);
}
break;
// variadic arguments
// variadic arguments
case '+':
case '*':
if ($varargs) {
error("A varargs specifier can only be used once. repeated char at column {$i}");
} else {
check_param($params, ++$j, 'zval**', $optional);
check_param($params, ++$j, 'int*', $optional);
$varargs = true;
}
break;
case 's':
case 'p':
check_param($params, ++$j, 'char**', $optional, $allow_uninit = true);
check_param($params, ++$j, 'size_t*', $optional, $allow_uninit = true);
if ($optional && !$params[$j - 1][2] && !$params[$j][2] && $params[$j - 1][0] !== '**dummy**' && $params[$j][0] !== '**dummy**') {
error("one of optional vars {$params[$j - 1][0]} or {$params[$j][0]} must be initialized", 1);
}
break;
case 'C':
// C must always be initialized, independently of whether it's optional
check_param($params, ++$j, 'zend_class_entry**', false);
break;
default:
if (!isset($API_params[$char])) {
error("unknown char ('{$char}') at column {$i}");
}
// If an is_null flag is in use, only that flag is required to be
// initialized
$allow_uninit = $i + 1 < $len && $spec[$i + 1] === '!' && in_array($char, array('l', 'L', 'd', 'b'));
foreach ($API_params[$char] as $exp) {
check_param($params, ++$j, $exp, $optional, $allow_uninit);
}
}
$last_char = $char;
}
}
}
}
开发者ID:cefalo19,项目名称:php-src,代码行数:93,代码来源:check_parameters.php
示例15: Copyright
http://dle-news.ru/
-----------------------------------------------------
Copyright (c) 2004,2015 SoftNews Media Group
=====================================================
Данный код защищен авторскими правами
=====================================================
Файл: rssinform.php
-----------------------------------------------------
Назначение: Вывод RSS информеров
=====================================================
*/
if (!defined('DATALIFEENGINE')) {
die("Hacking attempt!");
}
//################# Определение информеров
$informers = get_vars("informers");
if (!is_array($informers)) {
$informers = array();
$db->query("SELECT * FROM " . PREFIX . "_rssinform ORDER BY id ASC");
while ($row_b = $db->get_row()) {
$informers[$row_b['id']] = array();
foreach ($row_b as $key => $value) {
$informers[$row_b['id']][$key] = stripslashes($value);
}
}
set_vars("informers", $informers);
$db->free();
}
$allow_cache = $config['allow_cache'];
$config['allow_cache'] = 1;
$temp = array();
开发者ID:Gordondalos,项目名称:union,代码行数:31,代码来源:rssinform.php
示例16: CheckLogin
private function CheckLogin()
{
if ($_SESSION['dle_log'] >= 5) {
die("Hacking attempt!");
}
$GLOBALS['user_group'] = get_vars("usergroup");
if (!$GLOBALS['user_group']) {
$GLOBALS['user_group'] = array();
$this->db->query("SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC");
while ($row = $this->db->get_row()) {
$GLOBALS['user_group'][$row['id']] = array();
foreach ($row as $key => $value) {
$GLOBALS['user_group'][$row['id']][$key] = $value;
}
}
set_vars("usergroup", $GLOBALS['user_group']);
$this->db->free();
}
$hash_pass = md5(md5($_POST['password']));
$login = $this->db->safesql($_POST['name']);
if ($GLOBALS['member_id'] = $this->db->super_query("SELECT * FROM " . USERPREFIX . "_users WHERE name='{$login}' AND password='{$hash_pass}'")) {
if (!defined('DOMAIN')) {
define('DOMAIN', "." . $_SERVER['HTTP_HOST']);
}
setcookie("dle_password", md5($_POST['password']), time() + 3600 * 24 * 365, "/", DOMAIN, NULL, TRUE);
@session_register('dle_password');
@session_register('member_lasttime');
if ($GLOBALS['config']['version_id'] < 7.2) {
@session_register('dle_name');
setcookie("dle_name", $_POST['name'], time() + 3600 * 24 * 365, "/", DOMAIN, NULL, TRUE);
$_SESSION['dle_name'] = $_POST['name'];
} else {
@session_register('dle_user_id');
setcookie("dle_user_id", $GLOBALS['member_id']['user_id'], time() + 3600 * 24 * 365, "/", DOMAIN, NULL, TRUE);
$_SESSION['dle_user_id'] = $GLOBALS['member_id']['user_id'];
}
$_SESSION['dle_password'] = md5($_POST['password']);
$_SESSION['dle_log'] = 0;
return true;
} else {
$_SESSION['dle_log']++;
return false;
}
}
开发者ID:dautushenka,项目名称:Totalizator,代码行数:44,代码来源:InstallUpdate.php
示例17: print_success
// Reset RSS/Atom key
if ($vars['atom_key'] == "toggle") {
if (set_user_pref($user_id, 'atom_key', md5(strgen()))) {
print_success('RSS/Atom key updated.');
$prefs = get_user_prefs($user_id);
} else {
print_error('Error generating RSS/Atom key.');
}
}
// Reset API key
if ($vars['api_key'] == "toggle") {
if (set_user_pref($user_id, 'api_key', md5(strgen()))) {
print_success('API key updated.');
$prefs = get_user_prefs($user_id);
} else {
print_error('Error generating API key.');
}
}
}
$atom_key_updated = isset($prefs['atom_key']['updated']) ? formatUptime(time() - strtotime($prefs['atom_key']['updated']), 'shorter') . ' ago' : 'Never';
$api_key_updated = isset($prefs['api_key']['updated']) ? formatUptime(time() - strtotime($prefs['api_key']['updated']), 'shorter') . ' ago' : 'Never';
$filename = $config['html_dir'] . '/pages/preferences/' . $vars['section'] . '.inc.php';
if (is_file($filename)) {
$vars = get_vars('POST');
// Note, on edit pages use only method POST!
include $filename;
} else {
print_error('<h4>Page does not exist</h4>
The requested page does not exist. Please correct the URL and try again.');
}
// EOF
开发者ID:Natolumin,项目名称:observium,代码行数:31,代码来源:preferences.inc.php
示例18: get_vars
<?php
require_once "scripts/init.php";
?>
<img src="<?php
echo $images_relative_directory . get_vars('id');
?>
" />
开发者ID:r4fh4,项目名称:Visita,代码行数:9,代码来源:ver_imagem.php
示例19: intval
if (isset($_REQUEST['vote_action'])) {
$vote_action = $_REQUEST['vote_action'];
} else {
$vote_action = "";
}
if (isset($_REQUEST['vote_id'])) {
$vote_id = intval($_REQUEST['vote_id']);
} else {
$vote_id = 0;
}
if (isset($_REQUEST['vote_check'])) {
$vote_check = intval($_REQUEST['vote_check']);
} else {
$vote_check = 0;
}
$vote_info = get_vars("vote");
if (!is_array($vote_info)) {
$vote_info = array();
$db->query("SELECT id, title, category, body, vote_num, start, end, grouplevel FROM " . PREFIX . "_vote WHERE approve");
while ($row = $db->get_row()) {
$vote_info[$row['id']] = array('id' => $row['id'], 'title' => $row['title'], 'category' => $row['category'], 'body' => $row['body'], 'vote_num' => $row['vote_num'], 'start' => $row['start'], 'end' => $row['end'], 'grouplevel' => $row['grouplevel']);
}
set_vars("vote", $vote_info);
$db->free();
}
if (!$vote_id or $vote_info[$vote_id]['id'] == "") {
$find_vote = array();
$find_cats = array();
foreach ($vote_info as $votes) {
if ($votes['start'] and $_TIME < $votes['start']) {
continue;
开发者ID:Zzepish,项目名称:IvanShikalovWebSIte,代码行数:31,代码来源:vote.php
示例20: _online_block
private function _online_block(dle_template &$tpl)
{
global $PHP_SELF;
$cache = '';
if ($this->config['vb_block_online_cache_time'] && function_exists('dle_cache')) {
$block_time = get_vars('vb_block_online_cache_time');
if (time() - $block_time < $this->config['vb_block_online_cache_time']) {
$cache = dle_cache('vb_block_online_cache');
}
}
if (!$cache) {
$this->_db_connect();
if (!$this->vb_config['refresh']) {
$this->vb_config['refresh'] = 15;
}
$this->db->query("SELECT s.userid, s.host, s.lastactivity, s.location, s.useragent, u.username FROM " . VB_PREFIX . "session AS s\n LEFT OUTER JOIN " . VB_PREFIX . "user AS u\n ON u.userid=s.userid\n WHERE s.lastactivity>" . (time() - $this->vb_config['refresh'] * 60));
$users = $robots = array();
$guests = $count_user = $count_robots = 0;
while ($user = $this->db->get_row()) {
if (VB_CHARSET && VB_CHARSET != DLE_CHARSET) {
$user['useragent'] = iconv(VB_CHARSET, DLE_CHARSET, $user['useragent']);
$user['location'] = iconv(VB_CHARSET, DLE_CHARSET, $user['location']);
$user['username'] = iconv(VB_CHARSET, DLE_CHARSET, $user['username']);
}
if ($user['userid'] == 0) {
$current_robot = $this->_robots($user['useragent']);
if ($current_robot != "") {
$robots[$current_robot]['name'] = $current_robot;
$robots[$current_robot]['lastactivity'] = $user['lastactivity'];
$robots[$current_robot]['host'] = $user['host'];
$robots[$current_robot]['location'] = $user['location'];
} else {
$guests++;
}
} else {
$users[$user['userid']]['username'] = $user['username'];
$users[$user['userid']]['lastactivity'] = $user['lastactivity'];
$users[$user['userid']]['useragent'] = $user['
|
请发表评论