Project:Multisite Login
Version:6.x-1.0
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)

Issue Summary

I'm hoping that somebody can at least give me a few hints to track down my problem. I've got this and multisite api installed on my lead site and two dev sites, but not all sites (yet) on my multisite. I'm sharing the four tables:

$db_prefix = array(
'default' => '',
'users' => 'leaddb.',
'sessions' => 'leaddb.',
'multisite_login' => 'leaddb.',
'multisite_login_sessions' => 'leaddb.',
);

The user listings and so on demonstrate that the sharing is working. And the multisite api admin page lists all sites.

But nothing happens on other sites when I log on on the main site (which we want to limit logins to). No errors of evidence of anything on the two sites that are sharing, that any attempt was communicated.

The only indication of life that I get is that if I'm already logged into one of the other sites (only one of them), I get a log entry on the main site that that other site already logged in if I log in to the main site. But if I'm logged out on the other site, it doesn't log me in. I'm assuming here that if there is no window opened to the other site and I log into the main site, the other should be logged in if I go to it.

Where should I look for a problem? What can I do to test whether the communication is occurring at all? Thanks for any debugging hints!

Comments

#1

Status:active» postponed (maintainer needs more info)

When you login and your user has the "administer multisite login" permission, you will see a string of one-pixel images in the footer. Black images represent a successful login, red means a failure - in which case there should be something in the log. If there's no pixels then check that all the sites are listed as coming from the same server on the multi-site admin page and are not in the "excluded" category.

Note that you should avoid using the "default" sites directory.

#2

I cannot find any administer multisite login permission anywhere. I searched the permission form. There is no section for multisite login, nor does a browser search turn anything up for "administer multisite login" permission". I couldn't even find a perm hook in the module file. No pixel images either.

The only thing on the multisite admin page (admin/multisite/multisite_login) are the two checkboxes.

The multisite api preview page lists all the sites, but the ones I was testing on are listed as staging, while our main site is listed as public. So I tried adding the sharing to one of the public sites but it isn't working.

All of our sites have their own folder and settings file under sites.

#3

The multisite api preview page lists all the sites, but the ones I was testing on are listed as staging, while our main site is listed as public. So I tried adding the sharing to one of the public sites but it isn't working.

This sounds like the problem. You need to get manipulate the multisite API settings so that all the sites are shown as being on the same server, and with the same visibility. i.e. production/public.

#4

Do you know what controls public vs. staging? The sites listed a staging are subdomains while the others are separate domains, but I know that many multisites use many subdomains that I assume are public.

And what about those multisite login permissions?

#5

You seem to be mixing terms. Multisite API categorizes sites in two ways:
- what server it's on: development, staging, testing, production.
- it's visibility: public, private, excluded.

To elaborate on visibility. You might have public sites, sites that aren't publicly revealed yet, and sites that should be totally excluded from anything involved with Multisite API (for example an intranet site).

Multisite Login will only work with sites that exist on the same server with the same visibility.

#7

So I dug into the module tonight to figure this out. I put a bunch of variable_set calls in in various places. I found that this line was blocking it from doing anything in the hook_footer:

if (!empty($_SESSION['single_login_all_sites'])) {

When I commented that out, along with it's closing brace, I got logged in on my other site. I don't have much background with sessions, but I see that a hook_user call login op is setting this. The site that gets logged in is also trying to log in the site that logged it in, and I'm guessing this is because of the code I commented out.

So I need to figure out why that is blocking its functioning.

#8

Yeah that happened for me too.

I setup several sites. The primary domain was NOT using default, so in my sites folder I had:
site1.domain.com, site2.domain.com, main.domain.com

All sites share the users, sessions, multisite_login, and multisite_login_sessions table.

In multisite_login configuration, all domains are public on the production server.

However, when I logged in to site1 and then switched to the main site, the user was not logged into the main site. There were no errors or noties in the watchdog report of either site.

Once I commented out line 80 in multisite_login.module and then it worked. logging into site1 also logged me into the main site and there was a multisite_login confirmation message in the watchdog report on the main site.

Any updates on what might be causing this issue?

Drupal 6.16
mulstisite_login, multisite_api: 6.x-1.0

#9

Had almost the same problem as FilmKnurd (#8). Multisite install, users etc shared, but had just two sites and they both had their own domains, not subdomains.

What I noticed, when I logged in from site#1, the image tags that are supposed to do the login magic never got rendered and logging in at site#1 never logged user in to site#2. When logging in at site#2, the images got rendered and login to both sites went fine. I did try disabling other modules so that both sites used exactly the same ones and still the problem remained. Commenting out the line #80 if (!empty($_SESSION['single_login_all_sites'])) { and its closing bracket did the trick, after that all seems to work fine.

#10

can some one please upload an example of how they commented out line 80? every time i try the whole site dies so i must be doing something wrong..

thanks!

#11

I corrected this error in such a way.
A custom module with low birth weight interpretation the hook_footer()

function MYMODULE_footer($main = 0) {
  $_SESSION['multisite_login'] = 1;
}

This initializes a session for anonymous.

In order to place multisite logout interpretation the hook_user()

function MYMODULE_user($op, &$edit, &$account, $category = NULL) {
  switch ($op)  {
    case 'logout':
      db_query("DELETE {sessions}, {multisite_login_sessions}
        FROM {sessions}
        LEFT JOIN {multisite_login_sessions}
        ON {multisite_login_sessions}.sid = {sessions}.sid
        WHERE {sessions}.uid = %d", $account->uid);
      break;
  }
}