Example #1
0
if (defined('MODULE_SHIPPING_TABLE_SORT_ORDER')) {
    write_configure('MODULE_SHIPPING_TABLE_STATUS', '0.1');
}
if (defined('MODULE_SHIPPING_UPS_SORT_ORDER')) {
    write_configure('MODULE_SHIPPING_UPS_STATUS', '0.1');
}
if (defined('MODULE_SHIPPING_USPS_SORT_ORDER')) {
    write_configure('MODULE_SHIPPING_USPS_STATUS', '0.1');
}
// load the phreeform module
gen_pull_language('phreeform', 'admin');
require_once DIR_FS_MODULES . 'phreeform/config.php';
require_once DIR_FS_MODULES . 'phreeform/defaults.php';
require_once DIR_FS_MODULES . 'phreeform/classes/install.php';
$mInstall = new phreeform_admin();
admin_install_dirs($mInstall->dirlist, DIR_FS_MY_FILES . $_SESSION['company'] . '/');
admin_install_tables($mInstall->tables);
write_configure('MODULE_PHREEFORM_STATUS', constant('MODULE_PHREEFORM_VERSION'));
foreach ($mInstall->keys as $key => $value) {
    write_configure($key, $value);
}
$mInstall->load_reports('phreeform');
admin_add_reports('phreeform');
$mInstall->install('phreeform');
// load installed modules and build report folders
$contents = scandir(DIR_FS_MODULES);
foreach ($contents as $entry) {
    // load the configuration files to load version info
    if ($entry != '.' && $entry != '..' && is_dir(DIR_FS_MODULES . $entry)) {
        if (defined('MODULE_' . strtoupper($entry) . '_STATUS') && $entry != 'phreeform') {
            // build the directories
Example #2
0
 foreach ($copy_modules as $entry) {
     gen_pull_language($entry, 'admin');
 }
 foreach ($copy_modules as $entry) {
     require_once DIR_FS_MODULES . $entry . '/classes/install.php';
     $classname = $entry . '_admin';
     $install_mod = new $classname();
     $task = $_POST[$entry . '_action'];
     if ($entry == 'phreedom') {
         $task = 'data';
     }
     // force complete copy of phreedom module
     switch ($task) {
         case 'core':
         case 'demo':
             if (admin_install_dirs($install_mod->dirlist, DIR_FS_MY_FILES . $db_name . '/')) {
                 $error = true;
             } elseif (admin_install_tables($install_mod->tables)) {
                 // Create the tables
                 $error = true;
             } else {
                 // Load the installed module version into db
                 write_configure('MODULE_' . strtoupper($entry) . '_STATUS', constant('MODULE_' . strtoupper($entry) . '_VERSION'));
                 // Load the remaining configuration constants
                 foreach ($install_mod->keys as $key => $value) {
                     write_configure($key, $value);
                 }
                 if ($task == 'demo') {
                     if ($install_mod->load_demo()) {
                         $error = true;
                     }
Example #3
0
 function initialize($loaded_modules)
 {
     global $db, $messageStack, $currencies;
     // load the latest currency exchange rates
     if (web_connected(false) && AUTO_UPDATE_CURRENCY && ENABLE_MULTI_CURRENCY) {
         gen_pull_language('phreedom', 'admin');
         require_once DIR_FS_MODULES . 'phreedom/classes/currency.php';
         $currency = new currency();
         $currency->btn_update();
     }
     // Fix for change to audit log for upgrade to R3.6 causes perpertual crashing when writing audit log
     if (!db_field_exists(TABLE_AUDIT_LOG, 'stats')) {
         $db->Execute("ALTER TABLE " . TABLE_AUDIT_LOG . " ADD stats VARCHAR(32) NOT NULL AFTER ip_address");
     }
     // load installed modules and initialize them
     if (is_array($loaded_modules)) {
         foreach ($loaded_modules as $module) {
             if ($module == 'phreedom') {
                 continue;
             }
             // skip this module
             require_once DIR_FS_MODULES . $module . '/classes/install.php';
             $install_class = $module . '_admin';
             $mod_init = new $install_class();
             if (constant('MODULE_' . strtoupper($module) . '_STATUS') != constant('MODULE_' . strtoupper($module) . '_VERSION')) {
                 // add any new constants
                 if (sizeof($mod_init->keys) > 0) {
                     foreach ($mod_init->keys as $key => $value) {
                         if (!defined($key)) {
                             write_configure($key, $value);
                         }
                     }
                 }
                 admin_install_dirs($mod_init->dirlist, DIR_FS_MY_FILES . $_SESSION['company'] . '/');
                 if (method_exists($mod_init, 'update')) {
                     $mod_init->update($module);
                 }
             }
             if (method_exists($mod_init, 'initialize')) {
                 $mod_init->initialize($module);
             }
         }
     }
     if (web_connected(false) && CFG_AUTO_UPDATE_CHECK && SECURITY_ID_CONFIGURATION > 3) {
         // check for software updates
         $revisions = @file_get_contents(VERSION_CHECK_URL);
         if ($revisions) {
             $versions = xml_to_object($revisions);
             $latest = $versions->Revisions->Phreedom->Current;
             $current = MODULE_PHREEDOM_VERSION;
             if ($latest > $current) {
                 $messageStack->add_session(sprintf(TEXT_VERSION_CHECK_NEW_VER, $current, $latest), 'caution');
             }
             foreach ($loaded_modules as $mod) {
                 // check rest of modules
                 if ($mod == 'phreedom') {
                     continue;
                 }
                 // skip this module
                 $latest = $versions->Revisions->Modules->{$mod}->Current;
                 $current = constant('MODULE_' . strtoupper($mod) . '_VERSION');
                 if ($latest > $current) {
                     $messageStack->add_session(sprintf(TEXT_VERSION_CHECK_NEW_MOD_VER, $mod, $current, $latest), 'caution');
                 }
             }
         }
     }
     // Make sure the install directory has been moved/removed
     if (is_dir(DIR_FS_ADMIN . 'install')) {
         $messageStack->add_session(TEXT_INSTALL_DIR_PRESENT, 'caution');
     }
 }
Example #4
0
     continue;
 }
 // core module, already installed
 if ($entry != '.' && $entry != '..' && is_dir(DIR_FS_MODULES . $entry)) {
     if (DEBUG) {
         $messageStack->debug("\n  installing additional module = " . $entry);
     }
     if (file_exists(DIR_FS_MODULES . $entry . '/config.php')) {
         $error = false;
         require_once DIR_FS_MODULES . $entry . '/classes/install.php';
         $classname = $entry . '_admin';
         $install_mod = new $classname();
         if (admin_check_versions($entry, $install_mod->prerequisites)) {
             // Check for version levels
             $error = true;
         } elseif (admin_install_dirs($install_mod->dirlist, DIR_FS_MY_FILES . $_SESSION['company'] . '/')) {
             // Create any new directories
             $error = true;
         } elseif (admin_install_tables($install_mod->tables)) {
             // Create the tables
             $error = true;
         } else {
             // Load the installed module version into db
             write_configure('MODULE_' . strtoupper($entry) . '_STATUS', constant('MODULE_' . strtoupper($entry) . '_VERSION'));
             // 	Load the remaining configuration constants
             foreach ($install_mod->keys as $key => $value) {
                 write_configure($key, $value);
             }
             if ($company_demo) {
                 if ($install_mod->load_demo()) {
                     $error = true;