All pastes #2108009 Raw Edit

Mine

public text v1 · immutable
#2108009 ·published 2012-01-31 06:39 UTC
rendered paste body
class FakeSession {

  function __construct($user_no) {
    $principal = new Principal('user_no',$user_no);
    // Assign each field in the selected record to the object
    foreach( $principal AS $k => $v ) {
      $this->{$k} = $v;
    }
    $this->username = $principal->username();
    $this->user_no  = $principal->user_no();
    $this->principal_id = $principal->principal_id();
    $this->email = $principal->email();
    $this->dav_name = $principal->dav_name();
    $this->principal = $principal;
    
    $this->logged_in = true;

  }

  function AllowedTo($do_something) {
    return true;
  }
}