
Hi all, I am about to make some changes to the customer user backend and I need a tiny bit of advice on how to go about. On my site the generation of a CustomerUser record needs to follow a couple of rules: 1) UserLogin == UserEmail 2) Pasword is randomly generated 3) UserCustomerID is generated using a couple of address field that I added to the backend plus some other stuff. I can take a couple of routes: I can do it the easy (and crude) way which is by just adding and modifying the necessary code in the Kernel::System:CustomerUser::DB module. It is not very clean and OTRS version dependent of course. I can also take a more structured route so others can use it as well. In this case I need to add some stuff in the Configuration file. I could just do that by adding additional configuration entries for the rules as defined above but I could also extend the Map table which would be, IMHO, the cleanest and best reusable way. In the latter case I would add a column that defines the source of the data for the particular field, that could either be another field or a routine/module definition which needs to be called. Anyone has a specific opinion on this? Did I see all alternatives or am I missing one? Thanks for your time in advance. Kind regards, Tom Hesp

Hi Tom, On Mon, Dec 22, 2003 at 05:56:56PM +0100, Tom Hesp wrote:
I am about to make some changes to the customer user backend and I need a tiny bit of advice on how to go about.
On my site the generation of a CustomerUser record needs to follow a couple of rules: 1) UserLogin == UserEmail 2) Pasword is randomly generated 3) UserCustomerID is generated using a couple of address field that I added to the backend plus some other stuff.
I can take a couple of routes: I can do it the easy (and crude) way which is by just adding and modifying the necessary code in the Kernel::System:CustomerUser::DB module. It is not very clean and OTRS version dependent of course.
Jepp. You can add your own routes to Kernel::System:CustomerUser::DB, or better, rename it to Kernel::System:CustomerUser::TomHesp .-) Normally if we do something like that, we add "privat" routes with leading _ in the name. e. .g _CreateCustomerID(). So it's clear that this is just used in this module.
I can also take a more structured route so others can use it as well. In this case I need to add some stuff in the Configuration file. I could just do that by adding additional configuration entries for the rules as defined above but I could also extend the Map table which would be, IMHO, the cleanest and best reusable way. In the latter case I would add a column that defines the source of the data for the particular field, that could either be another field or a routine/module definition which needs to be called.
Anyone has a specific opinion on this? Did I see all alternatives or am I missing one?
Configurable is always better! :) But it must be usable for "normal" user. :)
Tom Hesp
Martin Edenhofer -- ((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg http://www.otrs.de/ :: Manage your communication!

Hi Martin, Thanks for your advice. Having had a chance to think it over I prefer the "configurable" way. It is a bit more work, although not that much. My plan is to add an extra column (source) in the Map table behind the http-link column so this should not have any influence on other routines using the Map table (I'll test it first :) ). My idea is to allow any Perl expression to be entered in the "source" column. This could then be a source field the user enters, a call to some routine or whatever one can think of. I am not sure what you mean by a "normal" user but I would expect someone to even think about configuring the back-end would at least have some knowledge about database techniques, scripting languages like Perl, etc. Anyway, when I get it to work I will post it and add some documentation as well. Kind regards, Tom Hesp

Hi Tom, it sounds good! :) -M On Tue, Dec 23, 2003 at 10:24:46AM +0100, Tom Hesp wrote:
Hi Martin,
Thanks for your advice.
Having had a chance to think it over I prefer the "configurable" way. It is a bit more work, although not that much.
My plan is to add an extra column (source) in the Map table behind the http-link column so this should not have any influence on other routines using the Map table (I'll test it first :) ). My idea is to allow any Perl expression to be entered in the "source" column. This could then be a source field the user enters, a call to some routine or whatever one can think of.
I am not sure what you mean by a "normal" user but I would expect someone to even think about configuring the back-end would at least have some knowledge about database techniques, scripting languages like Perl, etc. Anyway, when I get it to work I will post it and add some documentation as well.
Kind regards, Tom Hesp
_______________________________________________ OTRS mailing list: dev - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/dev To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev
Martin Edenhofer -- ((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg http://www.otrs.de/ :: Manage your communication!
participants (2)
-
Martin Edenhofer
-
Tom Hesp