* @param array $page An object containing all the data for this page.
*/
function config_form($config, $err) {
+ global $CFG;
+
+ $query = "
+ SELECT
+ h.id,
+ h.name as hostname,
+ h.wwwroot,
+ h2idp.publish as idppublish,
+ h2idp.subscribe as idpsubscribe,
+ idp.name as idpname,
+ h2sp.publish as sppublish,
+ h2sp.subscribe as spsubscribe,
+ sp.name as spname
+ FROM
+ {$CFG->prefix}mnet_host h
+ LEFT JOIN
+ {$CFG->prefix}mnet_host2service h2idp
+ ON
+ (h.id = h2idp.hostid AND
+ (h2idp.publish = 1 OR
+ h2idp.subscribe = 1))
+ INNER JOIN
+ {$CFG->prefix}mnet_service idp
+ ON
+ (h2idp.serviceid = idp.id AND
+ idp.name = 'sso_idp')
+ LEFT JOIN
+ {$CFG->prefix}mnet_host2service h2sp
+ ON
+ (h.id = h2sp.hostid AND
+ (h2sp.publish = 1 OR
+ h2sp.subscribe = 1))
+ INNER JOIN
+ {$CFG->prefix}mnet_service sp
+ ON
+ (h2sp.serviceid = sp.id AND
+ sp.name = 'sso_sp')
+ WHERE
+ ((h2idp.publish = 1 AND h2sp.subscribe = 1) OR
+ (h2sp.publish = 1 AND h2idp.subscribe = 1)) AND
+ h.id != {$CFG->mnet_localhost_id}
+ ORDER BY
+ h.name ASC";
+
+ $resultset = get_records_sql($query);
+ $id_providers = array();
+ $service_providers = array();
+ foreach($resultset as $hostservice) {
+ if(!empty($hostservice->idppublish) && !empty($hostservice->spsubscribe)) {
+ $service_providers[]= array('id' => $hostservice->id, 'name' => $hostservice->hostname, 'wwwroot' => $hostservice->wwwroot);
+ }
+ if(!empty($hostservice->idpsubscribe) && !empty($hostservice->sppublish)) {
+ $id_providers[]= array('id' => $hostservice->id, 'name' => $hostservice->hostname, 'wwwroot' => $hostservice->wwwroot);
+ }
+ }
+
include "config.html";
}
?>
</td>
</tr>
-
+<tr valign="top" class="required">
+ <td colspan="3"><?php print_string('auth_mnet_roamin', 'auth'); ?>: </td>
+</tr>
+<?php
+foreach($id_providers as $host):
+?>
+<tr valign="top" class="required">
+ <td align="right"><?php echo $host['name']; ?>: </td>
+ <td colspan="2"><?php echo $host['wwwroot']; ?> </td>
+</tr>
+<?php
+endforeach;
+?>
+<tr valign="top" class="required">
+ <td colspan="3"><?php print_string('auth_mnet_roamout', 'auth'); ?>: </td>
+</tr>
+<?php
+foreach($service_providers as $host):
+?>
+<tr valign="top" class="required">
+ <td align="right"><?php echo $host['name']; ?>: </td>
+ <td colspan="2"><?php echo $host['wwwroot']; ?> </td>
+</tr>
<?php
+endforeach;
// global $user_fields;
// print_auth_lock_options('mnet', $user_fields, get_string('auth_fieldlocks_help', 'auth'), false, false);
$string['auth_mnettitle'] = 'Moodle Network authentication';
$string['auth_mnetdescription'] = 'Users are authenticated according to the web of trust defined in your Moodle Network settings.';
$string['auth_mnet_rpc_negotiation_timeout'] = 'The timeout in seconds for authentication over the XMLRPC transport.';
+$string['auth_mnet_roamout'] = 'Your users can roam out to these hosts';
+$string['auth_mnet_roamin'] = 'These host\'s users can roam in to your site';
$string['auth_mnet_auto_add_remote_users'] = 'When set to Yes, a local user record is auto-created when a remote user logs in for the first time.';
$string['auto_add_remote_users'] = 'Auto add remote users';
$string['rpc_negotiation_timeout'] = 'RPC negotiation timeout';