__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php
/*
* @link http://kodcloud.com/
* @author warlee | e-mail:[email protected]
* @copyright warlee 2014.(Shanghai)Co.,Ltd
* @license http://kodcloud.com/tools/license/license.txt
*/

class editor extends Controller{
	function __construct()    {
		parent::__construct();
	}
	
	// 多文件编辑器
	public function index(){
		$this->themeSet();
		$this->display('editor.html');
	}
	// 单文件编辑
	public function edit(){
		$this->themeSet();
		$this->display('edit.html');
	}

	private function themeSet(){
		$setClass = '';
		//获取编辑器配置数据
		$editorConfig = $this->config['editorDefault'];
		$configFile = USER.'data/editor_config.php';
		if (!file_exists(iconv_system($configFile))) {//不存在则创建
			$sql=FileCache::save($configFile,$editorConfig);
		}else{
			$editorConfig=FileCache::load($configFile);
		}

		$blackTheme = array("ambiance","idle_fingers","monokai","pastel_on_dark","twilight",
					"solarized_dark","tomorrow_night_blue","tomorrow_night_eighties");
		if(in_array($editorConfig['theme'],$blackTheme)){
			$setClass = 'class="code-theme-black"';
		}
		$this->assign('editorConfig',json_encode($editorConfig));//获取编辑器配置信息
		$this->assign('codeThemeBlack',$setClass);//获取编辑器配置信息
	}

	// 获取文件数据
	public function fileGet(){
		if(isset($this->in['fileUrl'])){
			$pass = $this->config['settingSystem']['systemPassword'];
			$fileUrl = $this->in['fileUrl'];
			if(!request_url_safe($fileUrl)){
				show_json(LNG('url error!'),false);
			}			
			$urlInfo = parse_url_query($fileUrl);
			if( isset($urlInfo['fid']) &&
				strlen(Mcrypt::decode($urlInfo['fid'],$pass)) != 0
				){
				$filepath = Mcrypt::decode($urlInfo['fid'],$pass);
				$displayName = get_path_this($filepath);
				if(isset($urlInfo['downFilename'])){
					$displayName = rawurldecode($urlInfo['downFilename']);
				}
			}else{
				$displayName = rawurldecode($urlInfo['name']);
				$filepath = $fileUrl.'&accessToken='.access_token_get();
			}
		}else{
			$displayName = rawurldecode($this->in['filename']);
			$filepath =_DIR($this->in['filename']);
			if (!file_exists($filepath)){
				show_json(LNG('not_exists'),false);
			}
			if (!path_readable($filepath)){
				show_json(LNG('no_permission_read_all'),false);
			}
			if (filesize($filepath) >= 1024*1024*20){
				show_json(LNG('edit_too_big'),false);
			}
		}
		
		$fileContents=file_get_contents($filepath);//文件内容
		//echo $fileContents;exit;
		if(isset($this->in['charset']) && $this->in['charset']){
			$charset = strtolower($this->in['charset']);
		}else{
			$charset = get_charset($fileContents);
		}
		if ($charset !='' &&
			$charset !='utf-8' &&
			function_exists("mb_convert_encoding")
			){
			$fileContents = @mb_convert_encoding($fileContents,'utf-8',$charset);
		}
		$data = array(
			'ext'		=> get_path_ext($displayName),
			'name'		=> iconv_app(get_path_this($displayName)),
			'filename'	=> $displayName,
			'charset'	=> $charset,
			'base64'	=> true,// 部分防火墙编辑文件误判问题处理
			'content'	=> base64_encode($fileContents)
		);
		show_json($data);
	}
	public function fileSave(){
		$fileStr = rawurldecode($this->in['filestr']);
		$path =_DIR($this->in['path']);
		if(isset($this->in['create_file']) && !file_exists($path)){//不存在则创建
			if(!@touch($path)){
				show_json(LNG('create_error'),false);
			}
		}
		if (!path_writeable($path)) show_json(LNG('no_permission_write_file'),false);
		//支持二进制文件读写操作(base64方式)
		if(isset($this->in['base64'])){
			$fileStr = base64_decode($fileStr);
		}

		$charset = strtolower($this->in['charset']);
		if(isset($this->in['charsetSave'])){
			$charset = strtolower($this->in['charsetSave']);
		}
		if ( $charset !='' && 
			 $charset != 'utf-8' && 
			 $charset != 'ascii' &&
			 function_exists("mb_convert_encoding")
			) {
			$fileStr = @mb_convert_encoding($fileStr,$charset,'utf-8');
		}
		$fp=fopen($path,'wb');
		fwrite($fp,$fileStr);
		fclose($fp);
		show_json(LNG('save_success'));
	}

	/*
	* 获取编辑器配置信息
	*/
	public function setConfig(){
		$file = USER.'data/editor_config.php';
		if (!path_writeable(iconv_system($file))) {//配置不可写
			show_json(LNG('no_permission_write_file'),false);
		}
		$key= $this->in['k'];
		$value = $this->in['v'];
		if ($key !='' && $value != '') {
			$sql=new FileCache($file);
			$sql->set($key,$value);//没有则添加一条
			show_json(LNG('setting_success'));
		}else{
			show_json(LNG('error'),false);
		}
	}
}

Filemanager

Name Type Size Permission Actions
api.class.php File 1.35 KB 0775
app.class.php File 3.3 KB 0775
desktop.class.php File 926 B 0775
editor.class.php File 4.57 KB 0775
explorer.class.php File 45.71 KB 0775
fav.class.php File 1.77 KB 0775
pluginApp.class.php File 6.01 KB 0775
setting.class.php File 3.76 KB 0775
share.class.php File 20.3 KB 0775
systemGroup.class.php File 8.58 KB 0775
systemMember.class.php File 16.05 KB 0775
systemRole.class.php File 4.85 KB 0775
user.class.php File 21.61 KB 0775
userShare.class.php File 3.17 KB 0775
utils.php File 17.56 KB 0775
Filemanager