Jump to content

Edit History

MaXi32

MaXi32

Hello there, what are the alternative ways to put prestashop into a maintenance  from the backend server ? 

At this moment, if I want to manually put a prestashop website into maintenance mode, I can manually change the ps_configuration table.

So, I created a bash script and change the database table to maintenance mode like this. This is working for me:
 

        echo "[$script_name | info]: Turning on server maintenance mode for user admin:" | tee -a $REPORT_FILE
        # For lozira.com (prestashop)
        LOZDBUSER="dbuser"
        LOZDBPASS="dbpass"
        LOZDBNAME="dbname"
        # Clear Prestashop IPs from back office
        mysql -u $LOZDBUSER -p$LOZDBPASS -D $LOZDBNAME -e "UPDATE ps_configuration SET value = NULL WHERE ps_configuration.id_configuration = 1002;"
        # Disable prestashop shop from back office
        mysql -u $LOZDBUSER -p$LOZDBPASS -D $LOZDBNAME -e "UPDATE ps_configuration SET value = 1 WHERE ps_configuration.id_configuration = 28;"
        return_code=$?
        if [ $? -eq 0 ]; then
                echo "[$script_name | info]: OK, the website of domain.com is now under maintenance mode" | tee -a $REPORT_FILE
        else
                echo "[$script_name | info]: Warning, unable to put website of domain.com in maintenance mode" | tee -a $REPORT_FILE
        fi

The front page is under maintenace mode but I notice I can still access into the back office domain.com/backofficeurl (this is what I don't want). I also want to block admin users from accessing the back office until the script finished running.

Another way I can think of is creating maintenance using .htaccess in the root domain and then another htaccess inside domain.com/backofficeurl.. but is that one of the alternative approaches ? How do you put the entire site including people at the back office who won't be able to log into dashboard ? Then you can enable this from the server. I know how to do this in wordpress using .maintenance file but in prestashop I don't find any alternative ways. Is there an approach like wordpress .maintenace file ?

MaXi32

MaXi32

Hello there, what are the alternative ways to put prestashop into a maintenance  from the backend server ? 

At this moment, if I want to manually put a prestashop website into maintenance mode, I can manually change the ps_configuration table.

So, I created a bash script and change the database table to maintenance mode like this. This is working for me:
 

        echo "[$script_name | info]: Turning on server maintenance mode for user admin:" | tee -a $REPORT_FILE
        # For lozira.com (prestashop)
        LOZDBUSER="dbuser"
        LOZDBPASS="dbpass"
        LOZDBNAME="dbname"
        # Clear Prestashop IPs from back office
        mysql -u $LOZDBUSER -p$LOZDBPASS -D $LOZDBNAME -e "UPDATE ps_configuration SET value = NULL WHERE ps_configuration.id_configuration = 1002;"
        # Disable prestashop shop from back office
        mysql -u $LOZDBUSER -p$LOZDBPASS -D $LOZDBNAME -e "UPDATE ps_configuration SET value = 1 WHERE ps_configuration.id_configuration = 28;"
        return_code=$?
        if [ $? -eq 0 ]; then
                echo "[$script_name | info]: OK, the website of domain.com is now under maintenance mode" | tee -a $REPORT_FILE
        else
                echo "[$script_name | info]: Warning, unable to put website of domain.com in maintenance mode" | tee -a $REPORT_FILE
        fi

The front page is under maintenace mode but I notice I can still access into the back office domain.com/backofficeurl (this is what I don't want). I also want to block admin users from accessing the back office until the script finished running.

Another way I can think of is creating maintenance using .htaccess in the root domain and then another htaccess inside domain.com/backofficeurl.. but is that one of the alternative approaches ? How do you put the entire site including people at the back office who won't be able to log into dashboard ? Then you can enable this from the server. Anyone have an idea \? I know how to do this in wordpress using .maintenance file but in prestashop I don't find any alternative ways. Is there an approach like wordpress .maintenace file ?

MaXi32

MaXi32

Hello there, what are the alternative ways to put prestashop into a maintenance  from the backend server ? 

At this moment, if I want to manually put a prestashop website into maintenance mode, I can manually change the ps_configuration table.

So, I created a bash script and change the database table to maintenance mode like this. This is working for me:
 

        echo "[$script_name | info]: Turning on server maintenance mode for user admin:" | tee -a $REPORT_FILE
        # For lozira.com (prestashop)
        LOZDBUSER="dbuser"
        LOZDBPASS="dbpass"
        LOZDBNAME="dbname"
        # Clear Prestashop IPs from back office
        mysql -u $LOZDBUSER -p$LOZDBPASS -D $LOZDBNAME -e "UPDATE ps_configuration SET value = NULL WHERE ps_configuration.id_configuration = 1002;"
        # Disable prestashop shop from back office
        mysql -u $LOZDBUSER -p$LOZDBPASS -D $LOZDBNAME -e "UPDATE ps_configuration SET value = 1 WHERE ps_configuration.id_configuration = 28;"
        return_code=$?
        if [ $? -eq 0 ]; then
                echo "[$script_name | info]: OK, the website of domain.com is now under maintenance mode" | tee -a $REPORT_FILE
        else
                echo "[$script_name | info]: Warning, unable to put website of domain.com in maintenance mode" | tee -a $REPORT_FILE
        fi

The front page is under maintenace mode but I notice I can still access into the back office domain.com/backofficeurl (this is what I don't want). I also want to block admin users from accessing the back office until the script finished running.

Another way I can think of is creating maintenance using .htaccess in the root domain and then another htaccess inside domain.com/backofficeurl.. but is that one of the alternative approaches ? How do you put the entire site including people at the back office who won't be able to log into dashboard ? Then you can enable this from the server. Anyone have an idea \? I know how to do this in wordpress using .maintenance file but in prestashop I don't find any alternative ways.

MaXi32

MaXi32

Hello there, what are the alternative ways to put prestashop into a maintenance  from the backend server ? 

At this moment, if I want to manually put a prestashop website into maintenance mode, I can manually change the ps_configuration table.

So, I created a bash script and change the database table to maintenance mode like this. This is working for me:
 

        echo "[$script_name | info]: Turning on server maintenance mode for user admin:" | tee -a $REPORT_FILE
        # For lozira.com (prestashop)
        LOZDBUSER="dbuser"
        LOZDBPASS="dbpass"
        LOZDBNAME="dbname"
        # Clear Prestashop IPs from back office
        mysql -u $LOZDBUSER -p$LOZDBPASS -D $LOZDBNAME -e "UPDATE ps_configuration SET value = NULL WHERE ps_configuration.id_configuration = 1002;"
        # Disable prestashop shop from back office
        mysql -u $LOZDBUSER -p$LOZDBPASS -D $LOZDBNAME -e "UPDATE ps_configuration SET value = 1 WHERE ps_configuration.id_configuration = 28;"
        return_code=$?
        if [ $? -eq 0 ]; then
                echo "[$script_name | info]: OK, the website of domain.com is now under maintenance mode" | tee -a $REPORT_FILE
        else
                echo "[$script_name | info]: Warning, unable to put website of domain.com in maintenance mode" | tee -a $REPORT_FILE
        fi

The front page is under maintenace mode but I notice I can still access into the back office domain.com/backofficeurl (this is what I don't want). I also want to block admin users from accessing the back office until the script finished running.

Another way I can think of is creating maintenance using .htaccess in the root domain and then another htaccess inside domain.com/backofficeurl.. but is that one of the alternative approaches ? How do you put the entire site including people at the back office who won't be able to log into dashboard ? Then you can enable this from the server. Anyone have an idea \?

MaXi32

MaXi32

Hello there, what are the alternative ways to put prestashop into a maintenance  from the backend server ? 

At this moment, if I want to manually put a prestashop website into maintenance mode, I can manually change the ps_configuration table.

So, I created a bash script and change the database table to maintenance mode like this. This is working for me:
 

        echo "[$script_name | info]: Turning on server maintenance mode for user admin:" | tee -a $REPORT_FILE
        # For lozira.com (prestashop)
        LOZDBUSER="dbuser"
        LOZDBPASS="dbpass"
        LOZDBNAME="dbname"
        # Clear Prestashop IPs from back office
        mysql -u $LOZDBUSER -p$LOZDBPASS -D $LOZDBNAME -e "UPDATE ps_configuration SET value = NULL WHERE ps_configuration.id_configuration = 1002;"
        # Disable prestashop shop from back office
        mysql -u $LOZDBUSER -p$LOZDBPASS -D $LOZDBNAME -e "UPDATE ps_configuration SET value = 1 WHERE ps_configuration.id_configuration = 28;"
        return_code=$?
        if [ $? -eq 0 ]; then
                echo "[$script_name | info]: OK, the website of domain.com is now under maintenance mode" | tee -a $REPORT_FILE
        else
                echo "[$script_name | info]: Warning, unable to put website of domain.com in maintenance mode" | tee -a $REPORT_FILE
        fi

But, I notice I can still access into the back office domain.com/backofficeurl (this is what I don't want). I also want to block admin users from accessing the back office until the script finished running.

Another way I can think of is creating maintenance using .htaccess in the root domain and then another htaccess inside domain.com/backofficeurl.. but is that one of the alternative approaches ? How do you put the entire site including people at the back office who won't be able to log into dashboard ? Then you can enable this from the server. Anyone have an idea \?

×
×
  • Create New...