0

I have moodle LMS in three different countries (Ex:India, America, Eurppe). For these sites they have individual administrators. Suppose I am the main Administrator, I want to be able to manage all websites with one login.

If I login in Indian LMS and select America LMS in DROP DOWN, then the session should transfer to America LMS. Is there any solution for this?

Cœur
  • 37,241
  • 25
  • 195
  • 267
nandusr
  • 1
  • 2
  • Can't you just setup the same login/pass for the administrator in each LMS? – nageeb Sep 10 '12 at 05:33
  • Reading your question again a doubt crossed my mind: you need this for all users? Or only for you (as administrator?) – eldblz Sep 10 '12 at 06:53

2 Answers2

0

You're going to encounter cookie domain restrictions as your first major barrier. Essentially, you can't read a login cookie (which are required for sessions to work) from a domain other than the domain that issued it, so a moodle instance at us-foo.com will never be able to read a login cookie from eu-bar.com.

The simplest way to route around this would be to use a separate login form. On submission, use JavaScript to open hidden iFrames to the login pages of all three sites, with the username and passwords passed via GET parameters. Moodle may not natively support login credentials being sent with GET; you may need to edit the login scripts.

There's a forum thread about doing just this with Moodle, though - you may be in luck.

But in any case, for a login multiplexing hack like this to work it will mean you have to keep the admin username and password constant between your three sites. You could enforce this in the database using triggers, if they're all run from the same database; otherwise you'll want to alter the password changing script to write those changes to the remote databases.

Is this a serious undertaking? Kind of. Unfortunately, it's not a very robust solution, and it is likely to be extraordinarily fragile when it comes to updates and the like. You may find that the best choice is to just login separately, particularly given that these hacks don't easily lend themselves to being embedded in the main login for the sites, and you'll need to use similar ad-hoc synchronization to make logging out take place across the network as well.

Winfield Trail
  • 5,535
  • 2
  • 27
  • 43
0

If your sites are subdomains of the same domain you should consider reading this: PHP Sessions across sub domains

To set cookie for the main domain and all subdomain. So you can read the same cookie from us.foo.com and also from eu.foo.com

Plus you should have a unique user database or more than one syncronized (i'd prefer the first option anyway).

Community
  • 1
  • 1
eldblz
  • 758
  • 3
  • 11
  • 24