Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezimagecatalogue/admin/datasupplier.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: datasupplier.php 9501 2002-05-02 17:09:58Z br $
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 function writeAtAll()
35 {
36 $user =& eZUser::currentUser();
37 if( eZObjectPermission::getObjects( "imagecatalogue_category", 'w', true ) < 1
38 && !eZPermission::checkPermission( $user, "eZImageCatalogue", "WriteToRoot" ) )
39 {
40 $text = "You do not have write permission to any categories";
41 $info = urlencode( $text );
42 eZHTTPTool::header( "Location: /error/403?Info=$info" );
43 exit();
44 }
45 return true;
46 }
47
48
49 switch ( $url_array[2] )
50 {
51 case "customimage" :
52 {
53 $ImageID = $url_array[3];
54 $ImageWidth = $url_array[4];
55 $ImageHeight = $url_array[5];
56 include( "kernel/ezimagecatalogue/admin/customimage.php" );
57 }
58 break;
59
60 case "search" :
61 {
62 include( "kernel/ezimagecatalogue/admin/imagelist.php" );
63 }
64 break;
65
66 case "browse":
67 {
68 $CategoryID = $url_array[3];
69 include( "kernel/ezimagecatalogue/admin/browse.php" );
70 }
71 break;
72
73 case "browsesearch":
74 {
75 include( "kernel/ezimagecatalogue/admin/browse.php" );
76 }
77 break;
78
79 case "unassigned":
80 {
81 $Offset = $url_array[3];
82 $Limit = $url_array[4];
83 include( "kernel/ezimagecatalogue/admin/unassigned.php" );
84 }
85 break;
86
87 case "imageview" :
88 {
89 $ImageID = $url_array[3];
90 $VariationID = $url_array[4];
91 include( "kernel/ezimagecatalogue/admin/imageview.php" );
92 }
93 break;
94
95 case "import" :
96 {
97 include( "kernel/ezimagecatalogue/admin/imagelist.php" );
98 }
99 break;
100
101 case "image" :
102 {
103 switch ( $url_array[3] )
104 {
105 case "list" :
106 {
107 $CategoryID = $url_array[4];
108 if ( !is_numeric($CategoryID ) )
109 $CategoryID = 0;
110 $Offset = $url_array[6];
111
112 if ( $Offset == "" && is_Numeric( $url_array[4] ) && is_Numeric( $url_array[5] ) )
113 {
114 $Offset = $url_array[5];
115 }
116 else if ( $Offset == "" )
117 {
118 $Offset = 0;
119 }
120 include( "kernel/ezimagecatalogue/admin/imagelist.php" );
121 }
122 break;
123
124 case "new" :
125 {
126 writeAtAll();
127 $Action = "New";
128 include( "kernel/ezimagecatalogue/admin/imageedit.php" );
129 }
130 break;
131
132 case "Insert" :
133 {
134 writeAtAll();
135 $Action = "Insert";
136 include( "kernel/ezimagecatalogue/admin/imageedit.php" );
137 }
138 break;
139
140 case "edit" :
141 {
142 $ImageID = $url_array[4];
143 $Action = "Edit";
144 if( ( eZImage::isOwner( $user, $ImageID ) ||
145 eZObjectPermission::hasPermission( $ImageID, "imagecatalogue_image", 'w' ) )
146 && writeAtAll() )
147 {
148 include( "kernel/ezimagecatalogue/admin/imageedit.php" );
149 }
150 else
151 {
152 eZHTTPTool::header( "Location: /error/403" );
153 exit();
154 }
155 }
156 break;
157
158 case "update" :
159 {
160 $ImageID = $url_array[4];
161 $Action = "Update";
162 if( ( eZImage::isOwner( $user, $ImageID ) ||
163 eZObjectPermission::hasPermission( $ImageID, "imagecatalogue_image", 'w' ) )
164 && writeAtAll() )
165 include( "kernel/ezimagecatalogue/admin/imageedit.php" );
166 else
167 {
168 eZHTTPTool::header( "Location: /error/403" );
169 exit();
170 }
171 }
172 break;
173 default :
174 {
175 eZHTTPTool::header( "Location: /error/404" );
176 exit();
177 }
178 }
179 }
180 break;
181
182 case "download" :
183 {
184 $ImageID = $url_array[3];
185 if ( !is_numeric( $ImageID ) )
186 $ImageID = 0;
187 if ( ( eZImage::isOwner( $user, $ImageID ) ||
188 eZObjectPermission::hasPermission( $ImageID, "imagecatalogue_image", 'r' ) ) )
189 include( "kernel/ezimagecatalogue/admin/filedownload.php" );
190 else
191 {
192 eZHTTPTool::header( "Location: /error/404" );
193 exit();
194 }
195 }
196 break;
197
198 case "category" :
199 {
200 switch( $url_array[3] )
201 {
202
203 case "new" :
204 {
205 writeAtAll();
206 $CurrentCategoryID = $url_array[4];
207 $Action = "New";
208 include( "kernel/ezimagecatalogue/admin/categoryedit.php" );
209 }
210 break;
211
212 case "insert" :
213 {
214 writeAtAll();
215 $Action = "Insert";
216 include( "kernel/ezimagecatalogue/admin/categoryedit.php" );
217 }
218 break;
219
220 case "edit" :
221 {
222 $Action = "Edit";
223 $CategoryID = $url_array[4];
224 if( ( eZObjectPermission::hasPermission( $CategoryID, "imagecatalogue_category", 'w' ) ||
225 eZImageCategory::isOwner( $user, $CategoryID ) )
226 && writeAtAll() )
227 {
228 include( "kernel/ezimagecatalogue/admin/categoryedit.php" );
229 }
230 else
231 {
232 eZHTTPTool::header( "Location: /error/403" );
233 exit();
234 }
235 }
236 break;
237
238 case "update" :
239 {
240 $Action = "Update";
241 $CategoryID = $url_array[4];
242 if( ( eZObjectPermission::hasPermission( $CategoryID, "imagecatalogue_category", 'w' ) ||
243 eZImageCategory::isOwner( $user, $CategoryID ) )
244 && writeAtAll() )
245 {
246 include( "kernel/ezimagecatalogue/admin/categoryedit.php" );
247 }
248 else
249 {
250 $info= urlencode( "You have no permission to update categories" );
251 eZHTTPTool::header( "Location: /error/403?Info=$info" );
252 exit();
253 }
254
255 }
256 break;
257 }
258 }
259 break;
260
261
262 default:
263 $info = urlencode( "This page does not exist!" );
264 eZHTTPTool::header( "Location: /error/403?Info=$info" );
265
266 }
267
268 ?>
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZImageCategory\isOwner
static isOwner( $user, $imageCategory=false)
Definition: ezimagecategory.php:480
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
$Limit
$Limit
Definition: ezarticle/admin/categorylist.php:66
$Offset
$Offset
Definition: ezarticle/user/search.php:110
writeAtAll
writeAtAll()
Definition: ezimagecatalogue/admin/datasupplier.php:34
$CurrentCategoryID
$CurrentCategoryID
Definition: ezimagecatalogue/admin/imageedit.php:35
exit
exit
Definition: folder.php:81
$user
$user
Definition: user/adlist.php:39
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.