better installation messages; ignore \r in checksum

This commit is contained in:
Evgeny Gryaznov 2011-03-04 23:34:00 +01:00
parent c6c614b3c2
commit 4ef160897b
3 changed files with 28 additions and 8 deletions

View File

@ -96,7 +96,7 @@ function check_files()
$packageFile = dirname(__FILE__) . "/package";
$fp = @fopen($packageFile, "r");
if ($fp === FALSE) {
$errors[] = "Cannot open file $webimroot/install/package";
$errors[] = getlocal2("install.cannot_read", array("$webimroot/install/package"));
if (file_exists($packageFile)) {
$errors[] = getlocal2("install.check_permissions", array(fpermissions($packageFile)));
}
@ -117,17 +117,21 @@ function check_files()
$relativeName = dirname(__FILE__) . "/../$file";
if (!is_readable($relativeName)) {
if (file_exists($relativeName)) {
$errors[] = "Cannot read file $webimroot/$file";
$errors[] = getlocal2("install.cannot_read", array("$webimroot/$file"));
$errors[] = getlocal2("install.check_permissions", array(fpermissions($relativeName)));
} else {
$errors[] = "File is absent: $webimroot/$file";
$errors[] = getlocal2("install.no_file", array("$webimroot/$file"));
}
return false;
}
if ($sum != "-") {
$result = md5_file($relativeName);
if ($result != $sum) {
$errors[] = "Checksum differs for $webimroot/$file";
// try without \r
$result = md5(str_replace("\r", "", file_get_contents($relativeName)));
}
if ($result != $sum) {
$errors[] = getlocal2("install.bad_checksum", array("$webimroot/$file"));
$errors[] = getlocal("install.check_files");
return false;
}
@ -256,6 +260,8 @@ function check_status()
{
global $page, $webimroot, $settings, $dbversion;
$page['done'][] = getlocal2("install.0.php", array(phpversion()));
if (!check_webimroot()) {
return;
}

View File

@ -166,7 +166,8 @@ 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.0.package=Mibew package is verified.
install.0.package=Mibew package is valid.
install.0.php=PHP version {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.
@ -176,11 +177,13 @@ install.3.tables_exist=Requred tables are created.
install.4.create=Update tables
install.4.done=Tables structure is up to date.
install.4.notice=Structure of your tables should be adjusted for new version of Messenger.
install.5.text=Click to check the sound: {0} and {1}
install.5.newmessage=New Message
install.5.newvisitor=New Visitor
install.check_permissions=Insufficient file permissions {0}
install.5.text=Click to check the sound: {0} and {1}
install.bad_checksum=Checksum differs for {0}
install.cannot_read=Cannot read file {0}
install.check_files=Please, re-upload files to the server.
install.check_permissions=Insufficient file permissions {0}
install.connection.error=Could not connect, please check server settings in config.php. Error: {0}
install.done=Completed:
install.err.back=Resvole problem and try again. Press <a>back</a> to return to wizard.
@ -191,6 +194,7 @@ install.license=Software license agreement
install.message=Follow the wizard to setup your database.
install.newfeatures=Congratulations! You now have Mibew Messenger {1} installed. Turn on more features on <a href="{0}">Optional services</a> page.
install.next=Next step:
install.no_file=File is absent: {0}
install.title=Installation
install.updatedb=Please, run <a href="{0}">Update wizard</a> to adjust your database.
installed.login_link=Proceed to login page

View File

@ -149,7 +149,7 @@ form.field.groupname.description=
form.field.groupname=Название группы
form.field.login.description=Логин может состоять из маленьких латинских букв и знака подчеркивания.
form.field.login=Логин
form.field.mail.description=Для уведомлений и восстановления пароля
form.field.mail.description=Для уведомлений и восстановления пароля.
form.field.mail=Адрес электронной почты
form.field.message=Сообщение
form.field.name=Ваше имя
@ -166,6 +166,8 @@ 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.0.package=Контрольная сумма файлов проверена.
install.0.php=PHP версии {0}
install.1.connected=Вы подсоединены к серверу MySQL версии {0}
install.2.create=Создать базу данных "{0}"
install.2.db_exists=Создана база данных "{0}".
@ -175,6 +177,13 @@ install.3.tables_exist=
install.4.create=Обновить
install.4.done=Структура таблиц готова к использованию.
install.4.notice=Необходимо обновить структуру таблиц для корректной работы Веб Мессенджера.
install.5.newmessage=New Message
install.5.newvisitor=New Visitor
install.5.text=Проверьте звук: {0} и {1}
install.bad_checksum=Контрольная сумма не совпадает для {0}
install.cannot_read=Невозможно прочитать файл {0}
install.check_files=Попробуйте заново загрузить файлы на сервер.
install.check_permissions=Не хватает прав {0}
install.connection.error=Нет доступа к MySQL серверу, проверьте настройки в config.php. Ошибка: {0}
install.done=Выполнено:
install.err.back=Исправьте проблему и попробуйте еще раз. Нажмите <a>назад</a> чтобы вернуться к мастеру установки.
@ -185,6 +194,7 @@ install.license=
install.message=Следуйте указаниям мастера для правильной настройки базы данных.
install.newfeatures=Поздравляем! Вы успешно установили Mibew Веб Мессенджер {1}. Посетите <a href="{0}">страницу Расширений</a>, чтобы подключить больше функций.
install.next=Следующий шаг:
install.no_file=Не хватает файла: {0}
install.title=Установка
install.updatedb=Пожалуйста, запустите <a href="{0}">Мастер обновления базы данных</a>.
installed.login_link=Войти в систему