Revision 1838
Added by Luisehahne about 12 years ago
upgradePermissions.php | ||
---|---|---|
17 | 17 |
|
18 | 18 |
/* -------------------------------------------------------- */ |
19 | 19 |
// Must include code to stop this file being accessed directly |
20 |
if(defined('WB_PATH') == false) |
|
21 |
{ |
|
22 |
// Stop this file being access directly |
|
23 |
die('<h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2>'); |
|
20 |
if(!defined('WB_URL')) { |
|
21 |
require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php'); |
|
22 |
throw new IllegalFileException(); |
|
24 | 23 |
} |
25 | 24 |
/* -------------------------------------------------------- */ |
26 | 25 |
|
27 |
|
|
28 | 26 |
/** |
29 | 27 |
* |
30 | 28 |
* |
... | ... | |
59 | 57 |
'modules_install' => 0, |
60 | 58 |
'modules_uninstall' => 0, |
61 | 59 |
'modules_view' => 0, |
60 |
'modules_advanced' => 0, |
|
62 | 61 |
'pages' => 0, |
63 | 62 |
'pages_add' => 0, |
64 | 63 |
'pages_add_l0' => 0, |
... | ... | |
366 | 365 |
function setSystemCheckboxes( &$tpl, $admin, $permissions = null ) |
367 | 366 |
{ |
368 | 367 |
$array = array(); |
368 |
$aSytemArray = getSystemDefaultPermissions(); |
|
369 | 369 |
if(!is_array($permissions)) |
370 | 370 |
{ |
371 | 371 |
$array = convertStringToKeyArray($permissions); |
... | ... | |
382 | 382 |
foreach($array AS $key => $value) |
383 | 383 |
{ |
384 | 384 |
// if(strpos($key,'_view')) { continue; } |
385 |
if(array_key_exists($key, $aPermissions)) { continue; } |
|
385 |
$checked=''; |
|
386 |
if(array_key_exists($key, $aPermissions)) { |
|
387 |
continue; |
|
388 |
} |
|
386 | 389 |
$tpl->set_var('SYS_NAME', "system_permissions[$key]" ); |
387 | 390 |
$tpl->set_var('SYS_VALUE', 1 ); |
388 | 391 |
$tpl->parse('hidden_advanced_permission_list', 'show_cmd_hidden_advanced_permission_list_block', true); |
389 |
$checked = ''; |
|
390 | 392 |
} |
391 | 393 |
|
392 | 394 |
} else { |
393 |
// set baisc modus
|
|
395 |
// set basic modus
|
|
394 | 396 |
$tpl->set_var('SYS_NAME', "none" ); |
395 | 397 |
$tpl->set_var('SYS_VALUE', '' ); |
396 | 398 |
$tpl->parse('hidden_permission_list', 'show_cmd_hidden_permission_list_block', true); |
397 | 399 |
$array = !is_array($array) ? array() : $array; |
398 | 400 |
foreach($array AS $key => $value) |
399 | 401 |
{ |
400 |
if(strpos($key,'_view')) { continue; } |
|
402 |
$checked=''; |
|
403 |
if(strpos($key,'_view')) { |
|
404 |
continue; |
|
405 |
} |
|
401 | 406 |
$tpl->set_var('SYS_NAME', "system_permissions[$key]" ); |
402 | 407 |
$tpl->set_var('SYS_VALUE', 1 ); |
403 | 408 |
$tpl->parse('hidden_permission_list', 'show_cmd_hidden_permission_list_block', true); |
404 |
$checked = ''; |
|
405 | 409 |
} |
406 | 410 |
} |
407 | 411 |
reset($array); |
... | ... | |
411 | 415 |
$checked=''; |
412 | 416 |
if( $key != '' ) |
413 | 417 |
{ |
414 |
$checked = ' checked="checked"';
|
|
418 |
$checked = 'checked="checked"'; |
|
415 | 419 |
} |
416 | 420 |
$tpl->set_var('VALUE', 1); |
417 |
$tpl->set_var($key.'_checked', $checked);
|
|
421 |
$tpl->set_var(($key.'_checked'), $checked);
|
|
418 | 422 |
} |
419 | 423 |
|
424 |
// clean html |
|
425 |
$result = array_diff_key($aSytemArray, $array); |
|
426 |
foreach($result AS $key => $value) |
|
427 |
{ |
|
428 |
$tpl->set_var('VALUE', 1); |
|
429 |
$tpl->set_var(($key.'_checked'), ''); |
|
430 |
} |
|
431 |
|
|
420 | 432 |
return $array; |
421 | 433 |
} |
422 | 434 |
|
Also available in: Unified diff
groups management now completely html valide