ILIAS  trunk Revision v11.0_alpha-1702-gfd3ecb7f852
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilCertificateActiveValidator.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
25 {
26  private readonly ilSetting $setting;
28 
29  public function __construct(?ilSetting $setting = null, ?ilRPCServerSettings $rpcSettings = null)
30  {
31  if (null === $setting) {
32  $setting = new ilSetting("certificate");
33  }
34  $this->setting = $setting;
35 
36  if (null === $rpcSettings) {
37  $rpcSettings = ilRPCServerSettings::getInstance();
38  }
39  $this->rpcSettings = $rpcSettings;
40  }
41 
42  public function validate(): bool
43  {
44  $globalCertificateActive = (bool) $this->setting->get('active', '0');
45 
46  if (!$globalCertificateActive) {
47  return false;
48  }
49 
50  return $this->rpcSettings->isEnabled();
51  }
52 }
__construct(?ilSetting $setting=null, ?ilRPCServerSettings $rpcSettings=null)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class for storing all rpc communication settings.