X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fpackages.inc;h=c3aa518cd3de40f0d305c77eb1a3a5248f74751e;hb=0388050f6d4c6c7c9a9db06d2f31aa8879da69a8;hp=99b620d30eae15a87b8429adbdb47d52cb876f6e;hpb=7a5b4d5610ca016856b9a4ab60ff3d490b1b0dd5;p=fa-stable.git diff --git a/includes/packages.inc b/includes/packages.inc index 99b620d3..c3aa518c 100644 --- a/includes/packages.inc +++ b/includes/packages.inc @@ -19,7 +19,8 @@ define('PUBKEY_PATH', $path_to_root); // FrontAccounting package class // class package extends gzip_file { - function package($filename, $basedir=null) + + function __construct($filename, $basedir=null) { global $path_to_root; @@ -30,7 +31,7 @@ class package extends gzip_file { } else mkdir($basedir); } - $this->archive($filename); + parent::__construct($filename); $this->set_options(array('basedir'=> $basedir)); $this->options['type'] = "pkg"; } @@ -299,6 +300,10 @@ function get_pkg_or_list($type = null, $pkgname = null, $filter=array(), $outkey $sig = url_get_contents($repo.'/Release.sig'); $data = file_get_contents($loclist); $cert = file_get_contents(PUBKEY_PATH.'/FA.pem'); + if (!function_exists('openssl_verify')) { + display_error(_("OpenSSL have to be available on your server to use extension repository system.")); + return null; + } if (openssl_verify($data, $sig, $cert) <= 0) { if ($refresh) { if (!@unlink($loclist))