- COPYRIGHT AND LICENSE
- type: Text name: username constraints: - type: '+OpusVL::AppKit::FormFu::Constraint::AppKitUsername' user_stashkey: user_for_update
Ensures that duplicate user names aren't created.
To find existing user (the one we might be updating, therefore the username WILL exist) we check the context stash (Catalyst context) and look for stash key identified by 'user_stashkey'.
If the 'user' is in the stash, it will asume it to be a dbix object, pull its id and ignore that id when checking for existing usernames.
Nothing required except and AppKitAuthDB model, which should be in every AppKit app.
In the Catalyst stash there must be: 'user' - dbix object for the User.
OpusVL::AppKit::FormFu::Constraint::AppKitUsername - Username contraint for the AppKitAuthDB model.
Sets the key used to find an existing user in the context stash.
This method is used by formfu to hook into this constraints, constraining code.
Returns: boolean - 0 = did not validate, 1 = validated
OpusVL - www.opusvl.com
This software is copyright (c) 2010 by OpusVL - www.opusvl.com.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.