]> source.dussan.org Git - nextcloud-server.git/commitdiff
add some output why some of the external filesystems might not work
authorFrank Karlitschek <frank@owncloud.org>
Mon, 10 Dec 2012 20:10:28 +0000 (21:10 +0100)
committerFrank Karlitschek <frank@owncloud.org>
Mon, 10 Dec 2012 20:10:28 +0000 (21:10 +0100)
apps/files_external/lib/config.php
apps/files_external/personal.php
apps/files_external/settings.php
apps/files_external/templates/settings.php

index 87d6886c51e81dc643eebfacebcdba6d19e8b405..fb61689db86574fab43685780358c83e7840ee9a 100755 (executable)
@@ -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('<b>Warning:</b> "smbclient" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it.').'<br />';
+               if(!OC_Mount_Config::checkphpftp()) $txt.=$l->t('<b>Warning:</b> 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.').'<br />';
+
+               return($txt);
+       }
 }
index f0d76460f546056af83e35ce69c3ac8b56000a40..509c2977622817a2cc1b2ff2b431b70a7607f9b5 100755 (executable)
@@ -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();
index d2be21b71161491f083e841ad2b692c190bcfecf..94222149a38e25debb9d8d619261403a17b4ff85 100644 (file)
@@ -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();
index 5b954eeb50a2f52c32e46c97ba31f7774ac62e46..50f4a16a5aba7313ff11ab091ed358c790384a81 100644 (file)
@@ -1,6 +1,7 @@
 <form id="files_external">
        <fieldset class="personalblock">
        <legend><strong><?php echo $l->t('External Storage'); ?></strong></legend>
+                <?php if (isset($_['dependencies']) and ($_['dependencies']<>'')) echo ''.$_['dependencies'].''; ?>
                <table id="externalStorage" data-admin='<?php echo json_encode($_['isAdminPage']); ?>'>
                        <thead>
                                <tr>
                <input type="submit" name="cert_import" value="<?php echo $l->t('Import Root Certificate'); ?>" />
                <?php endif; ?>
 </fieldset>
-</form>
\ No newline at end of file
+</form>