]> source.dussan.org Git - nextcloud-server.git/commitdiff
add a check and a warning if setlocale is working
authorFrank Karlitschek <frank@owncloud.org>
Wed, 19 Dec 2012 14:10:33 +0000 (15:10 +0100)
committerFrank Karlitschek <frank@owncloud.org>
Wed, 19 Dec 2012 14:10:33 +0000 (15:10 +0100)
lib/base.php
lib/util.php
settings/admin.php
settings/templates/admin.php

index 0b75f6f085ef1b8ba65202febc1cd395ce5decd4..9cdadbb799183e2f977469060726a08297fb37c7 100644 (file)
@@ -474,6 +474,11 @@ class OC{
                                exit;
                        }
                }
+               
+               // write error into log if locale can't be set  
+               if(OC_Util::issetlocaleworking()==false) {
+                       OC_Log::write('core', 'setting locate to en_US.UTF-8 failed. Support is probably not installed on your system', OC_Log::ERROR);
+               }
        }
 
        /**
index fc50123b4fe9df1b1055c2e6b0ddff29530b8024..88f36e7954453f5c16149cf8aab07631299a5567 100755 (executable)
@@ -582,6 +582,18 @@ class OC_Util {
        }
 
 
+        /**
+         * Check if the setlocal call doesn't work. This can happen if the right local packages are not available on the server.
+         */
+       public static function issetlocaleworking() {
+               $result=setlocale(LC_ALL, 'en_US.UTF-8');
+               if($result==false) {
+                       return(false);
+               }else{
+                       return(true);
+               }
+       }
+
         /**
          * Check if the ownCloud server can connect to the internet
          */
index 0cf449ef2ba2f688749a0fe419c29fb0e5405f2c..0490539113844be1b241ffb5c29e2d031c17fff6 100755 (executable)
@@ -30,6 +30,7 @@ $tmpl->assign('entries', $entries);
 $tmpl->assign('entriesremain', $entriesremain);
 $tmpl->assign('htaccessworking', $htaccessworking);
 $tmpl->assign('internetconnectionworking', OC_Util::isinternetconnectionworking());
+$tmpl->assign('islocaleworking', OC_Util::issetlocaleworking());
 $tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax'));
 $tmpl->assign('shareAPIEnabled', OC_Appconfig::getValue('core', 'shareapi_enabled', 'yes'));
 $tmpl->assign('allowLinks', OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes'));
index a110e09b6928f44a51daa9ea7569eb12bd857c6d..a8e3375ab249fcf269a623db412ac920b980ac52 100644 (file)
@@ -8,6 +8,7 @@ $levels=array('Debug','Info','Warning','Error', 'Fatal');
 
 <?php
 
+// is htaccess working ?
 if(!$_['htaccessworking']) {
 ?>
 <fieldset class="personalblock">
@@ -20,9 +21,22 @@ if(!$_['htaccessworking']) {
 </fieldset>    
 <?php  
 }
+
+// is locale working ?
+if(!$_['islocaleworking']) {
 ?>
+<fieldset class="personalblock">
+        <legend><strong><?php echo $l->t('Locale not working');?></strong></legend>
+
+        <span class="connectionwarning">
+        <?php echo $l->t('This ownCloud server can\'t set system locale to "en_US.UTF-8". This means that there might be problems with certain caracters in file names. We strongly suggest to install the requirend packages on your system to support en_US.UTF-8.'); ?>
+    </span>
 
+</fieldset>
 <?php
+}
+
+// is internet connection working ?
 if(!$_['internetconnectionworking']) {
 ?>
 <fieldset class="personalblock">