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; }
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']; }
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; }
<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>
* @author Adam Armstrong <*****@*****.**> * @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'])) {
</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; ?>
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']); } }
<?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); } ?>
<?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 />"; // } ?>
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> "; } // print current page echo "\n\t\t\t\t\t\t[{$page}] "; // print all next pages for ($i = $page + 1; $i <= min($page + $pages_around, $pages_num); $i++) { echo "\n\t\t\t\t\t\t<a href=\"{$_SERVER['PHP_SELF']}{$get_vars}page={$i}&gallery_view={$gallery_view}\">{$i}</a> "; } if ($page < $pages_num) { echo "\n\t\t\t\t\t\t<a href=\"{$_SERVER['PHP_SELF']}{$get_vars}page=" . (int) ($page + 1) . "&gallery_view={$gallery_view}\">" . _t("_Next") . "</a> | \n\t\t\t\t\t\t<a href=\"{$_SERVER['PHP_SELF']}{$get_vars}page={$pages_num}&gallery_view={$gallery_view}\">" . _t("_Last") . "</a>"; } ?> </td> <?php // print gallery option for search page if ($_page['name_index'] == 32 && $oTemplConfig->show_gallery_link_in_page_navigation) { if ($gallery_view) { echo "\n\t\t\t\t\t<td style=\"padding-left: 10px;\"><a href=\"{$_SERVER['PHP_SELF']}{$get_vars}page={$page}&gallery_view=0\">" . _t("_view as profile details") . "</a></td>"; } else { echo "\n\t\t\t\t\t<td style=\"padding-left: 10px;\"><a href=\"{$_SERVER['PHP_SELF']}{$get_vars}page={$page}&gallery_view=1\">" . _t("_view as photo gallery") . "</a></td>"; } } else { echo "\n\t\t\t\t\t<td> </td>"; } ?> </tr> </table> </form> <?php } $ret = ob_get_contents(); ob_end_clean(); return $ret; }
/** * 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 = '******' 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 = '******' WHERE id_user = '******' "; $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 = '******' 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 = '******' WHERE 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; }
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(); }
/** 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; } } } }
/** 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; } } } }
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();
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='******'")) { 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; } }
// 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
<?php require_once "scripts/init.php"; ?> <img src="<?php echo $images_relative_directory . get_vars('id'); ?> " />
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;
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['useragent']; $users[$user['userid']]['host'] = $user['host']; $users[$user['userid']]['location'] = $user['location']; } } $location_array = array("%addcomments%" => $this->lang['paddcomments'], "%readnews%" => $this->lang['preadnews'], "%incategory%" => $this->lang['pincategory'], "%posin%" => $this->lang['pposin'], "%mainpage%" => $this->lang['pmainpage'], "%view_pofile%" => $this->lang['view_profile'], "%newposts%" => $this->lang['newposts'], "%view_stats%" => $this->lang['view_stats']); if (count($users)) { foreach ($users as $id => $value) { if ($GLOBALS['member_id']['user_group'] == 1) { $user_array[$value['username']] = $this->lang['os'] . $this->_os($users[$id]['useragent']) . '<br />' . $this->lang['browser'] . $this->_browser($users[$id]['useragent']) . '<br />' . '<b>IP:</b> ' . $users[$id]['host'] . '<br />'; } $user_array[$value['username']] .= $this->lang['was'] . $this->_timeagos($users[$id]['lastactivity']) . $this->lang['back'] . '<br />' . $this->lang['location']; if (preg_match("'%(.*?)%'si", $users[$id]['location'])) { foreach ($location_array as $find => $replace) { $users[$id]['location'] = str_replace($find, $replace, $users[$id]['location']); } } else { $users[$id]['location'] = $this->lang['pforum']; } $user_array[$value['username']] .= $users[$id]['location'] . "<br/>"; $descr = $user_array[$value['username']]; $user_array[$value['username']] = array(); $user_array[$value['username']]['descr'] = $descr; $user_array[$value['username']]['id'] = $id; $count_user++; } } if (count($robots)) { foreach ($robots as $name => $value) { if ($GLOBALS['member_id']['user_group'] == 1) { $robot_array[$name] = $this->lang['os'] . $this->_os($robots[$name]['useragent']) . '<br />' . $this->lang['browser'] . $this->_browser($robots[$name]['useragent']) . '<br />' . '<b>IP:</b> ' . $robots[$name]['host'] . '<br />'; } $robot_array[$name] .= $this->lang['was'] . $this->_timeagos($robots[$name]['lastactivity']) . $this->lang['back'] . '<br />' . $this->lang['location']; if (preg_match("'%(.*?)%'si", $robots[$name]['location'])) { foreach ($location_array as $find => $replace) { $robots[$name]['location'] = str_replace($find, $replace, $robots[$name]['location']); } } else { $robots[$name]['location'] = $this->lang['pforum']; } $robot_array[$name] .= $robots[$name]['location'] . "<br/>"; $count_robots++; } } $users = ""; $i = 0; if (count($user_array)) { foreach ($user_array as $name => $a) { $desc = $a['descr']; $id = $a['id']; if ($i) { $users .= $this->config['separator']; } $desc = htmlspecialchars($desc, ENT_QUOTES); if (!$this->config['vb_block_online_user_link_forum']) { $user_url = $GLOBALS['config']['allow_alt_url'] == "yes" ? $GLOBALS['config']['http_home_url'] . "user/" . urlencode($name) . "/" : $PHP_SELF . "?subaction=userinfo&user="******"/member.php?u=" . $id; } $users .= "<a onmouseover=\"showhint('{$desc}', this, event, '180px');\" href=\"" . $user_url . "\" >" . $name . "</a>"; $i++; } } else { $users = $this->lang['notusers']; } $robots = ""; $i = 0; if (count($robot_array)) { foreach ($robot_array as $name => $desc) { if ($i) { $robots .= $this->config['separator']; } $desc = htmlspecialchars($desc, ENT_QUOTES); $robots .= "<span onmouseover=\"showhint('{$desc}', this, event, '180px');\" style=\"cursor:hand;\" >" . $name . "</span>"; $i++; } } else { $robots = $this->lang['notbots']; } $tpl->load_template('block_online.tpl'); $tpl->set('{users}', $count_user); $tpl->set('{guest}', $guests); $tpl->set('{robots}', $count_robots); $tpl->set('{all}', $count_user + $guests + $count_robots); $tpl->set('{userlist}', $users); $tpl->set('{botlist}', $robots); $tpl->compile('block_online'); $tpl->clear(); if ($this->config['block_online_cache_time'] && function_exists('create_cache')) { create_cache("vb_block_online_cache", $tpl->result['block_online']); set_vars('vb_block_online_cache_time', time()); } } else { $tpl->result['block_online'] = $cache; } }
<h2 class="page-title">Painel de Administração de Ponto Turístico</h2> <p>Inclua e altere os dados dos pontos turístico que fazem parte do sistema.</p> <form name="form" method="POST" action="pontos-turisticos.php"> <!-- ACTIONS BUTTONS --> <p class="action-buttons"> <label>Nome </label><input type="text" name="search_content" value="<?php echo htmlspecialchars(get_vars("search_content")); ?> " size="50" class='' /> <br class='clean' /><br /> <center> <input type="submit" class="btn-form" name="search" value="Buscar" /> <input type="submit" class="btn-form" name="clear_search" value="Limpar" /> </center> </p> <br class='clean' /><br /> <input type="submit" class="btn-form left" name="new" value="Inserir Novo" /> <br class='clean' /> <!-- LIST DATA --> <div id="paginate"><?php print render_paginate($page, $total_pages, $url, $results_per_page); ?> </div> <?php if ($records) { ?> <table id="main-grid" width="98%" align="center"> <thead> <tr> <th width="5%">Editar</th>
----------------------------------------------------- Copyright (c) 2004,2015 SoftNews Media Group ===================================================== Данный код защищен авторскими правами ===================================================== Файл: links.php ----------------------------------------------------- Назначение: Модуль перекрестных ссылок ===================================================== */ if (!defined('DATALIFEENGINE')) { die("Hacking attempt!"); } $replace_links = array(); //################# Определение ссылок $links = get_vars("links"); if (!is_array($links)) { $links = array(); $db->query("SELECT * FROM " . PREFIX . "_links ORDER BY id DESC"); while ($row_b = $db->get_row()) { $links[$row_b['id']] = array(); foreach ($row_b as $key => $value) { $links[$row_b['id']][$key] = stripslashes($value); } } usort($links, "cmplinks"); set_vars("links", $links); $db->free(); } function cmplinks($a, $b) {
$cronmode = $argv[1]; } $_REQUEST = array(); $_POST = array(); $_GET = array(); if ($cronmode == "sitemap") { $_POST['action'] = "create"; $_POST['priority'] = "0.5"; $_POST['stat_priority'] = "0.6"; $_POST['cat_priority'] = "0.7"; $_POST['limit'] = 0; $member_id = array(); $user_group = array(); $member_id['user_group'] = 1; $user_group[$member_id['user_group']]['admin_googlemap'] = 1; $cat_info = get_vars("category"); 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] = stripslashes($value); } } set_vars("category", $cat_info); $db->free(); } if (count($cat_info)) { foreach ($cat_info as $key) { $cat[$key['id']] = $key['name'];
----------------------------------------------------- Copyright (c) 2004,2015 SoftNews Media Group ===================================================== Данный код защищен авторскими правами ===================================================== Файл: banners.php ----------------------------------------------------- Назначение: Вывод баннеров ===================================================== */ if (!defined('DATALIFEENGINE')) { die("Hacking attempt!"); } define('BANNERS', 1); //################# Определение баннеров $banners = get_vars("banners"); if (!is_array($banners)) { $banners = array(); $db->query("SELECT * FROM " . PREFIX . "_banners ORDER BY id ASC"); while ($row_b = $db->get_row()) { $banners[$row_b['id']] = array(); foreach ($row_b as $key => $value) { $banners[$row_b['id']][$key] = $value; } } set_vars("banners", $banners); $db->free(); } $ban = array(); $banner_in_news = array(); if (count($banners) > 0) {
$entidade = new entidade(); $pontos = $entidade->get_all_pontos(); echo json_encode($pontos); break; case 'get_coords_ponto': $entidade = new entidade(); $coords = $entidade->get_coords_ponto(get_vars('destino')); echo json_encode($coords); break; case 'get_all_by_destino': $entidade = new entidade(); $data = $entidade->get_proximidade(get_vars('destino')); $opcoes = $entidade->get_all_by_proximidade($data); $pontos = $entidade->get_all_rota($opcoes); echo json_encode($pontos); break; case 'set_comentario': $entidade = new entidade(); if (!get_vars('comentario')) { echo 'no'; exit; } if (trim(strip_tags(get_vars('comentario'))) == '') { echo 'no'; exit; } $entidade->insert_comentario(get_vars('comentario'), get_vars('user'), get_vars('ponto')); echo 'ok'; break; } }
* * @package observium * @subpackage ajax * @author Adam Armstrong <*****@*****.**> * @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited * */ $config['install_dir'] = "../.."; require_once $config['install_dir'] . "/includes/sql-config.inc.php"; include $config['html_dir'] . "/includes/functions.inc.php"; include $config['html_dir'] . "/includes/authenticate.inc.php"; if (!$_SESSION['authenticated']) { print_error('Session expired, please log in again!'); exit; } $vars = get_vars(); $vars['page'] = "popup"; switch ($vars['entity_type']) { case "port": if (is_numeric($vars['entity_id']) && port_permitted($vars['entity_id'])) { $port = get_port_by_id($vars['entity_id']); echo generate_port_popup($port); } else { print_warning("You are not permitted to view this port."); } exit; break; case "device": if (is_numeric($vars['entity_id']) && device_permitted($vars['entity_id'])) { $device = device_by_id_cache($vars['entity_id']); echo generate_device_popup($device, $vars, $start, $end);
$where[] = " ativo = '1' "; list($r, $records, $page, $total_pages) = default_search("tb_comentario", $where, "", "dt_comentario DESC"); if ($records) { foreach ($records as $k => $v) { $ponto = $geral->get_ponto_turistico($v["id_ponto_turistico"]); $nm = $user->get_user($v["id_user"]); $item_records[$k]["id"] = $v["id_comentario"]; $item_records[$k]["comentario"] = $v["ds_comentario"]; $item_records[$k]["user"] = $nm[0]["nm_user"]; $item_records[$k]["ponto"] = $ponto[0]["nm_ponto_turistico"]; $item_records[$k]["data"] = date('d/m/Y', strtotime($v["dt_comentario"])); } } // deletar imagens if (get_vars("delete")) { if (get_vars("action_item")) { $list_itens = $_POST["action_item"]; $geral->delete_comentario("'" . implode("','", $list_itens) . "'"); show_message("Comentário(s) removido(s) com sucesso!"); redir_page($url); } else { show_message("Nenhum item selecionado para exclusão, favor selecionar.", false); redir_page($url); } } include $template_directory . "comentarios.inc.php"; //fechar conexao $connection->disconnect(); include $template_directory . "footer.inc.php"; ?>
// parametros para query $where[] = " ativo = '1' "; if (get_vars("search_content")) { $where[] = "endereco like '%" . get_vars('search_content') . "%'"; $url = set_url($url, array("search_content" => get_vars("search_content"))); } list($r, $records, $page, $total_pages) = default_search("tb_ponto", $where, "", "endereco ASC"); // deletar imagens if (get_vars("delete")) { if (get_vars("action_item")) { $geral = new geral(); $list_itens = $_POST["action_item"]; $geral->delete_parada("'" . implode("','", $list_itens) . "'"); show_message("Parada(s) removida(s) com sucesso!"); redir_page($url); } else { show_message("Nenhum item selecionado para exclusão, favor selecionar.", false); redir_page($url); } } // redirecionar para tela de inclusão if (get_vars("new")) { redir_page("paradas_editar.php"); } include $template_directory . "paradas.inc.php"; //fechar conexao $connection->disconnect(); include $template_directory . "footer.inc.php"; ?>
define('ENGINE_DIR', ROOT_DIR . '/engine'); include ENGINE_DIR . '/data/config.php'; if ($config['http_home_url'] == "") { $config['http_home_url'] = explode("engine/ajax/message.php", $_SERVER['PHP_SELF']); $config['http_home_url'] = reset($config['http_home_url']); $config['http_home_url'] = "http://" . $_SERVER['HTTP_HOST'] . $config['http_home_url']; } require_once ENGINE_DIR . '/classes/mysql.php'; require_once ENGINE_DIR . '/data/dbconfig.php'; require_once ENGINE_DIR . '/modules/functions.php'; dle_session(); require_once ENGINE_DIR . '/classes/parse.class.php'; require_once ENGINE_DIR . '/modules/sitelogin.php'; require_once ROOT_DIR . '/language/' . $config['langs'] . '/website.lng'; //################# Определение групп пользователей $user_group = get_vars("usergroup"); 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(); } if (!$is_logged) { die("error"); }
public function rota_system() { // carregar variaveis globais require ROOT_WEBSITE . "scripts/load_globals.php"; $authenticated = false; $authentication = new cadastro_controller(); $this->authenticated = $authentication->authenticate($uri); if (!get_vars('ponto') || !get_vars('destino') || !get_vars('lat') || !get_vars('lng') || !get_vars('onibus')) { header("Location: " . $base_url_site); } $complement_title = htmlspecialchars("Meu Destino - " . get_vars('ponto')); $meta_description = htmlspecialchars(get_vars('ponto')); $css_files = write_css_header(array("rota")); $js_files = write_js_header(array("rota")); $google_api = true; include $template_directory . "header.inc.php"; include $template_directory . "rota.inc.php"; include $template_directory . "footer.inc.php"; }