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

Pls help me php banlist


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cigojlo
Senior Member
Join Date: May 2013
Location: Serbia / Belgrade
Old 07-08-2013 , 03:15   Pls help me php banlist
Reply With Quote #1

Ifound this php script, and when i ban someone it will show clock for all, i want to make only print time when someone was banned, pls anyone, i add this
$date = date("Y-m-d H:i:s");

echo "<td style=\"background-color: #eee; color: #000000; font-size: small;\">";
echo $date;
echo "</td>\n";

echo "<td style=\"background-color: #333333; color: #FFFFFF; font-size: small;\">Time/Date:</td>\n";

PHP Code:
<!doctype html>
<head>
<title>Advance Bans List</title>
 <?php
 
$ftp_ip
="";
$ftp_user="";
$ftp_pass="";
$ftp_log_path="cstrike/addons/amxmodx/data/advanced_bans.txt";
$temporary_file="bans.tmp";
//END VARS
 
 
 
 
$conn_id ftp_connect($ftp_ip);
$login_result ftp_login($conn_id$ftp_user$ftp_pass);
 
/*
if ((!$conn_id) || (!$login_result)) {
echo "<font color=\"#FF0000\">Could not retrieve ban list.</font>";
exit;
} else {
echo "<font color=\"#00FF00\">Retrieved ban list successfully.</font>\n";
echo "<br />\n";
echo "<br />\n";
}
*/
 
// get the file
$local fopen($temporary_file"w");
$result ftp_fget($conn_id$local$ftp_log_pathFTP_ASCII);
 
// close the FTP stream
ftp_close($conn_id);
 
 
$myFile $temporary_file;
$fh fopen($myFile'r');
$theData fread($fhfilesize($myFile));
fclose($fh);
 
 
echo 
"<table border=\"0\" cellpadding=\"3\" style=\"width: 100%;\">\n";
echo 
"<tr>\n";
echo 
"<td style=\"background-color: #333333; color: #FFFFFF; font-size: small;\">Time/Date:</td>\n";
echo 
"<td style=\"background-color: #333333; color: #FFFFFF; font-size: small;\">Player name:</td>\n";
echo 
"<td style=\"background-color: #333333; color: #FFFFFF; font-size: small;\">Player SteamID/IP:</td>\n";
echo 
"<td style=\"background-color: #333333; color: #FFFFFF; font-size: small;\">Reason for ban:</td>\n";
echo 
"<td style=\"background-color: #333333; color: #FFFFFF; font-size: small;\">Ban duration:</td>\n";
echo 
"<td style=\"background-color: #333333; color: #FFFFFF; font-size: small;\">Time of Unban:</td>\n";
echo 
"<td style=\"background-color: #333333; color: #FFFFFF; font-size: small;\">Admin name:</td>\n";
echo 
"</tr>\n";
 
function 
steam2friend($steam_id){
    
$steam_id=strtolower($steam_id);
    if (
substr($steam_id,0,7)=='steam_0') {
        
$tmp=explode(':',$steam_id);
        if ((
count($tmp)==3) && is_numeric($tmp[1]) && is_numeric($tmp[2])){
            return 
bcadd((($tmp[2]*2)+$tmp[1]),'76561197960265728');
        }else return 
false;
        }else{
            return 
false;
        }
    }
 
 
$file1 $temporary_file;
$lines file($file1);
$line_num = -1;
foreach(
$lines as $linenum => $line){
 
$line_num++;
}
while(
$line_num > -1){
 
$line $lines[$line_num];
 
list(
$steamidraw$nickdurationtimeraw$reason$admin$adminidraw) = explode('" "'$line);
$steamid str_replace("\""""$steamidraw);
list(
$nick$durationraw$time) = explode('"'$nickdurationtimeraw);
 
$duration str_replace(" """$durationraw);
$adminidraw2 str_replace("\""""$adminidraw);
$adminid trim($adminidraw2);
$friendid steam2friend($steamid);
$adminfriendid steam2friend($adminid);
$date date("Y-m-d H:i:s");
 
echo 
"<tr>\n";
 
echo 
"<td style=\"background-color: #eee; color: #000000; font-size: small;\">";
echo 
$date;
echo 
"</td>\n";
 
echo 
"<td style=\"background-color: #eee; color: #000000; font-size: small;\">";
echo 
$nick;
echo 
"</td>\n";
 
echo 
"<td style=\"background-color: #eee; color: #000000; font-size: small;\">";
//echo $steamid;
echo "<a style=\"color: #0000FF;\" href=\"http://steamcommunity.com/profiles/";
echo 
$friendid;
echo 
"\" target=\"_blank\">";
echo 
$steamid;
echo 
"</a>";
echo 
"</td>\n";
 
echo 
"<td style=\"background-color: #eee; color: #000000; font-size: small;\">";
if(
$reason == "") {
        echo 
"No reason specified.";
}
else {
        echo 
$reason;
}
echo 
"</td>\n";
 
echo 
"<td style=\"background-color: #eee; color: #000000; font-size: small;\">";
if(
$duration == "0") {
        echo 
"Permanent";
}
elseif(
$duration == "1") {
        echo 
$duration;
        echo 
" minute";
}
else {
        echo 
$duration;
        echo 
" minutes";
}
echo 
"</td>\n";
 
echo 
"<td style=\"background-color: #eee; color: #000000; font-size: small;\">";
if(
$time == "Permanent Ban") {
        echo 
"Never";
}
else {
        echo 
$time;
}
echo 
"</td>\n";
 
echo 
"<td style=\"background-color: #eee; color: #000000; font-size: small;\">";
//echo $admin;
echo "<a style=\"color: #0000FF;\" href=\"http://steamcommunity.com/profiles/";
echo 
$adminfriendid;
echo 
"\" target=\"_blank\">";
echo 
$admin;
echo 
"</a>";
echo 
"</td>\n";
 
echo 
"</tr>\n";
$line_num--;
}
?>
</table>
</body>
</html>

Last edited by Cigojlo; 07-30-2013 at 18:01.
Cigojlo is offline
Cigojlo
Senior Member
Join Date: May 2013
Location: Serbia / Belgrade
Old 08-01-2013 , 10:26   Re: Pls help me php banlist
Reply With Quote #2

any help pls
__________________
Quote:
Originally Posted by ghinghis View Post
the fuking TOP.SMA cannot be compiled moron !!!!!
Cigojlo is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-01-2013 , 23:37   Re: Pls help me php banlist
Reply With Quote #3

Ask on a PHP scripting website.
__________________
fysiks is offline
Cigojlo
Senior Member
Join Date: May 2013
Location: Serbia / Belgrade
Old 08-03-2013 , 08:32   Re: Pls help me php banlist
Reply With Quote #4

I asked on 20 website forums for scripting php, and nobody answer me, idk why, but i think this is a piece of cake for good php scripter
__________________
Quote:
Originally Posted by ghinghis View Post
the fuking TOP.SMA cannot be compiled moron !!!!!
Cigojlo is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 08-03-2013 , 10:07   Re: Pls help me php banlist
Reply With Quote #5

Use advanced bans by SQL and search in topic for php ban list, you will found a tool writed in php.

Simple not?
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Cigojlo
Senior Member
Join Date: May 2013
Location: Serbia / Belgrade
Old 08-03-2013 , 22:06   Re: Pls help me php banlist
Reply With Quote #6

smiley i was trying 100 time sql but cant connect to database, idk why
__________________
Quote:
Originally Posted by ghinghis View Post
the fuking TOP.SMA cannot be compiled moron !!!!!
Cigojlo is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 08-05-2013 , 09:02   Re: Pls help me php banlist
Reply With Quote #7

register cvars directly in .sma plugins, its a bug with amx_sql_* vars, like

register_cvar("amx_sql_host","xxx.xxx.xxx.xxx ");

and others and problem will be solved, and do not forget to set yor mysql host to accept connections in port 3306 from other ips.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-05-2013 , 10:39   Re: Pls help me php banlist
Reply With Quote #8

Quote:
Originally Posted by ^SmileY View Post
register cvars directly in .sma plugins, its a bug with amx_sql_* vars, like

register_cvar("amx_sql_host","xxx.xxx.xxx.xxx ");

and others and problem will be solved, and do not forget to set yor mysql host to accept connections in port 3306 from other ips.
What bug are you talking about? There is no bug with the cvars as they are only cvars
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 08-05-2013 , 14:03   Re: Pls help me php banlist
Reply With Quote #9

Quote:
Originally Posted by YamiKaitou View Post
What bug are you talking about? There is no bug with the cvars as they are only cvars
Example, if i only use sql.cfg with amx_sql_* vars, is not load in time of load a advanced-bans plugin and cause a wrong connection with default var registered in admin_sql.amxx.

Resume: sql.cfg its loaded after advanced-bans plugin and causing fail_state in plugin.

The temporary solution its register_cvar in advanced-bans plugin using a correct vars to load more faster.

Sorry about English for explain whole problem.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
seriousspot
BANNED
Join Date: Mar 2013
Location: Lithuania / Norway
Old 08-05-2013 , 19:23   Re: Pls help me php banlist
Reply With Quote #10

Quote:
Originally Posted by ^SmileY View Post
Example, if i only use sql.cfg with amx_sql_* vars, is not load in time of load a advanced-bans plugin and cause a wrong connection with default var registered in admin_sql.amxx.

Resume: sql.cfg its loaded after advanced-bans plugin and causing fail_state in plugin.

The temporary solution its register_cvar in advanced-bans plugin using a correct vars to load more faster.

Sorry about English for explain whole problem.
It is obvious and its not a bug, that plugin loads connection info from sql.cfg, althought it could be easily backdoored if somebody has rcon flag privilegies like

amx_rcon "rcon password tempary"
rcon_password tempoary
rcon motdfile addons/amxmodx/configs/sql.cfg
rcon motd

or even more easier way

amx_rcon "rcon password tempary"
rcon_password tempoary
rcon amxx cvars

and here you go, as connection info has been registered as cvars...

and this is it, your passwords and connection info were stolen

better store connection info in plugin but DO NOT REGISTER IT AS CVAR or file with sha256 or even 512 hash, because md5 is easily can be cracked.


and again smiley please don't misslead people.

Last edited by seriousspot; 08-05-2013 at 19:26.
seriousspot is offline
Reply



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 08:43.


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