[0003084] Database password with special chars was stored distorted in config_db.
[fa-stable.git] / admin / inst_theme.php
index fb9fad7a1c02e17897d2a8d00d0604069ece168a..70d8eb60a34afbc5768c5d6704e634a07367fa25 100644 (file)
@@ -14,7 +14,10 @@ $path_to_root="..";
 include_once($path_to_root . "/includes/session.inc");
 include_once($path_to_root."/includes/packages.inc");
 
-page(_($help_context = "Install Themes"));
+if ($SysPrefs->use_popup_windows) {
+       $js = get_js_open_window(900, 500);
+}
+page(_($help_context = "Install Themes"), false, false, '', $js);
 
 include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/admin/db/company_db.inc");
@@ -22,27 +25,9 @@ include_once($path_to_root . "/admin/db/maintenance_db.inc");
 include_once($path_to_root . "/includes/ui.inc");
 
 //---------------------------------------------------------------------------------------------
-// If theme is used in customer record set to default
-//
-function clean_user_themes($id)
-{
-       global $db_connections, $db, $installed_extensions;
-
-       $theme = $installed_extensions[$id]['package'];
-       $db_sav = $db;
-
-       foreach ($db_connections as $n => $conn) {
-               $db = $_SESSION["wa_current_user"]->get_db_connection($n);
-               $sql = "UPDATE {$conn['tbpref']}users SET theme='default' WHERE theme='$theme'";
-               if (!db_query($sql, 'Cannot update user theme settings'))
-                       return false;
-       }
-       $db = $db_sav;
-       $_SESSION['wa_current_user']->prefs->theme = 'default';
-       return true;
-}
 
-if (($id = find_submit('Delete', false)) && clean_user_themes($id))
+if (($id = find_submit('Delete', false))
+       && clean_user_themes($installed_extensions[$id]['package']))
 {
        $extensions = get_company_extensions();
        $theme = $extensions[$id]['package'];
@@ -113,4 +98,3 @@ start_form(true);
 end_form();
 
 end_page();
-?>
\ No newline at end of file