示例#1
1
<?php

require_once 'check_cookie.php';
require_once 'show_list.php';
require_once 'Request.php';
require_once 'Assign.php';
require_once 'Users.php';
if (check_cookie($_SERVER['PHP_SELF'], 2)) {
    $row_size = '1';
    if (!empty($_POST)) {
        // Update the 'approved' property
        $req = new Request();
        $approved = empty($_POST['approved']) ? 'false' : 'true';
        $query = 'UPDATE request SET approved=' . $approved . ' WHERE id=' . $_POST['rid'];
        $req->query($query);
        // What's the id of the person this job is assigned to?
        $user = new Users();
        $user->fullname = $_POST['assign_to'];
        $user->find();
        $aid = $user->uid;
        // Insert the new assignment
        $asn = new Assign();
        $asn->rid = $_POST['rid'];
        $asn->hours = $_POST['hours'];
        $asn->cost = str_replace('$', '', $_POST['cost']);
        $asn->complete = parse_date($_POST);
        $asn->aid = $aid;
        $asn->insert();
        header('Location: index.php');
    }
    // Initialize values!
示例#2
0
 function View()
 {
     $this->named_vars = array();
     $this->header_sent = false;
     global $db;
     global $request;
     $env =& environment();
     if (isset($request->resource)) {
         $this->collection = new Collection($request->resource);
     } else {
         $this->collection = new Collection(null);
     }
     $this->named_vars['db'] =& $db;
     $this->named_vars['request'] =& $request;
     $this->named_vars['collection'] =& $this->collection;
     $this->named_vars['response'] =& $this;
     if (check_cookie()) {
         $this->named_vars['profile'] =& get_profile();
     } else {
         $this->named_vars['profile'] = false;
     }
     if (isset($request->resource) && $request->resource != 'introspection') {
         $this->named_vars['resource'] =& $db->get_table($request->resource);
     } else {
         $this->named_vars['resource'] = false;
     }
     $this->named_vars['prefix'] = $db->prefix;
     $this->controller = $request->controller;
     load_apps();
     $controller_path = controller_path();
     // check for a controller file in controllers/[resource].php
     if (isset($request->resource)) {
         $cont = $controller_path . $request->resource . ".php";
         if (file_exists($cont)) {
             $this->controller = $request->resource . ".php";
         } elseif (isset($request->templates_resource[$request->resource]) && file_exists($controller_path . $request->templates_resource[$request->resource] . ".php")) {
             $this->controller = $request->templates_resource[$request->resource] . ".php";
         } else {
             if (isset($GLOBALS['PATH']['apps'])) {
                 foreach ($GLOBALS['PATH']['apps'] as $k => $v) {
                     if (file_exists($v['controller_path'] . $request->resource . ".php")) {
                         $this->controller = $request->resource . ".php";
                         $controller_path = $v['controller_path'];
                     }
                 }
             }
         }
     }
     if (is_file($controller_path . $this->controller)) {
         require_once $controller_path . $this->controller;
     } else {
         trigger_error('Sorry, the controller was not found at ' . $controller_path . $this->controller, E_USER_ERROR);
     }
     if (!isset($env['content_types'])) {
         trigger_error('Sorry, the content_types array was not found in the configuration file', E_USER_ERROR);
     }
     $this->negotiator = HTTP_Negotiate::choose($env['content_types']);
 }
示例#3
0
$_CFG['resume_photo_dir'] = $_CFG['site_dir'] . "data/" . $_CFG['resume_photo_dir'] . "/";
$_CFG['resume_photo_dir_thumb'] = $_CFG['site_dir'] . "data/" . $_CFG['resume_photo_dir_thumb'] . "/";
$_CFG['hunter_photo_dir'] = $_CFG['site_dir'] . "data/hunter/";
$_CFG['hunter_photo_dir_thumb'] = $_CFG['site_dir'] . "data/hunter/thumb/";
$upfiles_dir = "../data/" . $_CFG['updir_images'] . "/";
$thumb_dir = "../data/" . $_CFG['updir_thumb'] . "/";
$certificate_dir = "../data/" . $_CFG['updir_certificate'] . "/";
$certificate_train_dir = "../data/" . $_CFG['updir_train_certificate'] . "/";
$hunter_dir = "../data/hunter/";
$thumbwidth = "115";
$thumbheight = "85";
if (empty($_GET['perpage'])) {
    $_GET['perpage'] = 10;
}
$perpage = intval($_GET['perpage']);
require_once ADMIN_ROOT_PATH . 'include/admin_tpl.inc.php';
date_default_timezone_set("PRC");
if (empty($_SESSION['admin_id']) && $_REQUEST['act'] != 'login' && $_REQUEST['act'] != 'do_login' && $_REQUEST['act'] != 'logout') {
    if ($_COOKIE['Qishi']['admin_id'] && $_COOKIE['Qishi']['admin_name'] && $_COOKIE['Qishi']['admin_pwd']) {
        if (check_cookie($_COOKIE['Qishi']['admin_name'], $_COOKIE['Qishi']['admin_pwd'])) {
            update_admin_info($_COOKIE['Qishi']['admin_name'], false);
        } else {
            setcookie("Qishi[admin_id]", '', 1, $QS_cookiepath, $QS_cookiedomain);
            setcookie("Qishi[admin_name]", '', 1, $QS_cookiepath, $QS_cookiedomain);
            setcookie("Qishi[admin_pwd]", '', 1, $QS_cookiepath, $QS_cookiedomain);
            exit('<script type="text/javascript">top.location="admin_login.php?act=login";</script>');
        }
    } else {
        exit('<script type="text/javascript">top.location="admin_login.php?act=login";</script>');
    }
}
示例#4
0
<?php

/**
 * Developed by Jay Gaha
 * http://jaygaha.com.np
 */
include 'includes/inc-public.php';
include "includes/classes/class.music_dir.php";
$directory = new Music_Directory();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $arrData = array();
    $arrData['rate'] = $_POST['rate'];
    $arrData['parent_id'] = $_POST['pid'];
    $arrData['type'] = $_POST['rate_type'];
    $insert = false;
    if (!check_cookie($arrData['parent_id']) && $arrData['rate']) {
        $insert = $directory->add_rating($arrData);
    }
    if ($insert) {
        $one_day = 86400 + time();
        setcookie('star_' . $arrData['parent_id'], true, $one_day);
        //set cookie for one day
    }
    return true;
}
$data['page_title'] = 'World Music Listing: Welcome';
$data['musicListing'] = $directory->getMusicDirectoryListing();
$data['wmlMusicListing'] = $directory->getMusicPropListingByField('field');
$data['wmlBanners'] = $directory->getBanners();
$data['wmlAllWML'] = $directory->getPost();
$data['wmlWMLMusic'] = $directory->getPost('music');
示例#5
0
function load_abuse($id)
{
    $f = ".\\data\\" . $id . ".dsc";
    if (file_exists($f)) {
        echo "<div id=\"content\">\t\t\n\t\t\t<img style=\"display:block; margin: 0 auto;\" src=\"data/{$id}.jpg\" />\n\t\t\t<br />";
        $tmp = fopen($f, "r");
        $file = file($f);
        $count = count($file) - 4;
        while ($l_in_tmp = fgets($tmp)) {
            $a = explode("::", $l_in_tmp);
            if ($l_in_tmp[0] == '#') {
                continue;
            } else {
                if ($a[0] == 'meta') {
                    $m = explode("||", $a[1]);
                    echo "<span style=\"font-size: 9px; color:#696969;\"><b>Data dodania: </b>{$m['1']}</span>\n\t\t\t\t<span style=\"font-size: 9px; float:right; margin-left: 20px; font-weight:bold;\"><a href=\"?abuse={$id}\" id=\"viol\">Zgłoś naruszenie</a></span><br />\n\t\t\t\t<span style=\"font-size: 9px; color:#696969;\"><b>Użytkownik: </b>{$m['0']}</span><br />";
                } else {
                    if ($a[0] == 'cats') {
                        $c = explode("||", $a[1]);
                        echo "<span style=\"font-size: 9px; color:#696969;\"><b>Kategorie: </b></span>";
                        for ($i = 0; $i < count($c); $i++) {
                            echo "<a href=\"?cat={$c[$i]}\" id=\"cat\">{$c[$i]}</a> ";
                        }
                    } else {
                        if ($a[0] == 'comments') {
                            echo "<span style=\"font-size: 10px; float:right;\"><a href=\"?id={$id}\" id=\"cat\">Komentarze [<b>{$count}</b>]</a></span>\n\t\t\t\t\t\t<br />";
                            echo "<span style=\"margin-left: 20px;\"><h2>Komentarze<h2></span>";
                            echo "</div><hr /><br />";
                        } else {
                            $comm = explode("||", $l_in_tmp);
                            echo "<div id=\"cmnt\"><span style=\"color: #dfdfdf;\">{$comm['1']}</span>  <b>{$comm['0']}</b> <br /><span style=\"margin-left:20px; margin-top: 10px; word-wrap:break-word;\">{$comm['2']}</span></div><br />";
                        }
                    }
                }
            }
        }
        fclose($tmp);
        if (isset($_COOKIE['MyCookie']) && isset($_COOKIE['PHPSESSID']) && isset($_COOKIE['Auth']) && check_cookie($_COOKIE['MyCookie'], $_COOKIE['PHPSESSID'], $_COOKIE['Auth'])) {
            echo "<div id=\"cmnt\"><b>Wyślij zgłoszenie</b><br/>\n\t\t\t\t<form method=\"post\" action=\"?abuse={$id}\">\n\t\t\t\t<textarea name=\"comment\" rows=\"4\" cols=\"88\"></textarea><br />\n\t\t\t\t<input type=\"submit\" value=\"Wyślij\"></div>";
        }
    } else {
        echo "<br />Nieprawidłowy identyfikator obrazu";
    }
}
示例#6
0
文件: 16.php 项目: jjc224/Matasano
function strip_pkcs7($padded_str)
{
    $len = strlen($padded_str);
    $pad = ord($padded_str[$len - 1]);
    if (substr($padded_str, $len - $pad) != str_repeat(chr($pad), $pad)) {
        throw new Exception(__FUNCTION__ . '(): Bad padding.');
    }
    return substr($padded_str, 0, $len - $pad);
}
function aes_cbc_cookie($string, $key)
{
    $string = preg_replace('/(=|;)/', "'\$1'", $string);
    $string = "comment1=cooking%20MCs;userdata={$string};comment2=%20like%20a%20pound%20of%20bacon";
    return encrypt_aes_cbc($key, $string, 'YELLOW SUBMARINE');
}
function check_cookie($enc, $key)
{
    return strpos(decrypt_aes_cbc($key, $enc, 'YELLOW SUBMARINE'), ';admin=true;') !== false;
}
$bsize = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
$evil = str_repeat('A', $bsize) . '1234;dmi=rue';
// Create a sacrificial block. The appended string ends up as the size of a single block, which is to be bit-flipped.
$key = random_aes_key(16);
$enc = aes_cbc_cookie($evil, $key);
$flip = "'FIS";
// The four characters (in order) to be XOR'd with the single quotes to produce '1234;admin=true'.
$evil = "{$flip[0]}{$flip[1]}{$flip[2]}{$flip[3]}";
$evil = str_repeat("", $bsize * 2) . $evil . str_repeat("", $bsize * 4);
if (check_cookie($enc ^ $evil, $key)) {
    echo 'You win! :~)', PHP_EOL;
}
示例#7
0
文件: index.php 项目: chwdy/nmb_test
    $sjk = mysql_select_db("app_chwdywp1", $con);
    if (!$sjk) {
        echo "bu cun zai";
    } else {
        mysql_select_db("app_chwdywp1", $con);
        mysql_query("CREATE TABLE IF NOT EXISTS nmb_save ( num int(30),board int(30),id varchar(30),time varchar(30), text varchar(1000))");
        mysql_query("CREATE TABLE IF NOT EXISTS nmb_id ( id float(30), name varchar(40),status int(30),time int(30))");
        mysql_query("CREATE TABLE IF NOT EXISTS nmb_set ( item varchar(50), value varchar(30))");
        init_set();
        if (isset($_COOKIE['id'])) {
            br();
            br();
            br();
            echo "欢迎回来    " . $_COOKIE['name'];
        } else {
            if (check_cookie()) {
                $new_id = check_id();
                $new_time = time();
                $new_name = "user_{$new_id}";
                $cookie_expire = $new_time + 36000;
                mysql_query("INSERT INTO nmb_id  VALUES({$new_id},'{$new_name}',1,{$cookie_expire})");
                setcookie('id', $new_id, $new_time + 36000);
                setcookie('name', $new_name, $new_time + 36000);
                br();
                br();
                br();
                echo "已获得新身份  &nbsp;&nbsp;  " . $new_name;
            }
        }
    }
}
示例#8
0
文件: common.php 项目: istrwei/Luna
}
// Enable output buffering
if (!defined('FORUM_DISABLE_BUFFERING')) {
    // Should we use gzip output compression?
    if ($luna_config['o_gzip'] && extension_loaded('zlib')) {
        ob_start('ob_gzhandler');
    } else {
        ob_start();
    }
}
// Define standard date/time formats
$forum_time_formats = array($luna_config['o_time_format'], 'H:i:s', 'H:i', 'g:i:s a', 'g:i a');
$forum_date_formats = array($luna_config['o_date_format'], 'Y-m-d', 'Y-d-m', 'd-m-Y', 'm-d-Y', 'M j Y', 'jS M Y');
// Check/update/set cookie and fetch user info
$luna_user = array();
check_cookie($luna_user);
// Load l10n
require_once FORUM_ROOT . 'include/pomo/MO.php';
require_once FORUM_ROOT . 'include/l10n.php';
// Attempt to load the language file
if (file_exists(FORUM_ROOT . 'lang/' . $luna_user['language'] . '/luna.mo')) {
    load_textdomain('luna', FORUM_ROOT . 'lang/' . $luna_user['language'] . '/luna.mo');
} elseif (file_exists(FORUM_ROOT . 'lang/English/luna.mo')) {
    load_textdomain('luna', FORUM_ROOT . 'lang/English/luna.mo');
} else {
    error('There is no valid language pack \'' . luna_htmlspecialchars($luna_user['language']) . '\' installed. Please reinstall a language of that name');
}
// Check if we are to display a maintenance message
if ($luna_config['o_maintenance'] && $luna_user['g_id'] > FORUM_ADMIN && !defined('FORUM_TURN_OFF_MAINT')) {
    maintenance_message();
}
示例#9
0
        $id = last_id() + 1;
        if (fwrite($plik, $id . "||" . $login . "||" . md5("S417" . $id . "" . substr($login, 0, 3) . "" . $pass) . "||\n")) {
            echo "Rejestracja zakończona pomyślnie!<br />";
        } else {
            echo "Błąd rejestracji!<br />";
        }
        fclose($plik);
        $ref = $_SERVER['HTTP_REFERER'];
        header("Location: " . $ref);
    } else {
        $ref = $_SERVER['HTTP_REFERER'];
        header("Location: " . $ref);
        echo "Nieprawidłowy login lub hasło!<br />";
    }
} else {
    if (isset($_POST['login']) && isset($_POST['password']) && isset($_COOKIE['MyCookie']) && isset($_COOKIE['PHPSESSID']) && isset($_COOKIE['Auth']) && check_cookie($_COOKIE['MyCookie'], $_COOKIE['PHPSESSID'], $_COOKIE['Auth'])) {
        echo "Jesteś juz zarejestrowany!";
    } else {
        echo "<form method=\"post\" action=\"index.php\">\n\t\t\t\tLogin: <input style=\"margin-left: 12px; width: 120px;\" type=\"text\" name=\"login\"/><br />\n\t\t\t\tHasło: <input style=\"margin-left: 11px;width: 120px;\" type=\"password\" name=\"password\"/><br/>\n\t\t\t\t<input type=\"submit\" name=\"reg\" value=\"Rejestruj\">\n\t\t\t\t</form>";
    }
}
?>
		</div>
	</div>
	<div id="show" onClick="document.getElementById('log_show').style.display='none';document.getElementById('reg_show').style.display='none'">
		<?php 
if (isset($_GET['cat'])) {
    $cat = $_GET['cat'];
    include "gal.php";
} else {
    if (isset($_COOKIE['MyCookie']) && isset($_COOKIE['PHPSESSID']) && isset($_COOKIE['Auth']) && isset($_GET['id']) && isset($_POST['comment'])) {
?>
';

		(function() {
	        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
	        dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
	        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
	    })();

    	id = <?php 
echo $data['id'];
?>
;
		$.fn.raty.defaults.path = 'public/images';
		$.fn.raty.defaults.readOnly = "<?php 
echo check_cookie($data['id']);
?>
";
		$('#star').raty({score:"<?php 
echo $data['rate'];
?>
",
 			click: function(score, evt) {
 				$.post('single_profile.php',{'rate':score,'pid':id, 'rate_type' : '<?php 
echo $data["rate_type"];
?>
'},function(data)
				{
     				$('#star').raty({score:score, readOnly:true});
				}
			)
示例#11
0
function security_init()
{
    global $request;
    // add Routes -- route name, pattern to match, and default request parameters
    $request->connect('openid_continue/:fromserver', array('action' => 'openid_continue'));
    $request->connect('openid_continue');
    $request->connect('openid_login_return');
    $request->connect('openid_submit');
    $request->connect('password_submit');
    $request->connect('password_register');
    $request->connect('openid_logout');
    $request->connect('openid_login');
    $request->connect('openid_login/:openid', array('action' => 'openid_login'));
    $request->connect('email_login');
    $request->connect('register');
    $request->connect('email_submit');
    $request->connect('ldap_login');
    $request->connect('ldap_submit');
    $request->connect('oauth_login');
    $request->connect('facebook_login');
    $request->routematch();
    if (isset($_SESSION['fb_person_id']) && $_SESSION['fb_person_id'] > 0) {
        $request->openid_complete = true;
        return $_SESSION['fb_person_id'];
    } elseif (isset($_SESSION['oauth_person_id']) && $_SESSION['oauth_person_id'] > 0) {
        $request->openid_complete = true;
        return $_SESSION['oauth_person_id'];
    } elseif (isset($_SESSION['openid_complete']) && check_cookie()) {
        if (!isset($request->openid_url) && $_SESSION['openid_complete'] == true) {
            $request->openid_complete = true;
        }
    }
}
示例#12
0
文件: signup.php 项目: CDFLS/CWOJ
<?php

require __DIR__ . '/inc/init.php';
require __DIR__ . '/func/cookie.php';
if (isset($_SESSION['user']) || check_cookie()) {
    header("Location: /");
    exit;
}
$Title = _('Sign up ') . $oj_name;
?>
<!DOCTYPE html>
<html>
    <?php 
require __DIR__ . '/inc/head.php';
?>
    
    <body style="background-image: url(<?php 
echo $loginimg;
?>
)">
        <div class="container">
            <div class="row collapse">
                <div class="panel panel-default panel-login" style="display:table;margin:auto">
                    <div class="panel-body">
                        <form id="form_reg" method="post">
                            <h1 class="text-center">
                                <?php 
echo _('Sign up');
?>
                            </h1>
                            <hr>
示例#13
0
文件: checklogin.php 项目: CDFLS/CWOJ
<?php

static $check_login = 1;
if (!isset($_SESSION)) {
    session_start();
}
if (!isset($_SESSION['user'])) {
    if (!function_exists('check_cookie')) {
        require __DIR__ . '/cookie.php';
    }
    if (!check_cookie()) {
        if ($require_auth) {
            header("location: /login.php");
            exit;
        }
    } else {
        if (!function_exists('login')) {
            require __DIR__ . '/userlogin.php';
        }
        if (TRUE === login($_SESSION['user'], TRUE)) {
            write_cookie(1);
        }
    }
}
示例#14
0
}
// Enable output buffering
if (!defined('PANTHER_DISABLE_BUFFERING')) {
    // Should we use gzip output compression?
    if ($panther_config['o_gzip'] && extension_loaded('zlib')) {
        ob_start('ob_gzhandler');
    } else {
        ob_start();
    }
}
// Define standard date/time formats
$forum_time_formats = array($panther_config['o_time_format'], 'H:i:s', 'H:i', 'g:i:s a', 'g:i a');
$forum_date_formats = array($panther_config['o_date_format'], 'd-m-Y', 'Y-m-d', 'Y-d-m', 'm-d-Y', 'M j Y', 'jS M Y');
// Check/update/set cookie and fetch user info
$panther_user = array();
check_cookie($panther_user);
$loader = new Twig_Loader_Filesystem(PANTHER_ROOT . 'include/templates');
$style_root = ($panther_config['o_style_path'] != 'style' ? $panther_config['o_style_path'] : PANTHER_ROOT . $panther_config['o_style_path']) . '/' . $panther_user['style'] . '/templates/';
$loader->addPath(PANTHER_ROOT . 'include/templates/', 'core');
if (file_exists($style_root)) {
    // If the custom style doesn't use templates, then this is silly
    $loader->addPath($style_root, 'style');
}
$tpl_manager = new Twig_Environment($loader, array('cache' => FORUM_CACHE_DIR . 'templates/' . $panther_user['style'], 'debug' => $panther_config['o_debug_mode'] == '1' ? true : false));
// Attempt to load the common language file
if (file_exists(PANTHER_ROOT . 'lang/' . $panther_user['language'] . '/common.php')) {
    include PANTHER_ROOT . 'lang/' . $panther_user['language'] . '/common.php';
} else {
    error_handler(E_ERROR, 'There is no valid language pack \'' . $panther_user['language'] . '\' installed.', __FILE__, __LINE__);
}
// Load the updater
示例#15
0
// Load DB abstraction layer and connect
require PUN_ROOT . 'include/common_db.php';
// Load cached config
@(include PUN_ROOT . 'cache/cache_config.php');
if (!defined('PUN_CONFIG_LOADED')) {
    include PUN_ROOT . 'include/cache.php';
    generate_config_cache();
    include PUN_ROOT . 'cache/cache_config.php';
}
// Enable output buffering
if (!defined('PUN_DISABLE_BUFFERING')) {
    @ob_start();
}
// Check/update/set cookie and fetch user info
$pun_user = array();
check_cookie($pun_user);
// Attempt to load the common language file
@(include PUN_ROOT . 'lang/' . $pun_user['language'] . '/common.php');
if (!isset($lang_common)) {
    exit('There is no valid language pack "' . pun_htmlspecialchars($pun_user['language']) . '" installed. Please reinstall a language of that name.');
}
@iconv_set_encoding('internal_encoding', 'UTF-8');
@mb_internal_encoding('UTF-8');
// Check if we are to display a maintenance message
if ($pun_config['o_maintenance'] && $pun_user['g_id'] > PUN_ADMIN && !defined('PUN_TURN_OFF_MAINT')) {
    maintenance_message();
}
// Load cached bans
@(include PUN_ROOT . 'cache/cache_bans.php');
if (!defined('PUN_BANS_LOADED')) {
    include_once PUN_ROOT . 'include/cache.php';
示例#16
0
}
$onlineurl = 'http://' . $_SERVER['HTTP_HOST'] . addslashes($_SERVER["REQUEST_URI"]);
if ($config['gzip'] && extension_loaded('zlib') && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false || strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') !== false)) {
    ob_start('ob_gzhandler');
} else {
    ob_start();
}
if (URL_CRYPT) {
    include ROOT_PATH . 'include/urlcrypt.inc.php';
    urlcrypt();
}
//import_request_variables("cgP");
foreach (array('_COOKIE', '_POST', '_GET') as $_request) {
    foreach (${$_request} as $_key => $_value) {
        $_key[0] != '_' && (${$_key} = m_addslashes($_value));
    }
}
//m_exit($_POST,true);
check_cookie();
$online = update_online();
//${$cookiepre.auth} == $_COOKIE["{cookiepre}auth"] == $_COOKIE['Ecosme_auth']
$m_uid = $m_username = $m_password = '';
if (isset(${$cookiecfg['prefix'] . secret})) {
    list($m_uid, $m_username, $m_logintime) = explode("\t", authcrypt(${$cookiecfg['prefix'] . secret}, 'decode'));
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && times() - $m_logintime > 86400) {
    header('Location: ' . $_SERVER['HTTP_REFERER'] . '');
    exit;
}
//echo $m_uid."||".$m_username."||".$m_logintime;
//print_r($GLOBALS);
示例#17
0
    <script type="text/javascript">
    
		$(document).ready(function() {
			$('#newsslider').accessNews({
				title : "",
				subtitle:"",
				// speed : "slow",
				// slideBy : 4,
				// slideShowInterval: 100000,
				// slideShowDelay: 100000
			});

			id = 0;
			$.fn.raty.defaults.path = 'public/images';
			$.fn.raty.defaults.readOnly = "<?php 
echo check_cookie(0);
?>
";
			$('#star').raty({score:"<?php 
echo $data['rate'];
?>
",
	 			click: function(score, evt) {
	 				$.post('index.php',{'rate':score,'pid':id, 'rate_type' : 'd_site'},function(data)
					{
	     				$('#star').raty({score:score, readOnly:true});
					}
				)
			}
			});
示例#18
0
<?php

require_once 'Request.php';
require_once 'check_cookie.php';
require_once 'show_list.php';
if (check_cookie($_SERVER['PHP_SELF'], null)) {
    if (!empty($_POST)) {
        $req = new Request();
        $req->uid = $_COOKIE['uid'];
        $req->name = $_POST['name'];
        // Remove '-' from phone number.
        $req->phone = str_replace('-', '', $_POST['phone']);
        $req->description = $_POST['description'];
        // Force date into correct format.
        $req->deadline = parse_date($_POST);
        $req->insert();
        header('Location: index.php?conf=true');
    }
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Job Request Form</title>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="jquery-1.7.min.js"></script>
<script type="text/javascript" src="validator.js"></script>
<script type="text/javascript" src="validate_request.js"></script>
</head>
<body onload="loadEventHandlers();">
<?php 
示例#19
0
 * ============================================================================
 * 版权所有: 骑士网络,并保留所有权利。
 * 网站地址: http://www.74cms.com;
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用;不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
*/
define('IN_QISHI', true);
require_once dirname(__FILE__) . '/../include/common.inc.php';
$act = isset($_REQUEST['act']) ? trim($_REQUEST['act']) : 'add';
require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
$db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
if ((empty($_SESSION['uid']) || empty($_SESSION['username']) || empty($_SESSION['utype'])) && $_COOKIE['QS']['username'] && $_COOKIE['QS']['password'] && $_COOKIE['QS']['uid']) {
    require_once QISHI_ROOT_PATH . 'include/fun_user.php';
    if (check_cookie($_COOKIE['QS']['uid'], $_COOKIE['QS']['username'], $_COOKIE['QS']['password'])) {
        update_user_info($_COOKIE['QS']['uid'], false, false);
        header("Location:" . get_member_url($_SESSION['utype']));
    } else {
        unset($_SESSION['uid'], $_SESSION['username'], $_SESSION['utype'], $_SESSION['uqqid'], $_SESSION['activate_username'], $_SESSION['activate_email'], $_SESSION["openid"]);
        setcookie("QS[uid]", "", time() - 3600, $QS_cookiepath, $QS_cookiedomain);
        setcookie('QS[username]', "", time() - 3600, $QS_cookiepath, $QS_cookiedomain);
        setcookie('QS[password]', "", time() - 3600, $QS_cookiepath, $QS_cookiedomain);
        setcookie("QS[utype]", "", time() - 3600, $QS_cookiepath, $QS_cookiedomain);
    }
}
if ($_SESSION['uid'] == '' || $_SESSION['username'] == '') {
    $captcha = get_cache('captcha');
    $smarty->assign('verify_userlogin', $captcha['verify_userlogin']);
    $smarty->display('plus/ajax_login.htm');
    exit;
示例#20
0
require "libs/common.lib.php";
// Database
$link = mysql_connect($db_host, $db_user, $db_password);
mysql_select_db($db_name);
// Prepare subpage
$page = $_GET["page"];
if (empty($page)) {
    $page = "main";
}
// Admin
if ($page == "admin") {
    // Runlevel
    $runlevel = 0;
    // If cookie is set
    if ($_COOKIE["proma"] != "" && $_GET["action"] != "logout") {
        $runlevel = check_cookie();
        if ($runlevel == 0) {
            $message = "The session has timed out.";
        }
    }
    // If login info is entered
    if (!empty($_POST["login"])) {
        $runlevel = login();
        if ($runlevel == 0) {
            $message = "Wrong username or password, or you're not an admin.";
        }
    }
    // If logout-link is clicked
    if ($_GET["action"] == "logout") {
        $runlevel = logout();
        if ($runlevel == 0) {