diff options
| author | Carson Fleming <cflems@cflems.net> | 2017-02-28 17:37:57 -0500 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2017-02-28 17:37:57 -0500 |
| commit | a8f3669b4ea82f48edbca69742364adf2794e07f (patch) | |
| tree | b2668a0a31623a578a16622a5da6b0c924b3c071 /inc/user.php | |
| parent | 3bfe03a6f6136947eb8b9c714306d080ce889af7 (diff) | |
| download | bulletin-a8f3669b4ea82f48edbca69742364adf2794e07f.tar.gz | |
Modularized email and hashing
Diffstat (limited to 'inc/user.php')
| -rw-r--r-- | inc/user.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/user.php b/inc/user.php index cf0dde8..878a086 100644 --- a/inc/user.php +++ b/inc/user.php @@ -9,7 +9,7 @@ if (empty($_COOKIE[$b_config['c_name']]) || !preg_match('/^(\d+);([0-9a-zA-Z\.]+ } else { $db = new bdb(); - $result = $db->query('SELECT users.*, SUM(ratings.stars) / COUNT(ratings.stars) AS rating FROM users LEFT JOIN ratings ON ratings.rated = users.id WHERE users.id = '.intval($matches[1]).' AND users.session = \''.hash('sha512', $matches[2]).'\' AND users.active = 1 LIMIT 1') or fatal($db->error); + $result = $db->query('SELECT users.*, SUM(ratings.stars) / COUNT(ratings.stars) AS rating FROM users LEFT JOIN ratings ON ratings.rated = users.id WHERE users.id = '.intval($matches[1]).' AND users.session = \''.bulletin_hash($matches[2]).'\' AND users.active = 1 LIMIT 1') or fatal($db->error); if ($result->num_rows < 1) $b_user = $guest_user; else $b_user = $result->fetch_assoc(); $result->free(); |
