start(); # the auth feature depends on sess if (isset($feature["auth"])) { if (is_object($_SESSION['auth'])) { $_SESSION['auth'] = $_SESSION['auth']->check_feature($feature["auth"]); } else { $_SESSION['auth'] = new $feature["auth"]; } $_SESSION['auth']->start(); $GLOBALS['auth'] =& $_SESSION['auth']; # the perm feature depends on auth and sess if (isset($feature["perm"])) { if (!isset($GLOBALS['perm']) || !is_object($GLOBALS['perm'])) { $GLOBALS['perm'] = new $feature["perm"]; } } # the user feature depends on auth and sess if (isset($feature["user"])) { if (!isset($GLOBALS['user']) || !is_object($GLOBALS['user'])) { $GLOBALS['user'] = new $feature["user"]($GLOBALS['auth']->auth["uid"]); } } } } } function page_close() { try { NotificationCenter::postNotification('PageCloseWillExecute', null); } catch (NotificationVetoException $e) { return; } if (is_object($GLOBALS['sess'])) { @session_write_close(); } if (is_object($GLOBALS['user'])) { $GLOBALS['user']->set_last_action(); } NotificationCenter::postNotification('PageCloseDidExecute', null); }