mirror of
https://github.com/moodle/moodle.git
synced 2025-02-26 13:03:53 +01:00
144 lines
4.6 KiB
HTML
144 lines
4.6 KiB
HTML
<?php
|
|
|
|
admin_externalpage_print_header();
|
|
|
|
$currenttab = 'mnetdetails';
|
|
require_once($CFG->dirroot .'/'.$CFG->admin.'/mnet/tabs.php');
|
|
|
|
echo $OUTPUT->box_start();
|
|
?>
|
|
<form method="post" action="peers.php">
|
|
<div>
|
|
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
|
|
<input type="hidden" name="step" value="commit" />
|
|
<input type="hidden" name="last_connect_time" value="<?php echo $mnet_peer->last_connect_time; ?>" />
|
|
<input type="hidden" name="id" value="<?php echo isset($mnet_peer->id)? $mnet_peer->id : '0' ; ?>" />
|
|
<input type="hidden" name="applicationid" value="<?php echo isset($mnet_peer->applicationid)? $mnet_peer->applicationid : '0' ; ?>" />
|
|
<input type="hidden" name="applicationname" value="<?php echo isset($mnet_peer->application->name)? $mnet_peer->application->name : '' ; ?>" />
|
|
<table cellpadding="9" cellspacing="0" width="635">
|
|
|
|
<tr>
|
|
<td align="right" valign="top"><?php print_string('site'); ?>:</td>
|
|
<td valign="top"><input type="text" name="name" size="30" value="<?php echo $mnet_peer->name; ?>" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="right" valign="top"><?php print_string('hostname', 'mnet'); ?>:</td>
|
|
<td valign="top"><input type="text" name="wwwroot" size="30" value="<?php echo $mnet_peer->wwwroot; ?>" /></td>
|
|
</tr>
|
|
<?php
|
|
if (empty($mnet_peer->public_key)) $mnet_peer->public_key = '';
|
|
?>
|
|
<tr>
|
|
<td align="right" valign="top"><?php
|
|
print_string('publickey', 'mnet');
|
|
echo ': <br />';
|
|
echo $OUTPUT->help_icon("publickey", get_string('publickey', 'mnet'), "mnet", true);
|
|
?></td>
|
|
<?php
|
|
|
|
|
|
|
|
if (isset($mnet_peer->deleted) && $mnet_peer->deleted > 0) {
|
|
$key = mnet_get_public_key($mnet_peer->wwwroot, $mnet_peer->application->xmlrpc_server_url);
|
|
$mnet_peer->public_key = clean_param($key, PARAM_PEM);
|
|
}
|
|
?>
|
|
<td valign="top">
|
|
<?php
|
|
if (empty($mnet_peer->public_key)) {
|
|
print_string('nopubkey', 'mnet');
|
|
}
|
|
?><br />
|
|
<textarea rows="17" cols="65" name="public_key" style="font-size: 8px;"><?php echo $mnet_peer->public_key; ?></textarea>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="right" valign="top"><?php print_string('expires', 'mnet'); ?>:</td>
|
|
<td valign="top">
|
|
<?php
|
|
if($mnet_peer->public_key_expires < time()) {
|
|
print_string('expired', 'mnet');
|
|
echo ' ';
|
|
}
|
|
echo userdate($mnet_peer->public_key_expires);
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
|
|
if(!empty($currentkey)) {
|
|
?>
|
|
<tr>
|
|
<td align="right" valign="top"></td>
|
|
<td valign="top"><?php print_string('keymismatch', 'mnet'); ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="right" valign="top"><?php print_string('currentkey', 'mnet'); ?>:</td>
|
|
<td valign="top"><pre style="font-size: 8px;"><?php echo $currentkey;?></pre></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
|
|
if (isset($mnet_peer->id) && $mnet_peer->id > 0) {
|
|
?>
|
|
<tr>
|
|
<td align="right" valign="top"><?php print_string('last_connect_time', 'mnet'); ?>:</td>
|
|
<td valign="top"><?php echo ($mnet_peer->last_connect_time == 0)? get_string('never','mnet') : date('H:i:s d/m/Y',$mnet_peer->last_connect_time);?></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
|
|
if (isset($mnet_peer->deleted) && $mnet_peer->deleted > 0){
|
|
?>
|
|
<tr>
|
|
<td align="right" valign="top"><?php print_string('deleted'); ?>:</td>
|
|
<td valign="top">
|
|
<input type="radio" name="deleted" value="0" checked="checked" /> <?php print_string('reenableserver','mnet'); ?><br />
|
|
<input type="radio" name="deleted" value="1" /> <?php print_string('yes'); ?><br />
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
|
|
if (isset($mnet_peer->ip_address) && '' != $mnet_peer->ip_address){
|
|
?>
|
|
<tr>
|
|
<td align="right" valign="top"><?php print_string('ipaddress', 'mnet');
|
|
echo ': <br />';
|
|
echo $OUTPUT->help_icon("ipaddress", get_string('ipaddress', 'mnet'), "mnet", true);
|
|
?>:</td>
|
|
<td valign="top"><?php echo $mnet_peer->ip_address; ?></td>
|
|
</tr>
|
|
|
|
<?php
|
|
}
|
|
if (!empty($credentials)) {
|
|
?>
|
|
<tr>
|
|
<td align="right" valign="top"><?php print_string('certdetails', 'mnet'); ?>:</td>
|
|
<td valign="top"><pre style="margin: 0px; border: 0px;"><?php
|
|
foreach($credentials['subject'] as $key => $credential) {
|
|
if (is_scalar($credential)) {
|
|
echo str_pad($key, 16, " ", STR_PAD_LEFT).': '.$credential."\n";
|
|
} else {
|
|
echo str_pad($key, 16, " ", STR_PAD_LEFT).': '.var_export($credential,1)."\n";
|
|
}
|
|
}
|
|
?></pre>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
<tr>
|
|
<td></td>
|
|
<td><input type="submit" value="<?php print_string("savechanges"); ?>" /></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</form>
|
|
<?php
|
|
echo $OUTPUT->box_end();
|
|
echo $OUTPUT->footer();
|
|
?>
|