-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccount_confirm.php
37 lines (34 loc) · 1.73 KB
/
account_confirm.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
<?php
/******************************************************************************
Etano
===============================================================================
File: account_confirm.php
$Revision$
Software by: DateMill (http://www.datemill.com)
Copyright by: DateMill (http://www.datemill.com)
Support at: http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license. *
******************************************************************************/
define('CACHE_LIMITER','private');
require 'includes/common.inc.php';
require _BASEPATH_.'/includes/user_functions.inc.php';
require _BASEPATH_.'/skins_site/'.get_my_skin().'/lang/join.inc.php';
$tpl=new phemplate(_BASEPATH_.'/skins_site/'.get_my_skin().'/','remove_nonjs');
$uid=sanitize_and_format_gpc($_GET,'uid',TYPE_INT,0,0);
$secret=sanitize_and_format_gpc($_GET,'secret',TYPE_STRING,$__field2format[FIELD_TEXTFIELD],'');
if (!empty($uid) && !empty($secret)) {
$query="UPDATE `".USER_ACCOUNTS_TABLE."` SET `status`=".ASTAT_ACTIVE.",`temp_pass`='".gen_pass(7)."' WHERE `".USER_ACCOUNT_ID."`=$uid AND `status`=".ASTAT_UNVERIFIED." AND `temp_pass`='$secret' LIMIT 1";
if (!($res=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);}
if (isset($_SESSION[_LICENSE_KEY_]['user']['timedout'])) {
unset($_SESSION[_LICENSE_KEY_]['user']['timedout']);
}
if (mysql_affected_rows()) {
$qs='type=acctok';
redirect2page('info.php',array(),$qs);
} else {
$topass['message']['type']=MESSAGE_ERROR;
$topass['message']['text']=$GLOBALS['_lang'][1];
redirect2page('info.php',$topass);
}
}