MuWeb 0.9 Premium, Install Manager
MuWeb 0.9 Premium, Install Manager
'; if(!isset($_GET['next'])){ $install .='
Required Apache Mods
Availabile
GD Image Library
'.$gd2.'
Zend Optimizer
'.$zend.'
Zlib
'.$zlib.'
Mssql
'.$mssql.'
Mod_Rewrite
'.$m_re.'
'; if($error != 1){ $install .='
'; }else{ $install .='
Please enable the required mods from your apache folder / php.ini
'; } } switch ($_GET['next']){ case 1: if($muweb['connection_type'] == "ODBC"){ $db_primary = &ADONewConnection('odbc','date'); $connect_sql = $db_primary->Connect($muweb['db_name'],$muweb['db_user'],$muweb['db_password'],$muweb['db_host']); if(!$connect_sql){ $error = 1; $db = "NO"; }else{ $db = "YES"; } $db_secondary = &ADONewConnection('odbc','date'); $connect_sql = $db_secondary->Connect($muweb['db_name2'],$muweb['db_user'],$muweb['db_password'],$muweb['db_host']); if(!$connect_sql){ $error = 1; $db2 = "NO"; }else{ $db2 = "YES"; } }elseif($muweb['connection_type'] == "MSSQL"){ $db_primary = &ADONewConnection('mssql'); $connect_sql = $db_primary->Connect($muweb['db_host'],$muweb['db_user'],$muweb['db_password'],$muweb['db_name']); if(!$connect_sql){ $error = 1; $db = "NO"; }else{ $db = "YES"; } $db_secondary = &ADONewConnection('mssql'); $connect_sql = $db_secondary->Connect($muweb['db_host'],$muweb['db_user'],$muweb['db_password'],$muweb['db_name2']); if(!$connect_sql){ $error = 1; $db2 = "NO"; }else{ $db2 = "YES"; } } if($muweb['debug'] == 1){ $db_primary->debug = true; $db_secondary->debug = true; } $install .='
Databases
Connected
'.$muweb['db_name'].'
'.$db.'
'.$muweb['db_name2'].'
'.$db2.'
'; if($error != 1){ $install .='
'; }else{ $install .='
Connection with SQL Server could not be established, please check config.inc.php file.
'; } break; case 2: if($muweb['connection_type'] == "ODBC"){ $db_primary = &ADONewConnection('odbc','date'); $connect_sql = $db_primary->Connect($muweb['db_name'],$muweb['db_user'],$muweb['db_password'],$muweb['db_host']); if(!$connect_sql){ $error = 1; $db = "NO"; }else{ $db = "YES"; } $db_secondary = &ADONewConnection('odbc','date'); $connect_sql = $db_secondary->Connect($muweb['db_name2'],$muweb['db_user'],$muweb['db_password'],$muweb['db_host']); if(!$connect_sql){ $error = 1; $db2 = "NO"; }else{ $db2 = "YES"; } }elseif($muweb['connection_type'] == "MSSQL"){ $db_primary = &ADONewConnection('mssql'); $connect_sql = $db_primary->Connect($muweb['db_host'],$muweb['db_user'],$muweb['db_password'],$muweb['db_name']); if(!$connect_sql){ $error = 1; $db = "NO"; }else{ $db = "YES"; } $db_secondary = &ADONewConnection('mssql'); $connect_sql = $db_secondary->Connect($muweb['db_host'],$muweb['db_user'],$muweb['db_password'],$muweb['db_name2']); if(!$connect_sql){ $error = 1; $db2 = "NO"; }else{ $db2 = "YES"; } } if($muweb['debug'] == 1){ $db_primary->debug = true; $db_secondary->debug = true; } $reset_check = $db_primary->Execute("Select top 1 resets from character"); if(!$reset_check){ $reload = 1; $add_resets = $db_primary->Execute("alter table Character add Resets int not null default 0"); if($add_resets){ $reset_status = "Altering...Done"; }else{ $reset_status = "Altering...Falied"; } }else{ $reset_status = "OK"; } $adminaccess_check = $db_secondary->Execute("Select top 1 AdminAccess from MEMB_INFO"); if(!$adminaccess_check){ $reload = 1; $add_adminaccess = $db_secondary->Execute("alter table memb_info add AdminAccess int null"); if($add_adminaccess){ $adminaccess_status = "Altering...Done"; }else{ $adminaccess_status = "Altering...Falied"; } }else{ $adminaccess_status = "OK"; } $sq_check = $db_secondary->Execute("Select top 1 SecretQuestion from MEMB_INFO"); if(!$sq_check){ $reload = 1; $add_sq = $db_secondary->Execute("alter table memb_info add SecretQuestion int null"); if($add_sq){ $sq_status = "Altering...Done"; }else{ $sq_status = "Altering...Falied"; } }else{ $sq_status = "OK"; } $sa_check = $db_secondary->Execute("Select top 1 SecretAnswer from MEMB_INFO"); if(!$sa_check){ $reload = 1; $add_sa = $db_secondary->Execute("alter table memb_info add SecretAnswer varchar(100) null"); if($add_sa){ $sa_status = "Altering...Done"; }else{ $sa_status = "Altering...Falied"; } }else{ $sa_status = "OK"; } $country_check = $db_secondary->Execute("Select top 1 country from MEMB_INFO"); if(!$country_check){ $reload = 1; $add_country = $db_secondary->Execute("alter table memb_info add Country int null"); if($add_country){ $country_status = "Altering...Done"; }else{ $country_status = "Altering...Falied"; } }else{ $country_status = "OK"; } $gender_check = $db_secondary->Execute("Select top 1 gender from MEMB_INFO"); if(!$gender_check){ $reload = 1; $add_gender = $db_secondary->Execute("alter table memb_info add Gender int null"); if($add_gender){ $gender_status = "Altering...Done"; }else{ $gender_status = "Altering...Falied"; } }else{ $gender_status = "OK"; } $muweb_ban_check = $db_primary->Execute("Select top 1 id from MuWeb_Ban"); if(!$muweb_ban_check){ $reload = 1; $add_muweb_ban = $db_primary->Execute("if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MuWeb_Ban]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[MuWeb_Ban] CREATE TABLE [dbo].[MuWeb_Ban] ( [id] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [type] [int] NULL , [reason] [text] COLLATE Chinese_PRC_CI_AS NULL , [ban_time] [int] NULL , [date_ban] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]"); if($add_muweb_ban){ $muweb_ban_status = "Altering...Done"; }else{ $muweb_ban_status = "Altering...Falied"; } }else{ $muweb_ban_status = "OK"; } $mu_id_check = $db_primary->Execute("Select top 1 mu_id from character"); if(!$mu_id_check){ $reload = 1; $add_mu_id = $db_primary->Execute("alter table Character add mu_id int identity"); if($add_mu_id){ $mu_id_status = "Altering...Done"; }else{ $mu_id_status = "Altering...Falied"; } }else{ $mu_id_status = "OK"; } $muweb_vault_check = $db_primary->Execute("Select top 1 Accountid from MuWeb_Vault"); if(!$muweb_vault_check){ $reload = 1; $add_muweb_vault = $db_primary->Execute("if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MuWeb_Vault]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[MuWeb_Vault] CREATE TABLE [dbo].[MuWeb_Vault] ( [Accountid] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL , [Items] [varbinary] (1920) NULL , [verify] [int] NULL ) ON [PRIMARY]"); if($add_muweb_vault){ $muweb_vault_status = "Altering...Done"; }else{ $muweb_vault_status = "Altering...Falied"; } }else{ $muweb_vault_status = "OK"; } $memb_pwd_check = $db_secondary->Execute("Select top 1 memb__pwd2 from memb_info"); if(!$memb_pwd_check){ $reload = 1; $add_memb_pwd = $db_secondary->Execute("alter table MEMB_INFO add memb__pwd2 nvarchar(10) null"); if($add_memb_pwd){ $memb_pwd_status = "Altering...Done"; }else{ $memb_pwd_status = "Altering...Falied"; } }else{ $memb_pwd_status = "OK"; } $install .='
Checking,Altering Tables
Status
Reset row [Character.dbo]
'.$reset_status.'
AdminAccess row [MEMB_INFO.dbo]
'.$adminaccess_status.'
SecretQuestion row [MEMB_INFO.dbo]
'.$sq_status.'
SecretAnswer row [MEMB_INFO.dbo]
'.$sa_status.'
Country row [MEMB_INFO.dbo]
'.$country_status.'
Gender row [MEMB_INFO.dbo]
'.$gender_status.'
Table [MuWeb_Ban.dbo]
'.$muweb_ban_status.'
mu_id row [Character.dbo]
'.$mu_id_status.'
Table [MuWeb_Vault.dbo]
'.$muweb_vault_status.'
memb__pwd2 row [MEMB_INFO.dbo]
'.$memb_pwd_status.'
'; if($reload == 1){ $install .='
'; }else{ $install .='
'; } break; case 3: $install .='
Password Encryption Type
'; $install .='
'; break; case 4: if($_POST['pwd_enc'] == 1){ $new_db = fopen("sys_/muweb_config.inc.php", "w"); $data = ""; fwrite($new_db,$data); fclose($new_db); } if ($_POST['pwd_enc'] == 2){ $new_db = fopen("sys_/muweb_config.inc.php", "w"); $data = ""; fwrite($new_db,$data); fclose($new_db); } require("sys_/muweb_config.inc.php"); if($muweb['md5_encrypt'] == 1){ if($muweb['connection_type'] == "ODBC"){ $db_primary = &ADONewConnection('odbc','date'); $connect_sql = $db_primary->Connect($muweb['db_name'],$muweb['db_user'],$muweb['db_password'],$muweb['db_host']); if(!$connect_sql){ $error = 1; $db = "NO"; }else{ $db = "YES"; } $db_secondary = &ADONewConnection('odbc','date'); $connect_sql = $db_secondary->Connect($muweb['db_name2'],$muweb['db_user'],$muweb['db_password'],$muweb['db_host']); if(!$connect_sql){ $error = 1; $db2 = "NO"; }else{ $db2 = "YES"; } }elseif($muweb['connection_type'] == "MSSQL"){ $db_primary = &ADONewConnection('mssql'); $connect_sql = $db_primary->Connect($muweb['db_host'],$muweb['db_user'],$muweb['db_password'],$muweb['db_name']); if(!$connect_sql){ $error = 1; $db = "NO"; }else{ $db = "YES"; } $db_secondary = &ADONewConnection('mssql'); $connect_sql = $db_secondary->Connect($muweb['db_host'],$muweb['db_user'],$muweb['db_password'],$muweb['db_name2']); if(!$connect_sql){ $error = 1; $db2 = "NO"; }else{ $db2 = "YES"; } } if($muweb['debug'] == 1){ $db_primary->debug = true; $db_secondary->debug = true; } /* $check_dll = $db_primary->Execute("Use master; SELECT * FROM dbo.sysobjects where name='XP_MD5_EncodeKeyVal'"); $check_dll = $check_dll->numrows(); if($check_dll <= 0){ $executing_dll = $db_primary->Execute("USE master; exec sp_addextendedproc 'XP_MD5_EncodeKeyVal', 'WZ_MD5_MOD.dll'"); if($executing_dll){ $dll_status = "Done"; }else{ $error = 1; $dll_status = "WZ_MD5_MOD.dll Not Found"; } }else{ $dll_status = "Done"; } */ $create_function = $db_secondary->Execute("CREATE FUNCTION [dbo].[fn_md5] (@data VARCHAR(10), @data2 VARCHAR(10)) RETURNS BINARY(16) AS BEGIN DECLARE @hash BINARY(16) EXEC master.dbo.XP_MD5_EncodeKeyVal @data, @data2, @hash OUT RETURN @hash END"); if($create_function){ $func_status = "Done"; }else{ #$error = 1; $func_status = "Done"; } $install .='
Function [dbo].[fn_md5]
Status
Create Function [dbo].[fn_md5]
'.$func_status.'
';} if($error != 1){ $install .='
Create Administrator Account
Username
Password
Repeat Password
'; $install .='
'; }else{ $install .='
'; } break; case 5: require("sys_/muweb_config.inc.php"); if($muweb['connection_type'] == "ODBC"){ $db_primary = &ADONewConnection('odbc','date'); $connect_sql = $db_primary->Connect($muweb['db_name'],$muweb['db_user'],$muweb['db_password'],$muweb['db_host']); if(!$connect_sql){ $error = 1; $db = "NO"; }else{ $db = "YES"; } $db_secondary = &ADONewConnection('odbc','date'); $connect_sql = $db_secondary->Connect($muweb['db_name2'],$muweb['db_user'],$muweb['db_password'],$muweb['db_host']); }elseif($muweb['connection_type'] == "MSSQL"){ $db_secondary = &ADONewConnection('mssql'); $connect_sql = $db_secondary->Connect($muweb['db_host'],$muweb['db_user'],$muweb['db_password'],$muweb['db_name']); if(!$connect_sql){ $error = 1; $db = "NO"; }else{ $db = "YES"; } } if($muweb['debug'] == 1){ $db_primary->debug = true; $db_secondary->debug = true; } $check_acc = $db_secondary->Execute("Select memb___id from memb_info where memb___id=?",array($_POST['username'])); $check_acc = $check_acc->numrows(); if(empty($_POST['username']) || empty($_POST['password']) || empty($_POST['repassword'])){ $install .='
Some fields where left blank.
'; $error = 1; } elseif ($check_acc > 0){ $install .='
This username is already used.
'; $error = 1; } elseif ($_POST['password'] != $_POST['repassword']){ $install .='
Passwords did not match.
'; $error = 1; } if($error != 1){ if($muweb['md5_encrypt'] == 1){ $make_me_acc = $db_secondary->Execute("INSERT INTO memb_info (memb___id,memb__pwd,memb__pwd2,memb_name,sno__numb,bloc_code,ctl1_code,mail_chek,appl_days,modi_days,out__days,true_days,adminaccess) VALUES (?,[dbo].[fn_md5](?,?),?,?,?,?,?,?,?,?,?,?,?)",array($_POST['username'],$_POST['password'],$_POST['username'],$_POST['password'],'test','1','0','0','1',date('m/d/Y'),date('m/d/Y'),'2005-01-03','2005-01-03','1')); if($make_me_acc){ $install .='
Administrator Account Successfully Created.
'; }else{ $install .='
There was a problem with creating administrator account.
'; $error=1; } }else{ $make_me_acc = $db_secondary->Execute("INSERT INTO memb_info (memb___id,memb__pwd,memb__pwd2,memb_name,sno__numb,bloc_code,ctl1_code,mail_chek,appl_days,modi_days,out__days,true_days,adminaccess) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)",array($_POST['username'],$_POST['password'],$_POST['password'],'test','1','0','0','1',date('m/d/Y'),date('m/d/Y'),'2005-01-03','2005-01-03','1')); if($make_me_acc){ $install .='
Administrator Account Successfully Created.
'; }else{ $install .='
There was a problem with creating administrator account.
'; $error=1; } } } if($error == 1){ $install .='
Create Administrator Account
Username
Password
Repeat Password
'; $install .='
'; } if($error!=1){ $install .='
'; } break; case 6: $install .='
Installation Complete,
Thank you for using MuWeb 0.9
'; $install .='
For security reasons delete install.php
'; break; case 7: unlink("install.php"); $install .='
install.php file successfully deleted.
'; break; } echo $install; ?>