Skip to content

Commit

Permalink
only check online keys during nightly cron
Browse files Browse the repository at this point in the history
  • Loading branch information
tm1000 committed Jun 11, 2015
1 parent d218a73 commit fe05ae1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion amp_conf/bin/module_admin
Expand Up @@ -550,6 +550,10 @@ function showInfo($modulename) {

}

function updateKeys() {
FreePBX::GPG()->refreshKeys();
}

function showList($online = false) {
global $amp_conf;
$modulef =& module_functions::create();
Expand All @@ -567,7 +571,7 @@ function showList($online = false) {
}
ksort($modules);

$modulef->getAllSignatures(false);
$modulef->getAllSignatures(($online ? false : true), $online);

outn(str_pad("Module", 20));
outn(str_pad("Version", 18));
Expand Down Expand Up @@ -785,6 +789,9 @@ chdir ( $amp_conf["AMPWEBROOT"] . "/admin/" );


switch ($operation ) {
case 'updateKeys':
updateKeys();
break;
case 'checkdepends':
if (empty($param)) {
fatal("Missing module name");
Expand Down
4 changes: 2 additions & 2 deletions amp_conf/htdocs/admin/libraries/modulefunctions.class.php
Expand Up @@ -2871,7 +2871,7 @@ function getSignature($modulename,$cached=true) {
* Get all Cached Signatures, update if it doesnt exist
* @param {bool} $cached=true Whether to use cached data or not
*/
function getAllSignatures($cached=true) {
function getAllSignatures($cached=true, $online = false) {
FreePBX::GPG(); //declare class to get constants
$sql = "SELECT modulename, signature FROM modules";
$sth = FreePBX::Database()->prepare($sql);
Expand All @@ -2882,7 +2882,7 @@ function getAllSignatures($cached=true) {
// String below, if i18n'ed, must be identical to that in GPG class.
// Read the comment there.
$amportal = FreePBX::Config()->get('AMPSBIN')."/amportal "._("altered");
if(!$cached) {
if(!$cached && $online) {
FreePBX::GPG()->refreshKeys();
}
foreach($res as $mod) {
Expand Down

0 comments on commit fe05ae1

Please sign in to comment.