Best way to disable list pages?

Fernando

New Member
Hello friends,
I am using Mailwizz with my own API, so I want to disable all the list pages (subscribe form, unsubscribe form, update profile, etc).
So my question is: what is the best way to hide and disable all this pages?
I am using the extension List form custom redirect, but it isn't available in all pages, and also I have inserted javascript redirects and deleted the html code that MW allows, but I think it is not the most secure and professional.
Is there any better way to do this?
Thanks!!!
 
You could, create a file named init-custom.php in the apps folder, and place this code in it:
PHP:
Yii::app()->hooks->addAction('frontend_controller_lists_init', function(){
    Yii::app()->request->redirect('http://www.google.com/');
});
The above will redirect all lists pages to google.com
 
You could, create a file named init-custom.php in the apps folder, and place this code in it:
PHP:
Yii::app()->hooks->addAction('frontend_controller_lists_init', function(){
    Yii::app()->request->redirect('http://www.google.com/');
});
The above will redirect all lists pages to google.com
Suggesting to make this a backend setting option.
 
Not a good idea as it just disable the opt-in ability of the lists and much more.
Yeah, I see what you mean. With the right warnings (this will disable all your lists opt-in, un/subscribe and profile features) and confirmations before setting it, it should be safe enough. But I see it could make abuse of mwz easier. Maybe really better to leave it out.
 
Hello twisted and thank you very much!

I am testing this in local and it works, but is there any way to catch the list_id or list_uid variable?
Even better if we can catch the list page type... I think we can get both with the request_uri, but its not the better way.

Code:
Yii::app()->hooks->addAction('frontend_controller_lists_init', 'rv_redirect_list_pages' );
function rv_redirect_list_pages() {
    echo 'rv_redirect_list_pages function...<br>';
    $url = $_SERVER['REQUEST_URI'];
    echo 'url: ' .$url. '<br>';
    // Yii::app()->request->redirect('http://www.google.com/');
    }

Also I think this could be an extension (instead of the other) to add this option for each list and each list page...
 
I tried using the init-custom.php code above, and all that happens is that the content of init-custom.php is printed at the top of all mailwizz pages. How can I get it working?

Edit: I got it working. I forgot to enclose the above code in php tags.

This works:
PHP:
<?php
Yii::app()->hooks->addAction('frontend_controller_lists_init', function(){
    Yii::app()->request->redirect('http://www.google.com/');
});
?>
 
Back
Top