本文整理汇总了PHP中SessionManager::GetAccount方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionManager::GetAccount方法的具体用法?PHP SessionManager::GetAccount怎么用?PHP SessionManager::GetAccount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionManager
的用法示例。
在下文中一共展示了SessionManager::GetAccount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Init
/**
* Initialize Page Manager
*
* ## Overview
*
* @uses SatanBarbaraApp
* @uses SessionManager
* @uses ViewManager
* @uses DebugManager
* @uses RouteManager
* @uses PageView
*
* @see RouteManager
*
* @param array An array of creds for SendGrid API.
* @return true Always unless fatal error or exception is thrown.
*
* @version 2015-07-05.1
* @since 0.5.1b
* @author TronNet DevOps [Sean Murray] <smurray@tronnet.me>
*/
public static function Init($params)
{
DebugManager::Log("Initializing Page Manager", '@');
DebugManager::Log($params);
$appConfig = SatanBarbaraApp::GetConfig();
/**
* @todo have config in it's own 'config' position instead of array_merge
*/
$data = array('app' => array_merge($appConfig[SATANBARBARA_CURRENT_ENVIRONMENT], array()), 'page' => $params);
DebugManager::Log("checking if logged in...", null, 3);
if (SessionManager::IsLoggedIn()) {
$data['session'] = array('is_auth' => true, 'account' => SessionManager::GetAccount());
DebugManager::Log("Got an account, checking for a saved program...", null, 3);
}
$Page = ucfirst($params['page']) . 'View';
DebugManager::Log("Searching for view with class name: " . $Page);
if ($Page::HasAccess(SessionManager::GetAccessLevel())) {
$Page::Init($data);
ViewManager::Render($Page);
} else {
DebugManager::Log("looks like this page requires auth but user isn't authenticated!");
RouteManager::GoToPageURI('login');
}
return true;
}
示例2: Init
public static function Init($params)
{
DebugManager::Log("Got a logout request!", '@');
$params['start'] = date('c', strtotime($params['start']));
$params['end'] = date('c', strtotime($params['end']));
$Account = SessionManager::GetAccount();
try {
$Event = EventController::Create($params);
} catch (Exception $e) {
return new ResponseObject("Error", 1);
}
if (isset($params['acts']) && is_array($params['acts'])) {
foreach ($params['acts'] as $pos => $act) {
try {
$Act = ActController::Create(array('title' => $act));
} catch (Exception $e) {
$Acts = ActController::Search(array('title' => $act));
$Act = reset($Acts);
}
try {
if (isset($params['slots'][$pos])) {
$slot = date('c', strtotime($params['slots'][$pos]));
} else {
if (isset($slot)) {
$slot = date('c', strtotime('+1 hour', $slot));
} else {
$slot = date('c', strtotime('+30 minutes', $params['start']));
}
}
$Performance = PerformanceController::Create(array('act_id' => $Act['id'], 'event_id' => $Event['id'], 'position' => $pos, 'slot' => $slot));
} catch (Exception $e) {
}
}
}
if (isset($params['venue'])) {
try {
$Venue = VenueController::Create(array('title' => $params['venue']));
} catch (Exception $e) {
$Venues = VenueController::Search(array('title' => $params['venue']));
$Venue = reset($Venues);
}
try {
$Hoster = HosterController::Create(array('venue_id' => $Venue['id'], 'event_id' => $Event['id']));
} catch (Exception $e) {
}
}
$Attendee = AttendeeController::Create(array('account_id' => $Account['id'], 'event_id' => $Event['id'], 'privilege_level' => 3, 'role' => 3, 'type' => 3));
self::$defaultRedirect = 'event/' . $Event['id'];
return new ResponseObject();
}
示例3: Init
public static function Init($params)
{
DebugManager::Log("Got a logout request!", '@');
$Account = SessionManager::GetAccount();
try {
$Location = LocationController::Create($params);
} catch (Exception $e) {
$Locations = LocationController::Search($params);
$Location = reset($Locations);
}
try {
$Venue = VenueController::Update(array('ids' => $params['venue_id'], 'location_id' => $Location['id']));
} catch (Exception $e) {
}
self::$defaultRedirect = 'venue/' . $Venue['id'];
return new ResponseObject();
}