|
|
|
@ -15,7 +15,7 @@ switch($_POST['act']){
|
|
|
|
|
$rs=mysqli_query($lnMysql,
|
|
|
|
|
"SELECT 1
|
|
|
|
|
FROM bots
|
|
|
|
|
WHERE name='".mysqli_real_escape_string($lnMysql,$_POST['botname'])."'
|
|
|
|
|
WHERE name='".mysqli_real_escape_string($lnMysql,htmlentities($_POST['botname']))."'
|
|
|
|
|
AND game='".mysqli_real_escape_string($lnMysql,$_POST['game'])."';");
|
|
|
|
|
if(mysqli_num_rows($rs) > 0){
|
|
|
|
|
$alerts.="Un bot existant pour ce je porte le même nom\n";
|
|
|
|
@ -40,13 +40,33 @@ switch($_POST['act']){
|
|
|
|
|
|
|
|
|
|
//BotDescription=> a voir
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($alerts <>""){
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
//enregistrer le bot et envoyer un email pour la validation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$secret=rand_str(8, '$-_.+!*\'(),ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890');
|
|
|
|
|
|
|
|
|
|
$rs=mysqli_query($lnMysql,
|
|
|
|
|
"INSERT INTO bots (name,game,url,description,active,date_inscription,validate_secret) VALUES
|
|
|
|
|
( '".mysqli_real_escape_string($lnMysql,htmlentities($_POST['botname']))."',
|
|
|
|
|
'".mysqli_real_escape_string($lnMysql,$_POST['botGame'])."',
|
|
|
|
|
'".mysqli_real_escape_string($lnMysql,htmlentities($_POST['botURL']))."',
|
|
|
|
|
'".mysqli_real_escape_string($lnMysql,
|
|
|
|
|
preg_replace('#^(http|https|mailto|ftp)://(([a-z0-9\/\.\?-_=#@:~])*)#i','<a href="$1://$2">$1://$2</a>'
|
|
|
|
|
,nl2br(htmlentities($_POST['botDescription'])))
|
|
|
|
|
)."',
|
|
|
|
|
'NOW(),
|
|
|
|
|
'".$secret."'"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
require_once (__DIR__."/class.phpmailer.php");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|