Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezimagecatalogue/user/datasupplier.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: datasupplier.php 9623 2002-06-11 08:20:30Z jhe $
5 //
6 // Created on: <23-Oct-2000 17:53:46 bf>
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( "ezimagecatalogue/classes/ezimagecategory.php" );
32 // include_once( "ezimagecatalogue/classes/ezimage.php" );
33
34 $ini =& eZINI::instance( 'site.ini' );
35 $GlobalSectionID = $ini->variable( "eZImageCatalogueMain", "DefaultSection" );
36 $UserComments = $ini->variable( "eZImageCatalogueMain", "UserComments" );
37
38 function writeAtAll()
39 {
40 $user =& eZUser::currentUser();
41 if( eZObjectPermission::getObjects( "imagecatalogue_category", 'w', true ) < 1
42 && eZObjectPermission::getObjects( "imagecatalogue_category", 'u', true ) < 1
43 && !eZPermission::checkPermission( $user, "eZImageCatalogue", "WriteToRoot" ) )
44 {
45 $text = "You do not have write permission to any categories";
46 $info = urlencode( $text );
47 eZHTTPTool::header( "Location: /error/403?Info=$info" );
48 exit();
49 }
50 return true;
51 }
52
53 $user =& eZUser::currentUser();
54 switch ( $url_array[2] )
55 {
56 case "customimage" :
57 {
58 $ImageID = $url_array[3];
59 $ImageWidth = $url_array[4];
60 $ImageHeight = $url_array[5];
61 include( "kernel/ezimagecatalogue/user/customimage.php" );
62 }
63 break;
64
65 case "imageview" :
66 {
67 $ImageID = $url_array[3];
68 $VariationID = $url_array[4];
69 include( "kernel/ezimagecatalogue/user/imageview.php" );
70
71 if ( isset( $PrintableVersion ) && ( $PrintableVersion != "enabled" ) && ( $UserComments == "enabled" ) )
72 {
73 $RedirectURL = "/imagecatalogue/imageview/$ImageID/";
74 $image = new eZImage ( $ImageID );
75 if ( ( $image->id() >= 1 ) ) // && $product->discuss() )
76 {
77 for ( $i = 0; $i < count( $url_array ); $i++ )
78 {
79 if ( ( $url_array[$i] ) == "parent" )
80 {
81 $next = $i + 1;
82 $Offset = $url_array[$next];
83 }
84 }
85 $forum = $image->forum();
86 $ForumID = $forum->id();
87 include( "kernel/ezforum/user/messagesimplelist.php" );
88 }
89 }
90 }
91 break;
92
93 case "search" :
94 {
95 $CategoryID = $url_array[3];
96
97 if ( !is_numeric( $CategoryID ) )
98 $CategoryID = 0;
99
100 if( isset( $url_array[4] ) )
101 {
102 $Offset = $url_array[4];
103 }
104 else
105 {
106 $Offset = 0;
107 }
108
109 include( "kernel/ezimagecatalogue/user/imagelist.php" );
110
111 }
112 break;
113
114
115 case "image" :
116 {
117 switch ( $url_array[3] )
118 {
119 case "list" :
120 {
121 if ( isset( $url_array[4] ) )
122 {
123 $CategoryID = $url_array[4];
124 }
125 else
126 {
127 $CategoryID = 0;
128 }
129
130 if ( !is_numeric($CategoryID ) )
131 {
132 $CategoryID = 0;
133 }
134
135 if( isset( $url_array[6] ) )
136 {
137 $Offset = $url_array[6];
138 }
139 else
140 {
141 $Offset = 0;
142 }
143
144 if ( $Offset == "" && is_Numeric( $url_array[4] ) && is_Numeric( $url_array[5] ) )
145 {
146 $Offset = $url_array[5];
147 }
148 else if ( $Offset == "" )
149 {
150 $Offset = 0;
151 }
152 include( "kernel/ezimagecatalogue/user/imagelist.php" );
153 }
154 break;
155
156 case "new" :
157 {
158 writeAtAll();
159 $Action = "New";
160 include( "kernel/ezimagecatalogue/user/imageedit.php" );
161 }
162 break;
163
164 case "Insert" :
165 {
166 writeAtAll();
167 $Action = "Insert";
168 include( "kernel/ezimagecatalogue/user/imageedit.php" );
169 }
170 break;
171
172 case "edit" :
173 {
174 $ImageID = $url_array[4];
175 $Action = "Edit";
176 if( ( eZImage::isOwner( $user, $ImageID ) ||
177 eZObjectPermission::hasPermission( $ImageID, "imagecatalogue_image", 'w' ) )
178 && writeAtAll() )
179 {
180 include( "kernel/ezimagecatalogue/user/imageedit.php" );
181 }
182 else
183 {
184 eZHTTPTool::header( "Location: /error/403" );
185 exit();
186 }
187 }
188 break;
189
190 case "update" :
191 {
192 $ImageID = $url_array[4];
193 $Action = "Update";
194 if( ( eZImage::isOwner( $user, $ImageID ) ||
195 eZObjectPermission::hasPermission( $ImageID, "imagecatalogue_image", 'w' ) )
196 && writeAtAll() )
197 include( "kernel/ezimagecatalogue/user/imageedit.php" );
198 else
199 {
200 eZHTTPTool::header( "Location: /error/403" );
201 exit();
202 }
203 }
204 break;
205 default :
206 {
207 eZHTTPTool::header( "Location: /error/404" );
208 exit();
209 }
210 }
211 }
212 break;
213
214 case "download" :
215 {
216 $ImageID = $url_array[3];
217 if ( !is_numeric( $ImageID ) )
218 $ImageID = 0;
219 if ( ( eZImage::isOwner( $user, $ImageID ) ||
220 eZObjectPermission::hasPermission( $ImageID, "imagecatalogue_image", 'r' ) ) )
221 include( "kernel/ezimagecatalogue/user/filedownload.php" );
222 else
223 {
224 eZHTTPTool::header( "Location: /error/404" );
225 exit();
226 }
227 }
228 break;
229
230 case "slideshow" :
231 {
232 $CategoryID = $url_array[3];
233 if ( !is_numeric( $CategoryID ) )
234 $CategoryID = 0;
235 $Position = $url_array[4];
236 if ( !is_numeric( $Position ) )
237 $Position = 0;
238 $RefreshTimer = $url_array[5];
239 include( "kernel/ezimagecatalogue/user/slideshow.php" );
240 }
241 break;
242
243 case "category" :
244 {
245 switch( $url_array[3] )
246 {
247
248 case "new" :
249 {
250 writeAtAll();
251 $CurrentCategoryID = $url_array[4];
252 $Action = "New";
253 include( "kernel/ezimagecatalogue/user/categoryedit.php" );
254 }
255 break;
256
257 case "insert" :
258 {
259 writeAtAll();
260 $Action = "Insert";
261 include( "kernel/ezimagecatalogue/user/categoryedit.php" );
262 }
263 break;
264
265 case "edit" :
266 {
267 $Action = "Edit";
268 $CategoryID = $url_array[4];
269 if( ( eZObjectPermission::hasPermission( $CategoryID, "imagecatalogue_category", 'w' ) ||
270 eZImageCategory::isOwner( $user, $CategoryID ) )
271 && writeAtAll() )
272 {
273 include( "kernel/ezimagecatalogue/user/categoryedit.php" );
274 }
275 else
276 {
277 eZHTTPTool::header( "Location: /error/403" );
278 exit();
279 }
280 }
281 break;
282
283 case "update" :
284 {
285 $Action = "Update";
286 $CategoryID = $url_array[4];
287 if( ( eZObjectPermission::hasPermission( $CategoryID, "imagecatalogue_category", 'w' ) ||
288 eZImageCategory::isOwner( $user, $CategoryID ) )
289 && writeAtAll() )
290 {
291 include( "kernel/ezimagecatalogue/user/categoryedit.php" );
292 }
293 else
294 {
295 $info= urlencode( "You have no permission to update categories" );
296 eZHTTPTool::header( "Location: /error/403?Info=$info" );
297 exit();
298 }
299
300 }
301 break;
302 }
303 }
304 break;
305
306 default:
307 $info = urlencode( "This page does not exist!" );
308 eZHTTPTool::header( "Location: /error/403?Info=$info" );
309
310 }
311
312 ?>
$i
$i
Definition: admin/adlist.php:91
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
$forum
$forum
Definition: admin/forumlist.php:50
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZImageCategory\isOwner
static isOwner( $user, $imageCategory=false)
Definition: ezimagecategory.php:480
eZImage
Definition: ezimage.php:95
eZImage\isOwner
static isOwner( $user, $image)
Definition: ezimage.php:1274
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
$ImageID
$ImageID
Definition: companytypelist.php:201
$url_array
$url_array
Definition: ezaddress/admin/datasupplier.php:34
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$RedirectURL
$RedirectURL
Definition: ezforum/user/userlogin.php:91
$CurrentCategoryID
$CurrentCategoryID
Definition: ezimagecatalogue/admin/imageedit.php:35
writeAtAll
writeAtAll()
Definition: ezimagecatalogue/user/datasupplier.php:38
$user
$user
Definition: ezimagecatalogue/user/datasupplier.php:53
$GlobalSectionID
$GlobalSectionID
Definition: ezimagecatalogue/user/datasupplier.php:35
$UserComments
$UserComments
Definition: ezimagecatalogue/user/datasupplier.php:36
$ini
$ini
Definition: ezimagecatalogue/user/datasupplier.php:34
exit
exit
Definition: folder.php:81
$image
$image
Definition: user/articlelist.php:242
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.