ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

MSM cp logging in, forcing site

March 03, 2011 7:25am

Subscribe [3]
  • #1 / Mar 03, 2011 7:25am

    Joobs

    362 posts

    I have a MSM site, running 1.7.0 20101018

    I have two masked CPs one in a admin-english folder the other admin-french

    In each folder I have path.php with these variables setup

    $system_path = "../system/";
    $site_name = 'admin-english';
    $cp_url = 'http://example.com/admin-english/index.php';

    and

    $system_path = "../system/";
    $site_name = 'admin-french';
    $cp_url = 'http://example.com/admin-french/index.php';

    The session type is set to cookies (because my client had continued problems with getting locked out the site until he cleared his cache).

    What seems to be the problem is it remembers what site i last visited, so when i visit the url through a specific admin it takes me to the wrong site.  This is a problem due to the fact I am using “edit this” links which often results in the person trying to edit content that doesn’t exist on that site.

    Do you have any ideas how to solve this issue?

  • #2 / Mar 03, 2011 11:36am

    Sue Crocker

    26054 posts

    Change your edit this links to be MSM aware, and based on the url, change the edit this link. I use an admin.php file for both sites, so the path can be /admin.php whatever.

    Does that help?

  • #3 / Mar 03, 2011 11:49am

    Joobs

    362 posts

    no i’m not sure i follow.

    how can i make a link to the cp be site aware?  It seems to default to the last site i was editing (I haven’t logged out).

    this other thread describes the same problem http://ellislab.com/forums/viewthread/169222/

    links look something like this:
    http://foobar.uk/system/index.php?C=edit&M=edit_entry&weblog_id=7&entry_id=54

  • #4 / Mar 03, 2011 10:23pm

    Sue Crocker

    26054 posts

    I wrote something on this a few years ago.

    The key is to use an admin.php file, and change the link.

    See: http://expressionengine.com/wiki/Edit_Link_With_Entries/

    Does that help?

  • #5 / Mar 04, 2011 2:04am

    Joobs

    362 posts

    I am using the masked admin.php file. But two of them to specify each site, is that not correct?  I’m pretty sure i got the error when i only had 1 admin.php file.

    I’ve narrowed down the issue. 

    If i never switch sites from inside the control panel everything works as expected. front end edit links on SiteA work, frontend edit links on siteB work.

    The problem happens i if I am visiting siteA control panel and switch to siteB site from within siteA control panel, then all the front end links that are for siteA don’t work saying i am not authorised.  If i switch the site back to siteA then the links work again.

    However, this process of switching sites from inside of the CP seems to effect the siteB control panel, as if i go to the siteB front end and click an edit link (which is pointing to a different masked admin.php file with it’s path.php file) it ignores the settings in my path.php file and logs into siteA cp saying i’m not authorised.

    So basically switching sites from within the CP seems to effect “edit this” links

  • #6 / Mar 04, 2011 2:39pm

    Sue Crocker

    26054 posts

    ... you need TWO admin.php files, that way the /admin.php is right no matter what the domain name is. But the issue of not being authorized may continue to plague you if you mix and match like that. I tend to use two browsers in that case. Does that help?

  • #7 / Mar 04, 2011 6:09pm

    Joobs

    362 posts

    yes. i have two admin.php files.  The problem only happens when you switch sites form inside either CP.  It sounds like this is a problem with how EE works and i’ve done everything I can to stop it. 

    I also made a feature request here http://ellislab.com/forums/viewthread/182628/ suggesting a site_id url string for the CP to force the site you edit an entry on.

    It’s just a bit confusing for the client.  I will try to tell them to never switch sites from within the CP.

    Thanks

  • #8 / Mar 05, 2011 4:43pm

    Greg Salt

    3988 posts

    Hi Joobs,

    It seems as though you have a workaround so I’ll go ahead and close this issue.

    Cheers

    Greg

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases