diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index ebc83c7af8..2112266efc 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -524,17 +524,50 @@ class OC_Mount_Config { * check dependencies */ public static function checkDependencies() { - $txt=''; + $dependencyMessages = array(); foreach (OC_Mount_Config::$backends as $class => $backend) { if (isset($backend['has_dependencies']) and $backend['has_dependencies'] === true) { $result = $class::checkDependencies(); - if ($result !== true) { - $txt.=$result.'
'; + if ($result !== true and OC_Mount_Config::findFirstSentence($dependencyMessages, $result) < 0) { + $dependencyMessages[] = $result; } } } - return $txt; + if (count($dependencyMessages) > 0) { + return implode('
', $dependencyMessages); + } + return ''; + } + + /** + * Finds the first string in an array that has the same first sentence (or part thereof) + * as a given comparison string + * @param $arr array An array of strings + * @param $str string The string to find + * @return int The position of the first occurrence or -1 if not found + */ + private static function findFirstSentence($arr, $str) { + foreach ($arr as $i => $item) { + $itemPos = strpos($item, '.'); + $strPos = strpos($str, '.'); + + if ($itemPos < 0 && $strPos < 0) { + $itemPos = strpos($item, ','); + $strPos = strpos($str, ','); + + if ($itemPos < 0 && $strPos < 0) { + $itemPos = strlen($item); + $strPos = strlen($str); + } + } + + if ($itemPos === $strPos and strncasecmp($item, $str, $itemPos) === 0) { + return $i; + } + } + + return -1; } /** diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php index 43635f7f94..a6a775ff6d 100644 --- a/apps/files_external/lib/ftp.php +++ b/apps/files_external/lib/ftp.php @@ -25,7 +25,7 @@ class FTP extends \OC\Files\Storage\StreamWrapper{ return(true); } else { $l = new \OC_L10N('files_external'); - return $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 $l->t('Note: 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.'); } } diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php index 936153b35a..cfb7005c4c 100644 --- a/apps/files_external/lib/google.php +++ b/apps/files_external/lib/google.php @@ -49,7 +49,7 @@ class Google extends \OC\Files\Storage\Common { return true; } else { $l = new \OC_L10N('files_external'); - return $l->t('Warning: The cURL support in PHP is not enabled or installed. Mounting of Google Drive is not possible. Please ask your system administrator to install it.'); + return $l->t('Note: The cURL support in PHP is not enabled or installed. Mounting of Google Drive is not possible. Please ask your system administrator to install it.'); } } diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index bfe494e867..6fb262323f 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -28,7 +28,7 @@ class SMB extends \OC\Files\Storage\StreamWrapper{ } } $l = new \OC_L10N('files_external'); - return $l->t('Warning: "smbclient" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it.'); + return $l->t('Note: "smbclient" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it.'); } public function __construct($params) { diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php index ac6663133d..0ea7a08504 100644 --- a/apps/files_external/lib/webdav.php +++ b/apps/files_external/lib/webdav.php @@ -31,7 +31,7 @@ class DAV extends \OC\Files\Storage\Common { return true; } else { $l = new \OC_L10N('files_external'); - return $l->t('Warning: The cURL support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV is not possible. Please ask your system administrator to install it.'); + return $l->t('Note: The cURL support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV is not possible. Please ask your system administrator to install it.'); } }