mnet: core libraries and admin pages

This commit is contained in:
martinlanghoff 2007-01-04 02:33:51 +00:00
parent 10daca92c5
commit 71558f8502
26 changed files with 4213 additions and 0 deletions

127
admin/mnet/mnet_review.html Normal file
View file

@ -0,0 +1,127 @@
<?php
$logurl = $CFG->wwwroot.
'/course/report/log/index.php?chooselog=1&showusers=1&showcourses=1&host_course='.$mnet_peer->id.
'%2F1&user='.'0'.
'&date=0'.
'&modid=&modaction=0&logformat=showashtml';
admin_externalpage_print_header($adminroot);
if (isset($mnet_peer->id) && $mnet_peer->id > 0) {
$tabs[] = new tabobject('mnetdetails', 'peers.php?step=update&hostid='.$mnet_peer->id, $strmnetedithost, $strmnetedithost, false);
$tabs[] = new tabobject('mnetservices', 'mnet_services.php?step=list&hostid='.$mnet_peer->id, $strmnetservices, $strmnetservices, false);
$tabs[] = new tabobject('mnetlog', $logurl, $strmnetlog, $strmnetlog, false);
} else {
$tabs[] = new tabobject('mnetdetails', '#', $strmnetedithost, $strmnetedithost, false);
}
print_tabs(array($tabs), 'mnetdetails');
print_simple_box_start("center", "");
?>
<form method="post" action="peers.php">
<input type="hidden" name="sesskey" value="<?php echo $USER->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' ; ?>" />
<table cellpadding="9" cellspacing="0" >
<tr>
<td align="right" valign="top" nowrap><?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" nowrap><?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" nowrap><?php
print_string('publickey', 'mnet');
echo ': <br />';
helpbutton("publickey", get_string('publickey', 'mnet'), "mnet", true, true);
?></td>
<?php
if (isset($mnet_peer->deleted) && $mnet_peer->deleted > 0) {
$key = mnet_get_public_key($mnet_peer->wwwroot);
$mnet_peer->public_key = clean_param($key, PARAM_PEM);
?>
<td valign="top">
<?php
if (empty($mnet_peer->public_key)) {
notice(get_string('invalidpubkey', 'mnet'));
}
?>
<textarea rows="17" cols="65" name="public_key" style="font-size: 8px;"><?php echo $mnet_peer->public_key; ?></textarea></td>
</tr>
<?php
} else {
?>
<td valign="top">
<?php
if (empty($mnet_peer->public_key)) {
p(get_string('invalidpubkey', 'mnet'));
}
?>
<pre style="font-size: 8px;">
<?php echo $mnet_peer->public_key; ?>
</pre></td>
</tr>
<?php
}
if (isset($mnet_peer->id) && $mnet_peer->id > 0):
?>
<tr>
<td align="right" valign="top" nowrap><?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->transport) && $mnet_peer->transport > 0):
?>
<tr>
<td align="right" valign="top" nowrap><?php print_string('current_transport', 'mnet'); ?>:</td>
<td valign="top"><?php echo mnet_get_transport_name($mnet_peer->transport);?></td>
</tr>
<?php
endif;
if (isset($mnet_peer->deleted) && $mnet_peer->deleted > 0):
?>
<tr>
<td align="right" valign="top" nowrap><?php print_string('deleted'); ?>:</td>
<td valign="top">
<input type="radio" name="deleted" value="0" <?php echo ("off" == $CFG->mnet_dispatcher_mode)? 'checked="true"' : '' ?> /> No - select this option to re-enable this server. <br />
<input type="radio" name="deleted" value="1" <?php echo ("strict" == $CFG->mnet_dispatcher_mode)? 'checked="true"' : '' ?> /> Yes<br />
</td>
</tr>
<?php
endif;
endif;
if (isset($mnet_peer->ip_address) && '' != $mnet_peer->ip_address):
?>
<tr>
<td align="right" valign="top" nowrap><?php print_string('ipaddress', 'mnet');
echo ': <br />';
helpbutton("ipaddress", get_string('ipaddress', 'mnet'), "mnet", true, true);
?>:</td>
<td valign="top"><?php echo $mnet_peer->ip_address; ?></td>
</tr>
<?php
endif;
?>
<tr>
<td></td>
<td><input type="submit" value="<?php print_string("savechanges"); ?>" /></td>
</tr>
<?php
echo ' </table>';
print_simple_box_end();
admin_externalpage_print_footer($adminroot);
?>