chengkun
2025-05-26 8f3df543230cd4403368b39b9bbe5726d11a0284
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
 
class index_controller extends common{
    function index_action(){
        $msgM    =    $this->MODEL('email');
        $notice =     $this->MODEL('notice');
        
        if($this->uid==""){
            
            $this->ACT_msg($this->config['sy_weburl'], "您还没有登录,请先登录!");
        
        }
        if($_POST['submit']){
            
            if($this->config['sy_reg_invite']>0){
                
                $where['uid']    =    $this->uid;
                $where['ctime']    =    array('>',strtotime(date('Y-m-d')));
                $where['title']    =    array('like%','邀请注册-');
                
                $inviteregNum     =     $msgM->getEmsgNum($where);
                
                if($inviteregNum >= $this->config['sy_reg_invite']){
                    $this->ACT_layer_msg("今日邀请注册已达限额,请明天继续!",8,$_SERVER['HTTP_REFERER']);
                    exit();
                }
            }
            
            $emailData['uid']    =    $this->uid;
            
            $_POST['content']    =    '我一直在用'.$this->config['sy_webname'].'找工作;真的很不错;忍不住的想推荐给你,快去注册吧!免费哦!链接地址:'.Url('register',array('uid'=>$this->uid));
 
            session_start();
            
            $authcode            =    md5(strtolower($_POST['authcode']));
            
            unset($_POST['authcode']);
            
            $_POST['email']        =    trim($_POST['email']);
            
            if($this->config['sy_email_set']!="1"){
                
                $this->ACT_layer_msg("网站邮件服务器暂不可用!",8,$_SERVER['HTTP_REFERER']);
            }
            
            if($_POST['email']==""){
                
                $this->ACT_layer_msg("邮件不能为空!",8,$_SERVER['HTTP_REFERER']);
            } 
            if(CheckRegEmail($_POST['email'])==false){
                
                $this->ACT_layer_msg("邮件格式不正确!",8,$_SERVER['HTTP_REFERER']);
            }
            if($_POST['content']==""){
                
                $this->ACT_layer_msg("内容不能为空!",8,$_SERVER['HTTP_REFERER']);
            }
            if($authcode!=$_SESSION['authcode'] || empty($_SESSION['authcode'])){
                
                unset($_SESSION['authcode']);
                
                $this->ACT_layer_msg($_POST['authcode']."验证码错误!".$_SESSION['authcode'],8);
            } 
            
            //发送邮件并记录入库
            $emailData['email']     =    $_POST['email'];
            $emailData['subject']    =     "邀请注册-".$this->config['sy_webname'];
            $emailData['content']    =     $_POST['content'];
            
            $sendid                    =     $notice->sendEmail($emailData);
 
            if($sendid['status'] != -1){
                
                $this->ACT_layer_msg("邀请注册邮件已发送!",9,$_SERVER['HTTP_REFERER']);
            }else{
                
                $this->ACT_layer_msg("邀请注册邮件发送失败!",8,$_SERVER['HTTP_REFERER']);
            }
        }
 
        if($this->config['reg_moblie']){
            
            $type    =    2;
        }elseif($this->config['reg_email']){
            
            $type    =    3;
        }else{
            
            $type    =    1;
        }
        
        $reg_url    =    Url('register', array('uid'=>$this->uid), '1');
        
        $this->seo("invitereg");
        $this->yunset('reg_url', $reg_url);
        $this->yun_tpl(array('index'));
    }
}
?>