Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: steve288 on October 16, 2009, 03:58:15 PM

Title: Creating custom templates for certain users??
Post by: steve288 on October 16, 2009, 03:58:15 PM
I understand how to make some small changes to templates that change global settings, say for cron, and I have read the development faq,  but I dont know how to make templates that might create or change settings for just one user. Say I want to make changes to a file in
/home/e-smith/files/users/tester/.procmailrc  or other files that get updated to with a template for one specific user. In other words tester's templates are one thing but all others are something else. This is primarily because in testing I may set up varous settings but when I rebuild the templates they get lost back to the default.

Regards
Title: Re: Creating custom templates for certain users??
Post by: cactus on October 16, 2009, 04:09:38 PM
Say I want to make changes to a file in
/home/e-smith/files/users/tester/.procmailrc  or other files that get updated to with a template for one specific user. In other words tester's templates are one thing but all others are something else. This is primarily because in testing I may set up varous settings but when I rebuild the templates they get lost back to the default.
You will need to create templates in the template-user-custom tree and filter for the proper users using your own logic. You should be able to use the $USERNAME parameter for that as that should hold the user name for which user the template is expanded.

After making changes you should do the following for affected users:
Code: [Select]
signal-event user-modify usernameor for everyone at once:
Code: [Select]
signal-event user-modify
Title: Re: Creating custom templates for certain users??
Post by: steve288 on October 16, 2009, 04:36:55 PM
Great thanks for the help.

Regards
Title: Re: Creating custom templates for certain users??
Post by: Curly on October 18, 2009, 09:45:15 PM
This thread http://forums.contribs.org/index.php/topic,44481.0.html (http://forums.contribs.org/index.php/topic,44481.0.html) has an example.