validate_security($security_level, 3); // save general tab foreach ($install->keys as $key => $default) { $field = strtolower($key); if (isset($_POST[$field])) { write_configure($key, $_POST[$field]); } } $messageStack->add(GENERAL_CONFIG_SAVED, 'success'); gen_redirect(html_href_link(FILENAME_DEFAULT, gen_get_all_get_params(array('action')), 'SSL')); break; case 'fix': // drop the database $db->Execute("truncate " . TABLE_PHREEFORM); // load all the install classes to re-build directory structure $install_mod = new phreeform_admin(); $install_mod->load_reports('phreeform'); $contents = scandir(DIR_FS_MODULES); foreach ($contents as $entry) { // install each module if (!defined('MODULE_' . strtoupper($entry) . '_STATUS')) { continue; } // skip uninstalled modules if (!in_array($entry, array('.', '..', 'phreeform')) && is_dir(DIR_FS_MODULES . $entry)) { if (file_exists(DIR_FS_MODULES . $entry . '/config.php')) { require_once DIR_FS_MODULES . $entry . '/classes/install.php'; $classname = $entry . '_admin'; $install_mod = new $classname(); $install_mod->load_reports($entry); }
} 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') {