[support] Hacking core (user)

Dan Karran dan at karran.net
Tue Oct 21 14:35:02 UTC 2008


On Tue, Oct 21, 2008 at 3:06 PM, Clarke Robin
<Robin.Clarke at networkrail.co.uk> wrote:

> I have a requirement to include more information in the notification email that is sent to the site administrator when a user registers on the site (users can register, but admin approval is required to activate the account). The additional information required is the new user's email address. The only way I can think of satisfying this requirement is to change the User module in core (5.10).


You could use the String Overrides module[1] (also written by Rob
Loach :) to override any string in Drupal that is wrapped in the t()
function. It gives a much simpler way of managing string changes than
actually having to change any code.


[1] http://drupal.org/project/stringoverrides

Cheers,
Dan


> I could simply change this one line in user.module:
>      drupal_mail('user-register-approval-admin', $from, $subject, t("!username has applied for an account.\n\n!edit_uri", $variables), $from);
>
> To this:
>      drupal_mail('user-register-approval-admin', $from, $subject, t("!username (!mailto) has applied for an account.\n\n!edit_uri", $variables), $from);
>
> But I am not really happy about changing core, especially after reading the first article on Planet Drupal at the moment (http://robloach.net/node/128) which says that the first rule of Drupal is to 'do not hack core'. I can see changes becoming very hard to track, especially when it comes to upgrade time.
>
> So can someone suggest to me another way to acheive a solution to changing the content in this email?
>
> Thanks
> robin


-- 
Dan Karran
dan at karran.net
www.dankarran.com


More information about the support mailing list