From f3bd6d14eee95fa81337410c429f1f83552fd766 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Mon, 10 Dec 2012 21:10:28 +0100 Subject: [PATCH] add some output why some of the external filesystems might not work --- apps/files_external/lib/config.php | 31 ++++++++++++++++++++++ apps/files_external/personal.php | 1 + apps/files_external/settings.php | 1 + apps/files_external/templates/settings.php | 3 ++- 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 87d6886c51e..fb61689db86 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -394,4 +394,35 @@ class OC_Mount_Config { return true; } + /** + * check if smbclient is installed + */ + public static function checksmbclient() { + $output=shell_exec('which smbclient'); + return (empty($output)?false:true); + } + + /** + * check if php-ftp is installed + */ + public static function checkphpftp() { + if(function_exists('ftp_login')) { + return(true); + }else{ + return(false); + } + } + + /** + * check dependencies + */ + public static function checkDependencies() { + $l= new OC_L10N; + $txt=''; + + if(!OC_Mount_Config::checksmbclient()) $txt.=$l->t('Warning: "smbclient" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it.').'
'; + if(!OC_Mount_Config::checkphpftp()) $txt.=$l->t('Warning: The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it.').'
'; + + return($txt); + } } diff --git a/apps/files_external/personal.php b/apps/files_external/personal.php index f0d76460f54..509c2977622 100755 --- a/apps/files_external/personal.php +++ b/apps/files_external/personal.php @@ -29,5 +29,6 @@ $tmpl = new OCP\Template('files_external', 'settings'); $tmpl->assign('isAdminPage', false, false); $tmpl->assign('mounts', OC_Mount_Config::getPersonalMountPoints()); $tmpl->assign('certs', OC_Mount_Config::getCertificates()); +$tmpl->assign('dependencies', OC_Mount_Config::checkDependencies(),false); $tmpl->assign('backends', $backends); return $tmpl->fetchPage(); diff --git a/apps/files_external/settings.php b/apps/files_external/settings.php index d2be21b7116..94222149a38 100644 --- a/apps/files_external/settings.php +++ b/apps/files_external/settings.php @@ -30,5 +30,6 @@ $tmpl->assign('mounts', OC_Mount_Config::getSystemMountPoints()); $tmpl->assign('backends', OC_Mount_Config::getBackends()); $tmpl->assign('groups', OC_Group::getGroups()); $tmpl->assign('users', OCP\User::getUsers()); +$tmpl->assign('dependencies', OC_Mount_Config::checkDependencies(),false); $tmpl->assign('allowUserMounting', OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes')); return $tmpl->fetchPage(); diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index 5b954eeb50a..50f4a16a5ab 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -1,6 +1,7 @@
t('External Storage'); ?> + '')) echo ''.$_['dependencies'].''; ?> '> @@ -157,4 +158,4 @@ - \ No newline at end of file + -- 2.39.5