Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 457 Vote(s) - 3.59 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to make prestashop maintenance mode work with dynamic IP?

#1
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?

Reply

#2
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.
Reply

#3
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.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through