本文整理匯總了PHP中session::getSID方法的典型用法代碼示例。如果您正苦於以下問題:PHP session::getSID方法的具體用法?PHP session::getSID怎麽用?PHP session::getSID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類session
的用法示例。
在下文中一共展示了session::getSID方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run
public function run()
{
$tpl = new template();
$login = new login(session::getSID());
$tpl->assign('login', $login);
$tpl->display('general.header');
}
示例2: run
public function run()
{
$login = new login(session::getSID());
if ($login->logged_in() === true) {
header("Location: /index.php?logout=1");
}
}
示例3: run
public function run()
{
$login = new login(session::getSID());
if ($login->logged_in() === true) {
$user = new users();
$profilePicture = $user->getProfilePicture($_SESSION['userdata']['id']);
$tpl = new template();
$tpl->assign("profilePicture", $profilePicture);
$tpl->assign("userName", $_SESSION['userdata']['name']);
$tpl->assign("userEmail", $_SESSION['userdata']['mail']);
$tpl->display("general.loginInfo");
}
}
示例4: start
/**
* start - renders applicaiton and routes to correct template, writes content to output buffer
*
* @access public static
* @return void
*/
public function start()
{
$config = new config();
$login = new login(session::getSID());
$frontController = frontcontroller::getInstance(ROOT);
if ($login->logged_in() === false) {
if (isset($_GET['export']) === true) {
ob_start();
$frontController->run();
$toRender = ob_get_clean();
} else {
ob_start();
include 'includes/templates/' . TEMPLATE . '/login.php';
$toRender = ob_get_clean();
}
} else {
ob_start();
include 'includes/templates/' . TEMPLATE . '/content.php';
$toRender = ob_get_clean();
}
$this->render($toRender);
}
示例5: run
public function run()
{
$login = new login(session::getSID());
if ($login->logged_in() === true) {
$tpl = new template();
//Messages
$message = new messages();
$messages = $message->getInbox($_SESSION['userdata']['id'], 5, 0);
$messageCount = count($messages);
if ($messageCount) {
$mailOptions = array('class' => 'dropdown-toggle', 'data-toggle' => 'dropdown', 'href' => '#');
} else {
$mailOptions = array('class' => 'dropdown-toggle');
}
$tpl->assign("mailOptions", $mailOptions);
$tpl->assign("messagecount", $messageCount);
$tpl->assign("messages", $messages);
$tpl->assign("helper", new helper());
//Tickets
$tickets = new tickets();
$newTickets = $tickets->getUnreadTickets($_SESSION['userdata']['id']);
$ticketCount = count($newTickets);
if (count($newTickets)) {
$ticketOptions = array('class' => 'dropdown-toggle', 'data-toggle' => 'dropdown', 'data-target' => '#');
} else {
$ticketOptions = array('class' => 'dropdown-toggle');
}
if (is_array($newTickets) === true) {
$limitedTicketItems = array_slice($newTickets, 0, 5);
} else {
$limitedTicketItems = array();
}
$tpl->assign("tickeOptions", $ticketOptions);
$tpl->assign("ticketCount", $ticketCount);
$tpl->assign("newTickets", $limitedTicketItems);
$tpl->display("general.headMenu");
}
}
示例6: define
<?php
define('VERSION', '0.6');
define('RESTRICTED', TRUE);
define('PUBLIC', TRUE);
define('MYFILE', basename($_SERVER['PHP_SELF'], ".d"));
define('TEMPLATE', 'zypro');
$root = dirname(__FILE__);
define('ROOT', $root);
include_once 'config/settings.php';
include_once 'core/class.autoload.php';
include_once 'config/configuration.php';
$login = new login(session::getSID());
ob_start();
if ($login->logged_in() !== true) {
$login->showLogin();
$loginContent = ob_get_clean();
ob_start();
} else {
$loginContent = '';
}
$application = new application();
$application->start();
ob_end_flush();
示例7: run
/**
* run - display template and edit data
*
* @access public
*
*/
public function run()
{
$login = new login(session::getSID());
//Check if user is logged in
if ($login->logged_in() !== true) {
exit;
}
$helper = new helper();
$projects = new projects();
$tickets = new tickets();
$module = $_GET['module'];
//Organize ajax handlers by module and action
if ($module == "tickets.showAll") {
// AJAX status change
if (isset($_POST['ticketId'])) {
$ticketId = $_POST['ticketId'];
$newStatus = $_POST['newStatus'];
if ($tickets->getAccessRights($ticketId)) {
if ($tickets->changeStatus($ticketId, $newStatus) === true) {
echo "Status was changed";
} else {
echo "Error with change";
}
} else {
echo "You have no rights to do that.";
}
}
} else {
if ($module == "tickets.showTicket") {
$users = new users();
$id = $_GET['id'];
$results = $tickets->getTimelineHistory($id);
$ticket = $tickets->getTicket($id);
$jsonArr = array();
$description = strip_tags($ticket['description']);
$description = str_replace("\n", "", $description);
$description = str_replace("\r", "", $description);
$json = '{"timeline":
{ "headline":"Ticket History for ' . $ticket['headline'] . '",
"type":"default",
"text":"' . $description . '",
"startDate":"' . $ticket['timelineDate'] . '",
"date": [ ';
//Creation Date
$items[] = '{
"startDate":"' . $ticket['timelineDate'] . '",
"headline":"Ticket Created",
"text":"<p>Ticket created by ' . $ticket['userFirstname'] . ', ' . $ticket['userLastname'] . '</p>",
"asset":
{ "media":"",
"credit":"",
"caption":""
}
}';
foreach ($results as $row) {
$items[] = '{
"startDate":"' . $row['date'] . '",
"headline":"Ticket Update",
"text":"<p>' . $row['firstname'] . ', ' . $row['lastname'] . ' changed ' . $row['changeType'] . ' to ' . $row['changeValue'] . '</p>",
"asset":
{ "media":"' . $users->getProfilePicture($row['userId']) . '",
"credit":"' . $row['firstname'] . ', ' . $row['lastname'] . '",
"caption":""
}
}';
}
$comments = new comments();
$allcomments = $comments->getComments('ticket', $id);
foreach ($allcomments as $comment) {
$items[] = '{
"startDate":"' . $comment['timelineDate'] . '",
"headline":"New Comment",
"text":' . json_encode('<p>' . $comment['firstname'] . ', ' . $comment['lastname'] . ' said:<br /> </p>' . $comment['text']) . ',
"asset":
{ "media":"' . $users->getProfilePicture($comment['userId']) . '",
"credit":"' . $comment['firstname'] . ', ' . $comment['lastname'] . '",
"caption":""
}
}';
}
$file = new files();
$files = $file->getFilesByModule('ticket', $id);
$tempStr = '';
$tempStr3 = '';
$imgExtensions = array('jpg', 'jpeg', 'png', 'gif', 'psd', 'bmp', 'tif', 'thm', 'yuv');
foreach ($files as $fileRow) {
if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/userdata/' . $fileRow['module'] . '/' . $fileRow['encName'] . '.' . $fileRow['extension'])) {
$tempStr3 .= "<img style='max-height: 50px; max-width: 70px;' src='userdata/" . $fileRow["module"] . "/" . $fileRow['encName'] . "." . $fileRow["extension"] . "' />";
$filepath = "userdata/" . $fileRow["module"] . "/" . $fileRow['encName'] . "." . $fileRow["extension"] . "";
} else {
$tempStr3 .= "<img style='max-height: 50px; max-width: 70px;' src='userdata/file.png' />";
$filepath = "userdata/file.png";
}
$tempStr = '{
//.........這裏部分代碼省略.........