function itslenny_vercheck() { $newver = false; $module_local = itslenny_xml2array("modules/itslenny/module.xml"); $module_remote = itslenny_xml2array("https://github.com/POSSA/freepbx-Its_Lenny/master/module.xml"); if ($module_remote['module']['version'] > $module_local['module']['version']) { $newver = true; } return $newver; }
// // check to see if user has automatic updates enabled in FreePBX settings $cm =& cronmanager::create($db); $online_updates = $cm->updates_enabled() ? true : false; // check dev site to see if new version of module is available if ($online_updates && ($foo = itslenny_vercheck())) { print "<br>A <b>new version of this module is available</b> from the <a target='_blank' href='http://pbxossa.org'>PBX Open Source Software Alliance</a><br>"; } // check form and define var for form action isset($_REQUEST['action']) ? $action = $_REQUEST['action'] : ($action = ''); //if submitting form, update database if (isset($_POST['submit'])) { itslenny_edit(1, $_POST); redirect_standard(); } $module_local = itslenny_xml2array("modules/itslenny/module.xml"); $module_version = $module_local['module']['version']; $config = itslenny_config(); ?> <h2>Its Lenny Module</h2> <form autocomplete="off" name="edit" action="<?php $_SERVER['PHP_SELF']; ?> " method="post" > <table> <tr> <td colspan="2"> <?php echo _("This module is used to modify the standard FreePBX blacklist so that banned callers interact with a series of recordings attempting to fool them into thinking it is a real person. The sound files were originally developed for the online service, <a href='http://www.itslenny.com'>Its Lenny</a> and have been made available to users free of charge by the owner. The Asterisk dial plan for this module was developed by Ward Mundy at <a href='http://www.nerdvittles.com'>Nerd Vittles</a>.");