@@ 310-335 (lines=26) @@ | ||
307 | $grant_list->manager->default = 'manager'; |
|
308 | ||
309 | $grant = new stdClass(); |
|
310 | foreach($grant_list as $grant_name => $grant_info) |
|
311 | { |
|
312 | // Get the default value |
|
313 | $default = Context::get($grant_name.'_default'); |
|
314 | // -1 = Log-in user only, -2 = site members only, -3 = manager only, 0 = all users |
|
315 | $grant->{$grant_name} = array(); |
|
316 | if(strlen($default)) |
|
317 | { |
|
318 | $grant->{$grant_name}[] = $default; |
|
319 | continue; |
|
320 | // users in a particular group |
|
321 | } |
|
322 | else |
|
323 | { |
|
324 | $group_srls = Context::get($grant_name); |
|
325 | if($group_srls) |
|
326 | { |
|
327 | if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls); |
|
328 | elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls); |
|
329 | else $group_srls = array($group_srls); |
|
330 | $grant->{$grant_name} = $group_srls; |
|
331 | } |
|
332 | continue; |
|
333 | } |
|
334 | $grant->{$group_srls} = array(); // dead code???? |
|
335 | } |
|
336 | ||
337 | // Stored in the DB |
|
338 | $args = new stdClass(); |
|
@@ 584-612 (lines=29) @@ | ||
581 | ||
582 | $grant = new stdClass; |
|
583 | ||
584 | foreach($grant_list as $grant_name => $grant_info) |
|
585 | { |
|
586 | // Get the default value |
|
587 | $default = Context::get($grant_name.'_default'); |
|
588 | // -1 = Sign only, 0 = all users |
|
589 | $grant->{$grant_name} = array(); |
|
590 | if(strlen($default)) |
|
591 | { |
|
592 | $grant->{$grant_name}[] = $default; |
|
593 | continue; |
|
594 | // Users in a particular group |
|
595 | } |
|
596 | else |
|
597 | { |
|
598 | $group_srls = Context::get($grant_name); |
|
599 | if($group_srls) |
|
600 | { |
|
601 | if(!is_array($group_srls)) |
|
602 | { |
|
603 | if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls); |
|
604 | elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls); |
|
605 | else $group_srls = array($group_srls); |
|
606 | } |
|
607 | $grant->{$grant_name} = $group_srls; |
|
608 | } |
|
609 | continue; |
|
610 | } |
|
611 | $grant->{$group_srls} = array(); // dead code, too?? |
|
612 | } |
|
613 | ||
614 | // Stored in the DB |
|
615 | foreach($modules as $module_srl) |