Esempio n. 1
0
 function Refresh($toHere = 'logout.php', $session_id = '', $domain = 'default')
 {
     global $DCLINFO, $DCLUI;
     if (!empty($_SERVER)) {
         extract($_SERVER);
     }
     $bIsLogin = substr($toHere, 0, 10) == 'logout.php';
     if ($bIsLogin) {
         $theCookie = '';
         if (isset($QUERY_STRING) && $QUERY_STRING != '') {
             $toHere .= sprintf('%srefer_to=%s', strpos($toHere, '?') > 0 ? '&' : '?', urlencode($QUERY_STRING));
         }
     } else {
         $theCookie = $session_id . '/' . $domain;
     }
     if (DCL_COOKIE_METHOD == 'header') {
         $hdr = '';
         if (DCL_REDIR_METHOD == 'php') {
             $hdr = "Location: {$toHere}\n";
         }
         $hdr .= "Set-Cookie: DCLINFO={$theCookie}\n";
         $hdr .= "\n";
         Header($hdr);
         if ($bIsLogin) {
             exit;
         }
     }
     if (DCL_COOKIE_METHOD == 'php') {
         $httpDomain = '';
         if (ereg('^[0-9]{2,3}\\.[0-9]{2,3}\\.[0-9]{2,3}\\.[0-9]{2,3}$', $HTTP_HOST)) {
             $httpDomain = $HTTP_HOST;
         } else {
             if (ereg('.*\\..*$', $HTTP_HOST)) {
                 $httpDomain = eregi_replace('^www\\.', '', $HTTP_HOST);
                 $httpDomain = '.' . $httpDomain;
             }
         }
         if (($p = strpos($httpDomain, ':')) !== false) {
             $httpDomain = substr($httpDomain, 0, $p);
         }
         SetCookie('DCLINFO', $theCookie, 0, '/', $httpDomain);
         if (DCL_REDIR_METHOD == 'php') {
             Header("Location: {$toHere}\n\n");
             if ($bIsLogin) {
                 exit;
             }
         }
     }
     print '<html><head>';
     if (DCL_COOKIE_METHOD == 'meta') {
         print "<meta http-equiv=\"Set-Cookie\" content=\"DCLINFO={$theCookie}\">";
     }
     print "<meta http-equiv=\"refresh\" content=\"00;URL={$toHere}\">";
     print '</head>';
     if ($bIsLogin) {
         print '<body bgcolor="#FFFFFF"></body></html>';
         exit;
     }
 }
Esempio n. 2
0
 public function delCookie($name)
 {
     try {
         SetCookie($name, "");
     } catch (Exception $e) {
         throw Exeption::ThrowDef('Failed delete cookie var - ' . $e);
     }
 }
Esempio n. 3
0
 function loginout_action()
 {
     SetCookie("comname", "", time() - 286400, "/");
     SetCookie("comid", "", time() - 286400, "/");
     SetCookie("uid", "", time() - 286400, "/");
     SetCookie("username", "", time() - 86400, "/");
     SetCookie("salt", "", time() - 86400, "/");
     $this->wapheader('index.php');
 }
Esempio n. 4
0
	function updateCookie($userSession) {
		SetCookie("spotsession",
				  $userSession['session']['sessionid'] . '.' . $userSession['user']['userid'],
				  time()+60*60*24*30,
				  '', # path: The default value is the current directory that the cookie is being set in.
				  $this->_settings->get('cookie_host'),
				  false,	# Indicates if the cookie should only be transmitted over a secure HTTPS connection from the client.
				  true);	# Only available to the HTTP protocol. This means that the cookie won't be accessible by scripting languages, such as JavaScript.
	} # updateCookie
Esempio n. 5
0
function login($email, $password)
{
    $query = mysql_query("SELECT * FROM users WHERE email='" . $email . "' AND password = '******' AND allowed");
    if ($res = mysql_fetch_array($query)) {
        SetCookie("user", md5($res['email'] . '' . $res["password"]), 0);
        return true;
    } else {
        return false;
    }
}
Esempio n. 6
0
 function session($cache)
 {
     $session = empty($_COOKIE['tsvshop']) ? md5(uniqid(rand())) : $_COOKIE['tsvshop'];
     SetCookie("tsvshop", $session, time() + 7200, "/");
     //set the cookie to remain for 2 hours
     if ($cache) {
         $cache->cache("session", "tsvshop", $session);
     }
     return $session;
 }
Esempio n. 7
0
 public function setCartData()
 {
     $cart_content = serialize($_SESSION['cart']);
     // сериализует  данные корзины из сессии в строку
     SetCookie("cart", $cart_content, time() + 3600 * 24 * 365);
     //записывает сериализованную строку в куки, хранит 1 год
     /* echo "<pre>";
     			var_dump($cart_content);
     			echo "</pre>";*/
 }
Esempio n. 8
0
function login($email, $password)
{
    $query = mysql_query("SELECT * FROM users WHERE email='" . $email . "' AND password = '******' AND allowed");
    if ($res = mysql_fetch_array($query)) {
        mysql_query("INSERT INTO loginlog (user_id,ip) VALUES ('" . $res['id'] . "','" . $_SERVER["REMOTE_ADDR"] . "')");
        SetCookie("user", md5($res['email'] . '' . $res["password"]), 0);
        return true;
    } else {
        return false;
    }
}
Esempio n. 9
0
 function index_action()
 {
     if ($_POST) {
         if ($_POST['femail'] == "" || $_POST['myemail'] == "" || $_POST['authcode'] == "") {
             echo "请完整填写信息!";
             die;
         }
         session_start();
         if (md5($_POST['authcode']) != $_SESSION['authcode']) {
             unset($_SESSION['authcode']);
             echo "验证码不正确!";
             die;
         }
         if ($_COOKIE["sendresume"] == $_POST['id']) {
             echo "请不要频繁发送邮件!同一简历发送间隔为两分钟!";
             die;
         }
         if ($this->config["sy_smtpserver"] == "" || $this->config["sy_smtpemail"] == "" || $this->config["sy_smtpuser"] == "") {
             echo "网站邮件服务器不可用!";
             die;
         }
         if ($this->CheckRegEmail(trim($_POST['femail'])) == false) {
             echo "邮箱格式错误!";
             die;
         }
         $contents = file_get_contents($this->config[sy_weburl] . "/resume/index.php?c=sendresume&id=" . $_POST['id']);
         $smtp = $this->email_set();
         $smtpusermail = $this->config['sy_smtpemail'];
         $myemail = $this->stringfilter($_POST['myemail']);
         $sendid = $smtp->sendmail($_POST['femail'], $smtpusermail, "您的好友" . $myemail . "向您推荐了简历!", $contents, "HTML", "", "", "", $myemail);
         if ($sendid) {
             echo 1;
         } else {
             echo "邮件发送错误 原因:1邮箱不可用 2网站关闭邮件服务";
             die;
         }
         SetCookie("sendresume", $_POST['id'], time() + 120, "/");
         die;
     }
     if ($_GET['id']) {
         $M = $this->MODEL('resume');
         $id = (int) $_GET['id'];
         $user = $M->resume_select($id);
         $this->yunset("Info", $user);
         $data['resume_username'] = $user['username_n'];
         $data['resume_city'] = $user['city_one'] . "," . $user['city_two'];
         $data['resume_job'] = $user['hy'];
         $this->data = $data;
     }
     $this->seo("resume_share");
     $this->yun_tpl(array('resume_share'));
 }
Esempio n. 10
0
 public function han_rand()
 {
     header("Content-type: text/html; charset=utf-8");
     session_start();
     if (empty($_COOKIE['graee_rand'])) {
         $rand = "han_" . rand(100000, 999999) . "_" . mktime();
         //记录到cookie中
         SetCookie("graee_rand", $rand, time() + 3600 * 24);
         //3600秒=1小时 过期时间为24小时
         //记录到session中
         $_SESSION['graee_rand'] = $rand;
         //设置session存活时间
         $lifeTime = 24 * 3600;
         session_set_cookie_params($lifeTime);
     }
 }
Esempio n. 11
0
 function load_account()
 {
     global $sql;
     global $site;
     global $auth;
     /* Sélection de la base de données du site */
     $sql->selection_bd($auth->db_auth);
     $sql->requete("SELECT numchars FROM `realmcharacters` WHERE acctid = '" . $this->sess_id . "'", 0);
     while ($val = $sql->resultat(0, "array")) {
         $this->nb_char = $this->nb_char + $val['numchars'];
     }
     if ($this->nb_char > 0) {
         $this->load_characters();
     }
     $sql->selection_bd($site->db_site);
     $sql->requete("SELECT * FROM `users` WHERE id = '" . $this->sess_id . "'", 0);
     $this->array_user = $sql->resultat(0, "array");
     $this->sess_user = $this->array_user['login'];
     $this->level = $this->array_user['niveau'];
     $this->email = $this->array_user['mail'];
     $sql->requete("SELECT * FROM `voting` WHERE user_ip = '" . $this->ipaddr . "'", 0);
     $val = $sql->resultat(0, "array");
     if (!$val) {
         $sql->requete("INSERT INTO `voting` (`user_ip`) VALUES ('" . $this->ipaddr . "')", 0);
         $sql->requete("SELECT * FROM `voting` WHERE user_ip = '" . $this->ipaddr . "'", 0);
         $val = $sql->resultat(0, "array");
     }
     $this->array_voting = $val;
     $sql->requete("SELECT * FROM `voting_points` WHERE id = '" . $this->sess_id . "'", 0);
     $this->array_voting_points = $sql->resultat(0, "array");
     $sql->requete("UPDATE users SET last_ip = '" . $this->ipaddr . "' WHERE id = '" . $this->sess_id . "'", 0);
     if ($this->cookie) {
         $p = SHA1($this->sess_user);
         SetCookie("conection1", $p, time() + 3600 * 48);
         SetCookie("conection2", $rmd5, time() + 3600 * 48);
     }
 }
Esempio n. 12
0
<?php

/*
Copyright Intermesh 2003
Author: Merijn Schering <*****@*****.**>
Version: 1.0 Release date: 08 July 2003

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
*/
require "../Group-Office.php";
$GO_SECURITY->authenticate();
if (isset($_REQUEST['search_field'])) {
    SetCookie("user_search_field", $_REQUEST['search_field'], time() + 3600 * 24 * 365, "/", "", 0);
    $_COOKIE['user_search_field'] = $_REQUEST['search_field'];
}
$GO_HEADER['body_arguments'] = 'class="TableInside"';
require $GO_THEME->theme_path . "header.inc";
echo '<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td class="TableInside" valign="top">';
if (isset($_REQUEST['project_acl'])) {
    require $GO_LANGUAGE->get_language_file('projects');
}
$acl = new acl($_REQUEST['acl_id'], isset($_REQUEST['acl_table']) ? $_REQUEST['acl_table'] : 'acl');
echo '</td></tr></table>';
require $GO_THEME->theme_path . "footer.inc";
Esempio n. 13
0
	private function GetParamsFromCookie()
	{
		$cookieName = COption::GetOptionString("main", "cookie_name", "FREETRIX_SM")."_ADM_FLT_PARAMS";
		if(!isset($_COOKIE[$cookieName]) || $_COOKIE[$cookieName] == "")
			return false;

		$aParams = explode(",",$_COOKIE[$cookieName]);
		SetCookie($cookieName,'');

		if(empty($aParams))
			return false;

		$filterId = "";

		foreach ($aParams as $key => $aValue)
		{
			$aParam = explode(":",$aValue);
			unset($aParams[$key]);

			if(!empty($aParam) && $aParam[0] != "filter_id")
				$aParams[$aParam[0]] = $aParam[1];
			elseif($aParam[0] == "filter_id")
				$filterId = $aParam[1];
		}

		if($filterId == "")
			return false;

		foreach ($aParams as $paramName => $value)
			$_SESSION[self::SESS_PARAMS_NAME][$filterId][$paramName] = $value;

		return true;
	}
Esempio n. 14
0
 function header_end()
 {
     SetCookie("bNewsDate", $this->_TIME, $this->_TIME + 24 * 60 * 60);
     return "\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t</div>";
 }
Esempio n. 15
0
    exit("Stop! Forbidden");
}
if (empty($_GET)) {
    // Главная
} else {
    // Не главная
}
if (!empty($_POST["update"])) {
    SetCookie("new_version_system", "", time() - 3600 * 10000);
}
if (!empty($_POST["menu_as"])) {
    // меню админки
    if (isset($_COOKIE["menu_as"])) {
        SetCookie("menu_as", "", time() - 3600 * 10000);
    } else {
        SetCookie("menu_as", "true", time() + 3600 * 24 * 7, "/");
    }
}
/*$arr = Array(
	"default" => "blog"
);
$db = New DB();
$db -> installSettings("public_applications", $arr);*/
?>
<!DOCTYPE html>
<html lang="ru">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>APPS-SYSTEM</title>
Esempio n. 16
0
 public function get_enter()
 {
     if (!Bootstrap::$main->session('referer') && $this->id) {
         $id = $this->id;
         $r = explode('/', $this->data('referer'));
         if (isset($r[2])) {
             $id .= '-' . $r[2];
         }
         $referer = ['s' => substr($id, 0, 32)];
         Bootstrap::$main->session('referer', $referer);
         @SetCookie('referer', base64_encode(json_encode($referer)), Bootstrap::$main->now + 60 * 24 * 3600, '/');
     }
     return $this->status(Bootstrap::$main->session('referer'), true, 'enter');
 }
Esempio n. 17
0
/*
  Copyright Intermesh 2003
  Author: Merijn Schering <*****@*****.**>
  Version: 1.0 Release date: 08 July 2003

  This program is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published by the
  Free Software Foundation; either version 2 of the License, or (at your
  option) any later version.
*/
require "../../Group-Office.php";
$GO_SECURITY->authenticate();
//if the user is authorising but it's logged in under another user log him out first.
if (isset($_REQUEST['requested_user_id']) && $_REQUEST['requested_user_id'] != $GO_SECURITY->user_id) {
    SetCookie("GO_UN", "", time() - 3600, "/", "", 0);
    SetCookie("GO_PW", "", time() - 3600, "/", "", 0);
    unset($_SESSION);
    unset($_COOKIES);
    $GO_SECURITY->logout();
    $GO_SECURITY->authenticate();
}
$return_to = $GO_CONFIG->host . 'configuration/';
require $GO_LANGUAGE->get_base_language_file('account');
$page_title = $acTitle;
$tabtable = new tabtable('account', $acManager, '100%', '300');
$tabtable->add_tab('profile.inc', $acProfile);
$task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
switch ($task) {
    case 'accept':
        if (isset($_REQUEST['requested_user_id']) && isset($_REQUEST['authcode'])) {
            if ($user = $GO_USERS->get_user($_REQUEST['requesting_user_id'])) {
Esempio n. 18
0
function remember_this_view()
{
    global $server_url, $REQUEST_URI;
    if (empty($REQUEST_URI)) {
        $REQUEST_URI = $_SERVER["REQUEST_URI"];
    }
    if (empty($server_url)) {
        SetCookie("webcalendar_last_view", $REQUEST_URI);
    } else {
        SetCookie("webcalendar_last_view", $REQUEST_URI, 0, $server_url);
    }
}
Esempio n. 19
0
<?php

require_once "ZabbixApi.class.php";
require_once "zabbix_config.php";
//clear cookie
if (isset($_POST['clearstatus'])) {
    SetCookie("itemkey", '', time() - 3600);
    SetCookie("stime", '', time() - 3600);
    SetCookie("endtime", '', time() - 3600);
    SetCookie("order_key", '', time() - 3600);
    SetCookie("order_type", '', time() - 3600);
    return true;
} else {
    //获取传过来的参数
    if (isset($_POST['changeType'])) {
        $changedayList = array('1hour' => 3600, '2hour' => 7200, '1days' => 3600 * 24, '2days' => 3600 * 48, '7days' => 3600 * 24 * 7, '30days' => 3600 * 24 * 30, '1years' => 3600 * 24 * 365, '2years' => 3600 * 24 * 365 * 2);
        $changeType = $_POST['changeType'];
        $endTime = time();
        $beginTime = $endTime - $changedayList[$changeType];
        echo "{endTime:" . json_encode(date("Y-m-d H:i:s", $endTime)) . ",beginTime:" . json_encode(date("Y-m-d H:i:s", $beginTime)) . "}";
        exit;
    }
    global $zabbix_api_config;
    $url_http = dirname(dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER["REQUEST_URI"]));
    $zabbixApi = new ZabbixApi($url_http . '/' . trim($zabbix_api_config['api_url']), trim($zabbix_api_config['user']), trim($zabbix_api_config['passowrd']));
    $groupid = isset($_GET["groupid"]) ? $_GET["groupid"] : 0;
    if ($groupid > 0) {
        //根据分组id查询分组下的机器
        $hosts = $zabbixApi->hostGet(array("output" => "extend", "monitored_hosts" => true, "groupids" => array($groupid), "sortfield" => array("host"), "sortorder" => array("ASC")));
        $new_list = array();
        foreach ($hosts as $each_host) {
Esempio n. 20
0
<?php

/* $Id: pref.php,v 1.149.2.17 2013/01/24 21:10:19 cknudsen Exp $ */
include_once 'includes/init.php';
require_valide_referring_url();
//force the css cache to clear by incrementing webcalendar_csscache cookie
$webcalendar_csscache = 1;
if (isset($_COOKIE['webcalendar_csscache'])) {
    $webcalendar_csscache += $_COOKIE['webcalendar_csscache'];
}
SetCookie('webcalendar_csscache', $webcalendar_csscache);
function save_pref($prefs, $src)
{
    global $my_theme, $prefuser;
    while (list($key, $value) = each($prefs)) {
        if ($src == 'post') {
            $setting = substr($key, 5);
            $prefix = substr($key, 0, 5);
            if ($prefix != 'pref_') {
                continue;
            }
            // validate key name.  should start with "pref_" and not include
            // any unusual characters that might cause SQL injection
            if (!preg_match('/pref_[A-Za-z0-9_]+$/', $key)) {
                die_miserable_death(str_replace('XXX', $key, translate('Invalid setting name XXX.')));
            }
        } else {
            $setting = $key;
            $prefix = 'pref_';
        }
        //echo "Setting = $setting, key = $key, prefix = $prefix<br />\n";
Esempio n. 21
0
function phorum_login_user($sessid, $userid = 0)
{
    global $DB, $q, $pho_main;
    if (!isset($_COOKIE["phorum_auth"])) {
        AddGetPostVars("phorum_auth", "{$sessid}");
    }
    // **TODO: We should make this time configurable
    SetCookie("phorum_auth", "{$sessid}", time() + 86400 * 365);
    if ($userid) {
        $SQL = "update {$pho_main}" . "_auth set sess_id='{$sessid}' where id={$userid}";
        $q->query($DB, $SQL);
    }
}
Esempio n. 22
0
		</tr>
	</table>

	<?php 
        echo $this->FormClose();
    } else {
        // user is not logged in
        // is user trying to log in or register?
        if ($_REQUEST["action"] == "login") {
            // if user name already exists, check password
            if ($existingUser = $this->LoadUser($_POST["name"])) {
                // check password
                if ($existingUser["password"] == md5($_POST["password"])) {
                    $this->SetUser($existingUser, 0);
                    SetCookie("name", $existingUser["name"], 0, $this->CookiePath);
                    SetCookie("password", $existingUser["password"], 0, $this->CookiePath);
                    $this->Redirect($this->href('', '', 'action=checklogged', false));
                } else {
                    $error = "Mauvais mot de passe&nbsp;!";
                }
            }
        } elseif ($_REQUEST['action'] == 'checklogged') {
            $error = 'Vous devez accepter les cookies pour pouvoir vous connecter.';
        }
        echo $this->FormOpen();
        ?>
	<input type="hidden" name="action" value="login" />
	<table>
		<tr>
			<td></td>
			<td><?php 
Esempio n. 23
0
//}
#-------------------------------------------------------------------------------
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/Standard.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/DOM.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/HTTP.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/CheckBox.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/FormEdit.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/CtrlEnterEvent.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/Ajax/Window.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/Ajax/AutoComplite.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{others/jQuery/core.js}')));
#-------------------------------------------------------------------------------
$DOM->AddChild('Head', new Tag('LINK', array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => 'SRC:{others/jQuery/smoothness/jquery-ui-custom.css}')));
#-------------------------------------------------------------------------------
$DOM->AddHTML('Floating', TemplateReplace('Triggers.DOM.Before.Base.TABLE'));
#-------------------------------------------------------------------------------
$DOM->AddHTML('Floating', TemplateReplace('Triggers.DOM.Before.Base.DIV'));
#-------------------------------------------------------------------------------
if (isset($_COOKIE['Eval'])) {
    #-------------------------------------------------------------------------------
    $Eval = $_COOKIE['Eval'];
    #-------------------------------------------------------------------------------
    $DOM->AddAttribs('Body', array('onload' => $Eval));
    #-------------------------------------------------------------------------------
    if (!SetCookie('Eval', $Eval, Time() - 86400, '/')) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
Esempio n. 24
0
    }
    if (!isset(${$new_cookie})) {
        ${$new_cookie} = '0';
    }
    $use_haveread = false;
    if (isset(${$haveread_cookie})) {
        $arr = explode(".", ${$haveread_cookie});
        $old_message = reset($arr);
        array_walk($arr, "explode_haveread");
        $use_haveread = true;
    } else {
        $old_message = ${$new_cookie};
    }
    if (isset($collapse)) {
        ${$phcollapse} = $collapse;
        SetCookie("phorum-collapse-{$ForumTableName}", $collapse, time() + 31536000);
    } elseif (!isset(${$phcollapse})) {
        ${$phcollapse} = $ForumCollapse;
    }
} else {
    ${$phflat} = $ForumFlat;
    if (isset($collapse)) {
        ${$phcollapse} = $collapse;
    } else {
        ${$phcollapse} = $ForumCollapse;
    }
}
if ($DB->type == "postgresql") {
    $limit = "";
    $q->query($DB, "set QUERY_LIMIT TO '{$ForumDisplay}'");
} else {
Esempio n. 25
0
#-------------------------------------------------------------------------------
if (Is_Error(System_Load('classes/DOM.class.php', 'libs/Server.php'))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
if (isset($GLOBALS['__USER'])) {
    #-------------------------------------------------------------------------------
    $__USER = $GLOBALS['__USER'];
    #-------------------------------------------------------------------------------
    if (!SetCookie('OwnerID', $__USER['ID'])) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
    $_COOKIE['OwnerID'] = $__USER['ID'];
    #-------------------------------------------------------------------------------
    if (!SetCookie('IsManaged', 'yes')) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
    $_COOKIE['IsManaged'] = 'yes';
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Links =& Links();
# Коллекция ссылок
#-------------------------------------------------------------------------------
$DOM = new DOM();
#-------------------------------------------------------------------------------
$Links['DOM'] =& $DOM;
#-------------------------------------------------------------------------------
Esempio n. 26
0
 function loginout_action()
 {
     SetCookie("uid", "", time() - 86400, "/");
     SetCookie("username", "", time() - 86400, "/");
     SetCookie("usertype", "", time() - 86400, "/");
     SetCookie("salt", "", time() - 86400, "/");
     SetCookie("shell", "", time() - 86400, "/");
     $this->wapheader('../index.php');
 }
Esempio n. 27
0
    } elseif ($user == 0) {
        del_user_cookie();
        if (isset($_SESSION['username'])) {
            unset($_SESSION['username']);
        }
        $smarty->assign('signin_error', $smarty->get_config_vars('Wrong_password'));
    } else {
        // Имя пользователя и пароль совпадают
        $_SESSION['username'] = $user['name'];
        $_SESSION['shapass'] = $usersend_pass;
        $_REQUEST['account'] = 'signin_true';
        $_POST['remember_me'] = isset($_POST['remember_me']) ? $_POST['remember_me'] : 'no';
        if ($_POST['remember_me'] == 'yes') {
            // Запоминаем пользователя
            $remember_time = time() + 3000000;
            SetCookie('remember_me', $_POST['username'] . $usersend_pass, $remember_time);
        } else {
            del_user_cookie();
        }
    }
}
switch ($_REQUEST['account']) {
    case '':
        // TODO: Настройки аккаунта (Account Settings)
        break;
    case 'signin_false':
    case 'signin':
        // Вход в систему
        $smarty->assign('register', $AoWoWconf['register']);
        $smarty->display('signin.tpl');
        break;
Esempio n. 28
0
 /**
  * THE BIG EVIL NASTY ONE!
  *
  * @uses	Wakka::Footer()
  * @uses	Wakka::GetUser()
  * @uses	Wakka::GetCookie()
  * @uses	Wakka::GetMicroTime()
  * @uses	Wakka::Handler()
  * @uses	Wakka::Header()
  * @uses	Wakka::Href()
  * @uses	Wakka::LoadAllACLs()
  * @uses	Wakka::LoadPage()
  * @uses	Wakka::LoadUser()
  * @uses	Wakka::LogReferrer()
  * @uses	Wakka::ReadInterWikiConfig()
  * @uses	Wakka::Redirect()
  * @uses	Wakka::SetCookie()
  * @uses	Wakka::SetUser()
  * @uses	Wakka::SetPage()
  * @uses	Config::$root_page
  * @param $tag
  * @param $method
  * @return unknown_type
  */
 function Run($tag, $method = '')
 {
     $newtag = '';
     // Set default cookie path
     $base_url_path = preg_replace('/wikka\\.php/', '', $_SERVER['SCRIPT_NAME']);
     $this->wikka_cookie_path = '/' == $base_url_path ? '/' : substr($base_url_path, 0, -1);
     // do our stuff!
     $this->wikka_url = (bool) $this->GetConfigValue('rewrite_mode') ? WIKKA_BASE_URL : WIKKA_BASE_URL . WIKKA_URL_EXTENSION;
     $this->config['base_url'] = $this->wikka_url;
     #backward compatibility
     if (!($this->handler = trim($method))) {
         $this->handler = 'show';
     }
     if (!($this->tag = trim($tag))) {
         $this->Redirect($this->Href('', $this->GetConfigValue('root_page')));
     }
     if ($this->GetUser()) {
         $this->registered = true;
     } else {
         if ($user = $this->LoadUser($this->GetCookie('user_name'), $this->GetCookie('pass'))) {
             $this->SetUser($user);
         }
         if (isset($_COOKIE['wikka_user_name']) && ($user = $this->LoadUser($_COOKIE['wikka_user_name'], $_COOKIE['wikka_pass']))) {
             //Old cookies : delete them
             SetCookie('wikka_user_name', '', 1, $this->wikka_cookie_path);
             $_COOKIE['wikka_user_name'] = '';
             SetCookie('wikka_pass', '', 1, $this->wikka_cookie_path);
             $_COOKIE['wikka_pass'] = '';
             $this->SetUser($user);
         }
     }
     $this->SetPage($this->LoadPage($tag, $this->GetSafeVar('time', 'get')));
     #312
     $this->LogReferrer();
     $this->ACLs = $this->LoadAllACLs($this->GetPageTag());
     $this->ReadInterWikiConfig();
     if (!($this->GetMicroTime() % 3)) {
         $this->Maintenance();
     }
     if (preg_match('/\\.(xml|mm)$/', $this->GetHandler())) {
         header('Content-type: text/xml');
         print $this->handler($this->GetHandler());
     } elseif ($this->GetHandler() == "raw") {
         header('Content-type: text/plain');
         print $this->handler($this->GetHandler());
     } elseif ($this->GetHandler() == 'grabcode') {
         print $this->handler($this->GetHandler());
     } elseif (preg_match('/\\.(gif|jpg|png)$/', $this->GetHandler())) {
         header('Location: images/' . $this->GetHandler());
     } elseif (preg_match('/\\.css$/', $this->GetHandler())) {
         header('Location: css/' . $this->GetHandler());
     } elseif (0 !== strcmp($newtag = preg_replace('/\\s+/', '_', $tag), $tag)) {
         header("Location: " . $this->Href('', $newtag));
     } elseif ($this->GetHandler() == 'html') {
         header('Content-type: text/html');
         print $this->handler($this->GetHandler());
     } else {
         print $this->Header();
         // Upload?
         if (isset($_POST['action']) && $_POST['action'] == 'upload') {
             // Show files to anyone with read access, we'll check for write access if they try to delete a file.
             if ($this->page && $this->HasAccess('read') && $this->method != 'print.xml' && $this->method != 'edit') {
                 $this->CheckUploadedFiles();
             }
         }
         print $this->handler($this->GetHandler());
         print $this->Footer();
     }
 }
Esempio n. 29
0
 function recommend_action()
 {
     if ($_POST) {
         if ($this->config["sy_smtpserver"] == "" || $this->config["sy_smtpemail"] == "" || $this->config["sy_smtpuser"] == "") {
             echo "网站邮件服务器不可用";
             die;
         }
         if ($_POST['femail'] == "" || $_POST['myemail'] == "" || $_POST['authcode'] == "") {
             echo "请完整填写信息!";
             die;
         }
         if (md5($_POST['authcode']) != $_SESSION[authcode]) {
             echo "验证码不正确!";
             die;
         }
         if ($_COOKIE["sendjob"] == $_POST['id']) {
             echo "请不要频繁发送邮件!同一职位发送间隔为两分钟!";
             die;
         }
         $filename = APP_PATH . "/template/" . $this->config['style'] . "/" . $this->m . "/sendjob.htm";
         $handle = fopen($filename, "r");
         $contents = fread($handle, filesize($filename));
         fclose($handle);
         $contents = $this->assignhtm($contents, (int) $_POST['id']);
         $smtp = $this->email_set();
         $smtpusermail = $this->config["sy_smtpemail"];
         $myemail = $this->stringfilter(trim($_POST['myemail']));
         $title = "您的好友" . $myemail . "向您推荐了职位!";
         $sendid = $smtp->sendmail($_POST['femail'], $smtpusermail, $title, $contents, "HTML", "", "", "", $myemail);
         if ($sendid) {
             echo 1;
         } else {
             echo "邮件发送错误 原因:1邮箱不可用 2网站关闭邮件服务";
             die;
         }
         SetCookie("sendjob", $_POST['id'], time() + 120, "/");
         die;
     }
     $this->seo("recommend");
     $this->yun_tpl(array('recommend'));
 }
Esempio n. 30
0
    $count = $stmt->rowCount();
    if ($count == 1) {
        $session_expiration = time() + 3600 * 24;
        // +1 days
        session_set_cookie_params($session_expiration);
        session_start();
        $_SESSION["user"] = $result;
        $cookie = $_SESSION["user"]->a_username;
        setcookie("orderby", 'color', time() + 86400, "/planning/");
        setcookie('state', '0', time() + 86400, "/planning/");
        setcookie("UserName", $cookie, time() + 86400, "/planning/");
        SetCookie('medarbejder', '', time() + 86400, "/planning/");
        SetCookie('kunder', '', time() + 86400, "/planning/");
        SetCookie('overblik', '', time() + 86400, "/planning/");
        SetCookie('timeoversigt', '', time() + 86400, "/planning/");
        SetCookie('presse', '', time() + 86400, "/planning/");
        SetCookie('online', '', time() + 86400, "/planning/");
        setcookie('login', 'active', time() + 86400, "/planning/");
        setcookie('showtask', '0', time() + 86400, "/planning/");
        header("location:../../singleAssociate.php");
        $db->close();
    } else {
        header("location:../../index.php?error");
    }
} catch (PDOException $e) {
    header("location:../../index.php?error");
    echo $e->getMessage();
}
?>