/** * get the current active user * * @return \OCP\IUser|null Current user, otherwise null */ public function getUser() { // FIXME: This is a quick'n dirty work-around for the incognito mode as // described at https://github.com/owncloud/core/pull/12912#issuecomment-67391155 if (\OC_User::isIncognitoMode()) { return null; } if ($this->activeUser) { return $this->activeUser; } else { $uid = $this->session->get('user_id'); if ($uid !== null) { $this->activeUser = $this->manager->get($uid); return $this->activeUser; } else { return null; } } }