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.

Custom cpanel link to determine which site I log into with MSM

November 05, 2012 1:34pm

Subscribe [3]
  • #1 / Nov 05, 2012 1:34pm

    agregat

    26 posts

    Is there any way of setting up a custom link to the cpanel that allows me to pre-determine which site I will find myself in, when logging in using MSM?

    As far as I can work out, if a user has access to more than one of the sites in the installation he will automatically find himself in site_1 when he logs into the cpanel.

    It would be very useful to be able to configure this as users can forget to check which site they are in when the login.

    Thanks

    Chris

  • #2 / Nov 06, 2012 5:20pm

    Robin Sowell

    13255 posts

    Hi Chris, let me lay out the basics on how that works.

    If you have an admin.php file and specify the assign_to_config variables, the site_name you specify will be the default site folks are logged into using that admin.php.  Now- they still have to have permission to access the cp for that particular site, or it will default somewhat randomly to one they DO have permission for.  But that’s going to be the default.

    UNLESS…  EE sets a cookie to record the site you are on.  So say you login, are in the cp for site A, switch to site B, log out.  You will still have a cookie set denoting site B.  When you go log back in?  It will put you in site B.  Unless you delete all cookies- at which point it will go back to defaulting to the site in admin.php.

    What you could do is use a different admin.php for each site- and make sure your site name is correct.  Depending a bit on cookies, it wouldn’t even matter what the last site was on ‘A’ domain on ‘B’ domain, they’d work independently.  IF accessed at different domains.

    Does that help?

  • #3 / Nov 08, 2012 7:30am

    agregat

    26 posts

    Hi Robin
    thanks for the tip.

    First thing: I am currently using EE 2.1 (I’ve had serious update problems and have not been able to update the site to the current version), so I have no admin.php file.

    However, I am using the index.php file and masked cpanel access, that was the standard procedure with EE before the admin.php file was introduced.

    So general access to the cpanel is via the following file, which works correctly.

    <a href="http://www.domain.com/cpanel/index.php">http://www.domain.com/cpanel/index.php</a>

    In order to have separate access to each site’s cpanel in an MSM environment, this is what I set up:

    <a href="http://www.domain.com/site_1/cpanel/index.php">http://www.domain.com/site_1/cpanel/index.php</a>
    <a href="http://www.domain.com/site_2/cpanel/index.php">http://www.domain.com/site_2/cpanel/index.php</a>

    I have configured the index.php file with the following variables:

    $assign_to_config['site_name'] = 'site_two';
    $assign_to_config['cp_url'] = 'www.domain.com/site_2/cpanel/index.php';

    If I try to load this page I get the following error:

    An Error Was Encountered
    Unable to load the requested file: account/login.php

    If I login using the generic index.php page, which works, and then try and access the cpanel I’ve already logged into, using the one of the subdomain index.php files, I get the following error:

    An Error Was Encountered
    Unable to load the requested file: _shared/menu/item_parent.php

    Any suggestions? (Apart from updating, which I can’t do at the moment because my client won’t let me, after all the problems we had).

    Many thanks

    Chris

     

     

  • #4 / Nov 08, 2012 11:25am

    agregat

    26 posts

    Update..

    I’ve got it sorted. The problem I was having seems to have been caused by putting the “admin.php/index.php” file in a sub-sub folder.

    So instead of

    http://www.domain.com/site_1/cp/index.php

    I moved it to

    http://www.domain.com/site_1/admin.php

    and it worked fine.

    Thanks anyway for your help.

    Chris

  • #5 / Nov 08, 2012 4:45pm

    Shane Eckert

    7174 posts

    Hey there agregat,

    I am glad that you were able to sort it out!

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases