diff options
| author | Cassio de Campos <cassiopc@gmail.com> | 2017-11-01 18:13:51 +0000 |
|---|---|---|
| committer | Cassio de Campos <cassiopc@gmail.com> | 2017-11-01 18:13:51 +0000 |
| commit | 92bda853b5c48a8cd4a4bdaa6272ad21c51cfe86 (patch) | |
| tree | bc37484046f5a6e9d228072f6259309ae1618741 /src/fcontest.php | |
| parent | 8892bc8b32603e40d7c3d4856c47392675476787 (diff) | |
| download | boca-92bda853b5c48a8cd4a4bdaa6272ad21c51cfe86.tar.gz boca-92bda853b5c48a8cd4a4bdaa6272ad21c51cfe86.zip | |
avoid double transact
Diffstat (limited to 'src/fcontest.php')
| -rw-r--r-- | src/fcontest.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/fcontest.php b/src/fcontest.php index 50b9a08..9787e1c 100644 --- a/src/fcontest.php +++ b/src/fcontest.php @@ -327,7 +327,11 @@ function DBDeleteUser($contest, $site, $user) { $n = DBnlines($r); for ($i=0;$i<$n;$i++) { $a = DBRow($r,$i); - DBRunDelete($a["number"],$a["site"],$contest,$_SESSION["usertable"]["usernumber"],$_SESSION["usertable"]["usersitenumber"]); + if(DBRunDelete($a["number"],$a["site"],$contest,$_SESSION["usertable"]["usernumber"],$_SESSION["usertable"]["usersitenumber"],$c) === false) { + DBExec($c, "rollback work"); + LOGLevel("User $user (site=$site,contest=$contest) could not be removed (run delete error).", 1); + return false; + } } DBExec($c, "commit work"); LOGLevel("User $user (site=$site,contest=$contest) marked as inactive.", 1); |