chengkun
2025-04-30 6ab292fb7415be124651e312ec4f21c594568f17
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
<?php
 
class admin_concheck_config_controller extends adminCommon{  
    function index_action(){
        $this->yuntpl(array('admin/admin_concheck_config'));
    }
 
    function save_action(){
        
        $_POST =  $this->post_trim($_POST);
        
        $configM  =  $this->MODEL('config');
        
        if ($_POST['sy_concheck_open']){
            
            $data['sy_concheck_open'] = 1;
        }else{
            
            $data['sy_concheck_open'] = 2;
        }
        
        $data['sy_concheck_appkey']        =  $_POST['sy_concheck_appkey'];
        $data['sy_concheck_appsecret']  =  $_POST['sy_concheck_appsecret'];
        
        $configM -> setConfig($data);
        
        $this->web_config();
        
        $this->ACT_layer_msg("内容安全检测设置成功!",9,$_SERVER['HTTP_REFERER'],2,1);
    }
    function get_restnum_action(){
        
        $returnArr['num'] = 0;
 
        $url        =    'https://u.phpyun.com/feature';
        $url        .=    '?appKey='.$this->config['sy_concheck_appkey'].'&appSecret='.$this->config['sy_concheck_appsecret'];
        
        if (extension_loaded('curl')){
            
            $return     =     CurlGet($url);
            
        }else if(function_exists('file_get_contents')){
            
            $return     =     file_get_contents($url);
            
        }
        if($return){
            $msgInfo = json_decode($return,true);
            if($msgInfo['code'] == '200'){
                $returnArr['num'] = $msgInfo['num'];
            }
        }
 
        echo json_encode($returnArr);die;
    }
}
 
?>