/
verify.class.php
80 lines (72 loc) · 2.52 KB
/
verify.class.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/**
* [Nulled by DarkGoth - NCP TEAM] - 2015
*/
defined('PHPFOX') or exit('NO DICE!');
define('PHPFOX_DONT_SAVE_PAGE', true);
/**
* This controller receives the link for verifying a member's email address
*
* @copyright [PHPFOX_COPYRIGHT]
* @author Miguel Espinoza
* @package Module_User
* @version $Id: browse.class.php 719 2009-06-29 12:23:19Z Miguel_Espinoza $
*/
class User_Component_Controller_Verify extends Phpfox_Component
{
/**
* Class process method which is used to execute this component.
*/
public function process()
{
$this->template()->setTitle(Phpfox::getPhrase('user.email_verification'))->setBreadcrumb(Phpfox::getPhrase('user.email_verification'))
->assign(array(
'iVerifyUserId' => Phpfox::getLib('session')->get('cache_user_id')
)
);
$sHash = $this->request()->get('link', '');
if ($sHash == '')
{
}
elseif (Phpfox::getService('user.verify.process')->verify($sHash))
{
if ($sPlugin = Phpfox_Plugin::get('user.component_verify_process_redirection'))
{
eval($sPlugin);
}
$sRedirect = Phpfox::getParam('user.redirect_after_signup');
if (!empty($sRedirect))
{
Phpfox::getLib('session')->set('redirect', str_replace('.', '/', $sRedirect));
}
if (Phpfox::isMobile())
{
$this->url()->send('mobile.user.login', null, Phpfox::getPhrase('user.your_email_has_been_verified_please_log_in_with_the_information_you_provided_during_sign_up'));
}
// send to the log in and say everything is ok
Phpfox::getLib('session')->set('verified_do_redirect', '1');
$this->url()->send('user.login', null, Phpfox::getPhrase('user.your_email_has_been_verified_please_log_in_with_the_information_you_provided_during_sign_up'));
}
else
{
//send to the log in and say there was an error
Phpfox_Error::set(Phpfox::getPhrase('user.invalid_verification_link'));
$iTime = Phpfox::getParam('user.verify_email_timeout');
if ($iTime < 60)
{
$sTime = Phpfox::getPhrase('user.time_minutes', array('time' => $iTime));
}
elseif ($iTime < (60 * 60 * 24)) // one day
{
$sTime = ($iTime == 60 ? Phpfox::getPhrase('user.time_hour', array('time' => round($iTime / 60))) : Phpfox::getPhrase('user.time_hours', array('time' => round($iTime / 60))));
}
else
{
$sTime = Phpfox::getPhrase('user.time_days', array('time' => $sTime));
}
Phpfox::getService('user.verify.process')->sendMail(Phpfox::getLib('session')->get('cache_user_id'));
$this->template()->assign(array('sTime' => $sTime));
}
}
}
?>