r1489: We really should heed warnings on PHP.net that tell us that there's problems...
[bugdar.git] / includes / functions.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Blue Static
6 || #
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
10 || #
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 || # more details.
15 || #
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
21
22 // ###################################################################
23 /**
24 * Constructs HTML code <select>s from an array. You use they keys when
25 * you need to access a multi-dimensional array of data.
26 *
27 * @access public
28 *
29 * @param string HTML name of the select
30 * @param array Array of <option>s
31 * @param integer ID of the selected item, 0 for none
32 * @param string Name of the index where values are stored in the $array
33 * @param string Name of the iddex where the labels are stored in $array
34 * @param bool Value of the blank option, FALSE turns it off
35 * @param bool Construct a multiple-selection <select> menu and append "[]" to the end of the name
36 *
37 * @return string Constructed HTML output
38 */
39 function construct_option_select($name, $array, $selected = 0, $valuekey = '', $labelkey = '', $includenil = false, $multiple = false)
40 {
41 global $bugsys;
42
43 if ($multiple)
44 {
45 $selected = explode(',', $selected);
46 }
47
48 // if we're not working on a boolean false, we use it for the value (allows -1 and 0)
49 if ($includenil !== false)
50 {
51 $opts[] = '<option value="' . $includenil . '"' . ((!$selected OR (is_array($selected) AND in_array($includenil, $selected))) ? ' selected="selected"' : '') . '> ---------</option>';
52 }
53 foreach ($array AS $value => $label)
54 {
55 $newval = ($valuekey ? $label["$valuekey"] : $value);
56 $newlab = ($labelkey ? $label["$labelkey"] : $label);
57 $opts[] = '<option value="' . $newval . '"' . (($selected == $newval OR (is_array($selected) AND in_array($newval, $selected))) ? ' selected="selected"' : '') . '>' . $newlab . '</option>';
58 }
59 return '<select class="input" name="' . $name . ($multiple ? '[]' : '') . '"' . ($multiple ? ' multiple="multiple" size="' . (sizeof($array) < 8 ? sizeof($array) + 1 : 8) . '"' : '') . '>' . implode("\n\t", $opts) . "\r</select>";
60 }
61
62 // ################### Start construct_user_display ##################
63 // $userinfo needs userid, email, displayname, and showemail
64 function construct_user_display($userinfo, $html = true)
65 {
66 global $bugsys;
67
68 if (!$userinfo['userid'])
69 {
70 $userinfo['displayname'] = _('Guest');
71 $userinfo['showemail'] = false;
72 }
73
74 if ($html)
75 {
76 eval('$username = "' . $bugsys->template->fetch('username_display') . '";');
77 }
78 else
79 {
80 if ($userinfo['showemail'])
81 {
82 $username = sprintf(_('%1$s &lt;%2$s&gt;'), $userinfo['displayname'], $userinfo['email']);
83 }
84 else
85 {
86 $username = $userinfo['displayname'];
87 }
88 }
89
90 return $username;
91 }
92
93 // ######################## Start can_perform ########################
94 // short-hand for bitwise &
95 function can_perform($bitmask, $productid = 0, $userinfo = null)
96 {
97 global $bugsys;
98
99 // masks that aren't product-specific
100 static $inspecific = array(
101 'cansearch',
102 'canbeassignedto',
103 'canadminpanel',
104 'canadminbugs',
105 'canadminfields',
106 'canadminversions',
107 'canadminusers',
108 'canadmingroups',
109 'canadmintools'
110 );
111
112 if ($userinfo == null)
113 {
114 $userinfo =& $bugsys->userinfo;
115 }
116
117 $permissions =& $bugsys->datastore['permissions'];
118
119 if (!isset($bugsys->permissions["$bitmask"]))
120 {
121 trigger_error('Invalid bitmask "' . $bitmask . '" specified for can_perform() [includes/functions.php]', E_USER_WARNING);
122 }
123
124 if (!$userinfo['permissions'])
125 {
126 $userinfo['permissions'] = FetchUserPermissions($userinfo);
127 }
128
129 if ($productid AND !in_array($bitmask, $inspecific))
130 {
131 $verdict = (isset($permissions["$userinfo[usergroupid]"]["$productid"]) ? ($permissions["$userinfo[usergroupid]"]["$productid"] & $bugsys->permissions["$bitmask"]) : ($userinfo['permissions'] & $bugsys->permissions["$bitmask"]));
132
133 foreach ($userinfo['groupids'] AS $group)
134 {
135 if (isset($permissions["$group"]["$productid"]))
136 {
137 $verdict |= ($permissions["$group"]["$productid"] & $bugsys->permissions["$bitmask"]);
138 }
139 }
140 $bugsys->debug("verdict* on can_perform($bitmask, $productid, $userinfo[userid]) = $verdict");
141 return $verdict;
142 }
143
144 $bugsys->debug("verdict on can_perform($bitmask, $productid, $userinfo[userid]) = " . ($userinfo['permissions'] & $bugsys->permissions["$bitmask"]));
145 return ($userinfo['permissions'] & $bugsys->permissions["$bitmask"]);
146 }
147
148 // ###################################################################
149 /**
150 * Runs through a given datastore item and creates a series of <select>
151 * options.
152 *
153 * @access public
154 *
155 * @param string Datastore name
156 * @param string Array index for the label
157 * @param string Array index for the value
158 * @param mixed The selected value(s)
159 * @param bool Include a blank option? TRUE will set a null value, FALSE turns it off, anything else is used as the value for the blank option
160 * @param bool Generate it using admin printers?
161 *
162 * @return string Unelss in admin mode, returns the constructed options
163 */
164 function construct_datastore_select($datastore, $labelname, $valuename, $selectedvalue = 0, $includeblank = false, $adminmode = false)
165 {
166 global $bugsys;
167
168 if ($adminmode)
169 {
170 global $admin;
171 }
172
173 $select = '';
174
175 if ($includeblank === true OR $includeblank !== false)
176 {
177 $newval = ($inclueblank === true ? '' : $includeblank);
178 if ($adminmode)
179 {
180 $admin->list_item('', '', ((!$selectedvalue OR (is_array($selectedvalue) AND in_array($newval, $selectedvalue))) ? true : false));
181 }
182 else
183 {
184 $label = '';
185 $value = $newval;
186 $selected = ((!$selectedvalue OR (is_array($selectedvalue) AND in_array($newval, $selectedvalue))) ? true : false);
187 eval('$select .= "' . $bugsys->template->fetch('selectoption') . '";');
188 }
189 }
190
191 foreach ($bugsys->datastore["$datastore"] AS $item)
192 {
193 $label = $item["$labelname"];
194 $value = $item["$valuename"];
195 $selected = (($value == $selectedvalue OR (is_array($selectedvalue) AND in_array($value, $selectedvalue))) ? true : false);
196
197 if ($adminmode)
198 {
199 $admin->list_item($label, $value, $selected);
200 }
201 else
202 {
203 eval('$select .= "' . $bugsys->template->fetch('selectoption') . '";');
204 }
205 }
206
207 if (!$adminmode)
208 {
209 return $select;
210 }
211 }
212
213 // ################## Start construct_custom_fields ##################
214 function construct_custom_fields($bug = array(), $ignore21mask = false, $nodefault = false, $searchMode = false)
215 {
216 global $bugsys;
217 static $fields;
218
219 if (!is_array($fields))
220 {
221 $fields = array();
222 $fields_fetch = $bugsys->db->query("
223 SELECT bugfield.*, permission.mask
224 FROM " . TABLE_PREFIX . "bugfield AS bugfield
225 LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission
226 ON (bugfield.fieldid = permission.fieldid)
227 WHERE (permission.mask = 2 OR permission.mask = 1)
228 AND permission.usergroupid = {$bugsys->userinfo['usergroupid']}"
229 );
230 while ($field = $bugsys->db->fetch_array($fields_fetch))
231 {
232 $fields["$field[fieldid]"] = $field;
233 }
234 }
235
236 $fieldbits = array();
237
238 foreach ($fields AS $field)
239 {
240 if ($nodefault)
241 {
242 $field['defaultvalue'] = '';
243 }
244
245 if (!is_null($bug["custom$field[fieldid]"]))
246 {
247 $bugsys->debug("not null: $field[fieldid]");
248 $value = $bug["custom$field[fieldid]"];
249 }
250 else
251 {
252 $value = $field['defaultvalue'];
253 }
254
255 if ($ignore21mask AND $field['mask'] != 0)
256 {
257 $field['mask'] = 2;
258 }
259
260 if ($field['mask'] == 2)
261 {
262 switch ($field['type'])
263 {
264 case 'input_text':
265 eval('$tempfield = "' . $bugsys->template->fetch('bugfield_input_text') . '";');
266 break;
267
268 case 'input_checkbox':
269 $selected = ($value ? ' checked="checked"' : '');
270 eval('$tempfield = "' . $bugsys->template->fetch('bugfield_input_checkbox') . '";');
271 break;
272
273 case 'select_single':
274 $selects = unserialize($field['selects']);
275 $value = trim($value);
276
277 $options = '';
278
279 $id = -1;
280 $select = '';
281 if (!$field['usedefault'] AND !trim($value))
282 {
283 $selected = ' selected="selected"';
284 }
285 else
286 {
287 $selected = '';
288 }
289 eval('$options .= "' . $bugsys->template->fetch('bugfield_select_single_option') . '";');
290
291 foreach ($selects AS $id => $select)
292 {
293 $selected = '';
294 $select = stripslashes(trim($select));
295 if ($select == $value)
296 {
297 $selected = ' selected="selected"';
298 }
299 else if ($field['usedefault'] AND $id == 0)
300 {
301 $selected = ' selected="selected"';
302 }
303 eval('$options .= "' . $bugsys->template->fetch('bugfield_select_single_option') . '";');
304 }
305 eval('$tempfield = "' . $bugsys->template->fetch('bugfield_select_single') . '";');
306 break;
307 }
308 }
309 else
310 {
311 $bugsys->debug('mask 1 processing');
312 if (is_null($bug["custom$field[fieldid]"]))
313 {
314 $bugsys->debug("is null: $field[fieldid]");
315 if ($field['type'] == 'select_single')
316 {
317 if ($field['usedefault'])
318 {
319 $temp = unserialize($field['selects']);
320 $value = trim($temp[0]);
321 }
322 else
323 {
324 $value = $bug["custom$field[fieldid]"];
325 }
326 }
327 else
328 {
329 $value = $field['defaultvalue'];
330 }
331 }
332 else
333 {
334 $value = $bug["custom$field[fieldid]"];
335 }
336
337 if ($field['type'] == 'input_checkbox')
338 {
339 $value = ($value ? 'True' : 'False');
340 }
341 $field['value'] = $value;
342 eval('$tempfield = "' . $bugsys->template->fetch('bugfield_static_text') . '";');
343 }
344 $fieldbits[] = $tempfield;
345 }
346
347 return $fieldbits;
348 }
349
350 // ###################################################################
351 /**
352 * This takes the bug API object and input data and then sanitizes, verifies,
353 * and processes the data for custom fields. If there are any errors,
354 * they are passed to the message reporter.
355 *
356 * @param object A BugAPI object
357 * @param object MessageReporter object
358 * @param bool If there are errors, add them to an errorbox format? If not, then display-on-encounter
359 * @param bool Search mode: don't change certain fields when they're 0 or empty
360 *
361 * @return mixed NULL if an ID is passed, string if bugid is NULL
362 */
363 function process_custom_fields(&$bugapi, &$msg, $errorbox = false, $searchMode = false)
364 {
365 global $bugsys;
366
367 if (!$inputdata)
368 {
369 $inputdata =& $bugsys->in;
370 }
371
372 $fields = $bugsys->db->query("
373 SELECT bugfield.*
374 FROM " . TABLE_PREFIX . "bugfield AS bugfield
375 LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission
376 ON (bugfield.fieldid = permission.fieldid)
377 WHERE permission.mask = 2
378 AND permission.usergroupid = {$bugsys->userinfo['usergroupid']}"
379 );
380 while ($field = $bugsys->db->fetch_array($fields))
381 {
382 $fieldname = "custom$field[fieldid]";
383 if ($field['type'] == 'input_checkbox')
384 {
385 if ($searchMode AND intval($inputdata["$fieldname"]) == 0)
386 {
387 continue;
388 }
389 $bugapi->set($fieldname, intval($inputdata["$fieldname"]));
390 continue;
391 }
392
393 if ($field['required'] AND empty($inputdata["$fieldname"]) AND !$searchMode)
394 {
395 $errorlist[] = sprintf(_('The "%1$s" field is a required field.'), $field['name']);
396 continue;
397 }
398
399 if (!empty($field['regexmatch']))
400 {
401 if (!preg_match('#' . str_replace('#', '\#', $field['regexmatch']) . '#si', $inputdata["$fieldname"]))
402 {
403 $errorlist[] = sprintf(_('%1$s does not match the specified format'), $field['name']);
404 continue;
405 }
406 }
407
408 if (isset($inputdata["$fieldname"]))
409 {
410 if ($field['type'] == 'input_text')
411 {
412 if (empty($inputdata["$fieldname"]) AND $searchMode)
413 {
414 continue;
415 }
416 $bugapi->set($fieldname, $inputdata["$fieldname"]);
417 }
418 else
419 {
420 if ($inputdata["$fieldname"] == -1)
421 {
422 if (!$searchMode)
423 {
424 $bugapi->set($fieldname, '');
425 }
426 continue;
427 }
428
429 $temp = unserialize($field['selects']);
430 $bugapi->set($fieldname, trim($temp[ intval($inputdata["$fieldname"]) ]));;
431 }
432 }
433 }
434
435 if ($errorlist)
436 {
437 if ($errorbox)
438 {
439 foreach ($errorlist AS $err)
440 {
441 $msg->addError($err);
442 }
443 }
444 else
445 {
446 $msg->error($errorlist[0]);
447 }
448 }
449 }
450
451 // ####################### Start fetch_on_bits #######################
452 function fetch_on_bits($mask, $userinfo = null)
453 {
454 global $bugsys;
455
456 if ($userinfo == null)
457 {
458 $userinfo =& $bugsys->userinfo;
459 }
460
461 $onbits = array();
462
463 $usergroupid = $userinfo['usergroupid'];
464
465 if ($bugsys->datastore['usergroup']["$usergroupid"]['permissions'] & $bugsys->permissions["$mask"] AND is_array($bugsys->datastore['product']))
466 {
467 foreach ($bugsys->datastore['product'] AS $id => $product)
468 {
469 $onbits["$id"] = $id;
470 }
471 }
472
473 if (is_array($bugsys->datastore['permission']["$usergroupid"]))
474 {
475 foreach ($bugsys->datastore['permission']["$usergroupid"] AS $productid => $bit)
476 {
477 if ($bit & $bugsys->permissions["$mask"])
478 {
479 $onbits["$productid"] = $productid;
480 }
481 else
482 {
483 if ($onbits["$productid"])
484 {
485 unset($onbits["$productid"]);
486 }
487 }
488 }
489 }
490
491 if (sizeof($onbits) < 1)
492 {
493 $onbits = array(0);
494 }
495
496 return implode(',', $onbits);
497 }
498
499 // #################### Start isso_pre_parse_hook ####################
500 // the pre-parse hook for ISSO's template engine
501 function isso_pre_parse_hook($template)
502 {
503 $template = preg_replace('#\$help\[(.*)\]#', '" . fetch_help_link("\1") . "', $template);
504 return $template;
505 }
506
507 // ###################### Start fetch_help_link ######################
508 // returns a prepared link to insert into templates that opens up a
509 // help popup in the user-end
510 function fetch_help_link($topic)
511 {
512 global $bugsys;
513
514 if (isset($bugsys->datastore['help']["$topic"]))
515 {
516 eval('$temp = "' . $bugsys->template->fetch('help_link') . '";');
517 return $temp;
518 }
519 else
520 {
521 if ($bugsys->debug)
522 {
523 return "[[INVALID TOPIC: $topic]]";
524 }
525 // do we want this?
526 else if (null == 1)
527 {
528 return eval('$temp = "' . $bugsys->template->fetch('help_link') . '";');
529 }
530 }
531 }
532
533 // ###################################################################
534 /**
535 * Returns a user array of information that is specific to all visiting
536 * users (guests). This can then be passed to any function that requires
537 * user information.
538 *
539 * @access public
540 *
541 * @return array User information array
542 */
543 function fetch_guest_user()
544 {
545 global $bugsys;
546
547 return array(
548 'usergroupid' => 1,
549 'groupids' => array(),
550 'userid' => 0,
551 'email' => '',
552 'displayname' => '',
553 'showcolors' => 1,
554 'permissions' => $bugsys->datastore['usergroup'][1]['permissions'],
555 'displaytitle' => $bugsys->datastore['usergroup'][1]['displaytitle'],
556 'timezone' => $bugsys->options['defaulttimezone']
557 );
558 }
559
560 // ###################################################################
561 /**
562 * Does an exhaustive permissions check on the bug. It checks for hidden
563 * bug status and ability to view hidden bugs. This normally was done
564 * at the top of each page, but it got so big, it was moved to a function.
565 *
566 * @access public
567 *
568 * @param array Bug array
569 * @param array Alternate user array
570 *
571 * @return bool Does the user have permission
572 */
573 function check_bug_permissions($bug, $userinfo = null)
574 {
575 global $bugsys;
576 if ($userinfo == null)
577 {
578 $userinfo = $bugsys->userinfo;
579 }
580
581 $bugsys->debug("checking permissions for $userinfo[userid] on bug $bug[bugid]");
582
583 $bugsys->debug('*** START VERBOSE CHECK ***');
584
585 $bugsys->debug('* !can_perform(canviewbugs, $bug[product], $userinfo) = ' . (int)(!can_perform('canviewbugs', $bug['product'], $userinfo)));
586 $bugsys->debug('* $bug[hidden] = ' . (int)$bug['hidden']);
587 $bugsys->debug('* $userinfo[userid] (' . $userinfo['userid'] . ') == $bug[userid] (' . $bug['userid'] . ') = ' . (int)($userinfo['userid'] == $bug['userid']));
588 $bugsys->debug('* can_perform(canviewownhidden, $bug[product], $userinfo) = ' . (int)(!!can_perform('canviewownhidden', $bug['product'], $userinfo)));
589 $bugsys->debug('* can_perform(canviewhidden, $bug[product], $userinfo) = ' . (int)(!!can_perform('canviewhidden', $bug['product'], $userinfo)));
590 $bugsys->debug('* !$bug[hidden] = ' . (int)(!$bug['hidden']));
591
592 $bugsys->debug('*** END PERMISSIONS CHECK ***');
593
594 if
595 (
596 !can_perform('canviewbugs', $bug['product'], $userinfo)
597 OR
598 !(
599 (
600 $bug['hidden']
601 AND
602 (A
603 ($userinfo['userid'] == $bug['userid'] AND can_perform('canviewownhidden', $bug['product'], $userinfo))
604 OR
605 can_perform('canviewhidden', $bug['product'], $userinfo)
606 )
607 )
608 OR
609 !$bug['hidden']
610 )
611 )
612 {
613 $bugsys->debug('*** DONE WITH REAL CALLS ***');
614 return false;
615 }
616
617 $bugsys->debug('*** DONE WITH REAL CALLS ***');
618
619 return true;
620 }
621
622 // ###################################################################
623 /**
624 * Takes an array of bug information and returns another array with
625 * information that is suitable for display as all the IDs have been
626 * replaced by their string equivalents
627 *
628 * @param array Unprocessed bug data
629 * @param string Color to display if the user has opted to not show status colours
630 *
631 * @param array Bug array with data fit for display
632 */
633 function ProcessBugDataForDisplay($bug, $color = '')
634 {
635 global $bugsys;
636
637 $bug['hiddendisplay'] = ($bug['hidden'] AND (can_perform('canviewhidden', $bug['product']) OR (can_perform('canviewownhidden') AND $bug['userid'] == $bugsys->userinfo['userid'])));
638
639 $bug['bgcolor'] = ($bugsys->userinfo['showcolors'] ? $bugsys->datastore['status']["$bug[status]"]['color'] : $color);
640 $bug['product'] = $bugsys->datastore['product']["$bug[product]"]['title'];
641 $bug['version'] = $bugsys->datastore['version']["$bug[version]"]['version'];
642 $bug['component'] = $bugsys->datastore['component']["$bug[component]"]['title'];
643 $bug['status'] = $bugsys->datastore['status']["$bug[status]"]['status'];
644 $bug['resolution'] = $bugsys->datastore['resolution']["$bug[resolution]"]['resolution'];
645 $bug['priority'] = $bugsys->datastore['priority']["$bug[priority]"]['priority'];
646 $bug['severity'] = $bugsys->datastore['severity']["$bug[severity]"]['severity'];
647
648 $bug['lastposttime'] = ($bug['hiddendisplay'] ? $bug['hiddenlastposttime'] : $bug['lastposttime']);
649 $bug['lastpost'] = ($bug['hiddendisplay'] ? $bug['hiddenlastpostbyname'] : $bug['lastpostbyname']);
650
651 $bug['lastposttime'] = $bugsys->datef->format($bugsys->options['dateformat'], $bug['lastposttime']);
652
653 return $bug;
654 }
655
656 // ###################################################################
657 /**
658 * Loads the pagination module and sets all of the appropriate options
659 * for it
660 *
661 * @access public
662 */
663 function LoadPaginationFramework()
664 {
665 global $bugsys;
666
667 $bugsys->load('pagination', 'pagination', true);
668 $bugsys->pagination->setDefaultPerPage($bugsys->options['defaultpp']);
669 $bugsys->pagination->setMaxPerPage($bugsys->options['maxpp']);
670 $bugsys->pagination->setPageLinks($bugsys->options['pagelinks']);
671 $bugsys->pagination->setPageVar('p');
672 $bugsys->pagination->setPerPageVar('pp');
673 $bugsys->pagination->setBitProcessor('PageNavigatorBitCallback');
674 $bugsys->pagination->setNavigatorProcessor('PageNavigatorCallback');
675 $bugsys->pagination->processIncomingData();
676 }
677
678 // ###################################################################
679 /**
680 * Callback function for the Pagination->BitProcessor()
681 *
682 * @param string Base link
683 * @param bool Do not show this as a link
684 * @param integer Page number
685 * @param object Page navigator framework
686 *
687 * @return string Processed HTML
688 */
689 function PageNavigatorBitCallback($baselink, $nolink, $number, $paginator)
690 {
691 global $bugsys;
692 eval('$return = "' . $bugsys->template->fetch('pagenav_bit') . '";');
693 return $return;
694 }
695
696 // ###################################################################
697 /**
698 * Callback function for the Pagination->NavigatorProcessor()
699 *
700 * @param string Base URL
701 * @param integer Next page number
702 * @param integer Previous page number
703 * @param array Show information
704 * @param string Individual page bits
705 * @param object Page navigator framework
706 *
707 * @return string Processed HTML
708 */
709 function PageNavigatorCallback($baselink, $nextpage, $prevpage, $show, $pagebits, $paginator)
710 {
711 global $bugsys;
712 eval('$return = "' . $bugsys->template->fetch('pagenav') . '";');
713 return $return;
714 }
715
716 // ###################################################################
717 /**
718 * Determines the correct permissions of the user. This is especially
719 * important for working with multiple-usergroup permission schemes.
720 * If a user is assigned to more than one usergroup, the highest level
721 * will always override (so a YES will always override a NO); this is
722 * because permissions are calculated with bitwise OR.
723 *
724 * @param array The user array with usergroups already exploded
725 *
726 * @return integer Permissions value
727 */
728 function FetchUserPermissions(&$user)
729 {
730 global $bugsys;
731
732 $perms = (int)$bugsys->datastore['usergroup']["$user[usergroupid]"]['permissions'];
733 if (!is_array($user['groupids']))
734 {
735 $user['groupids'] = explode(',', $bugsys->userinfo['groupids']);
736 }
737
738 foreach ($user['groupids'] AS $group)
739 {
740 $perms |= (int)$bugsys->datastore['usergroup']["$group"]['permissions'];
741 }
742
743 return $perms;
744 }
745
746 /*=====================================================================*\
747 || ###################################################################
748 || # $HeadURL$
749 || # $Id$
750 || ###################################################################
751 \*=====================================================================*/
752 ?>