<?PHP
/***************************************************************************
* installer.php
* ---------------
* Version : 1.0.1
* Email : austin_inc@hotmail.com
* Site : http://phpbb-amod.com
*
***************************************************************************/
/***************************************************************************
* delete the right files
* ----------------------
* Version : 1.0.0
* Email : admin@prutsemie.com
* Site : http://www.prutsemie.com
*
***************************************************************************/
// delete the install files
$file[] = "install/install.php";
$file[] = "install/upgrade.php";
$file[] = "install/updates.php";
$file[] = "install/update_to_latest.php";
$file[] = "install/index.htm";
$file[] = "install/schemas/index.htm";
$file[] = "install/schemas/ms_access_primer.zip";
$file[] = "install/schemas/mysql_basic.sql";
$file[] = "install/schemas/mysql_schema.sql";
// delete the contrib files
$file[] = "contrib/dbinformer.php";
$file[] = "contrib/template_db_cache.php";
$file[] = "contrib/template_file_cache.php";
$file[] = "contrib/fixfiles.sh";
$file[] = "contrib/README.html";
// delete the blend files
$file[] = "/BlendAdmin/admin_downloads_config.php";
$file[] = "/images/new_download.gif";
$file[] = "/language/lang_english/lang_blend_downloads.php";
$file[] = "/templates/subSilver/downloads_body.tpl";
$file[] = "downloads.php";
for($i=0; $i<count($file); $i++){
}
// delete the install + contribmap
$repertoire = "install/schemas";
$repertoire1 = "install";
$repertoire2 = "contrib";
/***************************************************************************/
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
$page_title = 'phpBB Security Install';
$mode = ($_POST['mode']) ? $_POST['mode'] : $HTTP_POST_VARS['mode'];
if (!$mode)
{
echo 'Below, we will set up your DB values, so your site will be unique & dynamic!<br><br>'; <form name="build_install" action="security_install.php" method="post">
<p>Choose an admin config name. This can be anything. Try to keep it 1 or 2 words
max IE. <b>admins_allowed</b>. I would not suggest using that, but you get the
idea.</p>
<br><br>
<input type="text" value="" name="admin" size="30" class="post">
<br><br><br>
<p>Choose a mod config name. This can be anything. Try to keep it 1 or 2 words
max IE. <b>mods_allowed</b>. I would not suggest using that, but you get the
idea.</p>
<br><br>
<input type="text" value="" name="mods" size="30" class="post">
<br><br><br>
<p>Choose a disable config name. This can be anything. Try to keep it 1 or 2 words
max IE. <b>block_unwanted</b>. I would not suggest using that, but you get the
idea.</p>
<br><br>
<input type="text" value="" name="name" size="30" class="post">
<br>
<input type="hidden" value="submit" name="mode">
<input type="submit" class="mainoption" value=" Submit " onchange="document.build_install.submit()">
</form>';
}
if ($mode == 'submit')
{
$admin = ($_POST['admin']) ? $_POST['admin'] : $HTTP_POST_VARS['admin'];
$mod = ($_POST['mods']) ? $_POST['mods'] : $HTTP_POST_VARS['mods'];
$name = ($_POST['name']) ? $_POST['name'] : $HTTP_POST_VARS['name'];
message_die(GENERAL_ERROR, 'All three fields are REQUIRED. Please click <b>Back</b> & try again.', 'Error');
$sql[] = "DROP TABLE IF EXISTS ". $table_prefix ."phpBBSecurity";
$sql[] = "CREATE TABLE `". $table_prefix ."phpBBSecurity` (
`ban_id` mediumint(8) NOT NULL auto_increment,
`ban_ip` varchar(15) NOT NULL default '',
`ban_reason` varchar(50) NOT NULL default '0',
`ban_date` int(10) NOT NULL default '0',
`ban_attempts` int(10) NOT NULL default '0',
`ban_link` text NOT NULL,
PRIMARY KEY (`ban_id`)
) TYPE=MyISAM PACK_KEYS=0 AUTO_INCREMENT=1;";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_login_limit', '3');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_notify_admin', '1');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_notify_admin_id', '". $userdata['user_id'] ."');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_auto_ban', '1');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_allowed_sessions', '50');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('". $admin ."', '2');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('". $mod ."', '0');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('". $name ."', '1');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_DDoS_Ban', '1');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_Encoded_Ban', '1');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_Union_Ban', '1');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_Clike_Ban', '1');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_SQL_Ban', '1');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_File_Ban', '1');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_Perl_Ban', '1');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_total_attempts', '0');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_Cback_Ban', '1');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_Allow_Change', '0');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_notify_admin_pm', '1');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_notify_admin_em', '1');";
$sql[] = "ALTER TABLE ". USERS_TABLE ." ADD phpBBSecurity_answer TEXT NOT NULL;";
$sql[] = "ALTER TABLE ". USERS_TABLE ." ADD phpBBSecurity_question TEXT NOT NULL;";
$sql[] = "ALTER TABLE ". USERS_TABLE ." ADD phpBBSecurity_login_tries smallint(5) NOT NULL default '0';";
$sql[] = "ALTER TABLE ". USERS_TABLE ." ADD phpBBSecurity_pm_sent smallint(1) NOT NULL default '0';";
for ($b = 0; $b < count($sql); $b++) {
if (!$result = $db->sql_query($sql[$b]))
{
$error = $db->sql_error();
echo $sql[$b] .'<br><br><b>Error: </b>'. $error['message'] .'<br>'; }
else
{
echo $sql[$b]. '<br><br><b>Successfully Completed. </b>'; }
}
Install complete. Please open phpbb_security.php that was provided with the download. Find
the below & change it as posted below. Basically you are changing the return lines in each
of the functions to reflect your new fields you just created. If you skip this step, your
board WILL NOT function properly.
<br><br>
<b>FIND</b>
function phpBBSecurity_AdminConfigName()
{
return \'phpBBSecurity_max_admins\';
}
<br><br>
<b>REPLACE WITH</b>
function phpBBSecurity_AdminConfigName()
{
return \''. $admin .'\';
}
<br><br>
<b>FIND</b>
function phpBBSecurity_ModConfigName()
{
return \'phpBBSecurity_max_mods\';
}
<br><br>
<b>REPLACE WITH</b>
function phpBBSecurity_ModConfigName()
{
return \''. $mod .'\';
}
<br><br>
<b>FIND</b>
function phpBBSecurity_UseSpecial()
{
return \'phpBBSecurity_use_max\';
}
<br><br>
<b>REPLACE WITH</b>
function phpBBSecurity_UseSpecial()
{
return \''. $name .'\';
}
<br><br>
<b>CLOSE & SAVE</b>
<br><br>
<p>I have set your board to allow 2 admins & no mods. You need to goto
the ACP -> General Admin -> Configuration & scroll down to <b>phpBB Security :: Special Fields.</b>
And set the numbers correctly so your admins & mods can view the site. <br><br><b>NOW DELETE THIS FILE.</b></p>';
}
print "<br />If the upgrade completed without error you may click <a href=\"./../index.$phpEx\">Here</a> to proceed to the index<br />";
?>