"update_manager_installed", "value" => 1); db_process_sql_insert('tconfig', $values); um_db_connect ('mysql', $config['dbhost'], $config['dbuser'], $config['dbpass'], $config['dbname']); um_db_update_setting ('updating_code_path', dirname ($_SERVER['SCRIPT_FILENAME'])); update_settings_database_connection (); } function pandora_update_manager_uninstall () { global $config; switch ($config["dbtype"]) { case "mysql": db_process_sql ('DELETE FROM `tconfig` WHERE `token` = "update_manager_installed"'); db_process_sql ('DROP TABLE `tupdate_settings`'); db_process_sql ('DROP TABLE `tupdate_journal`'); db_process_sql ('DROP TABLE `tupdate`'); db_process_sql ('DROP TABLE `tupdate_package`'); break; case "postgresql": db_process_sql ('DELETE FROM "tconfig" WHERE "token" = \'update_manager_installed\''); db_process_sql ('DROP TABLE "tupdate_settings"'); db_process_sql ('DROP TABLE "tupdate_journal"'); db_process_sql ('DROP TABLE "tupdate"'); db_process_sql ('DROP TABLE "tupdate_package"'); break; case "oracle": db_process_sql ('DELETE FROM tconfig WHERE token = \'update_manager_installed\''); db_process_sql ('DROP TABLE tupdate_settings'); db_process_sql ('DROP TABLE tupdate_journal'); db_process_sql ('DROP TABLE tupdate'); db_process_sql ('DROP TABLE tupdate_package'); break; } } function pandora_update_manager_main () { global $config; if (! check_acl($config['id_user'], 0, "PM")) { require ("general/noaccess.php"); return; } load_update_manager_lib (); update_settings_database_connection (); require_once ('update_manager/main.php'); main_view(); } function pandora_update_manager_login () { global $config; if ($config["autoupdate"] == 0) return; unset($_SESSION['new_update']); if (enterprise_installed()) { um_db_connect ('mysql', $config['dbhost'], $config['dbuser'], $config['dbpass'], $config['dbname']); $settings = um_db_load_settings (); $user_key = get_user_key ($settings); $package = um_client_check_latest_update ($settings, $user_key); if (is_object ($package)) { if ($package->id != 'ERROR_NON_NUMERIC_FOUND') $_SESSION['new_update'] = 'new'; } } else { require( "extensions/update_manager/lib/functions.ajax.php"); $result = update_pandora_get_packages_online_ajax(false); if ($result['correct']) { $_SESSION['new_update'] = 'new'; } } } function pandora_update_manager_godmode () { global $config; load_update_manager_lib (); require_once ('update_manager/settings.php'); } if(isset($config['id_user'])) { if (check_acl($config['id_user'], 0, "PM")) { extensions_add_operation_menu_option (__('Update manager')); extensions_add_godmode_menu_option (__('Update manager settings'), 'PM'); extensions_add_main_function ('pandora_update_manager_main'); extensions_add_godmode_function ('pandora_update_manager_godmode'); extensions_add_login_function ('pandora_update_manager_login'); } } pandora_update_manager_install (); $db = NULL; ?>