示例#1
0
 public function __construct(&$dBAssertor, &$datastore, &$config, $userid)
 {
     $restoreSessionInfo = array('userid' => $userid);
     parent::__construct($dBAssertor, $datastore, $config, '', $restoreSessionInfo);
     $this->set('userid', $userid);
     //If we are in unit test we need to force a load of userinfo.
     if (defined('VB_AREA') and VB_AREA == 'Unit Test' and $userid > 0) {
         $useroptions = array();
         if (defined('IN_CONTROL_PANEL')) {
             $useroptions[] = vB_Api_User::USERINFO_ADMIN;
         }
         $this->userinfo = vB_User::fetchUserInfo($this->vars['userid'], $useroptions, $this->vars['languageid'], true);
     }
     //needed for error message handling.
     $_SERVER['HTTP_HOST'] = 'commandline';
 }
示例#2
0
 public function __construct($dBAssertor, $datastore, $config, $sessionhash = '', $vbApiParamsToVerify = array(), $vBApiRequests = array())
 {
     // we need this for validation, so can't wait for parent constructor
     $this->dBAssertor =& $dBAssertor;
     $this->datastore =& $datastore;
     $this->config =& $config;
     // Below call will either set $this->apiclient with the matched apiclient record, or throw an exception.
     $this->validateApiSession($vbApiParamsToVerify, $vBApiRequests);
     /*
     			VBV-12249 was broken by VBV-13651. It seems that before r82998, the behavior for API sessions was
     			to ALWAYS try to remember a session if a not-expired session was not found. The changes in VBV-13651
     			seems to have completely broken this, so in order to force API sessions to always try to remember
     			the session, we force the 'remembermetoken' to evaluate not empty, and not == 'facebook' (so boolean
     			true won't work, thanks PHP)
     			See the JIRAs, commits, & vB_session::loadExistingSession() for details.
     */
     $restoreSessionInfo = array('remembermetoken' => 'hello, this is api');
     parent::__construct($dBAssertor, $datastore, $config, $sessionhash, $restoreSessionInfo);
 }
示例#3
0
 public function __construct(&$dBAssertor, &$datastore, &$config, $styleid = 0, $languageid = 0)
 {
     parent::__construct($dBAssertor, $datastore, $config, '', array(), $styleid, $languageid);
 }
示例#4
0
 protected function __construct(&$dBAssertor, &$datastore, &$config, $sessionhash = '', $restoreSessionInfo = array(), $styleid = 0, $languageid = 0)
 {
     parent::__construct($dBAssertor, $datastore, $config, $sessionhash, $restoreSessionInfo, $styleid, $languageid);
 }