diff options
Diffstat (limited to 'examples/class/framework.class.php')
-rw-r--r-- | examples/class/framework.class.php | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/examples/class/framework.class.php b/examples/class/framework.class.php index 802c821..0461da7 100644 --- a/examples/class/framework.class.php +++ b/examples/class/framework.class.php @@ -1,30 +1,7 @@ <?php -/* Define Scrott version number */ -define("__VERSION__", "v0.0"); - -/* Init PHP session */ -session_start(); - -require_once "class/mysql.class.php"; -require_once "class/user.class.php"; - -/* - * Global functions / operations and access to contextual or session-based information - */ abstract class Framework { - static $dbobj = null; - - /* - * Check for the existence of Scrott's system-level config - */ - function scrottConfExists() - { - global $_SCROTT; - return isset($_SCROTT['conf']); - } - /* * Get the absolute path on this server for the root of this app */ @@ -51,50 +28,6 @@ abstract class Framework } /* - * Get a user object for the currently logged in user. Returns false if session is logged out. - */ - function getCurrentUser() - { - if (isset($_SESSION['userguid'])) - { - $user = new User($_SESSION['userguid']); - - if ($user->type == "user") - return $user; - - $this->setCurrentUser(); - } - - return false; - } - - /* - * Get the IP address the client held when the current session began - */ - function getOriginIP() - { - return $_SESSION['userip']; - } - - /* - * Set the current logged in user - */ - function setCurrentUser($user = null) - { - if ($user != null && isset($user->guid)) - { - $_SESSION['userguid'] = $user->guid; - $_SESSION['userip'] = $_SERVER['REMOTE_ADDR']; - } - - else - { - unset($_SESSION['userguid']); - unset($_SESSION['userip']); - } - } - - /* * Get or create the app's database connection object (this is a singleton object and dependent on system-level config) */ static function getDbConnection() |