Go to the documentation of this file.00001 <?php
00010 class module_nyroUtils_controller extends module_abstract {
00011
00012 protected function execIcon($prm=null) {
00013 response::getInstance()->neverExpire();
00014 if (array_search('..', $prm) !== false)
00015 response::getInstance()->error(null, 403);
00016 response::getInstance()->showFile(file::nyroExists(array(
00017 'name'=>'icons'.DS.implode(DS, $prm),
00018 'realName'=>true,
00019 'type'=>'other'
00020 )));
00021 }
00022
00023 protected function execUploadedFiles($prm=null) {
00024 if (array_search('..', $prm) !== false)
00025 response::getInstance()->error(null, 403);
00026 $text = request::get('text');
00027
00028 $file = FILESROOT.urldecode(implode(DS, $prm));
00029 if ($text)
00030 $file.= DS.$text;
00031
00032 $out = request::get('out');
00033 if ($out != 'html')
00034 $file.= '.'.$out;
00035
00036 response::getInstance()->showFile($file);
00037 }
00038
00039 protected function execTinyMce($prm=null) {
00040 $search = 'js/tiny_mce/';
00041 $request = request::get('request');
00042 $pos = strpos($request, $search);
00043 if ($pos === false)
00044 exit;
00045 $tmp = substr($request, $pos+strlen($search));
00046 $file = file::nyroExists(array(
00047 'name'=>'lib'.DS.'tinyMce'.DS.$tmp,
00048 'realName'=>true,
00049 'type'=>'other'
00050 ));
00051 if (strpos($file, '.php') !== false) {
00052 array_walk($_GET, create_function('&$v', '$v = urldecode($v);'));
00053 $path = str_replace($tmp, '', $file);
00054 ini_set('include_path', $path);
00055 define('TINYMCEPATH', substr($path, 0, -1));
00056 define('TINYMCECACHEPATH', substr(TMPROOT, 0, -1));
00057 if (ob_get_length())
00058 ob_clean();
00059 include($file);
00060 exit;
00061 } else
00062 response::getInstance()->showFile($file);
00063 }
00064
00065 }