From 2a9a79393d91dfc48d0657b35e900e7af30749af Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Wed, 4 Feb 2009 00:31:26 +0000 Subject: [PATCH] #2471875 Suggest to update if DB is outdated git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@341 c66351dc-e62f-0410-b875-e3a5c0b9693f --- src/messenger/webim/install/index.php | 7 ++++++- src/messenger/webim/libs/common.php | 3 +++ src/messenger/webim/locales/en/properties | 1 + src/messenger/webim/locales/names/level2 | 1 + src/messenger/webim/operator/index.php | 2 ++ src/messenger/webim/view/menu.php | 4 ++++ 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/messenger/webim/install/index.php b/src/messenger/webim/install/index.php index ed8dc189..21bdfed5 100644 --- a/src/messenger/webim/install/index.php +++ b/src/messenger/webim/install/index.php @@ -13,6 +13,7 @@ */ require_once('../libs/common.php'); +require_once('../libs/settings.php'); require_once('dbinfo.php'); $page = array( @@ -112,7 +113,7 @@ function check_columns($link) { } function check_status() { - global $page, $webimroot; + global $page, $webimroot, $settings, $dbversion; $link = check_connection(); if(!$link) { return; @@ -140,6 +141,10 @@ function check_status() { $page['nextstepurl'] = "$webimroot/"; mysql_close($link); + + loadsettings(); + $settings['dbversion'] = $dbversion; + update_settings(); } check_status(); diff --git a/src/messenger/webim/libs/common.php b/src/messenger/webim/libs/common.php index a9b8671c..44d04e0e 100644 --- a/src/messenger/webim/libs/common.php +++ b/src/messenger/webim/libs/common.php @@ -460,7 +460,10 @@ function webim_mail($toaddr, $reply_to, $subject, $body) { mail($toaddr, $real_subject, wordwrap(myiconv($webim_encoding, $mail_encoding, $body),70), $headers); } +$dbversion = '1.5.1'; + $settings = array( + 'dbversion' => 0, 'email' => '', /* inbox for left messages */ 'title' => 'Your Company', 'hosturl' => 'http://webim.sourceforge.net', diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties index fcd11fbc..7d0021d3 100644 --- a/src/messenger/webim/locales/en/properties +++ b/src/messenger/webim/locales/en/properties @@ -140,6 +140,7 @@ install.license=Software license agreement install.message=Follow the wizard to setup your database. install.next=Next step: install.title=Installation +install.updatedb=Please, run Update wizard to adjust your database. installed.login_link=Proceed to login page installed.message=Application installed successfully. installed.notice=You can logon as admin with empty password.

!!! For security reasons, please change your password immediately and remove /webim/install folder from your server. diff --git a/src/messenger/webim/locales/names/level2 b/src/messenger/webim/locales/names/level2 index 40e12fa2..62e13a32 100644 --- a/src/messenger/webim/locales/names/level2 +++ b/src/messenger/webim/locales/names/level2 @@ -52,6 +52,7 @@ image.button.delete image.button.login image.button.save image.button.search +install.updatedb leftMenu.client_agents leftMenu.client_gen_button leftMenu.client_settings diff --git a/src/messenger/webim/operator/index.php b/src/messenger/webim/operator/index.php index c3914504..2254c937 100644 --- a/src/messenger/webim/operator/index.php +++ b/src/messenger/webim/operator/index.php @@ -24,6 +24,8 @@ $page = array( 'localeLinks' => get_locale_links("$webimroot/operator/index.php"), 'showban' => $settings['enableban'] == "1", 'showadmin' => is_capable($can_administrate, $operator), + 'needUpdate' => $settings['dbversion'] != $dbversion, + 'updateWizard' => "$webimroot/install/", ); start_html_output(); diff --git a/src/messenger/webim/view/menu.php b/src/messenger/webim/view/menu.php index fbc041b9..5446a66f 100644 --- a/src/messenger/webim/view/menu.php +++ b/src/messenger/webim/view/menu.php @@ -43,6 +43,10 @@

+ +
+
+