diff options
author | Daniel Stefan Haischt <dsh@pfsense.org> | 2006-07-21 18:38:19 +0000 |
---|---|---|
committer | Daniel Stefan Haischt <dsh@pfsense.org> | 2006-07-21 18:38:19 +0000 |
commit | 1495716571e0b8a8a0e9e162e766f55a9e97ac6b (patch) | |
tree | bb21ed631ab263cecce3ca5b6cdccacb63adc87e | |
parent | d0ce596d4fd0de19c5a56efc5b57139c211c78ab (diff) | |
download | pfsense-packages-1495716571e0b8a8a0e9e162e766f55a9e97ac6b.tar.gz pfsense-packages-1495716571e0b8a8a0e9e162e766f55a9e97ac6b.tar.bz2 pfsense-packages-1495716571e0b8a8a0e9e162e766f55a9e97ac6b.zip |
- dynamically load the bcompiler extension if it has not been loaded already.
-rw-r--r-- | packages/dspam/pkg/dspam-guifunc.inc | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/packages/dspam/pkg/dspam-guifunc.inc b/packages/dspam/pkg/dspam-guifunc.inc index 5de9f3cb..121bc8b5 100644 --- a/packages/dspam/pkg/dspam-guifunc.inc +++ b/packages/dspam/pkg/dspam-guifunc.inc @@ -427,34 +427,40 @@ function &DisplayInfos() { $validity = "invalide (license files not found)"; } - require_once ("knione"); - $gen_lkey = getNIONEKey(trim($owneru), trim($ownerc)); - if (trim($lkey) <> $gen_lkey) { $validity = "invalide (wrong license key)"; } - - $cdate = mktime(0, 0, 0, date("m"), - date("d"), - date("Y")); - - $edate = mktime(0, 0, 0, date("m", $pdate), - date("d", $pdate), - date("Y", $pdate)+1); + if(! extension_loaded( 'bcompiler' )) { + if(@dl( 'bcompiler.so' )) { + require_once ("knione"); + $gen_lkey = getNIONEKey(trim($owneru), trim($ownerc)); + if (trim($lkey) <> $gen_lkey) { $validity = "invalide (wrong license key)"; } + + $cdate = mktime(0, 0, 0, date("m"), + date("d"), + date("Y")); + + $edate = mktime(0, 0, 0, date("m", $pdate), + date("d", $pdate), + date("Y", $pdate)+1); + + if ($edate < $cdate || + $pdate > $cdate) { + $validity = "invalide (license expired)"; + } - if ($edate < $cdate || - $pdate > $cdate) { - $validity = "invalide (license expired)"; - } + if ($fd = @fopen("{$g['conf_path']}/nione.lic.sha1", "r")) { + $chksum = str_replace("SHA1 (nione.lic) = ", "", fgets($fd, 4096)); + $chksum_new = sha1_file("{$g['conf_path']}/nione.lic"); - if ($fd = @fopen("{$g['conf_path']}/nione.lic.sha1", "r")) { - $chksum = str_replace("SHA1 (nione.lic) = ", "", fgets($fd, 4096)); - $chksum_new = sha1_file("{$g['conf_path']}/nione.lic"); + if (trim($chksum) !== trim($chksum_new)) { + $validity = "invalide (wrong license file checksum)"; + } - if (trim($chksum) !== trim($chksum_new)) { - $validity = "invalide (wrong license file checksum)"; + fclose($fd); + } else { + $validity = "invalide (license files not found)"; + } + } else { + $validity = "invalide (extension missing, which is necessary to validate license data.)"; } - - fclose($fd); - } else { - $validity = "invalide (license files not found)"; } } else { $validity = "invalide (license files not found)"; |