$this->renderas = $renderas;
$this->application = $app;
$this->vars = array();
- $this->vars['requesttoken'] = OC_Util::callRegister();
+ $this->vars['requesttoken'] = OC::$session && OC_Util::callRegister();
$parts = explode('/', $app); // fix translation when app is something like core/lostpassword
$this->l10n = OC_L10N::get($parts[0]);
*/
static public function getFormFactorExtension()
{
+ if (!\OC::$session) {
+ return '';
+ }
// if the formfactor is not yet autodetected do the
// autodetection now. For possible formfactors check the
// detectFormfactor documentation
* @return string uid or false
*/
public static function getUser() {
- $uid = OC::$session->get('user_id');
+ $uid = OC::$session ? OC::$session->get('user_id') : null;
if (!is_null($uid)) {
return $uid;
} else {