diff options
| author | Bulletin <bulletin@bulletinalpha.tk> | 2016-12-29 16:42:32 -0500 |
|---|---|---|
| committer | Bulletin <bulletin@bulletinalpha.tk> | 2016-12-29 16:42:32 -0500 |
| commit | 1a7fa60f6cb2ee26843ca19e37bb4ff44104ad55 (patch) | |
| tree | 2fa1fbdea9992ab63ba2a7abbac8bbcd633d13f7 /activate.php | |
| download | bulletin-1a7fa60f6cb2ee26843ca19e37bb4ff44104ad55.tar.gz | |
Added existing progress
Diffstat (limited to 'activate.php')
| -rw-r--r-- | activate.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activate.php b/activate.php new file mode 100644 index 0000000..66f14b3 --- /dev/null +++ b/activate.php @@ -0,0 +1,14 @@ +<?php +require('inc/common.php'); + +// TODO: remove this to re-enable registration +fatal('Registration has been disabled at the moment. We\'re sorry for the inconvenience.'); + +$db = new bdb() or fatal($db-error); +$uid = intval($_GET['uid']); +$key = $_GET['key']; +$db->query('UPDATE users SET active = 1 WHERE id = '.$uid.' AND session = \''.hash('sha512', $key).'\'') or fatal($db->error); +if ($db->affected_rows < 1) fatal('Invalid information provided.'); +setcookie($b_config['c_name'], $uid.';'.$key, 0, $b_config['c_path'], $b_config['c_dom'], $b_config['c_sec'], $b_config['c_http']); +fatal('Your account is now active, you will be taken to the user dashboard.', $b_config['base_url'].'dash/'); +?> |
