-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathpending.php
52 lines (52 loc) · 1.52 KB
/
pending.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
43
44
45
46
47
48
49
50
51
52
<?php
/**
* [PHPB2B] Copyright (C) 2007-2022, Ualink Inc. All Rights Reserved.
* The contents of this file are subject to the License; you may not use this file except in compliance with the License.
*
* @version $Revision: 2258 $
*/
define('CURSCRIPT', 'pending');
require("libraries/common.inc.php");
require("share.inc.php");
uses("member");
$member = new Members();
$hash = null;
if(isset($_GET['hash'])) $hash = trim($_GET['hash']);
if (empty($hash)) {
flash("invalid_request", null, 0);
}
$hash = rawurldecode($hash);
//$hash = str_replace(array("|", "_"), array("+", "|"), $hash);
$validate_str = authcode($hash, "DECODE");
if (empty($validate_str)) {
flash("invalid_request", null, 0);
}
if (!empty($validate_str)) {
list($tmp_username, $exp_time) = explode("\t", $validate_str);
if ($exp_time<$time_stamp) {
flash("auth_expired", null, 0);
}
$user_exists = $member->checkUserExist($tmp_username, true);
if ($user_exists && isset($_GET['action'])) {
switch ($_GET['action']) {
case "activate":
$result = $member->updateUserStatus($member->info['id']);
if ($result) {
flash("actived_and_login", "logging.php");
}
break;
case "getpasswd":
setvar("username", $member->info['username']);
$viewhelper->setPosition(L("reset_your_password", "tpl"));
render("getpasswd.pending");
break;
default:
break;
}
}else{
flash("member_not_exists", null, 0);
}
}else{
flash("invalid_request", null, 0);
}
?>