From 5c9c741811b582240a5a947bbf5d07305c85f6d8 Mon Sep 17 00:00:00 2001 From: Austin Date: Thu, 11 Nov 2021 10:00:46 -0500 Subject: [PATCH] add obfuscate email func --- globals/functions.php | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/globals/functions.php b/globals/functions.php index 59965f9..78469a8 100644 --- a/globals/functions.php +++ b/globals/functions.php @@ -43,6 +43,19 @@ function isbase64png($base64) //must already be decoded // ... +//obfuscation + +function obfuscate_email($email) +{ + $em = explode("@",$email); + $name = implode('@', array_slice($em, 0, count($em)-1)); + $len = floor(strlen($name)/2); + + return substr($name,0, $len) . str_repeat('.', $len) . "@" . end($em); +} + +// .. + //safe generation utilities function genHash($len) @@ -5224,14 +5237,22 @@ function getBC($id) { //end character colors portion } //settings portion { + +function is2FAInitialized($userid) +{ + $isinit = $GLOBALS['pdo']->prepare("SELECT * FROM `google_2fa` WHERE `validated` = 1 AND `userid` = :uid"); + $isinit->bindParam(":uid", $userid, PDO::PARAM_INT); + $isinit->execute(); + if ($isinit->rowCount() > 0) { + return true; + } + return false; +} function setBlurb($newblurb) { - if (strlen($newblurb)>4096) //limit 4096 characters - { - return false; - } - else + $newblurb = cleanInput($newblurb); + if (strlen($newblurb)<=4096) //limit 4096 characters { $localplayer = $GLOBALS['user']->id; @@ -6504,7 +6525,7 @@ function getCurrentThemeLogo() //grabs the alphaland logo for the users selected { $currenttheme = getCurrentTheme(); - return $GLOBALS['url'] . "/alphaland/cdn/imgs/alpha-spooky/alphalandzombie.png"; //spooky + //return $GLOBALS['url'] . "/alphaland/cdn/imgs/alpha-spooky/alphalandzombie.png"; //spooky if ($currenttheme == 0) //light theme dark logo {