aboutsummaryrefslogtreecommitdiff
path: root/src/fcontest.php
diff options
context:
space:
mode:
authorCassio de Campos <cassiopc@gmail.com>2017-10-26 08:05:05 +0000
committerCassio de Campos <cassiopc@gmail.com>2017-10-26 08:05:05 +0000
commit907334bbf19a01e46f58b999c2787c61aea3943e (patch)
tree5b62fbcfeafc869699e42cab8d4fd119a212d266 /src/fcontest.php
parent499ba9eba88be6bad972ee748e7389bd4f0dfa7e (diff)
downloadboca-907334bbf19a01e46f58b999c2787c61aea3943e.tar.gz
boca-907334bbf19a01e46f58b999c2787c61aea3943e.zip
bug in pass change for teams
Diffstat (limited to 'src/fcontest.php')
-rw-r--r--src/fcontest.php11
1 files changed, 6 insertions, 5 deletions
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");