hGetAll($k); if (!is_array($h) || empty($h['uid']) || empty($h['hash'])) { http_response_code(400); echo "Invalid or expired token"; exit; } if (!hash_equals((string)$h['hash'], token_hash($token))) { http_response_code(400); echo "Invalid token"; exit; } $uid = (string)$h['uid']; redis()->hSet(acct_key($uid), 'email_verified', '1'); // Flags: unreg -> reg. An admin must then set normal before the account gets in. $f = redis()->hGet(acct_key($uid), 'acct_flags'); $f = ($f === false || $f === '') ? 1 : ((int)$f & 0x3F); redis()->hSet(acct_key($uid), 'acct_flags', (string)((($f & ~1) | 2))); redis()->del($k); header('Content-Type: text/html; charset=utf-8'); echo "