1 | <?php
|
---|
2 | if(INCLUDED!==true)exit;
|
---|
3 | // ==================== //
|
---|
4 | $pathway_info[] = array('title'=>$lang['activation'],'link'=>'');
|
---|
5 | // ==================== //
|
---|
6 | $key = $_REQUEST['key'];
|
---|
7 | if($key){
|
---|
8 | if($act_accid = $auth->isvalidactkey($key)){
|
---|
9 | $DB->query("UPDATE account SET locked=0 WHERE id=?d LIMIT 1",$act_accid);
|
---|
10 | $DB->query("UPDATE account_extend SET activation_code=NULL WHERE account_id=?d LIMIT 1",$act_accid);
|
---|
11 | if($config['req_reg_invite'] > 0 && $config['req_reg_invite'] < 10){
|
---|
12 | $keys_arr = $auth->generate_keys($config['req_reg_invite']);
|
---|
13 | $email_text = '';
|
---|
14 | foreach ($keys_arr as $invkey){
|
---|
15 | $DB->query('INSERT INTO site_regkeys (`key`,`used`) VALUES(?,1)', $invkey);
|
---|
16 | $email_text .= ' - '.$invkey."\n";
|
---|
17 | }
|
---|
18 | $email_text = sprintf($lang['emailtext_inv_keys'],$email_text);
|
---|
19 | $accinfo = $auth->getprofile($act_accid);
|
---|
20 | send_email($accinfo['email'],$accinfo['username'],'== '.$config['site_title'].' invitation keys ==',$email_text);
|
---|
21 | output_message('notice',sprintf($lang['email_sent_keys'],$config['req_reg_invite']));
|
---|
22 | }
|
---|
23 | output_message('notice','<b>'.$lang['act_succ'].'.</b>');
|
---|
24 | }else{
|
---|
25 | output_message('alert',$lang['bad_act_key']);
|
---|
26 | redirect('index.php?n=account&sub=activate',0,2);
|
---|
27 | }
|
---|
28 | }
|
---|
29 |
|
---|
30 | ?>
|
---|