HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot//bs.kntsleep.com/system/web/feedback/feedback.class.php
<?php
/*
 * Copyright (c) Huyin Information Technology Co., Ltd. All Rights Reserved.
 * BOSSCMS Content Management System (https://www.bosscms.net/)
 */
defined('IS_OK') or exit('Access Forbidden');

into::basic_class('web');

class feedback extends web
{
	public function form()
	{
		global $G;
		if(isset($G['post'])){
			$items = arrExist($G['post'],'items');
			if(!is_numeric($items) && $items){
				die();
			}
			$data = page::config_option($items);
			$content = '';
			if($data){
				$G['config'] = array_merge($data, $G['config']);
			}
			$form = page::form($items);
			if($G['config']['feedback_open']){
				if($G['config']['feedback_captcha'] && (!session::get('captcha') || arrExist($G['post'],'captcha')!=session::get('captcha'))){
					alert($G['config']['feedback_captcha_error']);
				}
				$uping = 0;
				foreach($form as $v){
					if($v['must']){
						if(($v['style']==8 && $_FILES['params'.$v['id']]['error']!=0) || ($v['style']!=8 && !$G['post']['params'.$v['id']])){
							alert($v['title'].'不能为空');
						}
					}
					if($v['style']==8){
						$uping++;
					}
				}
				if($uping){
					into::basic_class('upload');
					foreach($form as $v){
						if($v['style']==8 && $_FILES['params'.$v['id']]['error']==0){
							upload::$maxsize = $G['config']['upload_maxsize']*1024*1024;
							upload::$extension = json::decode($v['param']);
							if(upload::files($_FILES['params'.$v['id']]) && upload::$path){
								$img = str_replace('../../','../',upload::$path);
								if(strstr($img,'/photo/')){
									$G['post']['params'.$v['id']] = "<img src={$img} check width=30 height=30 />";
								}else{
									$G['post']['params'.$v['id']] = "<a href={$img} color=blue target=_blank>{$G['config']['download_file']}</a>";
								}
							}else{
								alert(upload::$msg?upload::$msg:'文件上传失败');
							}
						}
					}
				}
				$post = array();
				foreach($form as $v){
					$post['params'.$v['id']] = $str = $G['post']['params'.$v['id']];
					$content .= "<tr>
					  <td><b>{$v['title']}</b>&nbsp;</td>
					  <td><p>".(is_array($str)?implode('&emsp;',$str):$str)."</p></td>
					</tr>";
				}
				if($content){
					$content = '<table>'.$content.'</table>';
				}
				$data = array(
					'param' => json::enfilter($post),
					'parent' => $items,
					'reply' => '',
					'manager' => '0',
					'ctime' => TIME,
					'mtime' => 0,
					'ip' => getIP(),
					'display' => 0
				);
				$res = mysql::select_one('ctime','feedback',"ip='{$data['ip']}'",'ctime DESC,id DESC');
				if($data['ctime'] - $res['ctime'] > 60){
					if(mysql::insert($data, 'feedback')){
						if($G['config']['feedback_mail']){
							into::basic_class('mailto');
							if($G['email']){
								mailto::send($G['config']['feedback_recipient'],$G['config']['feedback_title'],$content);
							}
						}
						alert($G['config']['feedback_success'], $_SERVER['HTTP_REFERER']);
					}else{
						alert('提交失败!');
					}
				}else{
					alert($G['config']['feedback_quick']);
				}
			}else{
				alert('反馈表单处于关闭状态,请启用!');
			}
		}
	}
}
?>