ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilCertificateActiveValidator.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8{
12 private $setting;
13
17 private $rpcSettings;
18
24 {
25 if (null === $setting) {
26 $setting = new ilSetting("certificate");
27 }
28 $this->setting = $setting;
29
30 if (null == $rpcSettings) {
32 }
33 $this->rpcSettings = $rpcSettings;
34 }
35
36 public function validate()
37 {
38 $globalCertificateActive = (bool) $this->setting->get('active');
39
40 if (false === $globalCertificateActive) {
41 return false;
42 }
43
44 $serverActive = (bool) $this->rpcSettings->isEnabled();
45
46 if (false === $serverActive) {
47 return false;
48 }
49
50 return true;
51 }
52}
An exception for terminatinating execution or to throw for unit testing.
__construct(ilSetting $setting=null, ilRPCServerSettings $rpcSettings=null)
static getInstance()
Get singelton instance.
ILIAS Setting Class.