-
Notifications
You must be signed in to change notification settings - Fork 0
/
verifyuser.php
executable file
·42 lines (32 loc) · 1.09 KB
/
verifyuser.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
require_once 'header.php';
require 'includes/functions.php';
include 'config.php';
$page_title = '啟用帳戶';
$op = "";
//Pulls variables from url. Can pass 1 (verified) or 0 (unverified/blocked) into url
$uid = $_GET['uid'];
$verify = $_GET['v'];
$e = new SelectEmail;
$eresult = $e->emailPull($uid);
$email = $eresult['email'];
$username = $eresult['username'];
$v = new Verify;
if (isset($uid) && !empty(str_replace(' ', '', $uid)) && isset($verify) && !empty(str_replace(' ', '', $verify))) {
//Updates the verify column on user
$vresponse = $v->verifyUser($uid, $verify);
//Success
if ($vresponse == 'true') {
$smarty->assign('msg', $activemsg);
//Send verification email
$m = new MailSender;
$m->sendMail($email, $username, $uid, 'Active');
} else {
//Echoes error from MySQL
$smarty->assign('msg', $vresponse);
}
} else {
//Validation error from empty form variables
$smarty->assign('msg', 'An error occurred... click <a href="index.php">here</a> to go back.');
}
require_once 'footer.php';