# HG changeset patch # User Matti Hamalainen # Date 1381473120 -10800 # Node ID d31fc2c53b2b4cf39a211bad1e4d8e403a43842a # Parent 30a4420e85aba48225a5f994c7013680088e407a Added stUpdateUserKey(uid) for updating / regenerating a vote key for given UID. diff -r 30a4420e85ab -r d31fc2c53b2b msite.inc.php --- a/msite.inc.php Fri Oct 11 09:31:25 2013 +0300 +++ b/msite.inc.php Fri Oct 11 09:32:00 2013 +0300 @@ -500,6 +500,22 @@ } +function stUpdateUserKey($uid) +{ + if (($res = stGenerateUserKey()) !== FALSE) + { + // Nope, add key into database + $sql = stPrepareSQL( + "UPDATE attendees SET key=%s,active=0 WHERE id=%d", + $key, $uid); + + return stExecSQL($sql); + } + else + return FALSE; +} + + function stSetStatus($val, $msg) { global $statusSet;