mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 14:23:17 -04:00
adding auth mode to ui and the url
This commit is contained in:
parent
884635557a
commit
331ad15d9b
2 changed files with 7 additions and 0 deletions
|
|
@ -121,6 +121,7 @@ class OC_Mount_Config {
|
|||
'use_logon_credentials' => '!Use ownCloud login',
|
||||
'user' => 'Username',
|
||||
'password' => '*Password',
|
||||
'auth_mode' => 'Authentication Mode',
|
||||
'zone' => 'Zone'));
|
||||
|
||||
return($backends);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ namespace OC\Files\Storage;
|
|||
set_include_path(get_include_path() . PATH_SEPARATOR .
|
||||
\OC_App::getAppPath('files_external') . '/3rdparty/irodsphp/prods/src');
|
||||
|
||||
require_once 'ProdsConfig.inc.php';
|
||||
require_once 'ProdsStreamer.class.php';
|
||||
|
||||
class iRODS extends \OC\Files\Storage\StreamWrapper{
|
||||
|
|
@ -21,6 +22,7 @@ class iRODS extends \OC\Files\Storage\StreamWrapper{
|
|||
private $zone;
|
||||
private $root;
|
||||
private $use_logon_credentials;
|
||||
private $auth_mode;
|
||||
|
||||
public function __construct($params) {
|
||||
if (isset($params['host']) && isset($params['user']) && isset($params['password'])) {
|
||||
|
|
@ -30,6 +32,7 @@ class iRODS extends \OC\Files\Storage\StreamWrapper{
|
|||
$this->password=$params['password'];
|
||||
$this->use_logon_credentials=$params['use_logon_credentials'];
|
||||
$this->zone=$params['zone'];
|
||||
$this->auth_mode=isset($params['auth_mode']) ? $params['auth_mode'] : '';
|
||||
|
||||
$this->root=isset($params['root'])?$params['root']:'/';
|
||||
if ( ! $this->root || $this->root[0]!='/') {
|
||||
|
|
@ -67,6 +70,9 @@ class iRODS extends \OC\Files\Storage\StreamWrapper{
|
|||
*/
|
||||
public function constructUrl($path) {
|
||||
$userWithZone = $this->user.'.'.$this->zone;
|
||||
if ($this->auth_mode === '') {
|
||||
$userWithZone .= $this->auth_mode;
|
||||
}
|
||||
return 'rods://'.$userWithZone.':'.$this->password.'@'.$this->host.':'.$this->port.$this->root.$path;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue