From bad8192a441906cedd2008f7fbaf7efcd7ba6e1f Mon Sep 17 00:00:00 2001 From: Asaf Ohayon Date: Fri, 25 Sep 2015 01:45:00 +0300 Subject: [PATCH] FKS : Issue #3 - Create mnet_application before mnet_host that references it --- lib/db/install.php | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/db/install.php b/lib/db/install.php index d3ca874c629a1..86abc17b6eceb 100644 --- a/lib/db/install.php +++ b/lib/db/install.php @@ -140,11 +140,30 @@ function xmldb_main_install() { // Bootstrap mnet + // Initial insert of mnet applications info + $mnet_app = new stdClass(); + $mnet_app->name = 'moodle'; + $mnet_app->display_name = 'Moodle'; + $mnet_app->xmlrpc_server_url = '/mnet/xmlrpc/server.php'; + $mnet_app->sso_land_url = '/auth/mnet/land.php'; + $mnet_app->sso_jump_url = '/auth/mnet/jump.php'; + $moodleapplicationid = $DB->insert_record('mnet_application', $mnet_app); + + $mnet_app = new stdClass(); + $mnet_app->name = 'mahara'; + $mnet_app->display_name = 'Mahara'; + $mnet_app->xmlrpc_server_url = '/api/xmlrpc/server.php'; + $mnet_app->sso_land_url = '/auth/xmlrpc/land.php'; + $mnet_app->sso_jump_url = '/auth/xmlrpc/jump.php'; + $DB->insert_record('mnet_application', $mnet_app); + + $mnethost = new stdClass(); $mnethost->wwwroot = $CFG->wwwroot; $mnethost->name = ''; $mnethost->name = ''; $mnethost->public_key = ''; + $mnethost->applicationid = $moodleapplicationid; if (empty($_SERVER['SERVER_ADDR'])) { // SERVER_ADDR is only returned by Apache-like webservers @@ -163,23 +182,6 @@ function xmldb_main_install() { $mnetid = $DB->insert_record('mnet_host', $mnethost); set_config('mnet_localhost_id', $mnetid); - // Initial insert of mnet applications info - $mnet_app = new stdClass(); - $mnet_app->name = 'moodle'; - $mnet_app->display_name = 'Moodle'; - $mnet_app->xmlrpc_server_url = '/mnet/xmlrpc/server.php'; - $mnet_app->sso_land_url = '/auth/mnet/land.php'; - $mnet_app->sso_jump_url = '/auth/mnet/jump.php'; - $moodleapplicationid = $DB->insert_record('mnet_application', $mnet_app); - - $mnet_app = new stdClass(); - $mnet_app->name = 'mahara'; - $mnet_app->display_name = 'Mahara'; - $mnet_app->xmlrpc_server_url = '/api/xmlrpc/server.php'; - $mnet_app->sso_land_url = '/auth/xmlrpc/land.php'; - $mnet_app->sso_jump_url = '/auth/xmlrpc/jump.php'; - $DB->insert_record('mnet_application', $mnet_app); - // Set up the probably-to-be-removed-soon 'All hosts' record $mnetallhosts = new stdClass(); $mnetallhosts->wwwroot = '';