[ Index ] |
PHP Cross Reference of phpwcms V1.4.7 _r403 (01.11.10) |
[Summary view] [Print] [Text view]
1 <?php 2 /************************************************************************************* 3 Copyright notice 4 5 (c) 2002-2010 Oliver Georgi (oliver@phpwcms.de) // All rights reserved. 6 7 This script is part of PHPWCMS. The PHPWCMS web content management system is 8 free software; you can redistribute it and/or modify it under the terms of 9 the GNU General Public License as published by the Free Software Foundation; 10 either version 2 of the License, or (at your option) any later version. 11 12 The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html 13 A copy is found in the textfile GPL.txt and important notices to the license 14 from the author is found in LICENSE.txt distributed with these scripts. 15 16 This script is distributed in the hope that it will be useful, but WITHOUT ANY 17 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 18 PARTICULAR PURPOSE. See the GNU General Public License for more details. 19 20 This copyright notice MUST APPEAR in all copies of the script! 21 *************************************************************************************/ 22 23 // session_name('hashID'); 24 session_start(); 25 $phpwcms = array(); 26 $ref = $_SESSION['REFERER_URL']; 27 28 29 require_once ('../../config/phpwcms/conf.inc.php'); 30 require_once ('../inc_lib/default.inc.php'); 31 require_once (PHPWCMS_ROOT.'/include/inc_lib/dbcon.inc.php'); 32 33 require_once (PHPWCMS_ROOT.'/include/inc_lib/general.inc.php'); 34 checkLogin(); 35 require_once (PHPWCMS_ROOT.'/include/inc_lib/backend.functions.inc.php'); 36 37 //list($id, $wert) = explode(".", $_GET["do"]); 38 //$do = intval($do); 39 //$id = intval($id); 40 41 //Wechseln des Status AKTIV für Datei/Ordner 42 if(isset($_GET["aktiv"])) { 43 list($id, $wert) = explode("|", $_GET["aktiv"]); 44 $id = intval($id); 45 $wert = intval($wert); 46 if($wert != 1 && $wert != 0) $wert = 0; 47 $sql = "UPDATE ".DB_PREPEND."phpwcms_file SET ". 48 "f_aktiv=".$wert.", f_changed='".time()."' ". 49 "WHERE f_id=".$id." AND f_uid=".intval($_SESSION["wcs_user_id"]); 50 $result = mysql_query($sql, $db) or die ("error while changing ACTIVE status"); 51 } 52 53 if(isset($_GET["public"])) { 54 list($id, $wert) = explode("|", $_GET["public"]); 55 $id = intval($id); 56 $wert = intval($wert); 57 if($wert != 1 && $wert != 0) $wert = 0; 58 $sql = "UPDATE ".DB_PREPEND."phpwcms_file SET ". 59 "f_public=".$wert.", f_changed='".time()."' ". 60 "WHERE f_id=".$id." AND f_uid=".intval($_SESSION["wcs_user_id"]); 61 $result = mysql_query($sql, $db) or die ("error while changing PUBLIC status"); 62 } 63 64 if(isset($_GET["delete"])) { 65 list($id, $wert) = explode("|", $_GET["delete"]); 66 $id = intval($id); 67 $wert = intval($wert); 68 if($wert == 9) { 69 $sql = "UPDATE ".DB_PREPEND."phpwcms_file SET ". 70 "f_trash=9, f_changed='".time()."' ". 71 "WHERE f_id=".$id." AND f_uid=".intval($_SESSION["wcs_user_id"]); 72 $result = mysql_query($sql, $db) or die ("error while deleted directory"); 73 } 74 } 75 76 if(isset($_GET["trash"])) { 77 list($id, $wert) = explode("|", $_GET["trash"]); 78 $id = intval($id); 79 $wert = intval($wert); 80 if($wert == 1 || $wert == 9 || $wert == 0) { 81 $sql = "UPDATE ".DB_PREPEND."phpwcms_file SET f_pid=0, ". 82 "f_trash=".$wert.", f_changed='".time()."' WHERE "; 83 $sql .= ($id) ? "f_id=".$id." AND " : "f_trash=1 AND "; 84 $sql .= "f_kid=1 AND f_uid=".intval($_SESSION["wcs_user_id"]); 85 $result = mysql_query($sql, $db) or die ("error while moving file to trash"); 86 } 87 } 88 89 if(isset($_GET["paste"])) { 90 list($file_id, $dir_id) = explode("|", $_GET["paste"]); 91 $file_id = intval($file_id); 92 $dir_id = intval($dir_id); 93 $sql = "UPDATE ".DB_PREPEND."phpwcms_file SET f_pid=".$dir_id.", ". 94 "f_changed='".time()."' WHERE f_id=".$file_id." AND f_kid=1 AND f_uid=".intval($_SESSION["wcs_user_id"]); 95 $result = mysql_query($sql, $db) or die ("error while moving file to other directory"); 96 } 97 98 if(isset($_GET["thumbnail"])) { 99 $_SESSION["wcs_user_thumb"] = intval($_GET["thumbnail"]); 100 } 101 102 if($_SESSION["wcs_user_admin"] == 1) { //Wenn Benutzer Admin-Rechte hat 103 104 //move deleted files into final deletion directory 105 if(isset($_GET['movedeletedfiles']) && intval($_GET['movedeletedfiles']) == $_SESSION["wcs_user_id"]) { 106 107 $sql = "SELECT * FROM ".DB_PREPEND."phpwcms_file WHERE f_trash=9 AND f_kid=1"; 108 if($result = mysql_query($sql, $db) or die ("error while retrieving list of deleted files")) { 109 110 //default file storage folder 111 $default_path = PHPWCMS_ROOT.$phpwcms["file_path"]; 112 $tempimg_path = PHPWCMS_ROOT.'/'.PHPWCMS_IMAGES; 113 114 if(!is_dir($default_path.'can_be_deleted')) { 115 @mkdir ($default_path.'can_be_deleted', 0777); 116 } 117 118 while($row = mysql_fetch_assoc($result)) { 119 120 $delstatus = false; 121 // name of the file that should be moved 122 $filename = ($row['f_ext']) ? $row['f_hash'].'.'.$row['f_ext'] : $row['f_hash']; 123 if(is_file($default_path.$filename)) { 124 125 if(@rename($default_path.$filename, $default_path.'can_be_deleted/'.$filename)) { 126 $delstatus = true; 127 } 128 129 } else { 130 $delstatus = true; 131 } 132 133 if($delstatus) { 134 135 $sql_f = "UPDATE ".DB_PREPEND."phpwcms_file SET f_trash=8 WHERE f_id=".$row['f_id']." AND f_kid=1"; 136 @mysql_query($sql_f, $db); 137 138 $temp_img = _dbQuery('SELECT * FROM '.DB_PREPEND."phpwcms_imgcache WHERE imgcache_hash='".aporeplace($row['f_hash'])."'"); 139 $g = 0; 140 foreach($temp_img as $value) { 141 if(is_file($tempimg_path.$value['imgcache_imgname'])) { 142 if(@rename($tempimg_path.$value['imgcache_imgname'], $default_path.'can_be_deleted/'.$value['imgcache_imgname'])) { 143 $g++; 144 } 145 } 146 } 147 if($g) { 148 @_dbQuery('DELETE FROM '.DB_PREPEND."phpwcms_imgcache WHERE imgcache_hash='".aporeplace($row['f_hash'])."'", 'DELETE'); 149 } 150 151 } 152 153 154 } 155 mysql_free_result($result); 156 157 } 158 159 } 160 } 161 162 headerRedirect($ref); 163 164 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Tue Nov 16 22:51:00 2010 | Cross-referenced by PHPXref 0.7 |