forked from extern/egroupware
* Filemanager: added user-interface to mount WebDAV or SMB shares
This commit is contained in:
parent
df946f7c80
commit
4727340f1d
@ -83,9 +83,14 @@ class Base
|
||||
*/
|
||||
static function mount($url = null, $path = null, $check_url = null, $persistent_mount = true, $clear_fstab = false)
|
||||
{
|
||||
if(is_null($check_url))
|
||||
if ($check_url === true || !isset($check_url) && strpos($url, '$') === false)
|
||||
{
|
||||
$check_url = strpos($url, '$') === false;
|
||||
$check_url = strtr($url, [
|
||||
'user' => $GLOBALS['egw_info']['user']['account_lid'],
|
||||
'pass' => urlencode($GLOBALS['egw_info']['user']['passwd']),
|
||||
'host' => $GLOBALS['egw_info']['user']['domain'],
|
||||
'home' => str_replace(array('\\\\', '\\'), array('', '/'), $GLOBALS['egw_info']['user']['homedirectory']),
|
||||
]);
|
||||
}
|
||||
|
||||
if(!isset($GLOBALS['egw_info']['server']['vfs_fstab'])) // happens eg. in setup
|
||||
@ -134,7 +139,7 @@ class Base
|
||||
}
|
||||
self::load_wrapper(Vfs::parse_url($url, PHP_URL_SCHEME));
|
||||
|
||||
if($check_url && (!file_exists($url) || opendir($url) === false))
|
||||
if ($check_url && (!file_exists($check_url) || opendir($check_url) === false))
|
||||
{
|
||||
if(self::LOG_LEVEL > 0)
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ class filemanager_admin extends filemanager_ui
|
||||
);
|
||||
|
||||
/**
|
||||
* Autheticated user is setup config user
|
||||
* Authenticated user is setup config user
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
@ -82,146 +82,180 @@ class filemanager_admin extends filemanager_ui
|
||||
{
|
||||
if (is_array($content))
|
||||
{
|
||||
//_debug_array($content);
|
||||
if ($content['sudo'])
|
||||
try
|
||||
{
|
||||
$msg = $this->sudo($content['user'],$content['password'],self::$is_setup) ?
|
||||
lang('Root access granted.') : lang('Wrong username or password!');
|
||||
$msg_type = Vfs::$is_root ? 'success' : 'error';
|
||||
}
|
||||
elseif ($content['etemplates'] && $GLOBALS['egw_info']['user']['apps']['admin'])
|
||||
{
|
||||
$path = '/etemplates';
|
||||
$url = 'stylite.merge://default/etemplates?merge=.&lang=0&level=1&extension=xet&url=egw';
|
||||
$backup = Vfs::$is_root;
|
||||
Vfs::$is_root = true;
|
||||
Vfs::mkdir($path);
|
||||
Vfs::chgrp($path, 'Admins');
|
||||
Vfs::chmod($path, 075);
|
||||
$msg = Vfs::mount($url, $path) ?
|
||||
lang('Successful mounted %1 on %2.',$url,$path) : lang('Error mounting %1 on %2!',$url,$path);
|
||||
Vfs::$is_root = $backup;
|
||||
}
|
||||
elseif (Vfs::$is_root)
|
||||
{
|
||||
if ($content['logout'])
|
||||
if ($content['sudo'])
|
||||
{
|
||||
$msg = $this->sudo('','',self::$is_setup) ? 'Logout failed!' : lang('Root access stopped.');
|
||||
$msg_type = !Vfs::$is_root ? 'success' : 'error';
|
||||
$this->sudo($content['user'], $content['password'], $msg, true, self::$is_setup);
|
||||
$msg_type = Vfs::$is_root ? 'success' : 'error';
|
||||
}
|
||||
if ($content['mounts']['disable'] || self::$is_setup && $content['mounts']['umount'])
|
||||
elseif ($content['etemplates'] && $GLOBALS['egw_info']['user']['apps']['admin'])
|
||||
{
|
||||
if (($unmount = $content['mounts']['umount']))
|
||||
{
|
||||
$path = @key($content['mounts']['umount']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$path = @key($content['mounts']['disable']);
|
||||
}
|
||||
if (!in_array($path, self::$protected_path) && $path != '/')
|
||||
{
|
||||
$msg = Vfs::umount($path) ?
|
||||
lang('%1 successful unmounted.',$path) : lang('Error unmounting %1!',$path);
|
||||
}
|
||||
else // re-mount / with sqlFS, to disable versioning
|
||||
{
|
||||
$msg = Vfs::mount($url=Vfs\Sqlfs\StreamWrapper::SCHEME.'://default'.$path,$path) ?
|
||||
lang('Successful mounted %1 on %2.',$url,$path) : lang('Error mounting %1 on %2!',$url,$path);
|
||||
}
|
||||
}
|
||||
if (($path = $content['mounts']['path']) &&
|
||||
($content['mounts']['enable'] || self::$is_setup && $content['mounts']['mount']))
|
||||
{
|
||||
$url = str_replace('$path',$path,$content['mounts']['url']);
|
||||
if (empty($url) && $this->versioning) $url = Versioning\StreamWrapper::PREFIX.$path;
|
||||
|
||||
if ($content['mounts']['enable'] && !$this->versioning)
|
||||
{
|
||||
$msg = lang('Versioning requires <a href="http://www.egroupware.org/products">Stylite EGroupware Enterprise Line (EPL)</a>!');
|
||||
$msg_type = 'info';
|
||||
}
|
||||
elseif (!Vfs::file_exists($path) || !Vfs::is_dir($path))
|
||||
{
|
||||
$msg = lang('Path %1 not found or not a directory!',$path);
|
||||
$msg_type = 'error';
|
||||
}
|
||||
// dont allow to change mount of /apps or /templates (eg. switching on versioning)
|
||||
elseif (in_array($path, self::$protected_path))
|
||||
{
|
||||
$msg = lang('Permission denied!');
|
||||
$msg_type = 'error';
|
||||
}
|
||||
else
|
||||
{
|
||||
$msg = Vfs::mount($url,$path) ?
|
||||
lang('Successful mounted %1 on %2.',$url,$path) : lang('Error mounting %1 on %2!',$url,$path);
|
||||
}
|
||||
}
|
||||
if ($content['allow_delete_versions'] != $GLOBALS['egw_info']['server']['allow_delete_versions'])
|
||||
{
|
||||
Api\Config::save_value('allow_delete_versions', $content['allow_delete_versions'], 'phpgwapi');
|
||||
$GLOBALS['egw_info']['server']['allow_delete_versions'] = $content['allow_delete_versions'];
|
||||
$msg = lang('Configuration changed.');
|
||||
}
|
||||
}
|
||||
// delete old versions and deleted files
|
||||
if ($content['delete-versions'])
|
||||
{
|
||||
if (!Versioning\StreamWrapper::check_delete_version(null))
|
||||
{
|
||||
$msg = lang('Permission denied')."\n\n".lang('You are NOT allowed to finally delete older versions and deleted files!');
|
||||
$msg_type = 'error';
|
||||
}
|
||||
else
|
||||
{
|
||||
// we need to be root to delete files independent of permissions and ownership
|
||||
$path = '/etemplates';
|
||||
$url = 'stylite.merge://default/etemplates?merge=.&lang=0&level=1&extension=xet&url=egw';
|
||||
$backup = Vfs::$is_root;
|
||||
Vfs::$is_root = true;
|
||||
if (!Vfs::file_exists($content['versionedpath']) || !Vfs::is_dir($content['versionedpath']))
|
||||
Vfs::mkdir($path);
|
||||
Vfs::chgrp($path, 'Admins');
|
||||
Vfs::chmod($path, 075);
|
||||
$msg = Vfs::mount($url, $path) ?
|
||||
lang('Successful mounted %1 on %2.', $url, $path) : lang('Error mounting %1 on %2!', $url, $path);
|
||||
Vfs::$is_root = $backup;
|
||||
}
|
||||
elseif (Vfs::$is_root)
|
||||
{
|
||||
if ($content['logout'])
|
||||
{
|
||||
$msg = lang('Directory "%1" NOT found!', $content['versionedpath']);
|
||||
$msg_type = 'error';
|
||||
$this->sudo('', '', $msg);
|
||||
$msg_type = 'success';
|
||||
}
|
||||
else
|
||||
if ($content['mounts']['disable'] || Vfs::$is_root && $content['mounts']['umount'])
|
||||
{
|
||||
@set_time_limit(0);
|
||||
$starttime = microtime(true);
|
||||
$deleted = $errors = 0;
|
||||
|
||||
// shortcut to efficently delete every old version and deleted file
|
||||
if ($content['versionedpath'] == '/')
|
||||
if (!empty($content['mounts']['umount']))
|
||||
{
|
||||
$deleted = Versioning\StreamWrapper::purge_all_versioning($content['mtime']);
|
||||
$path = @key($content['mounts']['umount']);
|
||||
}
|
||||
else
|
||||
{
|
||||
Vfs::find($content['versionedpath'], array(
|
||||
'show-deleted' => true,
|
||||
'hidden' => true,
|
||||
'depth' => true,
|
||||
'path_preg' => '#/\.(attic|versions)/#',
|
||||
)+(!(int)$content['mtime'] ? array() : array(
|
||||
'mtime' => ($content['mtime']<0?'-':'+').(int)$content['mtime'],
|
||||
)), function($path) use (&$deleted, &$errors)
|
||||
{
|
||||
if (($is_dir = Vfs::is_dir($path)) && Vfs::rmdir($path) ||
|
||||
!$is_dir && Vfs::unlink($path))
|
||||
{
|
||||
++$deleted;
|
||||
}
|
||||
else
|
||||
{
|
||||
++$errors;
|
||||
}
|
||||
});
|
||||
$path = @key($content['mounts']['disable']);
|
||||
}
|
||||
// set umounted url for a (changed) remount
|
||||
$mounts = Vfs::mount();
|
||||
$content['mounts']['path'] = $path;
|
||||
$content['mounts']['url'] = Vfs::parse_url($mounts[$path]);
|
||||
if (!empty($content['mounts']['url']['query']))
|
||||
{
|
||||
$content['mounts']['url']['path'] .= '?'.$content['mounts']['url']['query'];
|
||||
}
|
||||
if (!in_array($path, self::$protected_path) && $path != '/')
|
||||
{
|
||||
$msg = Vfs::umount($path) ?
|
||||
lang('%1 successful unmounted.', $path) : lang('Error unmounting %1!', $path);
|
||||
}
|
||||
else // re-mount / with sqlFS, to disable versioning
|
||||
{
|
||||
$msg = Vfs::mount($url = Vfs\Sqlfs\StreamWrapper::SCHEME . '://default' . $path, $path) ?
|
||||
lang('Successful mounted %1 on %2.', $url, $path) : lang('Error mounting %1 on %2!', $url, $path);
|
||||
}
|
||||
$time = number_format(microtime(true)-$starttime, 1);
|
||||
$msg = ($errors ? lang('%1 errors deleting!', $errors)."\n\n" : '').
|
||||
lang('%1 files or directories deleted in %2 seconds.', $deleted, $time);
|
||||
$msg_type = $errors ? 'error' : 'info';
|
||||
}
|
||||
Vfs::$is_root = false;
|
||||
if (($path = $content['mounts']['path']) &&
|
||||
($content['mounts']['enable'] || Vfs::$is_root && $content['mounts']['mount']))
|
||||
{
|
||||
if (empty($content['mounts']['url']['path']) && $this->versioning)
|
||||
{
|
||||
$content['mounts']['url'] = [
|
||||
'scheme' => Versioning\StreamWrapper::SCHEME,
|
||||
'path' => $path,
|
||||
];
|
||||
}
|
||||
if (empty($content['mounts']['url']['scheme']) || $content['mounts']['url']['scheme'] === 'filesystem' && !self::$is_setup)
|
||||
{
|
||||
throw new Api\Exception\NoPermission();
|
||||
}
|
||||
$url = $content['mounts']['url']['scheme'] . '://';
|
||||
if (in_array($content['mounts']['url']['scheme'], ['smb', 'webdavs', 'vfs']))
|
||||
{
|
||||
if (empty(trim($content['mounts']['url']['user'])))
|
||||
{
|
||||
throw new Api\Exception\WrongUserinput(lang('SMB, WebDAVs and VFS require a username!'));
|
||||
}
|
||||
$url .= $content['mounts']['url']['user'] === '$user' ? '$user' : urlencode(trim($content['mounts']['url']['user']));
|
||||
if (!empty($content['mounts']['url']['pass']))
|
||||
{
|
||||
$url .= ':' . ($content['mounts']['url']['pass'] === '$pass' ? '$pass' : urlencode(trim($content['mounts']['url']['pass'])));
|
||||
}
|
||||
$url .= '@';
|
||||
}
|
||||
$url .= $content['mounts']['url']['host'] ?: 'default';
|
||||
$url .= $content['mounts']['url']['path'] ?: $path;
|
||||
|
||||
if (($content['mounts']['enable'] || substr($content['mounts']['url']['scheme'], 0, 8) === 'stylite.') && !$this->versioning)
|
||||
{
|
||||
throw new Api\Exception\WrongUserinput(lang('Versioning requires EGroupware EPL'));
|
||||
}
|
||||
elseif (!Vfs::file_exists(Vfs::decodePath($path)) || Vfs::file_exists($path) && !Vfs::is_dir($path))
|
||||
{
|
||||
throw new Api\Exception\WrongUserinput(lang('Path %1 not found or not a directory!', $path));
|
||||
}
|
||||
// don't allow changing mount of /apps or /templates (eg. switching on versioning)
|
||||
elseif (in_array($path, self::$protected_path))
|
||||
{
|
||||
throw new Api\Exception\NoPermission();
|
||||
}
|
||||
else
|
||||
{
|
||||
$msg = Vfs::mount($url, $path, true) ?
|
||||
lang('Successful mounted %1 on %2.', $url, $path) : lang('Error mounting %1 on %2!', $url, $path);
|
||||
}
|
||||
}
|
||||
if ($content['allow_delete_versions'] != $GLOBALS['egw_info']['server']['allow_delete_versions'])
|
||||
{
|
||||
Api\Config::save_value('allow_delete_versions', $content['allow_delete_versions'], 'phpgwapi');
|
||||
$GLOBALS['egw_info']['server']['allow_delete_versions'] = $content['allow_delete_versions'];
|
||||
$msg = lang('Configuration changed.');
|
||||
}
|
||||
}
|
||||
// delete old versions and deleted files
|
||||
if ($content['delete-versions'])
|
||||
{
|
||||
if (!Versioning\StreamWrapper::check_delete_version(null))
|
||||
{
|
||||
$msg = lang('Permission denied') . "\n\n" . lang('You are NOT allowed to finally delete older versions and deleted files!');
|
||||
$msg_type = 'error';
|
||||
}
|
||||
else
|
||||
{
|
||||
// we need to be root to delete files independent of permissions and ownership
|
||||
Vfs::$is_root = true;
|
||||
if (!Vfs::file_exists($content['versionedpath']) || !Vfs::is_dir($content['versionedpath']))
|
||||
{
|
||||
$msg = lang('Directory "%1" NOT found!', $content['versionedpath']);
|
||||
$msg_type = 'error';
|
||||
}
|
||||
else
|
||||
{
|
||||
@set_time_limit(0);
|
||||
$starttime = microtime(true);
|
||||
$deleted = $errors = 0;
|
||||
|
||||
// shortcut to efficently delete every old version and deleted file
|
||||
if ($content['versionedpath'] == '/')
|
||||
{
|
||||
$deleted = Versioning\StreamWrapper::purge_all_versioning($content['mtime']);
|
||||
}
|
||||
else
|
||||
{
|
||||
Vfs::find($content['versionedpath'], array(
|
||||
'show-deleted' => true,
|
||||
'hidden' => true,
|
||||
'depth' => true,
|
||||
'path_preg' => '#/\.(attic|versions)/#',
|
||||
) + (!(int)$content['mtime'] ? array() : array(
|
||||
'mtime' => ($content['mtime'] < 0 ? '-' : '+') . (int)$content['mtime'],
|
||||
)), function ($path) use (&$deleted, &$errors) {
|
||||
if (($is_dir = Vfs::is_dir($path)) && Vfs::rmdir($path) ||
|
||||
!$is_dir && Vfs::unlink($path))
|
||||
{
|
||||
++$deleted;
|
||||
}
|
||||
else
|
||||
{
|
||||
++$errors;
|
||||
}
|
||||
});
|
||||
}
|
||||
$time = number_format(microtime(true) - $starttime, 1);
|
||||
$msg = ($errors ? lang('%1 errors deleting!', $errors) . "\n\n" : '') .
|
||||
lang('%1 files or directories deleted in %2 seconds.', $deleted, $time);
|
||||
$msg_type = $errors ? 'error' : 'info';
|
||||
}
|
||||
Vfs::$is_root = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
$msg = $e->getMessage();
|
||||
$msg_type = 'error';
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -230,10 +264,11 @@ class filemanager_admin extends filemanager_ui
|
||||
$content['versionedpath'] = '/';
|
||||
$content['mtime'] = 100;
|
||||
}
|
||||
if (true) $content = array(
|
||||
$content = [
|
||||
'versionedpath' => $content['versionedpath'],
|
||||
'mtime' => $content['mtime'],
|
||||
);
|
||||
'mounts' => $content['mounts'],
|
||||
];
|
||||
if ($this->versioning)
|
||||
{
|
||||
// statistical information
|
||||
@ -256,12 +291,12 @@ class filemanager_admin extends filemanager_ui
|
||||
Framework::message($msg, $msg_type);
|
||||
|
||||
$n = 2;
|
||||
$content['mounts'] = array();
|
||||
$content['mounts']['at'] = '@';
|
||||
foreach(Vfs::mount() as $path => $url)
|
||||
{
|
||||
$content['mounts'][$n++] = array(
|
||||
'path' => $path,
|
||||
'url' => preg_replace('#://([^:@/]+):([^@/]+)@#', '://$1:****@', $url),
|
||||
'url' => preg_replace('#://([^:@/]+):((?!\$pass)[^@/]+)@#', '://$1:****@', $url),
|
||||
);
|
||||
$readonlys["disable[$path]"] = !$this->versioning || !Vfs::$is_root ||
|
||||
Vfs::parse_url($url,PHP_URL_SCHEME) != $this->versioning;
|
||||
@ -274,6 +309,23 @@ class filemanager_admin extends filemanager_ui
|
||||
'admins' => lang('Administrators'),
|
||||
'everyone' => lang('Everyone'),
|
||||
);
|
||||
$sel_options['scheme'] = [
|
||||
"webdavs" => "WebDAVs",
|
||||
"smb" => "SMB",
|
||||
"filesystem" => "Filesystem",
|
||||
"sqlfs" => "SQLfs",
|
||||
"links" => "Links",
|
||||
"stylite.versioning" => "Versioning",
|
||||
"stylite.links" => "Links+Versioning",
|
||||
"vfs" => "VFS",
|
||||
];
|
||||
foreach($sel_options['scheme'] as $scheme => $label)
|
||||
{
|
||||
if (!Vfs::load_wrapper($scheme) || !self::$is_setup && $scheme === 'filesystem')
|
||||
{
|
||||
unset($sel_options['scheme'][$scheme]);
|
||||
}
|
||||
}
|
||||
// show [Mount /etemplates] button for admin, if not already mounted and available
|
||||
$readonlys['etemplates'] = !class_exists('\EGroupware\Stylite\Vfs\Merge\StreamWrapper') ||
|
||||
($fs_tab=Vfs::mount($url)) && isset($fs_tab['/etemplates']) ||
|
||||
|
@ -444,31 +444,48 @@ class filemanager_ui
|
||||
/**
|
||||
* Make the current user (vfs) root
|
||||
*
|
||||
* The user/pw is either the setup config user or a specially configured vfs_root user
|
||||
* The user/pw is either the "root_" prefixed setup config user or a specially configured vfs_root user
|
||||
*
|
||||
* @param string $user setup config user to become root or '' to log off as root
|
||||
* @param string $password setup config password to become root
|
||||
* @param string &$msg on return error or success message
|
||||
* @param bool $allow_setup =false true: allow "root_" prefixed setup-config user/pw
|
||||
* @param boolean &$is_setup=null on return true if authenticated user is setup config user, false otherwise
|
||||
* @return boolean true is root user given, false otherwise (including logout / empty $user)
|
||||
*/
|
||||
protected function sudo($user='',$password=null,&$is_setup=null)
|
||||
protected function sudo($user='', $password='', string &$msg=null, bool $allow_setup=false, &$is_setup=null)
|
||||
{
|
||||
$is_root = $is_setup = false;
|
||||
$msg = null;
|
||||
|
||||
if (!$user)
|
||||
{
|
||||
$is_root = $is_setup = false;
|
||||
$msg = lang('Root access stopped.');
|
||||
}
|
||||
// config user & password
|
||||
elseif ($allow_setup && substr($user, 0, 5) === 'root_')
|
||||
{
|
||||
if (!($msg = setup::checkip()))
|
||||
{
|
||||
$is_root = $is_setup = setup::check_auth(substr($user, 5), $password, $GLOBALS['egw_info']['server']['config_user'],
|
||||
$GLOBALS['egw_info']['server']['config_passwd']);
|
||||
}
|
||||
}
|
||||
// or vfs root user from setup >> configuration
|
||||
else
|
||||
{
|
||||
// config user & password
|
||||
$is_setup = Api\Session::user_pw_hash($user,$password) === $GLOBALS['egw_info']['server']['config_hash'];
|
||||
// or vfs root user from setup >> configuration
|
||||
$is_root = $is_setup || $GLOBALS['egw_info']['server']['vfs_root_user'] &&
|
||||
$is_root = $GLOBALS['egw_info']['server']['vfs_root_user'] &&
|
||||
in_array($user,preg_split('/, */',$GLOBALS['egw_info']['server']['vfs_root_user'])) &&
|
||||
$GLOBALS['egw']->auth->authenticate($user, $password, 'text');
|
||||
}
|
||||
//error_log(__METHOD__."('$user','$password',$is_setup) user_pw_hash(...)='".Api\Session::user_pw_hash($user,$password)."', config_hash='{$GLOBALS['egw_info']['server']['config_hash']}' --> returning ".array2string($is_root));
|
||||
if (empty($msg))
|
||||
{
|
||||
$msg = $is_root ? lang('Root access granted.') : lang('Wrong username or password!');
|
||||
}
|
||||
//error_log(__METHOD__."('$user', '$password', $is_setup, '$msg') --> returning ".array2string($is_root));
|
||||
Api\Cache::setSession('filemanager', 'is_setup',$is_setup);
|
||||
Api\Cache::setSession('filemanager', 'is_root',Vfs::$is_root = $is_root);
|
||||
|
||||
return Vfs::$is_root;
|
||||
}
|
||||
|
||||
@ -1187,9 +1204,7 @@ class filemanager_ui
|
||||
// need to check 'setup' button (submit button in sudo popup), as some browsers (eg. chrome) also fill the hidden field
|
||||
if ($button == 'sudo' && Vfs::$is_root || $button == 'setup' && $content['sudo']['user'])
|
||||
{
|
||||
$msg = $this->sudo($button == 'setup' ? $content['sudo']['user'] : '',$content['sudo']['passwd']) ?
|
||||
lang('Root access granted.') : ($button == 'setup' && $content['sudo']['user'] ?
|
||||
lang('Wrong username or password!') : lang('Root access stopped.'));
|
||||
$this->sudo($button === 'setup' ? $content['sudo']['user'] : '', $content['sudo']['passwd'], $msg);
|
||||
unset($content['sudo']);
|
||||
$content['is_owner'] = Vfs::has_owner_rights($path);
|
||||
}
|
||||
|
@ -20,6 +20,8 @@ import {et2_button} from "../../api/js/etemplate/et2_widget_button";
|
||||
import {et2_nextmatch_controller} from "../../api/js/etemplate/et2_extension_nextmatch_controller";
|
||||
import {egw, egw_get_file_editor_prefered_mimes} from "../../api/js/jsapi/egw_global";
|
||||
import {et2_createWidget} from "../../api/js/etemplate/et2_core_widget";
|
||||
import {et2_selectbox} from "../../api/js/etemplate/et2_widget_selectbox";
|
||||
import {et2_textbox} from "../../api/js/etemplate/et2_widget_textbox";
|
||||
|
||||
/**
|
||||
* UI for filemanager
|
||||
@ -88,6 +90,12 @@ export class filemanagerAPP extends EgwApp
|
||||
// call parent
|
||||
super.et2_ready(et2, name);
|
||||
|
||||
if (name === 'filemanager.admin')
|
||||
{
|
||||
this.changeMountScheme();
|
||||
return;
|
||||
}
|
||||
|
||||
let path_widget = this.et2.getWidgetById('path');
|
||||
if(path_widget) // do NOT set not found path-widgets, as uploads works on first one only!
|
||||
{
|
||||
@ -1413,5 +1421,25 @@ export class filemanagerAPP extends EgwApp
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mount scheme change --> enable/disable user, pass and host
|
||||
*/
|
||||
changeMountScheme()
|
||||
{
|
||||
const grid = this.et2.getWidgetById('mounts');
|
||||
const scheme = (<et2_selectbox>grid.getWidgetById('url[scheme]'))?.get_value();
|
||||
|
||||
['url[user]', 'url[pass]', 'url[host]', 'colon', 'at'].forEach((name) => {
|
||||
(<et2_textbox>grid.getWidgetById(name))?.set_disabled(scheme !== 'webdavs' && scheme !== 'smb');
|
||||
});
|
||||
if (scheme === 'vfs')
|
||||
{
|
||||
['url[user]', 'at'].forEach((name) => {
|
||||
(<et2_textbox>grid.getWidgetById(name))?.set_disabled(false);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
app.classes.filemanager = filemanagerAPP;
|
||||
|
@ -159,6 +159,7 @@ files from links filemanager de Zeige Dateien aus verknüpften Einträgen
|
||||
files from subdirectories filemanager de Dateien aus Unterverzeichnissen
|
||||
files in this directory filemanager de Dateien in diesem Verzeichnis
|
||||
filesystem check reported no problems. filemanager de Überprüfung des Dateisystems ergab keine Probleme
|
||||
filesystem: mount directory (inside /var/lib/egroupware!) from host filesystem filemanager de Dateisystem: mounted Verzeichnisse (innerhalb von /var/lib/egroupware) vom Dateisystem des Hosts
|
||||
finally delete filemanager de Endgültig löschen
|
||||
finally delete all older versions and deleted files under given directory.\n\nthis can not be undone! filemanager de Ältere Versionen und gelöschte Dateien unter dem angegebenen Verzeichnis endgültig löschen.\n\nDas kann NICHT rückgängig gemacht werden!
|
||||
finally delete this version filemanager de Diese Version endgültig löschen
|
||||
@ -175,6 +176,7 @@ go to your home directory filemanager de Zu Ihrem Heimverzeichnis wechseln
|
||||
go up filemanager de in das übergeordnete Verzeichnis wechseln
|
||||
hidden upload filemanager de Hochladen nicht einsehbar
|
||||
hidden uploads filemanager de Hochladen nicht einsehbar
|
||||
hostname/ip for webdav and smb filemanager de Hostname/IP für WebDAV und SMB
|
||||
id filemanager de ID
|
||||
if you specify a directory (full vfs path) here, %1 displays an action for each document. that action allows to download the specified document with the %1 data inserted. filemanager de Wenn Sie hier ein Verzeichnis angeben (vollständiger Pfad des virtuellen Dateisystems), zeigt %1 einen Befehl für jedes Dokument an. Dieser Befehl erlaubt es, das Dokument mit %1 Daten eingefügt herunterzuladen.
|
||||
if you specify a document (full vfs path) here, %1 displays an extra document icon for each entry. that icon allows to download the specified document with the data inserted. filemanager de Wenn Sie hier ein Dokument angeben (vollständiger Pfad des virtuellen Dateisystems), zeigt %1 ein zusätzliches Dokumentsymbol für jeden Eintrag an. Dieses Symbol erlaubt es, das Dokument mit eingefügten Daten herunterzuladen.
|
||||
@ -211,14 +213,15 @@ no access filemanager de Kein Zugriff
|
||||
no files in this directory. filemanager de Keine Dateien in diesem Verzeichnis
|
||||
no preview available filemanager de Keine Vorschau verfügbar
|
||||
no version history for this file/directory filemanager de Keine Versionshistorie für diese Datei oder dieses Verzeichnis
|
||||
notebookbar filemanager de In Registern
|
||||
noone filemanager de Niemand
|
||||
notebookbar filemanager de In Registern
|
||||
older versions or deleted files filemanager de Ältere Versionen oder gelöschte Dateien
|
||||
only owner can rename or delete the content filemanager de Nur der Besitzer kann den Inhalt umbenennen oder löschen
|
||||
open filemanager de Öffnen
|
||||
open documents with collabora, if permissions are given filemanager de Dokument mit Collabora Online öffnen, falls Rechte vorhanden sind
|
||||
open odt documents with collabeditor filemanager de odt Dokumente mit CollabEditor öffnen
|
||||
operation filemanager de Vorgang
|
||||
password for webdav and smb, use $pass for password of logged in user filemanager de Passwort für WebDAV und SMB, benutzer $pass für das Passwort des angemeldeten Benutzers
|
||||
paste link filemanager de Als Verknüpfung einfügen
|
||||
path %1 not found or not a directory! filemanager de Pfad %1 nicht gefunden oder kein Verzeichnis!
|
||||
percentage filemanager de Prozentual
|
||||
@ -231,6 +234,8 @@ preview %1 filemanager de Vorschau %1
|
||||
preview of %1 filemanager de Vorschau von %1
|
||||
projectmanager filemanager de Projektmanager
|
||||
properties saved. filemanager de Eigenschaften gespeichert
|
||||
protocol to use filemanager de Zu benutzendes Protokoll
|
||||
protocols filemanager de Protokolle
|
||||
quick jump to filemanager de Springe zu
|
||||
read & write access filemanager de Lese- und Schreibzugriff
|
||||
read access only filemanager de Nur Lesezugriff
|
||||
@ -272,6 +277,8 @@ show link "your home directory" in side box menu? filemanager de Möchten Sie de
|
||||
show link "your home directory*" in side box menu?* filemanager de Möchten Sie den Verknüpfung "Ihr Home Verzeichnis" innerhalb des Seitenmenüs angezeigt bekommen?
|
||||
show link to filemanagers basedirectory (/) in side box menu? filemanager de Zeige die Verknüpfung zum Basisverzeichnis (/) des Dateimanagers im Seitenmenü?
|
||||
size filemanager de Größe
|
||||
smb, webdavs and vfs require a username! filemanager de SMB, WebDAVs und VFS benötigen einen Benutzernamen!
|
||||
smb: mount samba of windows fileserver shares filemanager de SMB: mounten von Freigaben eines Samba oder Windows Dateiservern
|
||||
some functionalities require superuser permissions, please login here as filemanager superuser - allowed users are defined in setup. filemanager de Einige Funktionalitäten benötigen Superuser-Rechte. Bitte loggen sie sich hier als Dateimanager Superuser ein (Zulässige Benutzer werden im Setup festgelegt).
|
||||
sqlfs statistics filemanager de sqlFS Statistik
|
||||
start search filemanager de Suche starten
|
||||
@ -302,11 +309,14 @@ upload files filemanager de Dateien hochladen
|
||||
use this tag for addresslabels. put the content, you want to repeat, between two tags. filemanager de Benutzen Sie dieses Symbol für Adressetiketten. Stellen Sie den Inhalt der wiederholt werden soll zwischen 2 Symbole.
|
||||
used space filemanager de Benutzter Platz
|
||||
user color indicator filemanager de Benutzer-Farbe
|
||||
username for webdav and smb, use $user for name of logged in user filemanager de Benutzername für WebDAV und SMB, benutzer $user für den Benutzername des angemeldeten Benutzers
|
||||
users and groups filemanager de Benutzer und Gruppen
|
||||
versioning filemanager de Versionierung
|
||||
versioning requires egroupware epl filemanager de Versionierung benötigt EGroupware EPL
|
||||
vfs mounts and versioning common de VFS einhängen und versionieren
|
||||
view link filemanager de Zeige Link
|
||||
webdav link copied into clipboard filemanager de WebDAV-Link in die Zwischenablage kopiert
|
||||
webdavs: mount egroupware or *cloud shares filemanager de WebDAVs: mounten von EGroupware oder *Cloud Freigaben
|
||||
who should be allowed to finally delete deleted files or old versions of a file: filemanager de Wer soll gelöschte Dateien oder ältere Versionen endgültig löschen dürfen:
|
||||
writable share link filemanager de Beschreibbare Freigabe-Link
|
||||
wrong username or password! filemanager de Falscher Benutzername oder Passwort!
|
||||
|
@ -159,6 +159,7 @@ files from links filemanager en Files from links
|
||||
files from subdirectories filemanager en Files from sub directories
|
||||
files in this directory filemanager en Files in this directory
|
||||
filesystem check reported no problems. filemanager en Filesystem check reported no problems.
|
||||
filesystem: mount directory (inside /var/lib/egroupware!) from host filesystem filemanager en Filesystem: mount directory (inside /var/lib/egroupware!) from host filesystem
|
||||
finally delete filemanager en Finally delete
|
||||
finally delete all older versions and deleted files under given directory.\n\nthis can not be undone! filemanager en Finally delete all older versions and deleted files under given directory.\n\nThis can NOT be undone!
|
||||
finally delete this version filemanager en Finally delete this version
|
||||
@ -175,6 +176,7 @@ go to your home directory filemanager en Go to your home directory
|
||||
go up filemanager en Go up
|
||||
hidden upload filemanager en Hidden upload
|
||||
hidden uploads filemanager en Hidden uploads
|
||||
hostname/ip for webdav and smb filemanager en Hostname/IP for WebDAV and SMB
|
||||
id filemanager en ID
|
||||
if you specify a directory (full vfs path) here, %1 displays an action for each document. that action allows to download the specified document with the %1 data inserted. filemanager en If you specify a directory (full vfs path) here, %1 displays an action for each document. That action allows to download the specified document with the %1 data inserted.
|
||||
if you specify a document (full vfs path) here, %1 displays an extra document icon for each entry. that icon allows to download the specified document with the data inserted. filemanager en If you specify a document (full vfs path) here, %1 displays an extra document icon for each entry. That icon allows to download the specified document with the data inserted.
|
||||
@ -219,6 +221,7 @@ open filemanager en Open
|
||||
open documents with collabora, if permissions are given filemanager en open documents with Collabora, if permissions are given
|
||||
open odt documents with collabeditor filemanager en open odt documents with CollabEditor
|
||||
operation filemanager en Operation
|
||||
password for webdav and smb, use $pass for password of logged in user filemanager en Password for WebDAV and SMB, use $pass for password of logged in user
|
||||
paste link filemanager en Paste Link
|
||||
path %1 not found or not a directory! filemanager en Path %1 not found or not a directory!
|
||||
percentage filemanager en Percentage
|
||||
@ -231,6 +234,8 @@ preview %1 filemanager en Preview %1
|
||||
preview of %1 filemanager en Preview of %1
|
||||
projectmanager filemanager en Project Manager
|
||||
properties saved. filemanager en Properties saved.
|
||||
protocol to use filemanager en Protocol to use
|
||||
protocols filemanager en Protocols
|
||||
quick jump to filemanager en Quick jump to
|
||||
read & write access filemanager en Read & write access
|
||||
read access only filemanager en Read access only
|
||||
@ -261,8 +266,8 @@ select file(s) from vfs common en Select file(s) from VFS
|
||||
setting for document merge saved. filemanager en Setting for document merge saved.
|
||||
share files filemanager en Share files
|
||||
share link copied into clipboard filemanager en Share link copied into clipboard
|
||||
shared files filemanager en Shared files
|
||||
share mounted at %1.<br/>please close this tab. filemanager en Share mounted at %1.<br/>Please close this tab.
|
||||
shared files filemanager en Shared files
|
||||
shared with filemanager en Shared with
|
||||
show filemanager en Show
|
||||
show hidden files filemanager en Show hidden files
|
||||
@ -273,6 +278,8 @@ show link "your home directory" in side box menu? filemanager en Show link "Your
|
||||
show link "your home directory*" in side box menu?* filemanager en Show link "Your home directory*" in side box menu?*
|
||||
show link to filemanagers basedirectory (/) in side box menu? filemanager en Show link to File Manager's base directory (/) in side menu?
|
||||
size filemanager en Size
|
||||
smb, webdavs and vfs require a username! filemanager en SMB, WebDAVs and VFS require a username!
|
||||
smb: mount samba of windows fileserver shares filemanager en SMB: mount Samba of Windows fileserver shares
|
||||
some functionalities require superuser permissions, please login here as filemanager superuser - allowed users are defined in setup. filemanager en Some functionalities require superuser permissions, please login here as filemanager superuser - allowed users are defined in setup.
|
||||
sqlfs statistics filemanager en sqlFS Statistics
|
||||
start search filemanager en Start search
|
||||
@ -303,11 +310,14 @@ upload files filemanager en Upload files
|
||||
use this tag for addresslabels. put the content, you want to repeat, between two tags. filemanager en Use this tag for addresslabels. Put the content, you want to repeat, between two tags.
|
||||
used space filemanager en Used space
|
||||
user color indicator filemanager en User color indicator
|
||||
username for webdav and smb, use $user for name of logged in user filemanager en Username for WebDAV and SMB, use $user for name of logged in user
|
||||
users and groups filemanager en Users and groups
|
||||
versioning filemanager en Versioning
|
||||
versioning requires egroupware epl filemanager en Versioning requires EGroupware EPL
|
||||
vfs mounts and versioning common en VFS mounts and versioning
|
||||
view link filemanager en View link
|
||||
webdav link copied into clipboard filemanager en WebDAV link copied into clipboard
|
||||
webdavs: mount egroupware or *cloud shares filemanager en WebDAVs: mount EGroupware or *Cloud shares
|
||||
who should be allowed to finally delete deleted files or old versions of a file: filemanager en Who should be allowed to finally delete deleted files or old versions of a file:
|
||||
writable share link filemanager en Writable Share link
|
||||
wrong username or password! filemanager en Wrong username or password!
|
||||
|
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE overlay PUBLIC "-//EGroupware GmbH//eTemplate 2//EN" "http://www.egroupware.org/etemplate2.dtd">
|
||||
<!-- $Id$ -->
|
||||
<overlay>
|
||||
<template id="filemanager.admin" template="" lang="" group="0" version="1.7.001">
|
||||
<groupbox disabled="!@percent_size">
|
||||
@ -40,7 +39,7 @@
|
||||
<column/>
|
||||
<column/>
|
||||
<column disabled="!@@is_root"/>
|
||||
<column disabled="!@@is_setup"/>
|
||||
<column disabled="!@@is_root"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row class="th" part="header">
|
||||
@ -49,9 +48,31 @@
|
||||
<description value="Versioning" align="center"/>
|
||||
<description value="Mount" align="center"/>
|
||||
</row>
|
||||
<row disabled="!@@is_root" part="footer">
|
||||
<textbox id="path" class="inputFullWidth"/>
|
||||
<textbox size="50" blur="stylite.versioning://default/$path" class="inputFullWidth" id="url" statustext="Backend URL to mount"/>
|
||||
<row disabled="!@@is_root" part="footer" valign="bottom">
|
||||
<textbox id="path" size="64"/>
|
||||
<vbox width="100%">
|
||||
<groupbox>
|
||||
<caption label="Protocols"/>
|
||||
<vbox class="filemanager_protocols">
|
||||
<description value="WebDAVs: mount EGroupware or *Cloud shares"/>
|
||||
<description value="SMB: mount Samba of Windows fileserver shares"/>
|
||||
<description value="{Versioning}: {Versioning requires EGroupware EPL}"
|
||||
extra_link_target="_blank" href="https://www.egroupware.org/EPL"/>
|
||||
<description value="Filesystem: mount directory (inside /var/lib/egroupware!) from host filesystem"
|
||||
extra_link_target="_blank" href="https://github.com/EGroupware/egroupware/blob/master/api/src/Vfs/Filesystem/StreamWrapper.php#L20"/>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
<hbox width="100%">
|
||||
<select id="url[scheme]" statustext="Protocol to use" onchange="app.filemanager.changeMountScheme"/>
|
||||
<description value="://"/>
|
||||
<textbox id="url[user]" blur="user" statustext="Username for WebDAV and SMB, use $user for name of logged in user" size="12"/>
|
||||
<description id="colon" value=":"/>
|
||||
<passwd id="url[pass]" blur="password" statustext="Password for WebDAV and SMB, use $pass for password of logged in user" class="filemanager_password" size="12"/>
|
||||
<description id="at"/>
|
||||
<textbox id="url[host]" blur="host" statustext="Hostname/IP for WebDAV and SMB"/>
|
||||
<textbox id="url[path]" blur="Path and query-parameters, SMB: share and optional path (with slashes!)" size="64"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
<button label="Enable" id="enable" statustext="Enable versioning for given mountpoint" class="filemanager_smallButton" align="center"/>
|
||||
<button label="Mount" id="mount" class="filemanager_smallButton" align="center"/>
|
||||
</row>
|
||||
|
@ -102,6 +102,12 @@ table.egwGridView_grid .tile .file_tile {
|
||||
font-size: 90%;
|
||||
margin: 0;
|
||||
}
|
||||
.filemanager_password > input {
|
||||
min-width: 0 !important;
|
||||
}
|
||||
div.filemanager_protocols > *:before {
|
||||
content: "• ";
|
||||
}
|
||||
.filemanager_header {
|
||||
font-size: 120%;
|
||||
font-weight: bold;
|
||||
|
@ -21,7 +21,6 @@
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @author Stefan Reinhardt <stefan.reinhardt@pixelegg.de>
|
||||
* @package filemanager
|
||||
* @version $Id$
|
||||
*/
|
||||
/**
|
||||
* EGroupware - CSS Styles used by filemanager app
|
||||
@ -134,6 +133,12 @@ input.displayNone {
|
||||
font-size: 90%;
|
||||
margin: 0;
|
||||
}
|
||||
.filemanager_password > input {
|
||||
min-width: 0 !important;
|
||||
}
|
||||
div.filemanager_protocols > *:before {
|
||||
content: "• ";
|
||||
}
|
||||
.filemanager_header {
|
||||
font-size: 120%;
|
||||
font-weight: bold;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @author Stefan Reinhardt <stefan.reinhardt@pixelegg.de>
|
||||
* @package filemanager
|
||||
* @version $Id$
|
||||
*/
|
||||
/**
|
||||
* EGroupware - CSS Styles used by filemanager app
|
||||
@ -122,6 +121,12 @@ input.displayNone {
|
||||
font-size: 90%;
|
||||
margin: 0;
|
||||
}
|
||||
.filemanager_password > input {
|
||||
min-width: 0 !important;
|
||||
}
|
||||
div.filemanager_protocols > *:before {
|
||||
content: "• ";
|
||||
}
|
||||
.filemanager_header {
|
||||
font-size: 120%;
|
||||
font-weight: bold;
|
||||
@ -270,6 +275,13 @@ div#filemanager-file_tabs {
|
||||
}
|
||||
div#filemanager-file_tabs span.ui-icon-search {
|
||||
/*.background_color_10_gray;*/
|
||||
-webkit-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5);
|
||||
-moz-box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5);
|
||||
box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5);
|
||||
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
position: relative;
|
||||
top: 3px;
|
||||
margin-left: 3px;
|
||||
|
@ -9,10 +9,8 @@
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @author Stefan Reinhardt <stefan.reinhardt@pixelegg.de>
|
||||
* @package filemanager
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
|
||||
@import (reference) "../../../pixelegg/less/definitions.less";
|
||||
@import (reference) "../../../pixelegg/less/def_mobile.less";
|
||||
@import (less) "../default/app.css";
|
||||
|
Loading…
Reference in New Issue
Block a user