maha rashed maha rashed - 4 months ago 33x
PHP Question

Multiple schools on moodle

I'm trying to setup multiple school in a single moodle installation

I know Moodle does not supports it


I'm about to try using the same code base installation to run multiple moodle sites each with a different db. This is how I intend to do so hope it helps.

Point multiple domains to the same folder.

Edit my config file so that it has a list of incoming domains then changes the database and the datadir depending on the incoming name map.

pseudo code below

$domains = ('somedomain' => (object) array('dbname' => 'somedb', 'dbpass' => 'somedbpass', 'datadir' => 'somepath');

$domaincfg = $domains[$_SERVER['HTTP_HOST']];

// set the appropriate variables on the cfg dynamically including the wwwroot
$CFG->wwwroot = http://'.$_SERVER['HTTP_HOST'];

If you are trying to partition user's from each other within the same database of courses you should look into course groups using separate mode. That is the closest you will get without doing a bunch of coding. You can even assign each user a specific theme so the site will look totally different but this is a manual process so it is a pain.