Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezmediacatalogue/admin/datasupplier.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: datasupplier.php 8182 2001-11-01 17:17:57Z ce $
5 //
6 // Created on: <24-Jul-2001 10:59:19 ce>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "ezuser/classes/ezpermission.php" );
28 // include_once( "ezuser/classes/ezobjectpermission.php" );
29 // include_once( "classes/ezhttptool.php" );
30 // include_once( "ezuser/classes/ezuser.php" );
31 // include_once( "ezmediacatalogue/classes/ezmediacategory.php" );
32
33 $ini =& eZINI::instance( 'site.ini' );
34 $GlobalSectionID = $ini->variable( "eZMediaCatalogueMain", "DefaultSection" );
35
36 function writeAtAll()
37 {
38 $user =& eZUser::currentUser();
39 if( eZObjectPermission::getObjects( "mediacatalogue_category", 'w', true ) < 1
40 && !eZPermission::checkPermission( $user, "eZMediaCatalogue", "WriteToRoot" ) )
41 {
42 $text = "You do not have write permission to any categories";
43 $info = urlencode( $text );
44 eZHTTPTool::header( "Location: /error/403?Info=$info" );
45 exit();
46 }
47 return true;
48 }
49
50 $user =& eZUser::currentUser();
51
52 switch ( $url_array[2] )
53 {
54 case "browse":
55 {
56 $CategoryID = $url_array[3];
57 include( "kernel/ezmediacatalogue/admin/browse.php" );
58 }
59 break;
60
61 case "mediaview" :
62 {
63 $MediaID = $url_array[3];
64 $VariationID = $url_array[4];
65 include( "kernel/ezmediacatalogue/admin/mediaview.php" );
66 }
67 break;
68
69 case "media" :
70 {
71 switch ( $url_array[3] )
72 {
73 case "list" :
74 {
75 $CategoryID = $url_array[4];
76 if ( !is_numeric($CategoryID ) )
77 $CategoryID = 0;
78
79 if ( $url_array[5] == "parent" )
80 $Offset = $url_array[6];
81
82 include( "kernel/ezmediacatalogue/admin/medialist.php" );
83 }
84 break;
85
86 case "new" :
87 {
88 writeAtAll();
89 $Action = "New";
90 include( "kernel/ezmediacatalogue/admin/mediaedit.php" );
91 }
92 break;
93
94 case "Insert" :
95 {
96 writeAtAll();
97 $Action = "Insert";
98 include( "kernel/ezmediacatalogue/admin/mediaedit.php" );
99 }
100 break;
101
102 case "edit" :
103 {
104 $MediaID = $url_array[4];
105 $Action = "Edit";
106 if( ( eZMedia::isOwner( $user, $MediaID ) ||
107 eZObjectPermission::hasPermission( $MediaID, "mediacatalogue_media", 'w' ) )
108 && writeAtAll() )
109 {
110 include( "kernel/ezmediacatalogue/admin/mediaedit.php" );
111 }
112 else
113 {
114 eZHTTPTool::header( "Location: /error/403" );
115 exit();
116 }
117 }
118 break;
119
120 case "update" :
121 {
122 $MediaID = $url_array[4];
123 $Action = "Update";
124 if( ( eZMedia::isOwner( $user, $MediaID ) ||
125 eZObjectPermission::hasPermission( $MediaID, "mediacatalogue_media", 'w' ) )
126 && writeAtAll() )
127 include( "kernel/ezmediacatalogue/admin/mediaedit.php" );
128 else
129 {
130 eZHTTPTool::header( "Location: /error/403" );
131 exit();
132 }
133 }
134 break;
135 default :
136 {
137 eZHTTPTool::header( "Location: /error/404" );
138 exit();
139 }
140 }
141 }
142 break;
143
144 case "download" :
145 {
146 $MediaID = $url_array[3];
147 if ( !is_numeric( $MediaID ) )
148 $MediaID = 0;
149 if ( ( eZMedia::isOwner( $user, $MediaID ) ||
150 eZObjectPermission::hasPermission( $MediaID, "mediacatalogue_media", 'r' ) ) )
151 include( "kernel/ezmediacatalogue/admin/filedownload.php" );
152 else
153 {
154 eZHTTPTool::header( "Location: /error/404" );
155 exit();
156 }
157 }
158 break;
159
160 case "slideshow" :
161 {
162 $CategoryID = $url_array[3];
163 if ( !is_numeric( $CategoryID ) )
164 $CategoryID = 0;
165 $Position = $url_array[4];
166 if ( !is_numeric( $Position ) )
167 $Position = 0;
168 $RefreshTimer = $url_array[5];
169 include( "kernel/ezmediacatalogue/admin/slideshow.php" );
170 }
171 break;
172
173 case "typelist" :
174 {
175 include( "kernel/ezmediacatalogue/admin/typelist.php" );
176 }
177 break;
178
179 case "typeedit" :
180 {
181 if ( $url_array[3] == "edit" )
182 {
183 $TypeID = $url_array[4];
184 $Action = "Edit";
185 }
186 if ( $url_array[3] == "delete" )
187 {
188 $TypeID = $url_array[4];
189 $Action = "Delete";
190 }
191 if ( $url_array[3] == "up" )
192 {
193 $TypeID = $url_array[4];
194 $AttributeID = $url_array[5];
195 $Action = "up";
196 }
197 if ( $url_array[3] == "down" )
198 {
199 $TypeID = $url_array[4];
200 $AttributeID = $url_array[5];
201 $Action = "down";
202 }
203
204 include( "kernel/ezmediacatalogue/admin/typeedit.php" );
205 }
206 break;
207
208
209 case "category" :
210 {
211 switch( $url_array[3] )
212 {
213 case "list" :
214 {
215 $CategoryID = $url_array[4];
216 if ( !is_numeric($CategoryID ) )
217 $CategoryID = 0;
218 $Offset = $url_array[5];
219 if ( $Offset == "" )
220 $Offset = 0;
221 include( "kernel/ezmediacatalogue/admin/medialist.php" );
222 }
223 break;
224
225 case "new" :
226 {
227 writeAtAll();
228 $CurrentCategoryID = $url_array[4];
229 $Action = "New";
230 include( "kernel/ezmediacatalogue/admin/categoryedit.php" );
231 }
232 break;
233
234 case "insert" :
235 {
236 writeAtAll();
237 $Action = "Insert";
238 $CategoryID = $url_array[4];
239 include( "kernel/ezmediacatalogue/admin/categoryedit.php" );
240 }
241 break;
242
243 case "edit" :
244 {
245 $Action = "Edit";
246 $CategoryID = $url_array[4];
247 if( ( eZObjectPermission::hasPermission( $CategoryID, "mediacatalogue_category", 'w' ) ||
248 eZMediaCategory::isOwner( $user, $CategoryID ) )
249 && writeAtAll() )
250 {
251 include( "kernel/ezmediacatalogue/admin/categoryedit.php" );
252 }
253 else
254 {
255 eZHTTPTool::header( "Location: /error/403" );
256 exit();
257 }
258 }
259 break;
260
261 case "update" :
262 {
263 $Action = "Update";
264 $CategoryID = $url_array[4];
265 if( ( eZObjectPermission::hasPermission( $CategoryID, "mediacatalogue_category", 'w' ) ||
266 eZMediaCategory::isOwner( $user, $CategoryID ) )
267 && writeAtAll() )
268 {
269 include( "kernel/ezmediacatalogue/admin/categoryedit.php" );
270 }
271 else
272 {
273 eZHTTPTool::header( "Location: /error/403?Info=FUCK" );
274 exit();
275 }
276
277 }
278 break;
279
280
281 }
282 }
283 break;
284 }
285
286 ?>
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZMediaCategory\isOwner
isOwner(&$user, &$mediacategory)
Definition: ezmediacategory.php:444
eZMedia\isOwner
static isOwner(&$user, &$media)
Definition: ezmedia.php:604
eZObjectPermission\hasPermission
static hasPermission( $objectID, $moduleTable, $permission, $user=false)
Definition: ezobjectpermission.php:76
eZObjectPermission\getObjects
static getObjects( $moduleTable, $permission, $count=false, $user=false)
Definition: ezobjectpermission.php:425
eZPermission\checkPermission
static checkPermission( $user, $moduleName, $permissionName)
Definition: ezpermission.php:430
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$Action
$Action
Definition: companysearch.php:80
$url_array
$url_array
Definition: ezaddress/admin/datasupplier.php:34
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$CurrentCategoryID
$CurrentCategoryID
Definition: ezimagecatalogue/admin/imageedit.php:35
writeAtAll
writeAtAll()
Definition: ezmediacatalogue/admin/datasupplier.php:36
$user
$user
Definition: ezmediacatalogue/admin/datasupplier.php:50
$GlobalSectionID
$GlobalSectionID
Definition: ezmediacatalogue/admin/datasupplier.php:34
$ini
$ini
Definition: ezmediacatalogue/admin/datasupplier.php:33
exit
exit
Definition: folder.php:81
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.