Hi Paul,

Another feature request...

  • Purpose: To redirect anonymous users accessing the Mailing Lists menu to the register page instead of the login page.
  • Reason: Some sites may prefer to treat anonymous interest in mailing lists as an opportunity to gain new subscribers. It is also easier to add custom text to the register page than it is to the login page.
  • Notes: This feature changes the default behaviour of the phpList Integration module - it should therefore be controlled by an option in the admin page (which defaults to disabled).

--
Dominic Search
http://photographicon.com/

Comments

photographicon’s picture

This time I've provided some code :-)

In phplist.module v1.12.2.19 2009/03/26... at line 929 insert the following into function _phplist_redirect :

    elseif (arg(1) == '' && variable_get('phplist_anonymous_redirect_register', 0)) {
      drupal_goto('user/register');
    }

At line 269 insert the following into function phplist_admin_settings :

  $form['misc'] = array(
    '#title' => 'Miscellaneous',
    '#type' => 'fieldset'
    );

  $form['misc']['phplist_anonymous_redirect_register'] = array(
    '#type' => 'checkbox',
    '#title' => t('Mailing Lists menu - redirect anonymous users to register instead of login'),
    '#default_value' => variable_get('phplist_anonymous_redirect_register', 0),
  );

--
Dominic Search
http://photographicon.com/

paulbeaney’s picture

Hi Dominic,

Nice idea, but one thing to bear in mind when activating it - are people who use the /newsletters link as anonymous users more likely to be account-holders who aren't yet logged in, or "real" anonymous, no-account-yet users? I left the code as it is originally because the link http:///mysite.com/newsletters gets inserted into all mailshots sent by PHPlist and so Drupal account holders will be using it a lot, and they will get confused if they are asked to register rather than login.

No harm in adding it as an option though! Thanks for the code - I'll add it in shortly.

Regards,

- Paul

photographicon’s picture

Yes agreed, on some sites the majority of anonymous access to /newsletters maybe from account-holders who aren't yet logged in... but on other sites maybe not... that's a matter for the admin to work out, and hence why I made it an admin selectable option :)

For the site I'm developing I've added some text to the register page (via /admin/user/settings) with an explicit link to the login page... it's kind of redundant given there's a login tab on register page and a login link in the Navigation menu, but you can be sure some users won't see them ;-)

BTW, the links in the mailouts should contain the path plus an argument (eg /newsletters/?p=unsubscribe ) - my code only redirects to Register if no argument is present.

--
Dominic Search
http://photographicon.com/

photographicon’s picture

Hi Paul, Just to note that this didn't make it into release v 1.12.2.20 2009/05/11

paulbeaney’s picture

Status: Active » Closed (fixed)

Now added to D6-DEV. Thanks very much for this contribution!

Regards,

- Paul