| Total Complexity | 5 |
| Total Lines | 61 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class auth_helper |
||
| 14 | { |
||
| 15 | protected $auth; |
||
| 16 | protected $phpbb_root_path; |
||
| 17 | protected $php_ext; |
||
| 18 | protected $config; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * currency constructor. |
||
| 22 | * |
||
| 23 | * @param \phpbb\auth\auth $auth Auth Auth object |
||
| 24 | * @param \phpbb\config\config $config Config object |
||
| 25 | * @param string $phpbb_root_path phpBB root path |
||
| 26 | * @param string $php_ext phpEx |
||
| 27 | * |
||
| 28 | * @access public |
||
| 29 | */ |
||
| 30 | |||
| 31 | public function __construct( |
||
| 42 | } |
||
| 43 | |||
| 44 | public function set_guest_acl(): void |
||
| 45 | { |
||
| 46 | if (!class_exists(\auth_admin::class)) |
||
| 47 | { |
||
| 48 | include($this->phpbb_root_path . 'includes/acp/auth.' . $this->php_ext); |
||
| 49 | } |
||
| 50 | $auth_admin = new \auth_admin(); |
||
| 51 | |||
| 52 | $auth['u_ppde_use'] = (int) $this->config['ppde_allow_guest']; |
||
| 53 | $auth['u_ppde_view_donorlist'] = (int) $this->config['ppde_ipn_dl_allow_guest']; |
||
| 54 | |||
| 55 | $auth_admin->acl_set('user', [0], [ANONYMOUS], $auth); |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return bool |
||
| 60 | * @access public |
||
| 61 | */ |
||
| 62 | public function can_use_ppde(): bool |
||
| 63 | { |
||
| 64 | return $this->auth->acl_get('u_ppde_use'); |
||
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @return bool |
||
| 69 | * @access public |
||
| 70 | */ |
||
| 71 | public function can_view_ppde_donorlist(): bool |
||
| 74 | } |
||
| 75 | } |
||
| 76 |