60 | | == Registration Checks == |
| 60 | == Modular Registration Checks == |
| 61 | === Interface Definition === |
| 62 | {{{ |
| 63 | #!python |
| 64 | class IAccountRegistrationInspector(Interface): |
| 65 | """An interface for Components, that wish to participate in examining |
| 66 | requests for account creation. |
| 67 | |
| 68 | The check method is called not only by RegistrationModule but when adding |
| 69 | new users from the user editor in AccountManagerAdminPanels too. |
| 70 | """ |
| 71 | |
| 72 | def render_registration_fields(req): |
| 73 | """Emit one or multiple additional fields for registration form built. |
| 74 | |
| 75 | Returns a dict containing a 'required' and/or 'optional' tuple of |
| 76 | * Genshi Fragment or valid XHTML markup for registration form |
| 77 | * template data object with default values or empty dict |
| 78 | If the return value is just a single tuple, its fragment or markup |
| 79 | will be inserted into the 'required' section. |
| 80 | """ |
| 81 | |
| 82 | def validate_registration(req): |
| 83 | """Check registration form input. |
| 84 | |
| 85 | Returns a RegistrationError with error message, or None on success. |
| 86 | """ |
| 87 | }}} |
| 88 | |