chengkun
2025-04-18 1bb985f32f2efe0f9dd69f3cf29a1c809b1cf96d
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?php
/*
* $Author :PHPYUN开发团队
*
* 官网: http://www.phpyun.com
*
* 版权所有 2009-2021 宿迁鑫潮信息技术有限公司,并保留所有权利。
*
* 软件声明:未经授权前提下,不得用于商业运营、二次开发以及任何形式的再次发布。
 */
class index_controller extends common{
    function index_action(){
 
        $this->seo("activate");
        
        $this->yun_tpl(array('index'));
    
    }
    function sendstr_action(){
 
        $NoticeM                        =                $this->MODEL("notice");
 
        if($this->config['user_status']=="1"){
 
            $username=$this->stringfilter($_POST['username']);
 
            if(CheckRegUser($username)==false && CheckRegEmail($username)==false){
 
                die;
            }
 
            $UserinfoM                        =                $this->MODEL('userinfo');
 
            $where['username']                  =                $username;
 
            $info                            =                $UserinfoM->getInfo($where,array('field'=>'`uid`,`email`,`usertype`'));
 
            if(!empty($info)){
           
                $randstr                    =                rand(10000000,99999999);
                
                $base                        =                base64_encode($info['uid']."|".$randstr."|".$this->config['coding']);
                
                $url                        =                "<a href='".$this->config['sy_weburl']."/index.php?m=qqconnect&c=mcert&id=".$base."'>点击认证</a>";
                
                $data                        =                array(
                    
                    'uid'                    =>                $info['uid'],
 
                    'type'                      =>                'cert',
 
                    'email'                      =>                $info['email'],
 
                    'url'                    =>                $url,
 
                    'date'                      =>                date("Y-m-d")
 
                );
        
                if($this->config['sy_email_set']=="1"){
                      
                    $NoticeM->sendEmailType($data);
                      
                    echo 1;die;
 
                }else{
 
                    echo 3;die;
 
                }
 
            }else{
 
                echo 2;die;
 
            }
 
        }else{
 
            echo 0;die;
 
        }
 
    }
 
    function editpw_action(){
 
        $UserinfoM                      =                $this->MODEL("userinfo");
 
        $CompanyM                      =                $this->MODEL("company");
 
 
        if($_POST['username'] && $_POST['code'] && $_POST['pass']){
 
            if(!is_numeric($_POST['code']) || CheckRegUser($_POST['username'])==false){
 
                $this->ACT_msg($this->url("index","forgetpw","1"), $msg = "无效的信息!", $st = 2, $tm = 3);
 
                exit();
 
            }
 
            $password                 =                     $_POST['pass'];
 
            $certwhere['type']        =                    5;
 
            $certwhere['check2']    =                    $_POST['username'];
 
            $certwhere['check']        =                    $_POST['code'];
 
            $certwhere['orderby']    =                    array('id,desc');
 
 
            $cert                    =                    $CompanyM->getCertInfo($certwhere,array('field'=>'`uid`,`check2`,`ctime`'));
 
            if(!$cert['uid']){
                
                $this->ACT_msg($this->url("index","forgetpw","1"), $msg = "验证码填写错误!", $st = 2, $tm = 3);
                
                exit();
            
            }elseif((time()-$cert['ctime'])>1200){
                
                $this->ACT_msg($this->url("index","forgetpw","1"), $msg = "验证码已失效,请重新获取!", $st = 2, $tm = 3);
                
                exit();
            
            }
 
            $userhwere['uid']        =                $cert['uid'];
 
            $info                    =                $UserinfoM->getInfo($userhwere,array('field'=>'`email`'));
            
            if(is_array($info)){
                
                $info['username']     =                 $cert['check2'];
                
                if($this->config[sy_uc_type]=="uc_center" && $info['name_repeat']!="1"){
                    
                    $this->obj->uc_open();
                    
                    uc_user_edit($info[username], "", $password, $info['email'],"0");
                
                }
                    
                $data                    =        array(
 
                    'password'            =>        $password
 
                );
 
                $where['uid']            =        $cert['uid'];
            
                $UserinfoM->upInfo($where,$data);    
                    
                
                
                $this->ACT_msg($this->url("index","login","1"), $msg = "密码修改成功!", $st = 1, $tm = 3);
            
            }else{
                
                $this->ACT_msg($this->url("index","forgetpw","1"), $msg = "对不起!没有该用户!", $st = 2, $tm = 3);
            
            }
        
        }else{
            
            $this->ACT_msg($this->url("index","forgetpw","1"), $msg = "请完整填写信息!", $st = 2, $tm = 3);
            
            exit();
        
        }
        
    
    }
 
}
?>