public static function Init($data) { if (isset($data['page']['params']['id'])) { $Account = AccountController::Get(array('ids' => $data['page']['params']['id'])); $Memberships = MembershipController::Search(array('account_id' => $Account['id'], 'operator' => 'eq')); foreach ($Memberships as $Membership) { $Act = ActController::Get(array('ids' => $Membership['act_id'])); $Roles = RoleController::Search(array('membership_id' => $Membership['id'], 'operator' => 'eq')); foreach ($Roles as $Role) { $Tag = TagController::Get(array('ids' => $Role['tag_id'])); $Act['roles'][$Tag['title']] = $Tag['title']; $Account['roles'][$Tag['title']][$Act['id']] = $Act; } $Performances = PerformanceController::Search(array('act_id' => $Act['id'])); foreach ($Performances as $Performance) { $Event = EventController::Get(array('ids' => $Performance['event_id'])); $Account['performances'][$Performance['id']] = array('where' => $Event, 'as' => $Act, 'when' => $Performance, 'with' => array()); $Act['performances'][$Event['id']] = $Event; } $Account['acts'][$Act['id']] = $Act; } $Attendings = AttendeeController::Search(array('account_id' => $Account['id'], 'operator' => 'eq')); foreach ($Attendings as $Attending) { $Event = EventController::Get(array('ids' => $Attending['event_id'])); $Account['attending'][$Event['id']] = $Event; } $data['account'] = $Account; } else { } self::SetData($data); }
public static function Init($params) { DebugManager::Log("Got a logout request!", '@'); $account = AccountController::Create($params); SessionManager::Create($account); return new ResponseObject(); }
public static function Init($params) { DebugManager::Log("Got a logout request!", '@'); /** * @todo ValidateLogin should provide a token, which is passed to * SessionManager */ if (AccountController::ValidateLogin($params)) { $account = AccountController::Search($params); SessionManager::Create(true, reset($account)); } else { self::$defaultRedirect = 'login'; } return new ResponseObject(); }
public static function Init($data) { if (isset($data['page']['params']['id'])) { $Act = ActController::Get(array('ids' => $data['page']['params']['id'])); $Memberships = MembershipController::Search(array('act_id' => $Act['id'], 'operator' => 'eq')); foreach ($Memberships as $Membership) { $Member = AccountController::Get(array('ids' => $Membership['account_id'])); $Roles = RoleController::Search(array('membership_id' => $Membership['id'], 'operator' => 'eq')); foreach ($Roles as $Role) { $Tag = TagController::Get(array('ids' => $Role['tag_id'])); $Act['roles'][$Tag['title']] = $Tag['title']; $Member['roles'][] = $Tag['title']; } $Act['members'][$Member['id']] = $Member; } $data['act'] = $Act; } else { } self::SetData($data); }
/** * Set Session Account * * ## Overview * * @uses SessionManager * @uses DebugManager * * @return array The current account associated with this session. * * @version 2015-07-05.1 * @since 0.5.1b * @author TronNet DevOps [Sean Murray] <*****@*****.**> */ public static function SetAccount($account, $persist = false) { DebugManager::Log("Setting Session Account", '@'); DebugManager::Log("Current: "); DebugManager::Log(self::$account); if ($account) { $match = AccountController::Get(array('ids' => $account['id'])); if (count($match)) { $account = $match; } } else { /** * Allowing to set 'null' to destroy session */ // throw new Exception("No account was provided! Can't set session account!"); } self::$account = $account; if ($persist) { $_SESSION['account'] = $account; } DebugManager::Log("New: "); DebugManager::Log(self::$account); return true; }