[Pkg-owncloud-commits] [owncloud] 206/394: backport pull request #813 Check if smclient and php_ftp are installed

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:12:05 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.

commit 3a5271dd2e2bce343b03cffe8008f72dcc13a28f
Author: Frank Karlitschek <frank at owncloud.org>
Date:   Wed Dec 12 15:29:10 2012 +0100

    backport pull request #813
    Check if smclient and php_ftp are installed
---
 apps/files_external/lib/config.php         |   35 ++++++++++++++++++++++++++++
 apps/files_external/personal.php           |    1 +
 apps/files_external/settings.php           |    1 +
 apps/files_external/templates/settings.php |    3 ++-
 4 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index d87cf78..1deb287 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -327,4 +327,39 @@ class OC_Mount_Config {
 		return true;
 	}
 
+	/**
+	 * check if smbclient is installed 
+	 */
+	public static function checksmbclient() {
+		if(function_exists('shell_exec')) {
+			$output=shell_exec('which smbclient');
+			return (empty($output)?false:true);
+		}else{
+			return(false);
+		}
+	}
+
+	/**
+	 * 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('files_external');
+		$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);
+	}
+
 }
diff --git a/apps/files_external/personal.php b/apps/files_external/personal.php
index f0d7646..509c297 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 d2be21b..9422214 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 367ce2b..ad518d0 100644
--- a/apps/files_external/templates/settings.php
+++ b/apps/files_external/templates/settings.php
@@ -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>
@@ -113,4 +114,4 @@
         <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>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list