mirror of
https://github.com/Mibew/i18n.git
synced 2025-01-22 21:40:28 +03:00
Fix bugs in the installation script
This commit is contained in:
parent
29d7f891da
commit
89c61a5571
@ -231,7 +231,25 @@ function create_table($id, $link)
|
|||||||
mysql_query($query, $link) or show_install_err(' Query failed: ' . mysql_error($link));
|
mysql_query($query, $link) or show_install_err(' Query failed: ' . mysql_error($link));
|
||||||
|
|
||||||
if ($id == "${mysqlprefix}chatoperator") {
|
if ($id == "${mysqlprefix}chatoperator") {
|
||||||
create_operator("admin", "", "", "Administrator", "Administrator", "");
|
// Create First Administrator
|
||||||
|
mysql_query(
|
||||||
|
"INSERT INTO ${mysqlprefix}chatoperator ( " .
|
||||||
|
"vclogin, " .
|
||||||
|
"vcpassword, " .
|
||||||
|
"vclocalename, " .
|
||||||
|
"vccommonname, " .
|
||||||
|
"vcavatar, " .
|
||||||
|
"vcemail " .
|
||||||
|
") values ( " .
|
||||||
|
"'admin', " .
|
||||||
|
"MD5(''), " .
|
||||||
|
"'', " .
|
||||||
|
"'Administrator', " .
|
||||||
|
"'Administrator', " .
|
||||||
|
"''" .
|
||||||
|
")",
|
||||||
|
$link
|
||||||
|
);
|
||||||
} else if ($id == "${mysqlprefix}chatrevision") {
|
} else if ($id == "${mysqlprefix}chatrevision") {
|
||||||
$result = mysql_query("INSERT INTO ${mysqlprefix}chatrevision VALUES (1)", $link);
|
$result = mysql_query("INSERT INTO ${mysqlprefix}chatrevision VALUES (1)", $link);
|
||||||
if (! $result) {
|
if (! $result) {
|
||||||
|
@ -15,8 +15,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once('../libs/common.php');
|
session_start();
|
||||||
require_once('../libs/operator.php');
|
|
||||||
|
require_once('../libs/config.php');
|
||||||
|
// Include common functions
|
||||||
|
require_once('../libs/common/constants.php');
|
||||||
|
require_once('../libs/common/locale.php');
|
||||||
|
require_once('../libs/common/misc.php');
|
||||||
|
require_once('../libs/common/response.php');
|
||||||
|
// Include database structure
|
||||||
require_once('dbinfo.php');
|
require_once('dbinfo.php');
|
||||||
|
|
||||||
function runsql($query, $link)
|
function runsql($query, $link)
|
||||||
|
@ -15,8 +15,17 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once('../libs/common.php');
|
session_start();
|
||||||
require_once('../libs/settings.php');
|
|
||||||
|
require_once('../libs/config.php');
|
||||||
|
|
||||||
|
// Include common functions
|
||||||
|
require_once('../libs/common/constants.php');
|
||||||
|
require_once('../libs/common/locale.php');
|
||||||
|
require_once('../libs/common/misc.php');
|
||||||
|
require_once('../libs/common/response.php');
|
||||||
|
require_once('../libs/common/string.php');
|
||||||
|
// Include database structure
|
||||||
require_once('dbinfo.php');
|
require_once('dbinfo.php');
|
||||||
|
|
||||||
$page = array(
|
$page = array(
|
||||||
@ -295,7 +304,7 @@ function add_canned_messages($link){
|
|||||||
|
|
||||||
function check_status()
|
function check_status()
|
||||||
{
|
{
|
||||||
global $page, $webimroot, $dbversion;
|
global $page, $webimroot, $dbversion, $mysqlprefix;
|
||||||
|
|
||||||
$page['done'][] = getlocal2("install.0.php", array(phpversion()));
|
$page['done'][] = getlocal2("install.0.php", array(phpversion()));
|
||||||
|
|
||||||
@ -341,10 +350,15 @@ function check_status()
|
|||||||
|
|
||||||
$page['show_small_login'] = true;
|
$page['show_small_login'] = true;
|
||||||
|
|
||||||
|
// Update current dbversion
|
||||||
|
$res = mysql_query("select COUNT(*) as count from ${mysqlprefix}chatconfig where vckey = 'dbversion'", $link);
|
||||||
|
if(mysql_result($res, 0, 'count') == 0) {
|
||||||
|
mysql_query("insert into ${mysqlprefix}chatconfig (vckey) values ('dbversion')", $link);
|
||||||
|
}
|
||||||
|
|
||||||
|
mysql_query("update ${mysqlprefix}chatconfig set vcvalue = '{$dbversion}' where vckey='dbversion'", $link);
|
||||||
mysql_close($link);
|
mysql_close($link);
|
||||||
|
|
||||||
Settings::set('dbversion', $dbversion);
|
|
||||||
Settings::update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_status();
|
check_status();
|
||||||
|
Loading…
Reference in New Issue
Block a user