listDir($dir."/".$file."/");
} else{
if($file!="." && $file!=".."){
$this->_files[$tmp] = ['md5'=>md5_file($dir.$file)];
}
}
}
closedir($dh);
}
}
}
public function file()
{
$param = input();
if($param['ck']){
$ft = $param['ft'];
if(empty($ft)){
$ft = ['1','2'];
}
mac_echo('');
$url = base64_decode("aHR0cDovL3VwZGF0ZS5tYWNjbXMubGEv") . "v10/mac_files_".config('version')['code'].'.html';
$html = mac_curl_get($url);
$json = json_decode($html,true);
if(!$json){
return $this->error(lang('admin/safety/file_msg1'));
}
$this->listDir('./');
if(!is_array($this->_files)){
return $this->error(lang('admin/safety/file_msg2'));
}
foreach($this->_files as $k=>$v){
$color = '';
$msg = 'ok';
if(empty($json[$k]) && in_array('1',$ft)){
$color = 'BlueViolet';
$msg = lang('admin/safety/file_msg3');
}
elseif(!empty($json[$k]) && $v['md5'] != $json[$k]['md5'] && in_array('2',$ft)){
$color = 'red';
$msg = lang('admin/safety/file_msg4');
}
if($color!='') {
//$this->_files[$k]['jc'] = $color;
mac_echo($k . '---' . "" . $msg . '');
}
}
exit;
}
return $this->fetch('admin@safety/file');
}
public function data()
{
$param = input();
if ($param['ck']) {
$pre = config('database.prefix');
$schema = Db::query('select * from information_schema.columns where table_schema = ?', [config('database.database')]);
$col_list = [];
$sql = '';
foreach ($schema as $k => $v) {
$col_list[$v['TABLE_NAME']][$v['COLUMN_NAME']] = $v;
}
$tables = ['actor', 'art', 'gbook', 'link', 'topic', 'type', 'vod'];
$param['tbi'] = intval($param['tbi']);
if ($param['tbi'] >= count($tables)) {
mac_echo(lang('admin/safety/data_clear_ok'));
die;
}
$check_arr = ["