After thinking about this for a while, I came up with the following design idea.
The preprosessor plugin will be configured with a set of rules that will be administrated in the backend.
This goes a bit technical now. The plugin will have only one parameter that contains list of the rules. Each rule will be defined as
rulename(fields,whenToApply,parameter1,...,parameterN)
The rule name will tell the the preprosessor what to do, the fields is a comma separated list that describes the fields that should be prosessed.
When to apply describes whether the rule is applied in the frontend or backend or both and wether it applies to new registrations or only user updates. This will be implemented as binary 1=frontend, 2=backend, 4= userregistration, 8=update.
Parameters are special parameters that will be used with the preprosessor rule.
A rule could be an action e.g.
email(username;firstname;lastname,5,admin@joomlapolis.com,some text to email)
to notify the administrator of all new registrations (a bit dumb since it already exists)
Or a modification, e.g.
rsa(creditcardnumber,15,RSA-KEY)
which in this case encrypts the creditcardnumber field. After the modification the original value is replaced with the modified value for all subsequent rules.
I am also planning to implement a simple IF statement to control the flow of the actions.
A primitive plugin framework is possible. It could be implemented by having each action, modification or expression (something that the IF evaluates) in a separate file.
Now, the question is, what kinds of actions and modifications are desired for the first beta?
mikko