Skip to content

Commit

Permalink
FKS : Issue #3 - Create mnet_application before mnet_host that
Browse files Browse the repository at this point in the history
references it
  • Loading branch information
asafo committed Sep 24, 2015
1 parent fd29bf0 commit bad8192
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions lib/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = '';
Expand Down

0 comments on commit bad8192

Please sign in to comment.