本文整理汇总了PHP中SessionController::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionController::getInstance方法的具体用法?PHP SessionController::getInstance怎么用?PHP SessionController::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionController
的用法示例。
在下文中一共展示了SessionController::getInstance方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAndClauses
public function getAndClauses(array $definitions, $db_field)
{
if ($definitions['operator'] == "LIKE" && strlen($this->_post[$definitions['alias']]) > 0) {
$this->queryString .= ' ' . $definitions['clause'] . ' ' . $definitions['table'] . '.' . $db_field . ' ' . $definitions['operator'] . ' "%' . $this->_post[$definitions['alias']] . '%" ';
} elseif ($definitions['operator'] != "LIKE" && strlen($this->_post[$definitions['alias']]) > 0) {
$this->queryString .= ' ' . $definitions['clause'] . ' ' . $definitions['table'] . '.' . $db_field . ' ' . $definitions['operator'] . ' "' . trim($this->_post[$definitions['alias']]) . '" ';
}
$querySession = SessionController::getInstance();
$querySession->setSessionVar('adminQuery', $this->queryString);
$querySession->setSessionVar('tagQuery', $this->_post['name']);
}
示例2: setWebmasterAutentication
public function setWebmasterAutentication()
{
if (isset($_POST['submit'])) {
if ($_POST['password'] == "esbien") {
$webmasterSession = SessionController::getInstance();
$webmasterSession->setSessionVar('webmaster', 1);
}
if (isset($_SESSION['webmaster'])) {
header('Location: index.php');
}
}
}
示例3: openShopSession
public function openShopSession()
{
if (isset($_POST['shop_action'])) {
$db = PDOQuery::getInstance();
$db->connect();
$sql = "INSERT INTO shop_session\n\t\t\t\t\t\t(id_user, id_shop, date, is_active)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t(?, ?, ?, 1)";
$res = $db->prepareQuery($sql);
$res->execute(array($_SESSION['id_employee'], $_SESSION['id_shop'], time()));
SessionController::getInstance()->setSessionVar('shop_session_id', $db->insert_id());
$db->close();
}
}
示例4: login
public function login( DatabaseConnection $connection ) {
if( null == $connection || null == $this->user ) {
echo "something null";
return;
}
if ( $this->user->login( $connection ) ) {
$this->session = SessionController::getInstance();
$this->session->setMessage( "Welcome back {$this->user->username}");
$this->session->setupAuthorizedSession( $this->user );
} else {
echo "not logged in";
print_r( $this->user);
}
}
示例5: __construct
private function __construct()
{
$this->connection = DatabaseConnection::getInstance();
$this->session = SessionController::getInstance();
$this->session->start();
$this->appSettings = new ApplicationSettings(APPLICATION_SETTINGS_FILE, ENVIRONMENT);
$username = '';
$this->messages = array(ERROR_MESSAGES => array(), WARNING_MESSAGES => array(), INFORMATIONAL_MESSAGES => array());
if (isset($_SESSION['username'])) {
$username = $_SESSION['username'];
}
$this->user = new User($username, '');
if ($this->session->isSessionAuthenticated()) {
$this->user->restoreUserFromUsername($this->connection);
}
}
示例6: session_start
<?php
session_start();
require_once dirname(__FILE__) . '/settings.inc.php';
require_once dirname(__FILE__) . '/functions.php';
require_once dirname(__FILE__) . '/defines.inc.php';
require_once dirname(__FILE__) . '/defines.uri.inc.php';
require_once dirname(__FILE__) . '/smarty.config.inc.php';
require_once _CONFIG_DIR_ . 'autoload.php';
/* Get Context */
$context = Context::getContext();
/* instantiate language class */
$context->languageList = array(1 => 'en', 2 => 'es', 3 => 'de', 4 => 'nl');
$context->language = new MultiLanguageClass($context->languageList);
define(_ID_LANG_, $context->language->getLanguageId());
//contains session object
$context->session = SessionController::getInstance();
/* Get Smarty */
$context->smarty = $smarty;
示例7: start
public function start()
{
$session = SessionController::getInstance();
$session->setSessionVar('crumb_list', $this->setCrumbQueue());
$this->deleteEndCrumbUnMatches();
}
示例8: setShopSession
public static function setShopSession()
{
$id_shop = $_GET['id_shop'];
if (isset($_GET['id_shop']) || empty($id_shop) || !is_numeric($id_shop)) {
SessionController::getInstance()->setSessionVar('id_shop', $_GET['id_shop']);
return true;
}
return false;
}
示例9: buildList
private function buildList($action)
{
$objects = $this->scaffoldObject->find("all");
$length = count($objects);
if (0 == $length) {
$session = SessionController::getInstance();
$session->addMessage("Could not find and objects of type {$this->scaffoldObject->table_name}. Please create a new {$this->scaffoldObject->table_name} object.");
print_r($_SESSION);
exit(0);
}
$this->loadXML("<table></table>");
$root = $this->documentElement;
$root->setAttribute("class", "scaffolding_list");
$thead = $this->createElement("thead");
$keys = array_keys($objects[0]->values);
$tr = $this->createElement("tr");
foreach ($keys as $key) {
$td = $this->createElement("td", $key);
$tr->appendChild($td);
}
$thead->appendChild($tr);
$root->appendChild($thead);
$tbody = $this->createElement("tbody");
for ($i = 0; $i < $length; $i++) {
$tr = $this->createElement("tr");
$class = 0 == $i % 2 ? "scaffolding_list_row_even" : "scaffolding_list_row_odd";
$tr->setAttribute("class", $class);
foreach ($keys as $key) {
$td = $this->createElement("td", $objects[$i]->{$key});
$tr->appendChild($td);
}
$tbody->appendChild($tr);
}
$root->appendChild($tbody);
}
示例10: getOrderDirection
public function getOrderDirection()
{
if (!isset($_GET['orderBy'])) {
return $_SESSION['asc'];
}
if ($_SESSION['order'] == true) {
SessionController::getInstance()->setSessionVar('order', false);
SessionController::getInstance()->setSessionVar('asc', 'ASC');
} else {
SessionController::getInstance()->setSessionVar('order', true);
SessionController::getInstance()->setSessionVar('asc', 'DESC');
}
return $_SESSION['asc'];
}