From 907334bbf19a01e46f58b999c2787c61aea3943e Mon Sep 17 00:00:00 2001 From: Cassio de Campos Date: Thu, 26 Oct 2017 09:05:05 +0100 Subject: bug in pass change for teams --- src/fcontest.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/fcontest.php') diff --git a/src/fcontest.php b/src/fcontest.php index f8f2cff..dc8a6d7 100644 --- a/src/fcontest.php +++ b/src/fcontest.php @@ -1179,11 +1179,12 @@ function DBUserUpdate($contest, $site, $user, $username, $userfull, $userdesc, $ else $temp = $a["userpassword"]; $lentmp = strlen($temp); $temp = bighexsub($passn, $temp); - if($lentmp > strlen($temp)) - $newpass = '0' . $temp; - else - $newpass = substr($temp, strlen($temp)-$lentmp); - + if($lentmp > strlen($temp)) { + $newpass = '0' . $temp; + while(strlen($newpass) < $lentmp) $newpass = '0' . $newpass; + } else { + $newpass = substr($temp, strlen($temp)-$lentmp); + } $c = DBConnect(); DBExec($c, "begin work"); DBExec($c, "lock table usertable"); -- cgit v1.2.3