function init() { // Cannot edit with a "remember me" login. if ($_SESSION["cookie_login"]) { header('Location: ' . encode_url("login.php?type=simple&url=" . urlencode("edit_interface.php?" . decode_url($QUERY_STRING)), false)); exit; } // Coming soon ??? $this->has_familysearch = file_exists('modules/FamilySearch/familySearchWrapper.php'); if ($this->has_familysearch) { require_once 'modules/FamilySearch/familySearchWrapper.php'; } // The PID can come from a URL or a form $this->pid = safe_REQUEST($_REQUEST, 'pid', PGV_REGEX_XREF); $this->person = Person::getInstance($this->pid); $this->server_list = get_server_list(); $this->gedcom_list = get_all_gedcoms(); unset($this->gedcom_list[PGV_GED_ID]); // Other input values come from the form $this->form_txtPID = safe_POST('txtPID', PGV_REGEX_XREF); $this->form_cbRelationship = safe_POST('cbRelationship'); $this->form_location = safe_POST('location'); $this->form_txtURL = safe_POST('txtURL', PGV_REGEX_URL); $this->form_txtTitle = safe_POST('txtTitle', '[^<>"%{};]+'); $this->form_txtGID = safe_POST('txtGID', $this->gedcom_list); $this->form_txtUsername = safe_POST('txtUsername', PGV_REGEX_USERNAME); $this->form_txtPassword = safe_POST('txtPassword', PGV_REGEX_PASSWORD); $this->form_cbExistingServers = safe_POST('cbExistingServers', array_keys($this->server_list)); $this->form_txtCB_Title = safe_POST('txtCB_Title', '[^<>"%{};]+'); $this->form_txtCB_GID = safe_POST('txtCB_GID', $this->gedcom_list); $this->form_txtFS_URL = safe_POST('txtFS_URL', PGV_REGEX_URL); $this->form_txtFS_Title = safe_POST('txtFS_Title', '[^<>"%{};]+'); $this->form_txtFS_GID = safe_POST('txtFS_GID', $this->gedcom_list); $this->form_txtFS_Username = safe_POST('txtFS_Username', PGV_REGEX_USERNAME); $this->form_txtFS_Password = safe_POST('txtFS_Password', PGV_REGEX_PASSWORD); if (is_null($this->form_location)) { if ($this->server_list) { $this->form_location = 'existing'; } else { $this->form_location = 'remote'; } } }
for ($i = 0; $i < count($cookies); $i++) { $j = $i & 1 ? ' class="shade"' : ''; echo "<tr><td{$j}>{$cookies[$i][0]}</td><td{$j}>{$cookies[$i][1]}</td><td{$j}>{$cookies[$i][2]}</td>" . "<td{$j}>" . wordwrap($cookies[$i][3], 15, ' ') . "</td><td{$j}><a href=" . '"?action=cookies&delete=' . md5(implode('', $cookies[$i])) . '">delete</a></td></tr>'; } echo '</table>'; } else { echo '<div class="error">No cookies available.</div>'; } } else { if ($_GET['action'] == 'auth' && isset($_GET['server'], $_GET['realm'], $_GET['auth_url'])) { echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="server" value="' . $_GET['server'] . '" />'; echo '<input type="hidden" name="realm" value="' . $_GET['realm'] . '" />'; echo '<input type="hidden" name="auth_url" value="' . $_GET['auth_url'] . '" />'; echo '<table style="width: 100%">'; echo '<tr><td colspan="2" class="option">Enter user name and password for <b>' . decode_url($_GET['realm']) . '</b> at <i>' . decode_url($_GET['server']) . '</i></td></tr>'; echo '<tr><td width="30%" class="option">User name</td><td class="option"><input type="text" name="username" value="" /></td></tr>'; echo '<tr><td width="30%" class="option">Password</td><td class="option"><input type="password" name="password" value="" /></td></tr>'; echo '<tr><td colspan="2" style="text-align: center"><input type="submit" value="OK" /></td></tr>'; echo '</table>'; echo '</form>'; } } } else { ?> <form name="<?php echo $PHProxy->config['proxy_url_form_name']; ?> " method="get" action="<?php echo $_SERVER['PHP_SELF'];
$query = preg_split('#([&;])#', $_url_parts['query'], -1, PREG_SPLIT_DELIM_CAPTURE); for ($i = 0, $count = count($query); $i < $count; $_request_headers .= implode('=', array_map('urlencode', array_map('urldecode', explode('=', $query[$i])))) . (isset($query[++$i]) ? $query[$i] : ''), $i++) { } } $_request_headers .= " HTTP/1.0\r\n"; $_request_headers .= 'Host: ' . $_url_parts['host'] . $_url_parts['port_ext'] . "\r\n"; if (isset($_SERVER['HTTP_USER_AGENT'])) { $_request_headers .= 'User-Agent: ' . $_SERVER['HTTP_USER_AGENT'] . "\r\n"; } if (isset($_SERVER['HTTP_ACCEPT'])) { $_request_headers .= 'Accept: ' . $_SERVER['HTTP_ACCEPT'] . "\r\n"; } else { $_request_headers .= "Accept: */*;q=0.1\r\n"; } if ($_flags['show_referer'] && isset($_SERVER['HTTP_REFERER']) && preg_match('#^\\Q' . $_script_url . '?' . $_config['url_var_name'] . '=\\E([^&]+)#', $_SERVER['HTTP_REFERER'], $matches)) { $_request_headers .= 'Referer: ' . decode_url($matches[1]) . "\r\n"; } if (!empty($_COOKIE)) { $_cookie = ''; $_auth_creds = array(); foreach ($_COOKIE as $cookie_id => $cookie_content) { $cookie_id = explode(';', rawurldecode($cookie_id)); $cookie_content = explode(';', rawurldecode($cookie_content)); if ($cookie_id[0] === 'COOKIE') { $cookie_id[3] = str_replace('_', '.', $cookie_id[3]); //stupid PHP can't have dots in var names if (count($cookie_id) < 4 || $cookie_content[1] == 'secure' && $_url_parts['scheme'] != 'https') { continue; } if ((preg_match('#\\Q' . $cookie_id[3] . '\\E$#i', $_url_parts['host']) || strtolower($cookie_id[3]) == strtolower('.' . $_url_parts['host'])) && preg_match('#^\\Q' . $cookie_id[2] . '\\E#', $_url_parts['path'])) { $_cookie .= ($_cookie != '' ? '; ' : '') . (empty($cookie_id[1]) ? '' : $cookie_id[1] . '=') . $cookie_content[0];
function set_url($url) { $this->url = decode_url($url); if (strpos($this->url, '://') === false) { $this->url = 'http://' . $this->url; } if ($this->parse_url($this->url, $this->url_segments)) { $this->base = $this->url_segments; if (!$this->is_allowed_host()) { exit; } } else { $this->trigger_error('Please supply a valid URL'); } }
for ($i = 0; $i < count($cookies); $i++) { $j = $i & 1 ? ' class="shade"' : ''; echo "<tr><td{$j}>{$cookies[$i][0]}</td><td{$j}>{$cookies[$i][1]}</td><td{$j}>{$cookies[$i][2]}</td>" . "<td{$j}>" . wordwrap($cookies[$i][3], 15, ' ') . "</td><td{$j}><a href=" . '"?action=cookies&delete=' . md5(implode('', $cookies[$i])) . '">delete</a></td></tr>'; } echo '</table>'; } else { echo '<div class="error">Cookies не доступны.</div>'; } } else { if ($_GET['action'] == 'auth' && isset($_GET['server'], $_GET['realm'], $_GET['auth_url'])) { echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="server" value="' . $_GET['server'] . '" />'; echo '<input type="hidden" name="realm" value="' . $_GET['realm'] . '" />'; echo '<input type="hidden" name="auth_url" value="' . $_GET['auth_url'] . '" />'; echo '<table style="width: 100%">'; echo '<tr><td colspan="2" class="option">Введите логин и пароль для <b>' . decode_url($_GET['realm']) . '</b> at <i>' . decode_url($_GET['server']) . '</i></td></tr>'; echo '<tr><td width="30%" class="option">Логин</td><td class="option"><input type="text" name="username" value="" /></td></tr>'; echo '<tr><td width="30%" class="option">Пароль</td><td class="option"><input type="password" name="password" value="" /></td></tr>'; echo '<tr><td colspan="2" style="text-align: center"><input type="submit" value="OK" /></td></tr>'; echo '</table>'; echo '</form>'; } } } else { ?> <form name="<?php echo $PHProxy->config['proxy_url_form_name']; ?> " method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>
<?php /* User side header no predefinded templates, Created: js, 2001.08.13 ___________________________________________________________ This file is part of flexiUpdate, content control framework Copyright (c) 2001 UAB "Alternatyvus valdymas" http://www.avc.lt <*****@*****.**> */ /* CHANGES: 2001.09.07 js * left just different part from header.inc.php */ decode_url();
function encode_url($url, $entities = true) { $url = decode_url($url, $entities); // Make sure we don't do any double conversions $url = str_replace(array(' ', '+', '@#', '"', "'"), array('%20', '%2b', '@%23', '%22', '%27'), $url); if ($entities) { $url = htmlspecialchars($url, ENT_COMPAT, 'UTF-8'); } return $url; }
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> <head> <title>PHProxy</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <link rel="stylesheet" type="text/css" href="style.css" media="all" /> <script src="javascript.js" type="text/javascript"></script> </head> <body> <div id="container"> <div class="title">PHProxy</div> <?php if (isset($_GET['error'])) { echo '<div class="error"><b>Error:</b> ' . htmlspecialchars($_GET['error']) . '</div>'; if (isset($_GET['retry'])) { echo '<div class="error"><a href="' . $PHProxy->proxify_url(decode_url($_GET['retry'])) . '">Retry</a></div>'; } } if (isset($_GET['action'])) { if ($_GET['action'] == 'cookies') { $cookies = $PHProxy->get_cookies('COOKIE', false); if (!empty($cookies)) { echo '<table style="width: 100%">'; echo '<tr><td class="option" colspan="5"><a href="?action=cookies&delete=all">Clear All Cookies</a></td></tr>'; echo '<tr><td class="head">Name</td><td class="head">Domain</td><td class="head">Path</td><td class="head">Value</td><td class="head">Action</td></tr>'; for ($i = 0; $i < count($cookies); $i++) { $j = $i & 1 ? ' class="shade"' : ''; echo "<tr><td{$j}>{$cookies[$i][0]}</td><td{$j}>{$cookies[$i][1]}</td><td{$j}>{$cookies[$i][2]}</td>" . "<td{$j}>" . wordwrap($cookies[$i][3], 15, ' ') . "</td><td{$j}><a href=" . '"?action=cookies&delete=' . md5(implode('', $cookies[$i])) . '">delete</a></td></tr>'; } echo '</table>'; } else {
* along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @author Dparker * @package PhpGedView * @subpackage Admin * @version $Id$ */ require_once 'config.php'; require_once "includes/functions/functions_edit.php"; if (!PGV_USER_IS_ADMIN) { header("Location: login.php?url=dir_editor.php"); exit; } if ($_SESSION["cookie_login"]) { header("Location: " . encode_url("login.php?type=simple&ged={$GEDCOM}&url=" . urlencode("dir_editor.php?" . decode_url($QUERY_STRING)), false)); exit; } function full_rmdir($dir) { if (!is_writable($dir)) { if (!@chmod($dir, 0777)) { return FALSE; } } $d = dir($dir); while (FALSE !== ($entry = $d->read())) { if ($entry == '.' || $entry == '..') { continue; } $entry = $dir . '/' . $entry;
/** * get the menu with links change to each theme * @return Menu the menu item */ static function &getThemeMenu() { global $SEARCH_SPIDER, $ALLOW_THEME_DROPDOWN, $ALLOW_USER_THEMES, $THEME_DIR, $pgv_lang; $current = $THEME_DIR; foreach (get_theme_names() as $themedir) { if ($themedir == get_user_setting(PGV_USER_ID, 'theme')) { $current = $themedir; } } if ($ALLOW_THEME_DROPDOWN && $ALLOW_USER_THEMES && !$SEARCH_SPIDER) { isset($_SERVER["QUERY_STRING"]) == true ? $tqstring = "?" . $_SERVER["QUERY_STRING"] : ($tqstring = ""); $frompage = $_SERVER["SCRIPT_NAME"] . decode_url($tqstring); if (isset($_REQUEST['mod'])) { if (!strstr("?", $frompage)) { if (!strstr("%3F", $frompage)) { } else { $frompage .= "?"; } } if (!strstr("&mod", $frompage)) { $frompage .= "&mod=" . $_REQUEST['mod']; } } if (substr($frompage, -1) == "?") { $frompage = substr($frompage, 0, -1); } if (substr($frompage, -1) == "&") { $frompage = substr($frompage, 0, -1); } $menu = new Menu($pgv_lang['change_theme']); $menu->addClass('thememenuitem', 'thememenuitem_hover', 'themesubmenu', "icon_small_theme"); // $menu->print_menu = null; foreach (get_theme_names() as $themename => $themedir) { $submenu = new Menu($themename, encode_url("themechange.php?frompage={$frompage}&mytheme={$themedir}")); if ($themedir == $current) { $submenu->addClass('favsubmenuitem_selected', 'favsubmenuitem_hover'); } else { $submenu->addClass('favsubmenuitem', 'favsubmenuitem_hover'); } $menu->addSubMenu($submenu); } return $menu; } else { return new Menu('', ''); } }
for ($i = 0, $count = count($query); $i < $count; $GLOBALS['_request_headers'] .= implode('=', array_map('urlencode', array_map('urldecode', explode('=', $query[$i])))) . (isset($query[++$i]) ? $query[$i] : ''), $i++) { } } $GLOBALS['_request_headers'] .= " HTTP/1.0\r\n"; $GLOBALS['_request_headers'] .= 'Host: ' . $GLOBALS['_url_parts']['host'] . $GLOBALS['_url_parts']['port_ext'] . "\r\n"; if (isset($_SERVER['HTTP_USER_AGENT'])) { $GLOBALS['_request_headers'] .= 'User-Agent: ' . $_SERVER['HTTP_USER_AGENT'] . ' (eyeNav ' . EYEOS_VERSION . ')' . "\r\n"; // oneye } if (isset($_SERVER['HTTP_ACCEPT'])) { $GLOBALS['_request_headers'] .= 'Accept: ' . $_SERVER['HTTP_ACCEPT'] . "\r\n"; } else { $GLOBALS['_request_headers'] .= "Accept: */*;q=0.1\r\n"; } if ($GLOBALS['_flags']['show_referer'] && isset($_SERVER['HTTP_REFERER']) && preg_match('#^\\Q' . $GLOBALS['_script_url'] . '&' . $GLOBALS['_config']['url_var_name'] . '=\\E([^&]+)#', $_SERVER['HTTP_REFERER'], $matches)) { $GLOBALS['_request_headers'] .= 'Referer: ' . decode_url($matches[1]) . "\r\n"; } if (!empty($_COOKIE)) { $_cookie = ''; $GLOBALS['_auth_creds'] = array(); foreach ($_COOKIE as $cookie_id => $cookie_content) { $cookie_id = explode(';', rawurldecode($cookie_id)); $cookie_content = explode(';', rawurldecode($cookie_content)); if ($cookie_id[0] === 'COOKIE') { $cookie_id[3] = str_replace('_', '.', $cookie_id[3]); //stupid PHP can't have dots in var names if (count($cookie_id) < 4 || $cookie_content[1] == 'secure' && $GLOBALS['_url_parts']['scheme'] != 'https') { continue; } if ((preg_match('#\\Q' . $cookie_id[3] . '\\E$#i', $GLOBALS['_url_parts']['host']) || strtolower($cookie_id[3]) == strtolower('.' . $GLOBALS['_url_parts']['host'])) && preg_match('#^\\Q' . $cookie_id[2] . '\\E#', $GLOBALS['_url_parts']['path'])) { $_cookie .= ($_cookie != '' ? '; ' : '') . (empty($cookie_id[1]) ? '' : $cookie_id[1] . '=') . $cookie_content[0];
function set_url($url) { $this->url = decode_url($url); if (strpos($this->url, '://') === false) { $this->url = 'http://' . $this->url; } if ($this->parse_url($this->url, $this->url_segments)) { $this->base = $this->url_segments; if (!$this->is_allowed_host()) { exit; } } else { $this->trigger_error('Введите верный Адрес.'); } }
if (isset($_GET['till'], $_GET['time_till'])) { $from = isset($_GET['from']) && strlen(trim($_GET['from'])) > 0 ? decode_url(trim($_GET['from'])) : null; $till = decode_url($_GET['till']); $time_from = isset($_GET['time_from']) && strlen(trim($_GET['time_from'])) > 0 ? str_replace('-', '', trim(decode_url($_GET['time_from']))) : null; $time_till = str_replace('-', '', decode_url($_GET['time_till'])); $name = isset($_GET['name']) && strlen(trim($_GET['name'])) > 0 ? stripslashes(decode_url(trim($_GET['name']))) : null; $text = isset($_GET['text']) ? stripslashes(decode_url($_GET['text'])) : null; $allday = isset($_GET['allday']) ? (int) $_GET['allday'] : null; $priority = isset($_GET['priority']) ? (int) $_GET['priority'] : null; $dbtime_from = isset($from, $time_from) && strlen($from) == 8 && strlen($time_from) == 5 ? tosql(mktime(substr($time_from, 0, 2), substr($time_from, 3, 2), 0, substr($from, 4, 2), substr($from, 6, 2), substr($from, 0, 4)) - $tzone) : null; $dbtime_till = isset($till, $time_till) && strlen($till) == 8 && strlen($time_till) == 5 ? tosql(mktime(substr($time_till, 0, 2), substr($time_till, 3, 2), 0, substr($till, 4, 2), substr($till, 6, 2), substr($till, 0, 4)) - $tzone) : null; $new_calendar_id = isset($_GET['new_calendar_id']) ? (int) $_GET['new_calendar_id'] : null; SQL::UpdateEvent($settings->DbPrefix, $event_id, $calendar_id, $name, $text, $dbtime_from, $dbtime_till, $allday, $priority, $new_calendar_id); } else { if (isset($_GET['name'])) { $name = strlen(trim($_GET['name'])) ? stripslashes(decode_url(trim($_GET['name']))) : null; if ($name !== null) { SQL::UpdateEvent($settings->DbPrefix, $event_id, $calendar_id, $name); } } else { $errorCode = 3; } } } } else { $errorCode = 5; } if ($errorCode === 0) { $select = SQL::Select($settings->DbPrefix, 'acal_events', 'event_id', $event_id); if ($select && count($select) > 0) { $select[0]['event_timefrom'] = addsql($select[0]['event_timefrom'], $tzone);
<?php include "method/function.php"; $url = "?mod=loket_transaksi_modul"; echo "URL : " . $url . "<br/><br/>"; echo "Encode URL " . encode_url($url) . "<br/><br/>"; echo "Decode URL " . decode_url(encode_url($url)) . "<br/><br/>";