diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-09-11 00:01:55 -0700 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-09-11 00:01:55 -0700 |
commit | 4ab8dc9c083f0fd90665ba1614c0600ef1b5da9f (patch) | |
tree | 40098bacb4fefb49a9acd572cf8ae90183604fd5 | |
parent | a2ade4294cae84f592ad32a21b1d3beaa696844f (diff) | |
parent | 3b835ea1b6e6bfffa98ea10e4cb561b0fb31e5d6 (diff) | |
download | nextcloud-server-4ab8dc9c083f0fd90665ba1614c0600ef1b5da9f.tar.gz nextcloud-server-4ab8dc9c083f0fd90665ba1614c0600ef1b5da9f.zip |
Merge pull request #4788 from owncloud/fixin-irods-session-master
Fixing session handling in iRODS
-rw-r--r-- | apps/files_external/lib/irods.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/apps/files_external/lib/irods.php b/apps/files_external/lib/irods.php index 7ec3b3a0cfc..b8191db2f2e 100644 --- a/apps/files_external/lib/irods.php +++ b/apps/files_external/lib/irods.php @@ -27,12 +27,12 @@ class iRODS extends \OC\Files\Storage\StreamWrapper{ private $auth_mode; public function __construct($params) { - if (isset($params['host']) && isset($params['user']) && isset($params['password'])) { + if (isset($params['host'])) { $this->host = $params['host']; - $this->port = $params['port']; - $this->user = $params['user']; - $this->password = $params['password']; - $this->use_logon_credentials = $params['use_logon_credentials']; + $this->port = isset($params['port']) ? $params['port'] : 1247; + $this->user = isset($params['user']) ? $params['user'] : ''; + $this->password = isset($params['password']) ? $params['password'] : ''; + $this->use_logon_credentials = ($params['use_logon_credentials'] === 'true'); $this->zone = $params['zone']; $this->auth_mode = isset($params['auth_mode']) ? $params['auth_mode'] : ''; @@ -42,10 +42,11 @@ class iRODS extends \OC\Files\Storage\StreamWrapper{ } // take user and password from the session - if ($this->use_logon_credentials && isset($_SESSION['irods-credentials']) ) + if ($this->use_logon_credentials && \OC::$session->exists('irods-credentials')) { - $this->user = $_SESSION['irods-credentials']['uid']; - $this->password = $_SESSION['irods-credentials']['password']; + $params = \OC::$session->get('irods-credentials'); + $this->user = $params['uid']; + $this->password = $params['password']; } //create the root folder if necessary @@ -59,7 +60,7 @@ class iRODS extends \OC\Files\Storage\StreamWrapper{ } public static function login( $params ) { - $_SESSION['irods-credentials'] = $params; + \OC::$session->set('irods-credentials', $params); } public function getId(){ |