0
-#(c)2004-2008 by Ted Kulp (ted@cmsmadesimple.org)
0
-#This project's homepage is: http://cmsmadesimple.sf.net
0
-#This program is free software; you can redistribute it and/or modify
0
-#it under the terms of the GNU General Public License as published by
0
-#the Free Software Foundation; either version 2 of the License, or
0
-#(at your option) any later version.
0
-#This program is distributed in the hope that it will be useful,
0
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
0
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0
-#GNU General Public License for more details.
0
-#You should have received a copy of the GNU General Public License
0
-#along with this program; if not, write to the Free Software
0
-#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0
-// in filetypes.inc.php filetypes are defined
0
-require_once(dirname(dirname(__FILE__))."/lib/filemanager/filetypes.inc.php");
0
-require_once(dirname(dirname(__FILE__))."/lib/file.functions.php");
0
-require_once("../include.php");
0
- $handle = opendir($dir);
0
- while (false!==($FolderOrFile = readdir($handle)))
0
- if($FolderOrFile != "." && $FolderOrFile != "..")
0
- if(@is_dir("$dir/$FolderOrFile"))
0
- deldir("$dir/$FolderOrFile");
0
- unlink("$dir/$FolderOrFile");
0
-$dir = $config["image_uploads_path"];
0
-$url = $config["image_uploads_url"];
0
-if (!isset($IMConfig['thumbnail_dir'])) $IMConfig['thumbnail_dir'] = '';
0
-if (isset($_POST['reldir'])) $reldir = $_POST['reldir'];
0
-else if (isset($_GET['reldir'])) $reldir = $_GET['reldir'];
0
-if (strpos($reldir, '..') === false && strpos($reldir, '\\') === false)
0
-$userid = get_userid();
0
-$access = check_permission($userid, 'Modify Files');
0
-$username = $gCms->variables["username"];
0
-if (isset($_FILES) && isset($_FILES['uploadfile']) && isset($_FILES['uploadfile']['name']) && $_FILES['uploadfile']['name'] != "")
0
- if (!move_uploaded_file($_FILES['uploadfile']['tmp_name'], $dir."/".$_FILES['uploadfile']['name']))
0
- $errors .= "<li>".lang('filenotuploaded')."</li>";
0
- chmod($dir."/".$_FILES['uploadfile']['name'], octdec('0'.$config['default_upload_permission']));
0
- audit(-1, $_FILES['uploadfile']['name'], 'Uploaded File');
0
- $errors .= "<li>".lang('needpermissionto', array('Modify Files'))."</li>";
0
-#Did we create a new dir?
0
-if (isset($_POST['newdirsubmit']))
0
- #Make sure it isn't an empty dir name
0
- if ($_POST['newdir'] == "")
0
- $errors .= "<li>".lang('filecreatedirnoname')."</li>";
0
- else if (ereg('\.\.',$_POST['newdir']))
0
- $errors .= "<li>".lang('filecreatedirnodoubledot')."</li>";
0
- else if (ereg('/', $_POST['newdir']) || strpos($_POST['newdir'], '\\') !== false)
0
- $errors .= "<li>".lang('filecreatedirnoslash')."</li>";
0
- else if (file_exists($dir."/".$_POST['newdir']))
0
- $errors .= "<li>".lang('directoryexists')."</li>";
0
- mkdir($dir."/".$_POST['newdir'], 0777);
0
- audit(-1, $_POST['newdir'], 'Created Directory');
0
- $errors .= "<li>".lang('needpermissionto', array('Modify Files'))."</li>";
0
-if (isset($_GET['action']) && $_GET['action'] == "deletefile")
0
- if (is_file($dir . "/" . $_GET['file']))
0
- if (!(unlink($dir . "/" . $_GET['file'])))
0
- $errors .= "<li>".lang('errordeletingfile')."</li>";
0
- audit(-1, $reldir . "/" . $_GET['file'], 'Deleted File');
0
- $errors .= "<li>".lang('norealfile')."</li>";
0
- $errors .= "<li>".lang('needpermissionto', array('Modify Files'))."</li>";
0
-else if (isset($_GET['action']) && $_GET['action'] == "deletedir")
0
- if (@is_dir($dir . "/" . $_GET['file']))
0
- if (!(deldir($dir . "/" . $_GET['file'])))
0
- $errors .= "<li>".lang('errordeletingdirectory')."</li>";
0
- audit(-1, $reldir . "/" . $_GET['file'], 'Deleted Directory');
0
- $errors .= "<li>".lang('norealdirectory')."</li>";
0
- $errors .= "<li>".lang('needpermissionto', array('Modify Files'))."</li>";
0
-include_once("header.php");
0
- <script type="text/javascript" src="../lib/filemanager/ImageManager/assets/dialog.js"></script>
0
- <script type="text/javascript" src="../lib/filemanager/ImageManager/IMEStandalone.js"></script>
0
-<?php echo " <script type=\"text/javascript\" src=\"../lib/filemanager/ImageManager/lang/{$nls['htmlarea'][$current_language]}.js\"></script>\n" ?>
0
- <script type="text/javascript">
0
- //Create a new Imanager Manager, needs the directory where the manager is
0
- //and which language translation to use.
0
- var manager = new ImageManager('../lib/filemanager/ImageManager','en');
0
- var thumbdir = "<?php echo $IMConfig['thumbnail_dir']; ?>";
0
- var base_url = "<?php echo $url; ?>";
0
- //Image Manager wrapper. Simply calls the ImageManager
0
-<script type="text/javascript">
0
- // echo "<div class=\"pageerrorcontainer\"><ul class=\"error\">".$errors."</ul></div>";
0
- echo $themeObject->ShowErrors('<ul class="error">'.$errors.'</ul>');
0
-echo '<div class="pagecontainer">';
0
-echo $themeObject->ShowHeader('imagemanagement');
0
-<iframe class="imageframe" src="../lib/filemanager/ImageManager/images.php?dir=<?php echo "$reldir" ?>" name="imgManager" title="Image Selection"></iframe>
0
-<form enctype="multipart/form-data" action="imagefiles.php" method="post" name="uploader">
0
- <label><?php echo lang('uploadfile')?>:</label>
0
- <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $config["max_upload_size"]?>" />
0
- <input type="hidden" name="reldir" value="<?php echo $reldir?>" />
0
- <input name="uploadfile" type="file" style="margin-right:20px;" /> <input class="pagebutton" onmouseover="this.className='pagebuttonhover'" onmouseout="this.className='pagebutton'" type="submit" value="<?php echo lang('send')?>" />
0
- <label><?php echo lang('createnewfolder')?>:</label>
0
- <input type="text" name="newdir" style="margin-right:20px;" /><input class="pagebutton" onmouseover="this.className='pagebuttonhover'" onmouseout="this.className='pagebutton'" type="submit" name="newdirsubmit" value="<?php echo lang('create')?>" />
0
-include_once("footer.php");
Comments
No one has commented yet.