diff --git a/cms/data/content.sqlite b/cms/data/content.sqlite index c4b9218..4fd7d48 100644 Binary files a/cms/data/content.sqlite and b/cms/data/content.sqlite differ diff --git a/cms/data/userdata.sqlite b/cms/data/userdata.sqlite index 88005e6..fd7a622 100644 Binary files a/cms/data/userdata.sqlite and b/cms/data/userdata.sqlite differ diff --git a/cms/includes/tinymceimage.inc.php b/cms/includes/tinymceimage.inc.php index 84395ab..bb7bc08 100644 --- a/cms/includes/tinymceimage.inc.php +++ b/cms/includes/tinymceimage.inc.php @@ -1,15 +1,20 @@ $file, "value"=>BASE_URL . MEDIA_DIR . $file); +if(!defined('IN_INDEX')) exit; + +if(isset($_SESSION[$settings['session_prefix'].'user_id'])) { + + $img_path = BASE_PATH.MEDIA_DIR; + $fp=opendir($img_path); + while($file = readdir($fp)) + { + if(preg_match('/\.jpg$/i', $file) || preg_match('/\.jpeg$/i', $file) || preg_match('/\.png$/i', $file) || preg_match('/\.gif$/i', $file)) { + $images[] = array("title"=>$file, "value"=>BASE_URL . MEDIA_DIR . $file); + } } -} -closedir($fp); + closedir($fp); -header('Content-type: application/json'); -echo json_encode($images); -exit; + header('Content-type: application/json'); + echo json_encode($images); + exit; +} ?>