Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezbug/user/datasupplier.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: datasupplier.php 6739 2001-08-29 10:37:23Z 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/ezuser.php" );
28 // include_once( "ezuser/classes/ezpermission.php" );
29 // include_once( "ezuser/classes/ezobjectpermission.php" );
30 // include_once( "ezbug/classes/ezbugmodule.php" );
31 // include_once( "ezbug/classes/ezbug.php" );
32 // include_once( "classes/ezhttptool.php" );
33
34 $ini =& eZINI::instance( 'site.ini' );
35 $GlobalSectionID = $ini->variable( "eZBugMain", "DefaultSection" );
36
37 function hasPermission( $bugID )
38 {
39 $user =& eZUser::currentUser();
40 $bug = new eZBug( $bugID );
41 $module = $bug->module();
42 if ( is_a( $module, "eZBugModule" ) && eZObjectPermission::hasPermission( $module->id(), "bug_module", "w" ) )
43 {
44 return true;
45 }
46 else
47 {
48 return false;
49 }
50 }
51
52 switch ( $url_array[2] )
53 {
54 case "edit" :
55 {
56 if ( $url_array[3] == "edit" && hasPermission( $url_array[4] ) )
57 {
58 $Action = "Edit";
59 $BugID = $url_array[4];
60 include( "kernel/ezbug/admin/bugedit.php" );
61 }
62 else if ( $url_array[3] == "fileedit" && hasPermission( $BugID ) )
63 {
64 switch ( $url_array[4] )
65 {
66 case "new" :
67 {
68 $Action = "New";
69 $BugID = $url_array[5];
70 include( "kernel/ezbug/admin/fileedit.php" );
71 }
72 break;
73 case "edit" :
74 {
75 $Action = "Edit";
76 $BugID = $url_array[6];
77 $FileID = $url_array[5];
78 include( "kernel/ezbug/admin/fileedit.php" );
79 }
80 break;
81 case "delete" :
82 {
83 $Action = "Delete";
84 $BugID = $url_array[6];
85 $FileID = $url_array[5];
86 include( "kernel/ezbug/admin/fileedit.php" );
87 }
88 break;
89 default :
90 {
91 include( "kernel/ezbug/admin/fileedit.php" );
92 }
93 break;
94 }
95 }
96 else if ( $url_array[3] == "imageedit" && hasPermission( $BugID ) )
97 {
98 switch ( $url_array[4] )
99 {
100 case "new":
101 {
102 $Action = "New";
103 $BugID = $url_array[5];
104 include( "kernel/ezbug/admin/imageedit.php" );
105 }
106 break;
107 case "edit" :
108 {
109 $Action = "Edit";
110 $BugID = $url_array[6];
111 $ImageID = $url_array[5];
112 include( "kernel/ezbug/admin/imageedit.php" );
113 }
114 break;
115 case "delete" :
116 {
117 $Action = "Delete";
118 $BugID = $url_array[6];
119 $ImageID = $url_array[5];
120 include( "kernel/ezbug/admin/imageedit.php" );
121 }
122 break;
123 default :
124 {
125 include( "kernel/ezbug/admin/imageedit.php" );
126 }
127 break;
128 }
129 }
130 else if ( hasPermission( $BugID ) )
131 {
132 $Action = "Update";
133 include( "kernel/ezbug/admin/bugedit.php" );
134 }
135 else // someone is trying to push the envelope
136 {
137 eZHTTPTool::header( "Location: /error/403");
138 exit();
139 }
140 }
141 break;
142
143 case "archive" :
144 {
145 if( isset( $url_array[3] ) && $url_array[3] != "" )
146 $ModuleID = $url_array[3];
147 else
148 $ModuleID = 0;
149
150 include( "kernel/ezbug/user/buglist.php" );
151 }
152 break;
153
154 case "search" :
155 {
156 if ( $url_array[3] == "parent" )
157 {
158 $Offset = $url_array[5];
159 $SearchText = urldecode( $url_array[4] );
160 }
161
162 include( "kernel/ezbug/user/search.php" );
163 }
164 break;
165
166 case "view" :
167 case "bugview" :
168 {
169 $BugID = $url_array[3];
170
171 include( "kernel/ezbug/user/bugview.php" );
172 }
173 break;
174
175
176 case "report" :
177 {
178 switch ( $url_array[3] )
179 {
180 case "create" :
181 {
182 $Action = "";
183 include( "kernel/ezbug/user/bugreport.php" );
184 }
185 break;
186 case "new" :
187 {
188 $Action = "New";
189 $BugID = "";
190 include( "kernel/ezbug/user/bugreport.php" );
191 }
192 break;
193
194 case "edit" :
195 {
196 $BugID = $url_array[4];
197 $Action = "Edit";
198 if ( $session->variable( "CurrentBugEdit" ) == $BugID && $BugID != 0 )
199 {
200 $session->setVariable( "CurrentBugEdit", 0 );
201 include( "kernel/ezbug/user/bugreport.php" );
202 }
203 else
204 {
205 eZHTTPTool::header( "Location: /error/403");
206 exit();
207 }
208 }
209 break;
210
211 case "update" :
212 {
213 $BugID = $url_array[4];
214 $Action = "Update";
215 include( "kernel/ezbug/user/bugreport.php" );
216 }
217 break;
218
219 case "fileedit" :
220 {
221 if ( $url_array[4] == "new")
222 {
223 $Action = "New";
224 $BugID = $url_array[5];
225 include( "kernel/ezbug/user/fileedit.php" );
226 }
227 else if ( $url_array[4] == "edit" )
228 {
229 $Action = "Edit";
230 $BugID = $url_array[6];
231 $FileID = $url_array[5];
232 include( "kernel/ezbug/user/fileedit.php" );
233 }
234 else if ( $url_array[4] == "delete" )
235 {
236 $Action = "Delete";
237 $BugID = $url_array[6];
238 $FileID = $url_array[5];
239 include( "kernel/ezbug/user/fileedit.php" );
240 }
241 else
242 {
243 include( "kernel/ezbug/user/fileedit.php" );
244 }
245 }
246 break;
247 case "imageedit" :
248 {
249 if ( $url_array[4] == "new")
250 {
251 $Action = "New";
252 $BugID = $url_array[5];
253 include( "kernel/ezbug/user/imageedit.php" );
254 }
255 else if ( $url_array[4] == "edit" )
256 {
257 $Action = "Edit";
258 $BugID = $url_array[6];
259 $ImageID = $url_array[5];
260 include( "kernel/ezbug/user/imageedit.php" );
261 }
262 else if ( $url_array[4] == "delete" )
263 {
264 $Action = "Delete";
265 $BugID = $url_array[6];
266 $ImageID = $url_array[5];
267 include( "kernel/ezbug/user/imageedit.php" );
268 }
269 else
270 {
271 include( "kernel/ezbug/user/imageedit.php" );
272 }
273 }
274 break;
275
276 default :
277 {
278 print( "Error: Bug file not found" );
279 }
280 break;
281 }
282 }
283 break;
284
285 case "unhandled" :
286 {
287 include( "kernel/ezbug/user/unhandledbugs.php" );
288 }
289 break;
290
291 case "reportsuccess" :
292 {
293 include( "kernel/ezbug/user/reportsuccess.php" );
294 }
295 break;
296
297 default :
298 {
299 print( "Error: Bug file not found" );
300 }
301 break;
302
303 }
304
305 ?>
$session
$session
Definition: admin/articlelist.php:44
$bug
$bug
Definition: bugpreview.php:59
eZBug
Definition: ezbug.php:80
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZObjectPermission\hasPermission
static hasPermission( $objectID, $moduleTable, $permission, $user=false)
Definition: ezobjectpermission.php:76
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$module
$module
Definition: classes/admin/linkselect.php:219
$Action
$Action
Definition: companysearch.php:80
$ImageID
$ImageID
Definition: companytypelist.php:201
$url_array
$url_array
Definition: ezaddress/admin/datasupplier.php:34
$SearchText
$SearchText
Definition: ezaddress/admin/typelist.php:143
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$GlobalSectionID
$GlobalSectionID
Definition: ezbug/user/datasupplier.php:35
$ini
$ini
Definition: ezbug/user/datasupplier.php:34
hasPermission
hasPermission( $bugID)
Definition: ezbug/user/datasupplier.php:37
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+.