Raised This Month: $12 Target: $400
 3% 

How to correctly install amxbans?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Skuduriukas
Junior Member
Join Date: Jan 2015
Old 01-26-2015 , 04:00   How to correctly install amxbans?
Reply With Quote #1

Hi again. YES I READED TUTORIALS! AND YES I WRITED QUESTION IN AMXBANS FORUMS BUT DAT FORUM DEAD. So what is the problem, I keep my cs in other vps server and website is on another. And when im installing amxweb they need my database and amxbans database, but where to get dat amxbans database? and how normally instal dat amxbans in server? Please, help..
Skuduriukas is offline
brlight
Senior Member
Join Date: Jun 2011
Old 01-26-2015 , 08:50   Re: How to correctly install amxbans?
Reply With Quote #2

Before installing amxbans you must first create/have a database and user for it. you should create database and user for it on the host where you want to install amxbans (web).
brlight is offline
Skuduriukas
Junior Member
Join Date: Jan 2015
Old 01-26-2015 , 09:07   Re: How to correctly install amxbans?
Reply With Quote #3

so here

in root and url path i need to write my server ip? or leave it for defaults? if i leave it by defaults im going next and what i get is that:

but all privilegies are set on.

Last edited by Skuduriukas; 01-26-2015 at 09:11.
Skuduriukas is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 01-26-2015 , 09:50   Re: How to correctly install amxbans?
Reply With Quote #4

Remove the code which checks the permissions in the setup script, had the same issue.
__________________
Kia is offline
Skuduriukas
Junior Member
Join Date: Jan 2015
Old 01-26-2015 , 09:53   Re: How to correctly install amxbans?
Reply With Quote #5

Quote:
<?php

/*

AMXBans v6.0

Copyright 2009, 2010 by AMXBans.de

This file is part of AMXBans.

AMXBans is free software, but it's licensed under the
Creative Commons - Attribution-NonCommercial-ShareAlike 2.0

AMXBans is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

You should have received a copy of the cc-nC-SA along with AMXBans.
If not, see <http://creativecommons.org/licenses/by-nc-sa/2.0/>.

*/

session_start();

//check for existing config file
// if(file_exists("include/db.config.inc.php")) {
// header("Location: index.php");
// }

require_once("install/functions.inc");
require_once("include/functions.inc.php");

$config->v_web = "6.0.3";


//installation are 6 sites
$sitenrall=6;
$sitenr=(int)$_POST["site"];

if($sitenr==7 && isset($_POST["check7"])) {
$sitenrall=7;
}
//if all setup data is ok, unlock and open site 7
if(isset($_POST["check6"])) {
$sitenrall=7;
$sitenr++;
}
if(isset($_POST["back"])) $sitenr--;
if(isset($_POST["next"])) $sitenr++;


if($sitenr < 1 || $sitenr > $sitenrall) $sitenr=1;


/////////////// basic functions /////////////////

//$config->path_root=str_replace("/".basename($_SERVER["SCRIPT_FILENAME"]),"",$_SERVER["SCRIPT_FILENAME"]);
$config->path_root=str_replace("/".basename(str_replace("\\", "/", $_SERVER["SCRIPT_FILENAME"])),"",str_replace("\\", "/", $_SERVER["SCRIPT_FILENAME"]));
$config->document_root=str_replace("/".basename($_SERVER["PHP_SELF"]),"",$_SERVER["PHP_SELF"]);
$config->templatedir = $config->path_root."/install";
$config->langfilesdir = $config->path_root."/install/language/";
$config->default_lang = "german";
if(empty($_SESSION["lang"])) $_SESSION["lang"]="english";

if(!is__writable($config->path_root."/include/smarty/templates_c/")) {
echo '<br />
<table border="0" align="center">
<tr>
<td align="center" style="color: #c04040;font-width=bold;font-size=18px;"><img src="images/warning.gif" /> <u>Directory include/smarty/templates_c is not writable !!</u></td>
</tr>
</table>';
exit;
}

/* Smarty settings */
define("SMARTY_DIR", $config->path_root."/include/smarty/");

require_once(SMARTY_DIR."Smarty.class.php");

class dynamicPage extends Smarty {
function dynamicPage() {

global $config;

$this->Smarty();

$this->template_dir = $config->templatedir;
$this->compile_dir = SMARTY_DIR."templates_c/";
$this->config_dir = SMARTY_DIR."configs/";
$this->cache_dir = SMARTY_DIR."cache/";
$this->caching = false;

//for changing templates itīs better "true", but slow down site load
$this->force_compile = true;
$this->caching = false;

$this->assign("app_name","dynamicPage");
}
}
$smarty = new dynamicPage;

$smarty->assign("next",false);

if($sitenr==1) {
$smarty->assign("next",true);
}

/////////////// site 2 server settings /////////////////
if($sitenr==2) {
$php_settings=array(
"display_errors"=>(ini_get('display_errors')= ="")?"off":ini_get('display_errors'),
"register_globals"=>(ini_get('register_global s')==1 || ini_get('register_globals')=="on")?"_ON":"_OF F",
"magic_quotes_gpc"=>(get_magic_quotes_gpc()== true)?"_ON":"_OFF", #(ini_get('magic_quotes_gpc')=="0")?"off":"on ",
"safe_mode"=>(ini_get('safe_mode')==1 || ini_get('safe_mode')=="on")?"_ON":"_OFF",
"post_max_size"=>ini_get('post_max_size') ." (".return_bytes(ini_get('post_max_size')). " bytes)",
"upload_max_filesize"=>ini_get('upload_max_fi lesize')." (".return_bytes(ini_get('upload_max_filesize' ))." bytes)",
"max_execution_time"=>ini_get('max_execution_ time'),
"version_php"=>phpversion(),
"version_amxbans_web"=>$config->v_web,
"server_software"=>$_SERVER["SERVER_SOFTWARE"],
"mysql_version"=>mysql_get_client_info(),
"bcmath"=>(extension_loaded('bcmath')=="1")?" _YES":"_NO",
"gmp"=>(extension_loaded('gmp')=="1")?"_YES": "_NO"
);
$smarty->assign("next",true);
$smarty->assign("checkvalue","_REFRESH");
$smarty->assign("php_settings",$php_settings);
}

/////////////// site 3 dirs /////////////////
if($sitenr==3) {
if(isset($_POST["path_root"]) && $_POST["path_root"] != $config->path_root) $config->path_root = stripcslashes($_POST["path_root"]);
if(isset($_POST["document_root"]) && $_POST["document_root"] != $config->document_root) $config->document_root = stripcslashes($_POST["document_root"]);
$include_dir=is__writable($config->path_root."/include/");
$backup_dir=is__writable($config->path_root."/include/backup/");
$files_dir=is__writable($config->path_root."/include/files/");
$temp_dir=is__writable($config->path_root."/temp/");
$templates_c_dir=is__writable($config->path_root."/include/smarty/templates_c/");
$setupphp=is__writable($config->path_root."/");

$dirs=array(
"document_root" => $config->document_root,
"path_root" => $config->path_root,
"include" => $include_dir,
"files" => $files_dir,
"backup" => $backup_dir,
"temp" => $temp_dir,
"templates_c" => $templates_c_dir,
"setupphp" => $setupphp
);
if($include_dir && $files_dir && $temp_dir && $templates_c_dir && $backup_dir) $smarty->assign("next",true);
$smarty->assign("checkvalue","_RECHECK");
$smarty->assign("dirs",$dirs);
}

/////////////// site 4 db /////////////////
if($sitenr==4 && isset($_POST["check4"])) {
$_SESSION["dbcheck"]=false;
$dbhost=trim($_POST["dbhost"]);
$dbuser=trim($_POST["dbuser"]);
$dbpass=trim($_POST["dbpass"]);
$dbdb=trim($_POST["dbdb"]);
$dbprefix=trim($_POST["dbprefix"]);

$_SESSION["dbhost"]=$dbhost;
$_SESSION["dbuser"]=$dbuser;
$_SESSION["dbpass"]=$dbpass;
$_SESSION["dbdb"]=$dbdb;
$_SESSION["dbprefix"]=$dbprefix;

$smarty->assign("db",array($dbhost,$dbuser,$dbpass,$d bdb,$dbprefix));

if($dbhost=="" || $dbuser=="" || $dbdb=="" || $dbprefix=="") {
$msg="_NOREQUIREDFIELDS";
}

$mysql=@mysql_connect($dbhost,$dbuser,$dbpass ) or $msg="_CANTCONNECT";
if(!$msg) {
$enc = @mysql_query("SET CHARACTER SET 'utf-8'");
$enc = @mysql_query("SET NAMES 'utf8'");
$ressource=@mysql_select_db($dbdb) or $msg="_CANTSELECTDB";
}

//get user privileges
if(!$msg) {
$previleges=sql_get_privilege();
$prev[]=array("name"=>"SELECT","value"=>in_array("SE LECT",$previleges));
$prev[]=array("name"=>"INSERT","value"=>in_array("IN SERT",$previleges));
$prev[]=array("name"=>"UPDATE","value"=>in_array("UP DATE",$previleges));
$prev[]=array("name"=>"DELETE","value"=>in_array("DE LETE",$previleges));
$prev[]=array("name"=>"CREATE","value"=>in_array("CR EATE",$previleges));
//search for all needed previleges
foreach($prev as $k => $v) {
if(in_array(false,$v)) {$msg="_NOTALLPREVILEGES";break;}
}
}
//check for existing tables
if(!$msg) {
$ressource=@mysql_select_db($dbdb);
//search for existing dbprefix
if( mysql_num_rows( @mysql_query("SHOW TABLES FROM `".$dbdb."` LIKE '".$dbprefix."\_%'"))) {
$prefix_exists=true;
//search for field "imported" in bans table, added since 6.0
if( mysql_num_rows( @mysql_query("SHOW COLUMNS FROM `".$dbprefix."_bans` WHERE Field LIKE 'imported'"))) {
$prefix_isnew=true;
}
}
}

$smarty->assign("prevs",$prev);

if(!$msg) {
if($prefix_exists) {
if($prefix_isnew) {
$msg="_PREFIXEXISTSV6";
$_SESSION["dbcheck"]=true;
$smarty->assign("next",true);
} else {
$msg="_PREFIXEXISTSV5";
}
} else {
$msg="_DBOK";
$_SESSION["dbcheck"]=true;
$smarty->assign("next",true);
}
}
}
if($sitenr==4) $smarty->assign("checkvalue","_DBCHECK");

/////////////// site 5 admin /////////////////
if($sitenr==5 && isset($_POST["check5"])) {
$_SESSION["admincheck"]=false;
$adminuser=trim($_POST["adminuser"]);
$adminpass=trim($_POST["adminpass"]);
$adminpass2=trim($_POST["adminpass2"]);
$adminemail=trim($_POST["adminemail"]);

$_SESSION["adminuser"]=$adminuser;
$_SESSION["adminemail"]=$adminemail;
$_SESSION["adminpass"]="";
$_SESSION["adminpass2"]="";

$smarty->assign("admin",array($adminuser,$adminemail) );

if(strlen($adminuser) < 4) $validate[]="_USERTOSHORT";
if(strlen($adminpass) < 4) $validate[]="_PWTOSHORT";
if($adminpass != $adminpass2) $validate[]="_PWNOCONFIRM";
#if(!ereg(".+@.+\..{2,}",$adminemail)) $validate[]="_NOVALIDEMAIL";
if(!preg_match("/^[a-zA-Z0-9-_.]{2,}@[a-zA-Z0-9-_.]{2,}.[a-zA-Z]{2,6}$/",$adminemail)) $validate[]="_NOVALIDEMAIL";

if(!$adminuser || !$adminpass || !$adminpass2 || !$adminemail) {
$validate[]="_NOREQUIREDFIELDS";
}
if(!$validate) {
$_SESSION["adminpass"]=$adminpass;
$_SESSION["adminpass2"]=$adminpass2;
$_SESSION["admincheck"]=true;
$msg="_ADMINOK";
$smarty->assign("adminpass",$adminpass);
$smarty->assign("next",true);

}
$smarty->assign("validate",$validate);
}
if($sitenr==5) $smarty->assign("checkvalue","_ADMINCHECK");
#if($sitenr==5 && $_SESSION["admincheck"]==true) $smarty->assign("next",true);

/////////////// site 6 show data /////////////////
if($sitenr==6) $smarty->assign("checkvalue","_STEP7");

/////////////// site 7 end /////////////////
if($sitenr==7 && $_SESSION["dbcheck"]==true && $_SESSION["admincheck"]==true && !isset($_POST["check7"])) {

if(sql_connect()) {
//get tables structure
include("install/tables.inc");
//create db structure
foreach($table_create as $k => $v) {
$table=array("table"=>$k,"success"=>sql_creat e_table($k,$v));
$tables[]=$table;
}
//get default data
include("install/datas.inc");
//create default data
foreach($data_create as $k => $v) {
$data=array("data"=>$k,"success"=>sql_insert_ data($k,$v));
$datas[]=$data;
}
//create default websettings
$websettings_create=array("data"=>"_CREATEWEB SETTINGS","success"=>sql_insert_setting($webs ettings_query));
//create default usermenu
$usermenu_create=array("data"=>"_CREATEUSERME NU","success"=>sql_insert_setting($usermenu_q uery));
//create webadmin userlevel
$webadmin_create[]=array("data"=>"_CREATEUSERLEVEL","success"=> sql_insert_setting($userlevel_query));
//create webadmin
$webadmin_create[]=array("data"=>"_CREATEWEBADMIN","success"=>s ql_insert_setting($webadmin_query));
//install default modules
foreach($modules_install as $k => $v) {
$modul=array("name"=>$k,"success"=>sql_insert _setting($v));
$modules[]=$modul;
}

//write db.config.inc.php
$content="<?php

\$config->document_root = \"".$_SESSION["document_root"]."\";
\$config->path_root = \"".$_SESSION["path_root"]."\";

\$config->db_host = \"".$_SESSION["dbhost"]."\";
\$config->db_user = \"".$_SESSION["dbuser"]."\";
\$config->db_pass = \"".$_SESSION["dbpass"]."\";
\$config->db_db = \"".$_SESSION["dbdb"]."\";
\$config->db_prefix = \"".$_SESSION["dbprefix"]."\";

?>";
$msg=write_cfg_file($config->path_root."/include/db.config.inc.php",$content);
$smarty->assign("content",$content);
//create first log ;-)
sql_insert_setting($log_query);
}
$smarty->assign("tables",$tables);
$smarty->assign("datas",$datas);
$smarty->assign("modules",$modules);
$smarty->assign("usermenu_create",$usermenu_create) ;
$smarty->assign("websettings_create",$websettings_cre ate);
$smarty->assign("webadmin_create",$webadmin_create) ;
$smarty->assign("checkvalue","_SETUPEND");
}
if($sitenr==7 && isset($_POST["check7"])) {
//clear smarty cache
$smarty->clear_compiled_tpl();
//delete setup.php
@unlink("setup.php");
header("Location: index.php");
exit;
}


$_SESSION["path_root"] = $config->path_root;
$_SESSION["document_root"] = $config->document_root;

// Generate template
$smarty->assign("msg",$msg);
$smarty->assign("sitenr",$sitenr);
$smarty->assign("sitenrall",$sitenrall);
$smarty->assign("current_lang",$config->default_lang);
$smarty->assign("v_web",$config->v_web);

$smarty->display('setup.tpl');
?>
which part to remove?
Skuduriukas is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 01-26-2015 , 11:32   Re: How to correctly install amxbans?
Reply With Quote #6

PHP Code:
//search for all needed previleges 
__________________
Kia is offline
Skuduriukas
Junior Member
Join Date: Jan 2015
Old 01-26-2015 , 12:15   Re: How to correctly install amxbans?
Reply With Quote #7

Then i get this error:
Quote:
Parse error: syntax error, unexpected $end in /home/u536752076/public_html/amxbans/setup.php on line 346
line 346:
Quote:
?>
:/ hmm what the hell :/
Skuduriukas is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 01-26-2015 , 12:40   Re: How to correctly install amxbans?
Reply With Quote #8

Remove that.
__________________
Kia is offline
Skuduriukas
Junior Member
Join Date: Jan 2015
Old 01-26-2015 , 12:58   Re: How to correctly install amxbans?
Reply With Quote #9

But its code ending symbol.. Well i removed now they say the same about other line.
Quote:
Parse error: syntax error, unexpected $end in /home/u536752076/public_html/amxbans/setup.php on line 345
line:
Quote:
$smarty->display('setup.tpl');
Skuduriukas is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode