From 765d3d17dab1aefd85328231612724f1d98fe5b1 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 5 Apr 2022 13:51:36 +0200 Subject: [PATCH] Finished the login and sterilisation --- confirm.php | 59 ++++++++++++++++++++++---------------------- create.php | 3 +++ index.php | 1 + login.php | 71 +++++++++++++++++++++++++++++++++++++++++++++++++---- 4 files changed, 100 insertions(+), 34 deletions(-) diff --git a/confirm.php b/confirm.php index 71eb2f1..b0a43e3 100644 --- a/confirm.php +++ b/confirm.php @@ -2,10 +2,11 @@ '.PHP_EOL); + fwrite($rolefile, '$playsbestwith = ";"'.PHP_EOL); + fwrite($rolefile, '";'.PHP_EOL); #Convars $f_convars = '$convars = "Normal Role Convars (also found in ULX): - '.removeBrackets($_POST['gconvars'].' + '.sanitizeMyThings($_POST['gconvars']).' Rolespecific Convars: - '.removeBrackets($_POST['cconvars']).'"'; + '.sanitizeMyThings($_POST['cconvars']).'";'; fwrite($rolefile, $f_convars.PHP_EOL); @@ -77,21 +78,21 @@ if (preg_match('/^[\/\w\-. ]+$/', $_POST['rolename'].'.php')){ # #The Steam URL to your addon - $f_steam = removeBrackets($_POST['steam']); - fwrite($rolefile, '$steam = "'.$f_steam.'"'.PHP_EOL); + $f_steam = sanitizeMyThings($_POST['steam']); + fwrite($rolefile, '$steam = "'.$f_steam.'";'.PHP_EOL); #The Source URL to your addon - $f_source = removeBrackets($_POST['source']); - fwrite($rolefile, '$source = "'.$f_source.'"'.PHP_EOL); + $f_source = sanitizeMyThings($_POST['source']); + fwrite($rolefile, '$source = "'.$f_source.'";'.PHP_EOL); #Creator of the Addon - $f_author = removeBrackets($_POST['creator']); - fwrite($rolefile, '$author = "'.$f_author.'"'.PHP_EOL); + $f_author = sanitizeMyThings($_POST['creator']); + fwrite($rolefile, '$author = "'.$f_author.'";'.PHP_EOL); #Creatorlink - $f_authorurl = removeBrackets($_POST['creatorurl']); - fwrite($rolefile, '$authorurl = "'.$f_authorurl.'"'.PHP_EOL); + $f_authorurl = sanitizeMyThings($_POST['creatorurl']); + fwrite($rolefile, '$authorurl = "'.$f_authorurl.'";'.PHP_EOL); # Credittext (can use the above variables) - $f_ctext = removeBrackets($_POST['credits']); - fwrite($rolefile, '$ctext = "'.$f_ctext.'"'.PHP_EOL); + $f_ctext = sanitizeMyThings($_POST['credits']); + fwrite($rolefile, '$ctext = "'.$f_ctext.'";'.PHP_EOL); fwrite($rolefile, '?>'); fclose($rolefile); diff --git a/create.php b/create.php index 654380f..e71d0d9 100644 --- a/create.php +++ b/create.php @@ -1,3 +1,6 @@ + diff --git a/index.php b/index.php index e7ed548..4900fb2 100644 --- a/index.php +++ b/index.php @@ -46,6 +46,7 @@
  • Official TTT2 Discord
  • +
  • Create your own! [BETA]
  • Roles
  • diff --git a/login.php b/login.php index deeb78a..371fddf 100644 --- a/login.php +++ b/login.php @@ -6,19 +6,80 @@ $pass = @$_POST['pass']; if($user == "admin" && $pass == "soup") { + $runningFileName = "login.php"; include("create.php"); } else { +?> + + + + + + TTT2 Role Adder + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    - User
    - Pass
    - + +
    +
    + +
    +
    +
    + +
    +
    - '; +
    + +
    +
    +
    +
    + + + + + +