500,6 → 500,7 |
|
public function implementsFeature($id) { |
if (strtolower($id) == '1.3.6.1.4.1.37476.2.5.2.3.1') return true; // oobeEntry, oobeRequested |
if (strtolower($id) == '1.3.6.1.4.1.37476.2.5.2.3.8') return true; // getNotifications() |
return false; |
} |
|
536,28 → 537,6 |
return; |
} |
|
$testurl = 'https://www.google.com/'; |
$ch = curl_init(); |
if (ini_get('curl.cainfo') == '') curl_setopt($ch, CURLOPT_CAINFO, OIDplus::localpath() . 'vendor/cacert.pem'); |
curl_setopt($ch, CURLOPT_URL, $testurl); |
curl_setopt($ch, CURLOPT_USERAGENT, 'ViaThinkSoft-OIDplus/2.0'); |
curl_setopt($ch, CURLOPT_HEADER, TRUE); |
curl_setopt($ch, CURLOPT_NOBODY, TRUE); |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); |
curl_exec($ch); |
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
curl_close($ch); |
if (!$httpCode) { |
echo '<p><font color="red">'; |
echo _L('The "CURL" PHP extension cannot access HTTPS webpages. Therefore, you cannot use this feature. Please download <a href="https://curl.haxx.se/ca/cacert.pem">cacert.pem</a>, place it somewhere and then adjust the setting <code>curl.cainfo</code> in PHP.ini.').' '; |
echo _L('Therefore, you <b>cannot</b> register your OIDplus instance now.'); |
echo '</font></p>'; |
if ($do_edits) { |
OIDplus::config()->setValue('oobe_registration_done', '1'); |
} |
return; |
} |
|
$pki_status = OIDplus::getPkiStatus(); |
|
if (!$pki_status) { |
636,4 → 615,16 |
echo '</p>'; |
} |
|
public function getNotifications($user=null): array { |
// Interface 1.3.6.1.4.1.37476.2.5.2.3.8 |
$notifications = array(); |
if ((!$user || ($user == 'admin')) && OIDplus::authUtils()->isAdminLoggedIn()) { |
if (!function_exists('curl_init')) { |
$title = _L('System registration'); |
$notifications[] = array('ERR', _L('OIDplus plugin "%1" is enabled, but required PHP extension "%2" is not installed.', $title, 'php_curl')); |
} |
} |
return $notifications; |
} |
|
} |