Campustream 1.0
A social network MQP for WPI
core/lib/immutablesession.php
Go to the documentation of this file.
00001 <?php
00002 
00003 // ImmutableSession is used to create a read-only non-modifiable session. It is used by
00004 // the API to authenticate method calls using an OAuth or PIN Authentication. It silently
00005 // ignores all writes.
00006 
00007 class ImmutableSession {
00008         
00009         public $sess_object = '';
00010         private $sess_user = null;
00011         
00012         public function __construct($user) {
00013                 require($GLOBALS['APPROOT'] . 'application/config/sessions.php');
00014                 $this->sess_object = $SESSION_OBJECT;
00015                 
00016                 $this->sess_user = $user;
00017         }
00018         
00019         public function get_session_object() {
00020                 return $this->sess_user;
00021         }
00022         
00023         public function get($key) {
00024                 return $this->__get($key);
00025         }
00026         
00027         public function set($key, $value) {
00028                 return $this->__set($key, $value);
00029         }
00030         
00031         public function __set($key, $value) {
00032                 return;
00033         }
00034         
00035         public function __get($key) {
00036                 return ($key == "authenticated") ? true : null;
00037         }
00038         
00039 }