Prestashop's maintenance mode works with a whitelist of IP addresses. The problem is that too often my clients don't have a static public IP available, they are on dhcp. Anyone knows of any way to make the frontend available anyway?
-
Do you mean local network? – marsaldev Feb 10 '15 at 10:33
-
no, I mean production remote site – Luca Reghellin Feb 10 '15 at 13:49
-
ah, an network providers often don't give static ips – Luca Reghellin Feb 10 '15 at 13:49
2 Answers
I guess that this is the simplest solution:
Go to:
- Administration -> Profiles
- Create new profile ( named like 'Visitor')
Then:
- Administration -> Visitor
- ( For your request ) Under Precerences -> Maintenance add the flag for View, Add ( maybe also for Edit it's not a problem ).
- Give all the other permissions that you want to give to this profile
Create an account with this profile and give it to your client, when his IP changes, he must add his IP in the backoffice, with this profile he can't make damage. ( Obviously, your clients have to know the URL to administration panel )
Otherwise your clients must to ask to you every times to add their IP in the maintenance field.

- 3,338
- 2
- 16
- 27
I have done this through the use of a simple shell script which is executed on a regular schedule via cron. It obtains the current IP address (using dig), includes it in a MySQL statement which is saved to a text file, and then executes the MySQL query against the Prestashop database, directly updating the relevant configuration record containing the maintenance IP addresses.
#!/bin/sh
echo -n "UPDATE ps_configuration SET value=\"" > update.sql
dig +short yourdomain.com | tr -d '\n' >> update.sql
echo "\" WHERE name=\"PS_MAINTENANCE_IP\";" >> update.sql
/usr/bin/mysql --user='username' --password='password' yourdatabase < update.sql
I'm sure there's a more elegant/efficient way to do this, but it works.

- 11
- 4