From bcb41ec0ffd63c0ec80e366a1fd554db13a6902c Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Tue, 30 Oct 2007 12:13:04 +0000 Subject: [PATCH] Location other than /webim git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@33 c66351dc-e62f-0410-b875-e3a5c0b9693f --- src/webim/index.php | 2 +- src/webim/install/dbinfo.php | 4 +- src/webim/install/index.php | 6 +- src/webim/install/view_index.php | 14 ++--- src/webim/install/view_installerr.php | 10 ++-- src/webim/libs/common.php | 6 +- src/webim/libs/config.php | 5 ++ src/webim/libs/operator.php | 13 ++-- src/webim/locales/en/properties | 10 ++-- src/webim/locales/ru/properties | 10 ++-- src/webim/operator/index.php | 2 +- src/webim/view/agent.php | 28 ++++----- src/webim/view/agents.php | 24 ++++---- src/webim/view/chat_ajaxed.php | 86 ++++++++++++--------------- src/webim/view/chat_error.php | 32 +++++----- src/webim/view/chat_mailsent.php | 32 +++++----- src/webim/view/chat_mailthread.php | 50 +++++----------- src/webim/view/chat_oldbrowser.php | 32 +++++----- src/webim/view/chat_simple.php | 62 +++++++++---------- src/webim/view/gen_button.php | 14 ++--- src/webim/view/login.php | 16 ++--- src/webim/view/menu.php | 16 ++--- src/webim/view/pending_users.php | 29 +++++---- src/webim/view/thread_log.php | 10 ++-- src/webim/view/thread_search.php | 30 +++++----- 25 files changed, 258 insertions(+), 285 deletions(-) diff --git a/src/webim/index.php b/src/webim/index.php index 7cc35a98..8d22b8ee 100644 --- a/src/webim/index.php +++ b/src/webim/index.php @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/webim/install/dbinfo.php b/src/webim/install/dbinfo.php index b4e303d0..122c132a 100644 --- a/src/webim/install/dbinfo.php +++ b/src/webim/install/dbinfo.php @@ -60,10 +60,10 @@ $dbtables_can_update = array( ); function show_install_err($text) { - global $page, $version, $errors; + global $page, $version, $errors, $webimroot; $page = array( 'version' => $version, - 'localeLinks' => get_locale_links("/webim/install/index.php") + 'localeLinks' => get_locale_links("$webimroot/install/index.php") ); $errors = array($text); start_html_output(); diff --git a/src/webim/install/index.php b/src/webim/install/index.php index 4c19456c..980d1198 100644 --- a/src/webim/install/index.php +++ b/src/webim/install/index.php @@ -17,7 +17,7 @@ require('dbinfo.php'); $page = array( 'version' => $version, - 'localeLinks' => get_locale_links("/webim/install/index.php") + 'localeLinks' => get_locale_links("$webimroot/install/index.php") ); @@ -113,7 +113,7 @@ function check_columns($link) { } function check_status() { - global $page; + global $page, $webimroot; $link = check_connection(); if(!$link) { return; @@ -138,7 +138,7 @@ function check_status() { $page['nextstep'] = getstring("installed.login_link"); $page['nextnotice'] = getstring("installed.notice"); - $page['nextstepurl'] = "/webim/"; + $page['nextstepurl'] = "$webimroot/"; mysql_close($link); } diff --git a/src/webim/install/view_index.php b/src/webim/install/view_index.php index 526b1b3b..2cccd415 100644 --- a/src/webim/install/view_index.php +++ b/src/webim/install/view_index.php @@ -17,10 +17,10 @@ - + - + <?php echo getstring("app.title") ?> - <?php echo getstring("install.title") ?> @@ -44,7 +44,7 @@ 0 ) { ?> - + diff --git a/src/webim/install/view_installerr.php b/src/webim/install/view_installerr.php index 49688073..9be75586 100644 --- a/src/webim/install/view_installerr.php +++ b/src/webim/install/view_installerr.php @@ -17,10 +17,10 @@ - + - + <?php echo getstring("app.title") ?> - <?php echo getstring("install.err.title") ?> @@ -41,7 +41,7 @@ 0 ) { ?>
0 ) { @@ -63,7 +63,7 @@ -
+
-
    @@ -82,7 +82,7 @@
+
@@ -90,14 +90,14 @@ - +
-Web Messenger/ +Web Messenger/
- + - +
0 ) { @@ -67,14 +67,14 @@
-Web Messenger/ +Web Messenger/ diff --git a/src/webim/libs/common.php b/src/webim/libs/common.php index 43f7b897..86e3e6bd 100644 --- a/src/webim/libs/common.php +++ b/src/webim/libs/common.php @@ -17,7 +17,6 @@ session_start(); require(dirname(__FILE__).'/converter.php'); require(dirname(__FILE__).'/config.php'); -$webimroot = "/webim"; # absolute path on server $version = 'v1.0.8 pre1'; function myiconv($in_enc, $out_enc, $string) { @@ -311,10 +310,11 @@ function quote_smart($value,$link) { } function get_app_location($showhost,$issecure) { + global $webimroot; if( $showhost ) { - return ($issecure?"https://":"http://").$_SERVER['HTTP_HOST']."/webim"; + return ($issecure?"https://":"http://").$_SERVER['HTTP_HOST'].$webimroot; } else { - return "/webim"; + return $webimroot; } } diff --git a/src/webim/libs/config.php b/src/webim/libs/config.php index 25d6d74f..8014feec 100644 --- a/src/webim/libs/config.php +++ b/src/webim/libs/config.php @@ -12,6 +12,11 @@ * Evgeny Gryaznov - initial API and implementation */ +/* + * Application path on server + */ +$webimroot = "/webim"; + /* * MySQL Database parameters */ diff --git a/src/webim/libs/operator.php b/src/webim/libs/operator.php index a3fd36a6..59c75062 100644 --- a/src/webim/libs/operator.php +++ b/src/webim/libs/operator.php @@ -107,10 +107,11 @@ function get_operator_name($operator) { function generate_button($title,$locale,$inner,$showhost,$forcesecure) { $link = get_app_location($showhost,$forcesecure)."/client.php". ($locale?"?locale=".$locale : ""); - return "".get_popup($link, $inner, $title, "webim", "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=600,height=420,resizable=1" ).""; + return "".get_popup($link, $inner, $title, "webim", "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=600,height=420,resizable=1" ).""; } function check_login() { + global $webimroot; if( !isset( $_SESSION['operator'] ) ) { if( isset($_COOKIE['webim_lite']) ) { list($login,$pwd) = split(",", $_COOKIE['webim_lite'], 2); @@ -121,7 +122,7 @@ function check_login() { } } $_SESSION['backpath'] = $_SERVER['PHP_SELF']; - header("Location: /webim/operator/login.php"); + header("Location: $webimroot/operator/login.php"); exit; } return $_SESSION['operator']; @@ -132,21 +133,23 @@ function get_logged_in() { } function login_operator($operator,$remember) { + global $webimroot; $_SESSION['operator'] = $operator; if( $remember ) { $value = $operator['vclogin'].",".md5($operator['vcpassword']); - setcookie('webim_lite', $value, time()+60*60*24*1000, "/webim/"); + setcookie('webim_lite', $value, time()+60*60*24*1000, "$webimroot/"); } else if( isset($_COOKIE['webim_lite']) ) { - setcookie('webim_lite', '', time() - 3600, "/webim/"); + setcookie('webim_lite', '', time() - 3600, "$webimroot/"); } } function logout_operator() { + global $webimroot; $_SESSION['operator'] = NULL; $_SESSION['backpath'] = NULL; if( isset($_COOKIE['webim_lite']) ) { - setcookie('webim_lite', '', time() - 3600, "/webim/"); + setcookie('webim_lite', '', time() - 3600, "$webimroot/"); } } diff --git a/src/webim/locales/en/properties b/src/webim/locales/en/properties index 0fd7081b..c506a442 100644 --- a/src/webim/locales/en/properties +++ b/src/webim/locales/en/properties @@ -121,11 +121,11 @@ button.save=Save button.search=Search tag.pagination.info=Page {0} of {1}, {2}-{3} from {4} tag.pagination.no_items=Found 0 elements -image.chat.history=/webim/locales/en/images/history.gif -image.chat.message=/webim/locales/en/images/message.gif -image.button.login=/webim/locales/en/images/login.gif -image.button.save=/webim/locales/en/images/save.gif -image.button.search=/webim/locales/en/images/search.gif +image.chat.history=/locales/en/images/history.gif +image.chat.message=/locales/en/images/message.gif +image.button.login=/locales/en/images/login.gif +image.button.save=/locales/en/images/save.gif +image.button.search=/locales/en/images/search.gif chat.came.from=Vistor came from page {0} content.history=Search the dialogs history content.logoff=Log out of the system. diff --git a/src/webim/locales/ru/properties b/src/webim/locales/ru/properties index 7c0752f3..4d333ddc 100644 --- a/src/webim/locales/ru/properties +++ b/src/webim/locales/ru/properties @@ -121,11 +121,11 @@ button.save= button.search=Искать tag.pagination.info=Страница {0} из {1}, показаны {2}-{3} из {4} tag.pagination.no_items=Ничего не найдено -image.chat.history=/webim/locales/ru/images/history.gif -image.chat.message=/webim/locales/ru/images/message.gif -image.button.login=/webim/locales/ru/images/login.gif -image.button.save=/webim/locales/ru/images/save.gif -image.button.search=/webim/locales/ru/images/search.gif +image.chat.history=/locales/ru/images/history.gif +image.chat.message=/locales/ru/images/message.gif +image.button.login=/locales/ru/images/login.gif +image.button.save=/locales/ru/images/save.gif +image.button.search=/locales/ru/images/search.gif chat.came.from=Посетитель пришел со страницы {0} content.history=Поиск по истории диалогов content.logoff=Покинуть систему. diff --git a/src/webim/operator/index.php b/src/webim/operator/index.php index 1877ea8a..ea4ee246 100644 --- a/src/webim/operator/index.php +++ b/src/webim/operator/index.php @@ -20,7 +20,7 @@ $operator = check_login(); $page = array( 'operator' => get_operator_name($operator), 'version' => $version, - 'localeLinks' => get_locale_links("/webim/operator/index.php") + 'localeLinks' => get_locale_links("$webimroot/operator/index.php") ); start_html_output(); diff --git a/src/webim/view/agent.php b/src/webim/view/agent.php index f498cafc..c0e4d056 100644 --- a/src/webim/view/agent.php +++ b/src/webim/view/agent.php @@ -17,10 +17,10 @@ - + - + <?php echo getstring("app.title") ?> - <?php echo getstring("page_agent.title") ?> @@ -37,7 +37,7 @@

-
|">|">
+
|">|">
@@ -51,7 +51,7 @@ 0 ) { ?> - +
0 ) { @@ -69,38 +69,38 @@
-
-
-
*
+ +
+ - - - - - + -
*
*
+
*
*
+
*
*
+
*
*
+
*
- +
+
diff --git a/src/webim/view/agents.php b/src/webim/view/agents.php index 4064b6b3..e915e76a 100644 --- a/src/webim/view/agents.php +++ b/src/webim/view/agents.php @@ -17,10 +17,10 @@ - + - + <?php echo getstring("app.title") ?> - <?php echo getstring("page_agents.title") ?> @@ -37,7 +37,7 @@

-
|">
+
|">
@@ -50,10 +50,10 @@ - + @@ -77,33 +77,33 @@ + + - +
- "> + "> - +
- '> + '>
-
- +
-
- +
diff --git a/src/webim/view/chat_ajaxed.php b/src/webim/view/chat_ajaxed.php index cf92be3d..0a2a6d17 100644 --- a/src/webim/view/chat_ajaxed.php +++ b/src/webim/view/chat_ajaxed.php @@ -16,18 +16,18 @@ <?php echo getstring("chat.window.title.agent") ?> - + - - - + + + - + - + @@ -36,7 +36,7 @@ var threadParams = { servl:"/webim/thread.php",frequency:2, - - + + - + - + + Refresh  - +
+ - +
@@ -72,7 +72,7 @@ var threadParams = { servl:"/webim/thread.php",frequency:2, ">">
@@ -94,39 +94,39 @@ var threadParams = { servl:"/webim/thread.php",frequency:2,;"> - + - - + +
">>>">>>
- - + +
">">">
"> - " onclick="this.newWindow = window.open('&act=mailthread', 'ForwardMail', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=603,height=204,resizable=0');this.newWindow.focus();this.newWindow.opener=window;return false;">Mail " onclick="this.newWindow = window.open('&act=mailthread', 'ForwardMail', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=603,height=204,resizable=0');this.newWindow.focus();this.newWindow.opener=window;return false;">Mail  "> - Refresh 
@@ -145,23 +145,23 @@ var threadParams = { servl:"/webim/thread.php",frequency:2, - + - + - + - + - +
-
@@ -172,23 +172,11 @@ var threadParams = { servl:"/webim/thread.php",frequency:2, - + - - - - - - -
+ - - - - - -
-
+
@@ -220,12 +208,12 @@ var threadParams = { servl:"/webim/thread.php",frequency:2, - "> - -
+ "> + +
">
- "> + "> @@ -237,9 +225,9 @@ var threadParams = { servl:"/webim/thread.php",frequency:2, - - - + + + diff --git a/src/webim/view/chat_error.php b/src/webim/view/chat_error.php index 99ae633f..b4445f81 100644 --- a/src/webim/view/chat_error.php +++ b/src/webim/view/chat_error.php @@ -16,10 +16,10 @@ <?php echo getstring("chat.error_page.title") ?> - - + + - +
@@ -38,11 +38,11 @@ - - - - - + + + + - - - + + + +
+
0 ) { print getstring("errors.header"); @@ -55,10 +55,10 @@ } ?> -
@@ -75,7 +75,7 @@
- + @@ -89,9 +89,9 @@ - - - + + +
">"> ">
diff --git a/src/webim/view/chat_mailsent.php b/src/webim/view/chat_mailsent.php index 0ef9799a..80881090 100644 --- a/src/webim/view/chat_mailsent.php +++ b/src/webim/view/chat_mailsent.php @@ -16,10 +16,10 @@ <?php echo getstring("chat.window.title.user") ?> - - + + - +
@@ -39,26 +39,26 @@ - - - + + + - - + - + - - - + + +
+
@@ -75,7 +75,7 @@
- + @@ -89,9 +89,9 @@ - - - + + +
">"> ">
diff --git a/src/webim/view/chat_mailthread.php b/src/webim/view/chat_mailthread.php index 380fce47..ed743444 100644 --- a/src/webim/view/chat_mailthread.php +++ b/src/webim/view/chat_mailthread.php @@ -16,15 +16,15 @@ <?php echo getstring("chat.window.title.user") ?> - - + + - + @@ -83,19 +61,19 @@ @@ -205,9 +205,9 @@ - - - + + +
- + @@ -40,35 +40,13 @@
- - - - - - - - - -
- - +
- - - - - - - - -
-
- -
+
- - + - +
"> -
+
"> +
">
">">
- + @@ -109,9 +87,9 @@ - - - + + +
">"> ">
diff --git a/src/webim/view/chat_oldbrowser.php b/src/webim/view/chat_oldbrowser.php index 88913dfd..0627eeb8 100644 --- a/src/webim/view/chat_oldbrowser.php +++ b/src/webim/view/chat_oldbrowser.php @@ -16,10 +16,10 @@ <?php echo getstring("page.chat.old_browser.title") ?> - - + + - + - + - - + + - + - + + Refresh @@ -115,23 +115,23 @@
@@ -37,18 +37,18 @@ - - - - - + + + + - - - + + + +
+
-
@@ -65,7 +65,7 @@
- + @@ -79,9 +79,9 @@ - - - + + +
">"> ">
diff --git a/src/webim/view/chat_simple.php b/src/webim/view/chat_simple.php index 964c62bc..0a32049c 100644 --- a/src/webim/view/chat_simple.php +++ b/src/webim/view/chat_simple.php @@ -16,13 +16,13 @@ <?php echo getstring("chat.window.title.user") ?> - + - - + + - + @@ -31,7 +31,7 @@
- - +
+
@@ -67,7 +67,7 @@
">">
@@ -82,17 +82,17 @@
">>>">>>" onclick="this.newWindow = window.open('&act=mailthread', 'ForwardMail', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=603,height=204,resizable=0');this.newWindow.focus();this.newWindow.opener=window;return false;">Mail" onclick="this.newWindow = window.open('&act=mailthread', 'ForwardMail', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=603,height=204,resizable=0');this.newWindow.focus();this.newWindow.opener=window;return false;">Mail "> - Refresh
- + @@ -142,25 +142,25 @@ - + @@ -189,12 +189,12 @@
HistoryHistory - + - + - + - +
-
MessageMessage - + - + - + - +
- +
- - + - +
"> -
+
"> +
">
">">
diff --git a/src/webim/view/gen_button.php b/src/webim/view/gen_button.php index 67f7ce64..e340401b 100644 --- a/src/webim/view/gen_button.php +++ b/src/webim/view/gen_button.php @@ -17,10 +17,10 @@ - + - + <?php echo getstring("app.title") ?> - <?php echo getstring("page.gen_button.title") ?> @@ -37,15 +37,15 @@

-
|">
+
|">


-
-
+ +
@@ -90,7 +90,7 @@ - + @@ -116,7 +116,7 @@ -
+
diff --git a/src/webim/view/login.php b/src/webim/view/login.php index d221fb17..d9622c03 100644 --- a/src/webim/view/login.php +++ b/src/webim/view/login.php @@ -17,10 +17,10 @@ - + - + <?php echo getstring("app.title") ?> - <?php echo getstring("page_login.title") ?> @@ -44,7 +44,7 @@ 0 ) { ?> - +
0 ) { @@ -62,8 +62,8 @@
-
-
+ +
@@ -104,14 +104,14 @@ - + - -
+
+
diff --git a/src/webim/view/menu.php b/src/webim/view/menu.php index cb664dde..76e4fcdb 100644 --- a/src/webim/view/menu.php +++ b/src/webim/view/menu.php @@ -17,10 +17,10 @@ - + - + <?php echo getstring("app.title") ?> - <?php echo getstring("topMenu.admin") ?> @@ -46,15 +46,15 @@ - + - + - + - + - +






























@@ -63,7 +63,7 @@ - + diff --git a/src/webim/view/pending_users.php b/src/webim/view/pending_users.php index ca1a8c34..f9e0deae 100644 --- a/src/webim/view/pending_users.php +++ b/src/webim/view/pending_users.php @@ -17,8 +17,8 @@ - - + + - + - + <?php echo getstring("app.title") ?> - <?php echo getstring("clients.title") ?> @@ -50,7 +49,7 @@ var updaterOptions = {

-
|">
+
|">

@@ -59,8 +58,8 @@ var updaterOptions = {
- - + +
@@ -90,7 +89,7 @@ var updaterOptions = { - +
@@ -105,7 +104,7 @@ var updaterOptions = {
- +
@@ -119,7 +118,7 @@ var updaterOptions = {
- +
@@ -132,9 +131,9 @@ var updaterOptions = {
- + - + diff --git a/src/webim/view/thread_log.php b/src/webim/view/thread_log.php index 3a5bd124..c767f474 100644 --- a/src/webim/view/thread_log.php +++ b/src/webim/view/thread_log.php @@ -17,11 +17,11 @@ - - + + - + <?php echo getstring("app.title") ?> - <?php echo getstring("thread.chat_log") ?> @@ -59,11 +59,11 @@ - +

- +
diff --git a/src/webim/view/thread_search.php b/src/webim/view/thread_search.php index 1103c6c7..c626fc41 100644 --- a/src/webim/view/thread_search.php +++ b/src/webim/view/thread_search.php @@ -17,10 +17,10 @@ - + - + <?php echo getstring("app.title") ?> - <?php echo getstring("page_analysis.search.title") ?> @@ -37,7 +37,7 @@

-
|">
+
|">
@@ -47,20 +47,20 @@ -
-
+ +
- + -
- +
+

@@ -75,19 +75,19 @@ - - + + - + - + , - +
@@ -95,11 +95,11 @@

-
+
-
+