break; case 'remove': validate_security($security_level, 4); // load the module installation class if (!file_exists(DIR_FS_MODULES . $method . '/classes/install.php')) { $messageStack->add(sprintf('Looking for the installation script for module %s, but could not locate it. The module cannot be installed!', $method), 'error'); break; } require_once DIR_FS_MODULES . $method . '/classes/install.php'; $cName = $method . '_admin'; $mInstall = new $cName(); foreach ($mInstall->keys as $key => $value) { remove_configure($key); } remove_configure('MODULE_' . strtoupper($method) . '_STATUS'); if (admin_remove_tables(array_keys($mInstall->tables))) { $error = true; } if (admin_remove_dirs($mInstall->dirlist, DIR_FS_MY_FILES . $_SESSION['company'] . '/')) { $error = true; } if ($mInstall->remove($method)) { $error = true; } gen_add_audit_log(sprintf(AUDIT_LOG_REMOVE_SUCCESS, $method)); gen_redirect(html_href_link(FILENAME_DEFAULT, gen_get_all_get_params(array('action')), 'SSL')); break; case 'save': validate_security($security_level, 3); // save general tab foreach ($install->keys as $key => $default) {
function remove($module) { global $db; $error = false; // Don't allow delete if there is activity $sql = "select id from " . TABLE_JOURNAL_MAIN . " where journal_id = '19'"; $result = $db->Execute($sql); if ($result->RecordCount() != 0) { $messageStack->add(ERROR_CANT_DELETE, 'error'); return true; } foreach ($this->tables as $table => $sql) { admin_remove_tables(array($table => $sql)); } return $error; }