Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 1277 → Rev 1278

/trunk/plugins/viathinksoft/adminPages/010_notifications/OIDplusPageAdminNotifications.class.php
42,12 → 42,12
* @throws OIDplusException
*/
public function gui(string $id, array &$out, bool &$handled) {
$parts = explode('$',$id);
$parts = explode('$',$id,2);
$id = $parts[0];
$ra_email = $parts[1] ?? null/*no filter*/;
 
if ($id == 'oidplus:notifications') {
$handled = true;
$ra_email = $parts[1] ?? null/*no filter*/;
 
$out['title'] = _L('Notifications');
$out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : '';
/trunk/plugins/viathinksoft/adminPages/130_create_ra/OIDplusPageAdminCreateRa.class.php
90,12 → 90,13
* @throws OIDplusException
*/
public function gui(string $id, array &$out, bool &$handled) {
$parts = explode('$',$id);
$parts = explode('$',$id,2);
$id = $parts[0];
$email = $parts[1] ?? '';
 
if ($id == 'oidplus:create_ra') {
$handled = true;
$email = $parts[1] ?? '';
 
$out['title'] = _L('Manual creation of a RA');
$out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : '';
 
/trunk/plugins/viathinksoft/adminPages/800_plugins/OIDplusPageAdminPlugins.class.php
82,7 → 82,7
* @throws OIDplusException
*/
public function gui(string $id, array &$out, bool &$handled) {
$tmp = explode('$',$id);
$tmp = explode('$',$id,2);
$classname = $tmp[1] ?? null;
 
$parts = explode('.',$tmp[0],2);
/trunk/plugins/viathinksoft/adminPages/900_software_update/OIDplusPageAdminSoftwareUpdate.class.php
186,9 → 186,7
* @throws OIDplusException
*/
public function gui(string $id, array &$out, bool &$handled) {
$parts = explode('$',$id,2);
if (!isset($parts[1])) $parts[1] = '';
if ($parts[0] == 'oidplus:software_update') {
if ($id == 'oidplus:software_update') {
@set_time_limit(0);
 
$handled = true;
/trunk/plugins/viathinksoft/adminPages/901_vnag_version_check/OIDplusPageAdminVNagVersionCheck.class.php
57,9 → 57,7
* @throws OIDplusException
*/
public function gui(string $id, array &$out, bool &$handled) {
$parts = explode('$',$id,2);
if (!isset($parts[1])) $parts[1] = '';
if ($parts[0] == 'oidplus:vnag_version_check') {
if ($id == 'oidplus:vnag_version_check') {
@set_time_limit(0);
 
 
/trunk/plugins/viathinksoft/adminPages/902_systemfile_check/OIDplusPageAdminSystemFileCheck.class.php
52,8 → 52,10
public function gui(string $id, array &$out, bool &$handled) {
$parts = explode('$',$id,2);
if (!isset($parts[1])) $parts[1] = '';
 
if ($parts[0] == 'oidplus:system_file_check') {
$handled = true;
 
$out['title'] = _L('System file check');
$out['icon'] = OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png';
 
/trunk/plugins/viathinksoft/adminPages/911_rest_api/OIDplusPageAdminRestApi.class.php
63,19 → 63,22
* @throws OIDplusException
*/
public function gui(string $id, array &$out, bool &$handled) {
$tmp = explode('$',$id);
$classname = $tmp[1] ?? '';
$parts = explode('$',$id,2);
$subpage = $parts[1] ?? '';
 
$parts = explode('.',$tmp[0],2);
if ($parts[0] != 'oidplus:rest_api_information_admin') return;
if ($parts[0] == 'oidplus:rest_api_information_admin') {
$handled = true;
 
if (str_starts_with($classname, 'endpoints:')) {
$plugin = OIDplus::getPluginByOid(explode(':',$classname)[1]);
if (str_starts_with($subpage, 'endpoints:')) {
// Note: This page can be accessed WITHOUT login!
$plugin = OIDplus::getPluginByOid(explode(':',$subpage)[1]);
if (!$plugin || !($plugin instanceof INTF_OID_1_3_6_1_4_1_37476_2_5_2_3_9)) throw new OIDplusException(_L("No endpoints for this plugin found"), null, 404);
$out['title'] = _L('REST API').' - '.$plugin->getManifest()->getName() . ' ' . _L('Endpoints');
$out['icon'] = file_exists(__DIR__.'/img/endpoints_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/endpoints_icon.png' : '';
$out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:rest_api_information_admin').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>';
$out['text'] = '';
if (OIDplus::authUtils()->isAdminLoggedIn()) {
$out['text'] .= '<p><a '.OIDplus::gui()->link('oidplus:rest_api_information_admin').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>';
}
$out['text'] .= $plugin->restApiInfo('html');
} else {
$out['title'] = _L('REST API');
135,6 → 138,7
$out['text'] .= '<button type="button" name="btn_blacklist_jwt" id="btn_blacklist_jwt" class="btn btn-danger btn-xs" onclick="OIDplusPageAdminRestApi.blacklistJWT()">'._L('Blacklist all previously generated tokens').'</button>';
}
}
}
 
/**
* @param array $json
/trunk/plugins/viathinksoft/language/dede/messages.xml
1966,6 → 1966,14
</message>
<message>
<source><![CDATA[
Documentation
]]></source>
<target><![CDATA[
Dokumentation
]]></target>
</message>
<message>
<source><![CDATA[
Documents and Resources
]]></source>
<target><![CDATA[
/trunk/plugins/viathinksoft/publicPages/000_objects/OIDplusPagePublicObjects.class.php
25,6 → 25,7
 
class OIDplusPagePublicObjects extends OIDplusPagePluginPublic
implements INTF_OID_1_3_6_1_4_1_37476_2_5_2_3_1, /* oobeEntry, oobeRequested */
INTF_OID_1_3_6_1_4_1_37476_2_5_2_3_2, /* modifyContent */
INTF_OID_1_3_6_1_4_1_37476_2_5_2_3_8, /* getNotifications */
INTF_OID_1_3_6_1_4_1_37476_2_5_2_3_9 /* restApi* */
// Important: Do NOT implement INTF_OID_1_3_6_1_4_1_37476_2_5_2_3_7, because our getAlternativesForQuery() is the one that calls others!
59,6 → 60,22
}
 
/**
* Implements interface INTF_OID_1_3_6_1_4_1_37476_2_5_2_3_2
* @param string $id
* @param string $title
* @param string $icon
* @param string $text
* @return void
* @throws \ViaThinkSoft\OIDplus\OIDplusException
*/
public function modifyContent(string $id, string &$title, string &$icon, string &$text) {
// TODO: How can we achieve that RDAP, REST, WHOIS links are grouped together?
$text .= '<br /> <a href="'.OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE)
.'rest/v1/objects/'.htmlentities($id).'" class="gray_footer_font" target="_blank">'._L('REST API').'</a> '
.'(<a '.OIDplus::gui()->link('oidplus:rest_api_information_admin$endpoints:1.3.6.1.4.1.37476.2.5.2.4.1.0').' class="gray_footer_font">'._L('Documentation').'</a>)';
}
 
/**
* Implements INTF_OID_1_3_6_1_4_1_37476_2_5_2_3_9
* @param string $requestMethod
* @param string $endpoint
/trunk/plugins/viathinksoft/raPages/910_automated_ajax_calls/OIDplusPageRaAutomatedAJAXCalls.class.php
66,11 → 66,12
* @throws OIDplusException
*/
public function gui(string $id, array &$out, bool &$handled) {
if (explode('$',$id)[0] == 'oidplus:automated_ajax_information_ra') {
$parts = explode('$',$id,2);
$ra_email = $parts[1] ?? '';
 
if ($parts[0] == 'oidplus:automated_ajax_information_ra') {
$handled = true;
 
$ra_email = explode('$',$id)[1];
 
$out['title'] = _L('Automated AJAX calls');
$out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : '';
 
/trunk/plugins/viathinksoft/raPages/911_rest_api/OIDplusPageRaRestApi.class.php
66,23 → 66,27
* @throws OIDplusException
*/
public function gui(string $id, array &$out, bool &$handled) {
$tmp = explode('$',$id);
$classname = $tmp[1] ?? '';
$parts = explode('$',$id,3);
$ra_email = $parts[1] ?? '';
$subpage = $parts[2] ?? '';
 
$parts = explode('.',$tmp[0],2);
if ($parts[0] != 'oidplus:rest_api_information_ra') return;
if (empty($ra_email)) return;
 
if ($parts[0] == 'oidplus:rest_api_information_ra') {
$handled = true;
 
if (str_starts_with($classname, 'endpoints:')) {
$plugin = OIDplus::getPluginByOid(explode(':',$classname)[1]);
if (str_starts_with($subpage, 'endpoints:')) {
// Note: This page can be accessed WITHOUT login!
$plugin = OIDplus::getPluginByOid(explode(':',$subpage)[1]);
if (!$plugin || !($plugin instanceof INTF_OID_1_3_6_1_4_1_37476_2_5_2_3_9)) throw new OIDplusException(_L("No endpoints for this plugin found"), null, 404);
$out['title'] = _L('REST API').' - '.$plugin->getManifest()->getName() . ' ' . _L('Endpoints');
$out['icon'] = file_exists(__DIR__.'/img/endpoints_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/endpoints_icon.png' : '';
$out['text'] = '<p><a '.OIDplus::gui()->link('oidplus:rest_api_information_ra').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>';
$out['text'] = '';
if (!OIDplus::authUtils()->isRaLoggedIn($ra_email) && !OIDplus::authUtils()->isAdminLoggedIn()) {
$out['text'] .= '<p><a '.OIDplus::gui()->link('oidplus:rest_api_information_ra').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Go back').'</a></p>';
}
$out['text'] .= $plugin->restApiInfo('html');
} else {
$ra_email = explode('$',$id)[1];
 
$out['title'] = _L('REST API');
$out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : '';
 
111,7 → 115,7
$endpoints = '';
foreach (OIDplus::getAllPlugins() as $plugin) {
if ($plugin instanceof INTF_OID_1_3_6_1_4_1_37476_2_5_2_3_9) {
$link = 'oidplus:rest_api_information_ra$endpoints:'.$plugin->getManifest()->getOid();
$link = 'oidplus:rest_api_information_ra$'.$ra_email.'$endpoints:'.$plugin->getManifest()->getOid();
$endpoints .= '<li><a '.OIDplus::gui()->link($link).'>'.htmlentities($plugin->getManifest()->getName()).'</a></li>';
}
}
140,6 → 144,7
$out['text'] .= '<button type="button" name="btn_blacklist_jwt" id="btn_blacklist_jwt" class="btn btn-danger btn-xs" onclick="OIDplusPageRaRestApi.blacklistJWT('.js_escape($ra_email).')">'._L('Blacklist all previously generated tokens').'</button>';
}
}
}
 
/**
* @param array $json
169,7 → 174,7
foreach (OIDplus::getAllPlugins() as $plugin) {
if ($plugin instanceof INTF_OID_1_3_6_1_4_1_37476_2_5_2_3_9) {
$submenu[] = [
'id' => 'oidplus:rest_api_information_ra$endpoints:'.$plugin->getManifest()->getOid(),
'id' => 'oidplus:rest_api_information_ra$'.$ra_email.'$endpoints:'.$plugin->getManifest()->getOid(),
'icon' => $tree_icon_endpoints,
'text' => $plugin->getManifest()->getName() . ' ' . _L('Endpoints')
];
177,7 → 182,7
}
 
$json[] = array(
'id' => 'oidplus:rest_api_information_ra',
'id' => 'oidplus:rest_api_information_ra$'.$ra_email,
'icon' => $tree_icon,
'text' => _L('REST API'),
'children' => $submenu