404 problem fix

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@516 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2009-05-31 15:29:55 +00:00
parent 9c6b9ff678
commit 3ab00d8111
2 changed files with 6 additions and 5 deletions

View File

@ -22,7 +22,8 @@ function runsql($query,$link) {
return $res; return $res;
} }
$act = verifyparam( "act", "/^(silentcreateall|createdb|createtables|droptables|addcolumns)$/"); $act = verifyparam( "act", "/^(silentcreateall|createdb|ct|dt|addcolumns)$/");
$link = @mysql_connect($mysqlhost,$mysqllogin ,$mysqlpass ) $link = @mysql_connect($mysqlhost,$mysqllogin ,$mysqlpass )
or show_install_err('Could not connect: ' . mysql_error()); or show_install_err('Could not connect: ' . mysql_error());
@ -42,7 +43,7 @@ if ($act == "silentcreateall") {
mysql_query("SET character set $dbencoding", $link); mysql_query("SET character set $dbencoding", $link);
} }
if( $act == "createtables") { if( $act == "ct") {
$curr_tables = get_tables($link); $curr_tables = get_tables($link);
if( $curr_tables === false) { if( $curr_tables === false) {
show_install_err($errors[0]); show_install_err($errors[0]);
@ -51,7 +52,7 @@ if ($act == "silentcreateall") {
foreach( $tocreate as $id) { foreach( $tocreate as $id) {
create_table($id, $link); create_table($id, $link);
} }
} else if( $act == "droptables") { } else if( $act == "dt") {
foreach( array_keys($dbtables) as $id) { foreach( array_keys($dbtables) as $id) {
mysql_query("DROP TABLE IF EXISTS $id",$link) mysql_query("DROP TABLE IF EXISTS $id",$link)
or show_install_err(' Query failed: '.mysql_error()); or show_install_err(' Query failed: '.mysql_error());

View File

@ -72,7 +72,7 @@ function check_tables($link) {
return true; return true;
} else { } else {
$page['nextstep'] = getlocal("install.3.create"); $page['nextstep'] = getlocal("install.3.create");
$page['nextstepurl'] = "$webimroot/install/dbperform.php?act=createtables"; $page['nextstepurl'] = "$webimroot/install/dbperform.php?act=ct";
} }
} }
return false; return false;
@ -93,7 +93,7 @@ function check_columns($link) {
if( count($cannot_update) != 0) { if( count($cannot_update) != 0) {
$errors[] = "Key columns are absent in table `$id'. Unable to continue installation."; $errors[] = "Key columns are absent in table `$id'. Unable to continue installation.";
$page['nextstep'] = getlocal("install.kill_tables"); $page['nextstep'] = getlocal("install.kill_tables");
$page['nextstepurl'] = "$webimroot/install/dbperform.php?act=droptables"; $page['nextstepurl'] = "$webimroot/install/dbperform.php?act=dt";
$page['nextnotice'] = getlocal("install.kill_tables.notice"); $page['nextnotice'] = getlocal("install.kill_tables.notice");
return false; return false;
} }