Fixed system tests and error handling for extension repository functions.
authorJanusz Dobrowolski <janusz@frontaccouting.eu>
Sun, 8 Apr 2012 17:22:36 +0000 (19:22 +0200)
committerJanusz Dobrowolski <janusz@frontaccouting.eu>
Sun, 8 Apr 2012 17:22:36 +0000 (19:22 +0200)
includes/packages.inc
includes/system_tests.inc

index bb7a096e0d79aaf8f0d711a25e3867cca07b77d8..e3c55e28e4b38999da3bb66ae3d5635b5baf1f5c 100644 (file)
@@ -288,7 +288,7 @@ function get_pkg_or_list($type = null, $pkgname = null, $filter=array(), $outkey
                $sig = url_get_contents(REPO_URL.'/Release.sig');
                $data = file_get_contents($loclist);
                $cert = file_get_contents(PUBKEY_PATH.'/FA.pem');
-               if (!openssl_verify($data, $sig, $cert)) {
+               if (openssl_verify($data, $sig, $cert) <= 0) {
                        if ($refresh) {
                                if (!@unlink($loclist))
                                {
index 710178e4e294fe2dc9bb6f17a0a1d771c38faaa8..0729ec432c7de90b2a144e08423f73746690573c 100644 (file)
@@ -359,9 +359,18 @@ function tst_extconfig($install)
                $test['result'] &= $t;
        }
 
+       foreach(array('Release', 'Themes', 'Languages', 'Extensions', 'Charts') as $file) {
+               $fname = $path_to_root."/modules/_cache/".$file.".gz";
+               $t = !file_exists($fname) || is_writable($fname);
+               if (!$t)
+                       $test['comments'][] = sprintf(_("'%s' is not writeable"), $fname);
+               $test['result'] &= $t;
+       }
+
        if(!$test['result'])
                $test['comments'][] = _("Extensions configuration files and directories should be writeable");
 
+       $fname = $path_to_root."/themes";
        $themedir = opendir($fname);
        while (false !== ($fname = readdir($themedir)))
        {