check webimroot variable during installation

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@804 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2010-05-02 18:20:55 +00:00
parent a0d3403cb5
commit 47b4a82da2
3 changed files with 29 additions and 3 deletions

View File

@ -33,6 +33,25 @@ $page['nextstep'] = false;
$page['nextnotice'] = false;
$errors = array();
function check_webimroot() {
global $page, $errors, $webimroot;
$requestUri = $_SERVER["REQUEST_URI"];
if(!preg_match('/^(.*)\\/install(\\/[^\\/\\\\]*)?$/', $requestUri, $matches)) {
$errors[] = "Cannot detect application location: $requestUri";
return false;
}
$applocation = $matches[1];
if($applocation != $webimroot) {
$errors[] = "Please, check file ${applocation}/libs/config.php<br/>Wrong value of \$webimroot variable, should be \"$applocation\"";
$webimroot = $applocation;
return false;
}
$page['done'][] = getlocal2("install.0.app", array($applocation));
return true;
}
function check_connection() {
global $mysqlhost,$mysqllogin,$mysqlpass, $page, $errors, $webimroot;
$link = @mysql_connect($mysqlhost,$mysqllogin,$mysqlpass);
@ -121,6 +140,11 @@ function check_columns($link) {
function check_status() {
global $page, $webimroot, $settings, $dbversion;
if(!check_webimroot()) {
return;
}
$link = check_connection();
if(!$link) {
return;
@ -144,7 +168,7 @@ function check_status() {
$page['done'][] = getlocal("installed.message");
$page['nextstep'] = getlocal("installed.login_link");
$page['nextnotice'] = getlocal("installed.notice");
$page['nextnotice'] = getlocal2("installed.notice", array($webimroot."/install/"));
$page['nextstepurl'] = "$webimroot/";
$page['show_small_login'] = true;

View File

@ -168,6 +168,7 @@ image.button.search=/locales/en/images/search.gif
image.chat.history=/locales/en/images/history.gif
image.chat.message=/locales/en/images/message.gif
image.chat.sprite=/locales/en/images/wmchat.png
install.0.app=Application path is {0}
install.1.connected=You are connected to MySQL server version {0}
install.2.create=Create database "{0}"
install.2.db_exists=Database "{0}" is created.
@ -191,7 +192,7 @@ install.title=Installation
install.updatedb=Please, run <a href="{0}">Update wizard</a> to adjust your database.
installed.login_link=Proceed to login page
installed.message=<b>Application installed successfully.</b>
installed.notice=You can logon as <b>admin</b> with empty password.<br/><br/><font color="#c13030"><b>!!! For security reasons, please change your password immediately and remove /webim/install folder from your server.</b></font>
installed.notice=You can logon as <b>admin</b> with empty password.<br/><br/><font color="#c13030"><b>!!! For security reasons, please change your password immediately and remove {0} folder from your server.</b></font>
lang.choose=Choose your language
leavemail.body=Your have a message from {0}:\n\n{2}\n\nHis email: {1}\n{3}\n--- \nYours site messenger
leavemail.subject=Question from {0}

View File

@ -168,6 +168,7 @@ image.button.search=/locales/ru/images/search.gif
image.chat.history=/locales/ru/images/history.gif
image.chat.message=/locales/ru/images/message.gif
image.chat.sprite=/locales/ru/images/wmchat.png
install.0.app=Приложение найдено по адресу {0}
install.1.connected=Вы подсоединены к серверу MySQL версии {0}
install.2.create=Создать базу данных "{0}"
install.2.db_exists=Создана база данных "{0}".
@ -191,7 +192,7 @@ install.title=
install.updatedb=Пожалуйста, запустите <a href="{0}">Мастер обновления базы данных</a>.
installed.login_link=Войти в систему
installed.message=<b>Установка успешно завершена. </b>
installed.notice=Вы можете войти в систему как <b>admin</b> с пустым паролем.<br/><br/><font color="#c13030"><b>!!! В целях безопасности, удалите, пожалуйста, каталог /webim/install с вашего сервера и поменяйте пароль.</b></font>
installed.notice=Вы можете войти в систему как <b>admin</b> с пустым паролем.<br/><br/><font color="#c13030"><b>!!! В целях безопасности, удалите, пожалуйста, каталог {0} с вашего сервера и поменяйте пароль.</b></font>
lang.choose=Выберите ваш язык
leavemail.body=Ваш посетитель '{0}' оставил сообщение:\n\n{2}\n\nЕmail: {1}\n{3}\n--- \nС уважением,\nВаш Веб Мессенджер
leavemail.subject=Вопрос от {0}