当前位置: 首页>>代码示例>>PHP>>正文


PHP getSessionVariable函数代码示例

本文整理汇总了PHP中getSessionVariable函数的典型用法代码示例。如果您正苦于以下问题:PHP getSessionVariable函数的具体用法?PHP getSessionVariable怎么用?PHP getSessionVariable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getSessionVariable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: db_error_logger

	function db_error_logger($errno, $errstr, $errfile = "", $errline = "", $errorcontext = array()){
	
		$errno = makeStringSafe($errno);
		$errstr = makeStringSafe($errstr);
		$errfile = makeStringSafe($errfile);
		$errline = makeStringSafe($errline);
		
		if($errno < E_STRICT){
	
			doQuery("INSERT INTO ".getDBPrefix()."_error_log set user_id = '".getSessionVariable("user_id")."', error_number = '".$errno."',
				message = '".$errstr."', file = '".$errfile."', line_number = '".$errline."', context = '".serialize($errorcontext)."',
				time = '".getCurrentMySQLDateTime()."'");
				
			$errorrow = mysql_fetch_assoc(doQuery("SELECT error_id FROM ".getDBPrefix()."_error_log ORDER BY error_id DESC LIMIT 1"));
			
			if(getConfigVar('error_output') == ERROR_OUTPUT_DBID || getConfigVar('error_output') == ERROR_OUTPUT_BOTH){
			
				echo "<h4 style=\"color: #FF0000;\">An error occured! If you would like to report this error, please report that your 'ERROR_ID' is '".$errorrow['error_id']."'.</h4>";
			
			}
		
		}
		
		return !(getConfigVar("error_output") == ERROR_OUTPUT_PHP || getConfigVar("error_output") == ERROR_OUTPUT_BOTH);
	
	}
开发者ID:ramielrowe,项目名称:Radford-Reservation-System,代码行数:26,代码来源:error_functions.php

示例2: testCreateReservationFromWeekdaytoWeekend

	public function testCreateReservationFromWeekdaytoWeekend(){
	
		$this->setSessionUserAdmin();
		$startDate = '2011-11-18'; # A Friday
		$length = 1;
		$endDate = '2011-11-21'; # The Next Monday
		$actualLength = 3;
		$equipId = 1;
		$userComment = "test user comment";
		$adminComment = "test admin comment";
		$modStatus = RES_STATUS_PENDING;
		
		createReservation(getSessionVariable('user_id'), $equipId, $startDate, $length, $userComment, $adminComment, $modStatus);
		
		$actualReservation = mysql_fetch_assoc(doQuery("select * from ".getConfigVar('db_prefix')."_reservations ORDER BY res_id DESC LIMIT 1"));
		
		$this->assertEquals(getSessionVariable('user_id'), $actualReservation['user_id'], "User IDs not equal");
		$this->assertEquals($equipId, $actualReservation['equip_id'], "Equip IDs not equal");
		$this->assertEquals($startDate, $actualReservation['start_date'], "Start dates not equal");
		$this->assertEquals($actualLength, $actualReservation['length'], "Lengths not equal");
		$this->assertEquals($endDate, $actualReservation['end_date'], "End dates not equal");
		$this->assertEquals($userComment, $actualReservation['user_comment'], "User comments not equal");
		$this->assertEquals($adminComment, $actualReservation['admin_comment'], "Admin comments not equal");
		$this->assertEquals($modStatus, $actualReservation['mod_status'], "Statuses not equal");
	
	}
开发者ID:ramielrowe,项目名称:Radford-Reservation-System,代码行数:26,代码来源:TestCaseResFunctionsTest.php

示例3: checkAuthResult

function checkAuthResult()
{
    $code = getVariable('code', FALSE);
    $state = getVariable('state', FALSE);
    $provider = createProvider([], []);
    $oauthUnguessable = getSessionVariable('oauthUnguessable', null);
    if (!$code || !$state || !$oauthUnguessable) {
        return;
    }
    if ($state !== $oauthUnguessable) {
        //Miss-match on what we're tring to validated.
        echo "Mismatch on secret'";
        return;
    }
    try {
        $api = $provider->make('DebugGithub');
        //$client
        /** @var  $api DebugGithub */
        $command = $api->oauthAuthorize(GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, $code, "http://" . SERVER_HOSTNAME . "/github/return.php");
        $accessResponse = $command->execute();
        setSessionVariable(GITHUB_ACCESS_RESPONSE_KEY, $accessResponse);
        if ($accessResponse->oauthScopes) {
            echo "You are now authed for the following scopes:<br/>";
            foreach ($accessResponse->oauthScopes as $scope) {
                echo $scope . "<br/>";
            }
        }
    } catch (GithubArtaxServiceException $fae) {
        echo "Exception processing response: " . $fae->getMessage();
    }
}
开发者ID:danack,项目名称:githubartaxservice,代码行数:31,代码来源:return.php

示例4: checkAuthResult

function checkAuthResult()
{
    $code = getVariable('code', FALSE);
    $state = getVariable('state', FALSE);
    $oauthUnguessable = getSessionVariable('oauthUnguessable', null);
    if (!$code || !$state || !$oauthUnguessable) {
        return;
    }
    if ($state != $oauthUnguessable) {
        //Miss-match on what we're tring to validated.
        echo "Miss-match on secret'";
        return;
    }
    try {
        $api = new \AABTest\GithubAPI\GithubAPI();
        $command = $api->accessToken(GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, $code, "http://" . SERVER_HOSTNAME . "/github/return.php");
        $response = $command->execute();
        setSessionVariable('githubAccess', $response);
        echo "You are now authed for the following scopes:<br/>";
        foreach ($response->scopes as $scope) {
            echo $scope . "<br/>";
        }
    } catch (\AABTest\GithubAPI\GithubAPIException $fae) {
        echo "Exception processing response: " . $fae->getMessage();
    }
}
开发者ID:danack,项目名称:artaxservicebuilder,代码行数:26,代码来源:return.php

示例5: testGetSessionVariableShouldGetValue

	public function testGetSessionVariableShouldGetValue()
	{
		$variableName = "varTestSet";
		$expectedValue = "TestValue2";
		
		setSessionVariable($variableName, $expectedValue);
		$actualValue = getSessionVariable($variableName);
		
		$this->assertEquals($expectedValue, $actualValue,
			"getSessionVariable(variable_name, value) got incorrect value.");
			
	}
开发者ID:ramielrowe,项目名称:Radford-Reservation-System,代码行数:12,代码来源:TestCaseFunctionsTest.php

示例6: addEquipment

function addEquipment($name, $type, $serial, $description, $max, $picture, $minuserlevel, $checkoutfrom)
{
    $name = makeStringSafe($name);
    $type = makeStringSafe($type);
    $serial = makeStringSafe($serial);
    $description = makeStringSafe($description);
    $max = makeStringSafe($max);
    $picture = makeStringSafe($picture);
    $minuserlevel = makeStringSafe($minuserlevel);
    $checkoutfrom = makeStringSafe($checkoutfrom);
    doQuery("INSERT INTO " . getDBPrefix() . "_equipment SET name = '" . $name . "', type = '" . $type . "', serial = '" . $serial . "', description = '" . $description . "', max_length = '" . $max . "', picture = '" . $picture . "', min_user_level = '" . $minuserlevel . "', checkoutfrom = '" . $checkoutfrom . "'");
    $equip = mysql_fetch_assoc(doQuery("SELECT equip_id FROM " . getDBPrefix() . "_equipment ORDER BY equip_id DESC LIMIT 1"));
    logAddEquipment(getSessionVariable('user_id'), $equip['equip_id']);
}
开发者ID:ramielrowe,项目名称:Reservation-System-V1,代码行数:14,代码来源:adminfunctions.php

示例7: mysql_fetch_assoc

<?php

if ($pageid == "warnuser") {
    $user = mysql_fetch_assoc(getUserByID($_GET['user_id']));
    echo "\r\n\r\n\t\t<center><h3>Warn " . $user['name'] . "</h3></center>\r\n\r\n\t\t<form action=\"./index.php?pageid=submitwarning\" method=\"POST\">\r\n\t\t<input type=\"hidden\" name=\"user_id\" value=\"" . $_GET['user_id'] . "\">\r\n\t\t\t<table class=\"warning\">\r\n\t\t\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t\r\n\t\t\t\t\t<td colspan=2 class=\"centeredcellbold\">Warn Reason</td>\r\n\t\t\t\t\t\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t\r\n\t\t\t\t\t<td colspan=2 class=\"centeredcellbold\"><textarea cols=\"55\" rows=\"7\" name=\"reason\"></textarea></td>\r\n\t\t\t\t\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t\r\n\t\t\t\t\t<td class=\"centeredcell\"><select name=\"type\"><option value=\"1\">Active</option><option value=\"2\">Notification</option><option value=\"3\">Inactive</option></select></td>\r\n\t\t\t\t\t<td class=\"centeredcell\"><input type=\"submit\" value=\"Warn\"></textarea></td>\r\n\t\t\t\t\r\n\t\t\t\t</tr>\r\n\t\t\t\r\n\t\t\t</table>\r\n\t\t\r\n\t\t</form>\r\n\r\n\t";
} else {
    if ($pageid == "submitwarning") {
        warnUser($_POST['user_id'], $_POST['reason'], $_POST['type']);
        $user = mysql_fetch_assoc(getUserByID($_POST['user_id']));
        echo "<center><h3>" . $user['name'] . " Warned</h3><a href=\"./index.php?pageid=edituser&user=" . $user['user_id'] . "\">View User</a></center>";
    } else {
        if ($pageid == "viewwarnings") {
            if (getSessionVariable('user_level') < getConfigVar("admin_rank") && getSessionVariable('user_id') != $_GET['user_id']) {
                echo "<center><h3><font color=\"#FF0000\">Error: You are not authorized to view other user's warnings.</font></h3></center>";
            } else {
                $warnings = getWarningsForUser($_GET['user_id']);
                $user = mysql_fetch_assoc(getUserByID($_GET['user_id']));
                $options = "";
                while ($row = mysql_fetch_assoc($warnings)) {
                    $options = $options . "<option value=\"" . $row['warn_id'] . "\">" . $row['time'] . " - " . getWarningType($row['type']) . "</option>";
                }
                echo "<center><h3>View Warnings For " . $user['name'] . "</h3>";
                if ($options != "") {
                    echo "<form action=\"index.php\" method=\"GET\">\r\n\t\t\t<input type=\"hidden\" name=\"pageid\" value=\"editwarning\">\r\n\t\t\t<select name=\"warn_id\">" . $options . "</select><input type=\"submit\" value=\"View\"></form></center>";
                } else {
                    echo "<h4>User has no warnings.</h4>";
                }
            }
        } else {
            if ($pageid == "editwarning" || $pageid == "savewarning") {
                $message = "";
开发者ID:ramielrowe,项目名称:Reservation-System-V1,代码行数:31,代码来源:warn.php

示例8: getSessionVariable

<?php

require "githubBootstrap.php";
use GithubService\GithubArtaxService\GithubArtaxServiceException;
use Amp\Artax\DnsException;
echo <<<END
<html>
<body>
<h3><a href='/'>Oauth test home</a> </h3>
END;
/** @var  $accessResponse \GithubService\Model\AccessResponse */
$accessResponse = getSessionVariable(GITHUB_ACCESS_RESPONSE_KEY);
if ($accessResponse) {
    if (!$accessResponse instanceof GithubService\Model\AccessResponse) {
        //class was renamed...or something else bad happened.
        setSessionVariable(GITHUB_ACCESS_RESPONSE_KEY, null);
        $accessResponse = null;
    }
}
$shareClasses = [];
if ($accessResponse) {
    $shareClasses['GithubService\\Model\\AccessResponse'] = $accessResponse;
}
$provider = createProvider([], $shareClasses);
//These actions need to be done before the rest of the page.
$action = getVariable('action');
switch ($action) {
    case 'delete':
        unsetSessionVariable(GITHUB_ACCESS_RESPONSE_KEY);
        $accessResponse = null;
        break;
开发者ID:danack,项目名称:githubartaxservice,代码行数:31,代码来源:index.php

示例9: if

	}else{
		
		$message = "<font color=\"#005500\"><b>Error: A Required Field Was Left Blank</b></font><br><br>";
	
	}

}
else if($pageid == "saveemail"){

	$email = $_POST['email'];
	
	if($email != ""){

		changeUserEmail(getSessionVariable('user_id'), $email);
		
		$user = mysql_fetch_assoc(getUserByID(getSessionVariable('user_id')));
		
		$message = "<font color=\"#005500\"><b>Email Updated!</b></font><br><br>";
	
	}else{
		
		$message = "<font color=\"#FF0000\"><b>Error: Email Field Was Left Blank</b></font><br><br>";
	
	}

}


$pageData = "
	<center><h3>My Account</h3>".$message."</center>
	
开发者ID:ramielrowe,项目名称:Radford-Reservation-System,代码行数:30,代码来源:myaccount.php

示例10: getVariable

require "flickrBootstrap.php";
use ArtaxApiBuilder\Service\OauthConfig;
$action = getVariable('action');
if ($action === 'delete') {
    unsetSessionVariable('oauthAccessToken');
    unsetSessionVariable('oauthRequest');
}
echo <<<END

<html>
<body>
<h3><a href='/'>Oauth test home</a> </h3>
END;
/** @var \AABTest\OauthAccessToken $oauthAccessToken */
$oauthAccessToken = getSessionVariable('oauthAccessToken');
if ($oauthAccessToken == null) {
    echo "<p>You are not flickr authorised.</p>";
    createOauthRequest();
} else {
    echo "<p>You are flickr authorised.</p>";
    showFlickrStatus($oauthAccessToken);
    echo "<p><a href='/flickr/index.php?action=delete'>Delete authority</a></p>";
}
echo <<<END

</body>
</html>

END;
function showFlickrStatus(\AABTest\OauthAccessToken $oauthAccessToken)
开发者ID:danack,项目名称:artaxservicebuilder,代码行数:30,代码来源:index.php

示例11:

                }
            }
            $page = $page . "<center><h3>You need to be logged in to view this page.</h3>\n\t\t<font color=\"#FF0000\">" . $errormessage . "</font></center>\n\t\t<form action=\"./confirmReservation.php\" method=\"POST\">\n\t\t\t<input type=\"hidden\" name=\"resid\" value=\"" . $resid . "\"><input type=\"hidden\" name=\"page\" value=\"login\">\n\t\t\t<table class=\"login\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=2 class=\"header\">User Login</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=\"centeredcellbold\">Username</td>\n\t\t\t\t\t<td class=\"centeredcell\"><input type=\"text\" name=\"id\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=\"centeredcellbold\">Password</td>\n\t\t\t\t\t<td class=\"centeredcell\"><input type=\"password\" name=\"pass\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=2 class=\"centeredcellbold\"><input type=\"submit\" value=\"Login\"></td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</form>";
        }
    }
}
?>

<html>

<head>

<LINK REL=StyleSheet HREF="./style.css" TYPE="text/css">

<title><?php 
if (issetSessionVariable('user_level') && getSessionVariable('user_level') >= RES_USERLEVEL_ADMIN) {
    echo "Reservation Confirmation Page";
}
?>
</title>

</head>

<body>



<?php 
echo $page;
?>
开发者ID:ramielrowe,项目名称:Reservation-System-V1,代码行数:30,代码来源:confirmReservation.php

示例12: if

		$status = "D";
	
	}
	else if($row['mod_status']==RES_STATUS_CHECKED_IN){
	
		$status = "CI";
	
	}
	else if($row['mod_status']==RES_STATUS_CHECKED_OUT){
		$status = "CO";
	}

	$equip = mysql_fetch_assoc(getEquipmentByID($row['equip_id']));
	$user = mysql_fetch_assoc(getUserByID($row['user_id']));
	$editlink = "&nbsp;&nbsp;-&nbsp;&nbsp;";
	if(getSessionVariable('user_level') == getConfigVar("admin_rank")){
		$editlink = "<a href=\"./index.php?pageid=editreservation&resid=".$row['res_id']."\">Edit</a>";
	}
	$browsetable = $browsetable . "<tr><td class=\"centeredcell\"><a href=\"./userinfo.php?user_id=".$user['user_id']."\" target=\"_BLANK\">".$user['name']."</a></td><td class=\"centeredcell\">".$equip['name']."</td><td class=\"centeredcell\">".$row['start_date']."</td><td class=\"centeredcell\">".$status."</td><td class=\"centeredcell\">".$row['end_date']."</td><td class=\"centeredcell\"><a href=\"./index.php?pageid=viewreservation&resid=".$row['res_id']."\">View</a></td><td class=\"centeredcell\">".$editlink."</td></tr>";

}

$browsetable = $browsetable . "</table>";

echo "
<script language=\"JavaScript\" id=\"jscal1x\">
var cal1x = new CalendarPopup(\"testdiv1\");
</script>

<center>
	<h3>Browse Reservations</h3>
开发者ID:ramielrowe,项目名称:Radford-Reservation-System,代码行数:31,代码来源:browsereservations.php

示例13: getAllMessages

<?php
if(issetSessionVariable('user_level')){
	if(getSessionVariable('user_level') >= RES_USERLEVEL_ADMIN){
	
		
	
	}
	else{
		echo "Error: You don't have permissions to access this page!";
		die("");
		
	}
	
}
else{
	echo "Error: You don't have permissions to access this page!";
	die("");
}
if($pageid == "messages"){
	$messages = getAllMessages();
	
	$select = "<select name=\"messageid\">";
	
	while($row = mysql_fetch_assoc($messages)){
	
		$select = $select . "<option value=\"".$row['message_id']."\">".$row['start_date']." to ".$row['end_date']." - Priority ".$row['priority']."</option>";
	
	}
	
	$select = $select . "</select>";
开发者ID:ramielrowe,项目名称:Radford-Reservation-System,代码行数:30,代码来源:messages.php

示例14: addMessage

        } else {
            if ($pageid == "createmessage") {
                require 'adminfunctions.php';
                $startdate = $_POST['startdate'];
                $enddate = $_POST['enddate'];
                $priority = $_POST['priority'];
                $body = $_POST['body'];
                addMessage(getSessionVariable('user_id'), $startdate, $enddate, $priority, $body);
                echo "<center><h3>New Message Created!</h3></center>";
            } else {
                if ($pageid == "savemessage") {
                    require 'adminfunctions.php';
                    $messageid = $_POST['messageid'];
                    $startdate = $_POST['startdate'];
                    $enddate = $_POST['enddate'];
                    $priority = $_POST['priority'];
                    $body = $_POST['body'];
                    saveMessage($messageid, getSessionVariable('user_id'), $startdate, $enddate, $priority, $body);
                    echo "<center><h3>Message Saved!</h3></center>";
                } else {
                    if ($pageid == "deletemessage") {
                        require 'adminfunctions.php';
                        $messageid = $_POST['messageid'];
                        deleteMessage($messageid);
                        echo "<center><h3>Message Deleted</h3></center>";
                    }
                }
            }
        }
    }
}
开发者ID:ramielrowe,项目名称:Reservation-System-V1,代码行数:31,代码来源:messages.php

示例15: deleteReservation

function deleteReservation($res_id)
{
    $res_id = makeStringSafe($res_id);
    doQuery("DELETE FROM " . getDBPrefix() . "_reservations WHERE res_id = " . $res_id . "");
    logAdminDeleteReservation(getSessionVariable('user_id'), $res_id);
}
开发者ID:ramielrowe,项目名称:Reservation-System-V1,代码行数:6,代码来源:db_res_functions.php


注:本文中的getSessionVariable函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。