Jump to content

Maintenance mode except for select accounts/profiles


Higino

Recommended Posts

So I was using maintenance mode with IP whitelist to allow access to a website for the final client, so they can see how the site is coming along as I work on it.

However some of the employees there change locations frequently, so their public IP keeps changing and they keep asking for new IPs to whitelist.

To eliminate that need I thought I would create accounts/profiles instead, and filter access through those accounts instead of by IP. However, for some reason, you can't see the website unless your IP is on the whitelist. This is version 1.7.

Even if another account is set as SuperAdmin, they still see the maintenance page instead of the actual site. 

Why is that? It doesn't seem very logical to me to force users to have a static IP in order to see and work on a website in progress. That can't be right, right? Is there a way to filter access by profile/account?

Thanks!

Link to comment
Share on other sites

1 minute ago, El Patron said:

I'm really grateful for your help, but I'm flabbergasted that you'd have to pay 50 bucks to do something that should be possible by default, and is indeed already so in other CMSs like Wordpress.

Since there's a module for that, I doubt there's another free workaround. But if someone knows of one, I'd love to hear about it.

Thanks!

Link to comment
Share on other sites

1 minute ago, Higino said:

I'm really grateful for your help, but I'm flabbergasted that you'd have to pay 50 bucks to do something that should be possible by default, and is indeed already so in other CMSs like Wordpress.

Since there's a module for that, I doubt there's another free workaround. But if someone knows of one, I'd love to hear about it.

Thanks!

Hi, I'm flabergasted that you think developers don't need to eat, send their kids to college etc.  wordpress is for the weak...don't mention it in ps forum...lool

There is no free workaround that I know of.

I can tell you how to do it for free and is 'best practice'

  1. make back up copy of your production robots.txt
  2. update robots.txt with (to disallow all)
  3. User-agent: *
  4. Disallow: /
  5. optional make robots.txt non-writable
  6. Take shop out of maintenance mode, it will not be indexed.
  7. When ready to go production then restore your back up copy or generate from back office.  
  8. make robots.txt r/w if you make ro earlier

with 18 person agency it would be impossible to play the IP game.

happy ps'ing

 

 

  • Like 1
Link to comment
Share on other sites

Quote

Hi, I'm flabergasted that you think developers don't need to eat, send their kids to college etc.  wordpress is for the weak...don't mention it in ps forum...lool

I hope I didn't offend you, I didn't mean to sound entitled, but I guess I might have.

I just feel it would be a standard thing by now. I can see It's not really cool to mention other CMS on a specific CMS forum so sorry about that, but at the same time, as tech guys, I don't think we should defend technologies as if they were football clubs. We use what's best. 

Of course, I'll be happy to support developers. But if we follow your logic, then how is Prestashop even free in the first place? 

Because they offer a base software that you can build upon. I'm arguing that this kind of thing should be included in that base software. I don't think I'm alone in that. Usually the logic follows that you get basic stuff for free, and more elaborate/specific/professional stuff for a fee. What I'm saying is, this feels like it should be a basic thing. 

Anyway, sorry about that, and thanks a lot for the help!

 

Edited by Higino (see edit history)
Link to comment
Share on other sites

3 minutes ago, Higino said:

I hope I didn't offend you, I didn't mean to sound entitled, but I guess I might have.

I just feel it would be a standard thing by now. I can see It's not really cool to mention other CMS on a specific CMS forum so sorry about that, but at the same time, as tech guys, I don't think we should defend technologies as if they were football clubs. We use what's best. 

Of course, I'll be happy to support developers. But if we follow your logic, then how is Prestashop even free in the first place? 

Because they offer a base software that you can build upon. I'm arguing that this kind of thing should be included in that base software. I don't think I'm alone in that. Usually the logic follows that you get basic stuff for free, and more elaborate/specific/professional stuff for a fee. What I'm saying is, this feels like it should be a basic thing. 

Anyway, sorry about that, and thanks a lot for the help!

 

oh you didn't offend me at all, and happy you understand the model.

you already got a free 'cart system' including base features needed to build a product catalog and sell it...

what you think should be inculded free in base shop is 'irrelevant' here on the forum, you can however go to PS github and make requests.

No need to be sorry, you took it well and I think you will be more sensitive to amount of work behind a 'good' module.  Is the above a good module, don't know we use other method.  My advice is to buy a 'high quality' theme which will have a lot of the tools  the default theme lacks...

happy ps'ing 

  • Like 1
Link to comment
Share on other sites

for some reason my post on how to have shop enabled 

update robots punto txt to disallow indexing

learn how here

this removes friction for team/client reviews.

then when ready  to go production simply regenerate your robots.txt file from PS admin seo&urls

this is how we do it, it would not be possible to manage visibility and we only care that it's not indexed until in production.

 

Link to comment
Share on other sites

On 6/2/2021 at 7:28 PM, Higino said:

So I was using maintenance mode with IP whitelist to allow access to a website for the final client, so they can see how the site is coming along as I work on it.

However some of the employees there change locations frequently, so their public IP keeps changing and they keep asking for new IPs to whitelist.

To eliminate that need I thought I would create accounts/profiles instead, and filter access through those accounts instead of by IP. However, for some reason, you can't see the website unless your IP is on the whitelist. This is version 1.7.

Even if another account is set as SuperAdmin, they still see the maintenance page instead of the actual site. 

Why is that? It doesn't seem very logical to me to force users to have a static IP in order to see and work on a website in progress. That can't be right, right? Is there a way to filter access by profile/account?

Thanks!

It is not that difficult. Just make the definition of PS_MOD_DEV conditional. Something like:

if (($_SERVER['REMOTE_ADDR'] == '1.2.3.4') ||($_SERVER['REMOTE_ADDR'] == '11.22.33.44') || ($_SERVER['REMOTE_ADDR'] == '77.88.99.12'))
    define('_PS_MODE_DEV_', true);
else
    define('_PS_MODE_DEV_', false);

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...