use quickform rule "notcallback" now instead of our own
This commit is contained in:
parent
71e665fd9b
commit
f4c51ccb4e
@ -30,16 +30,11 @@ if (!$GLOBALS['enableRegistration']) {
|
|||||||
require_once 'HTML/QuickForm2.php';
|
require_once 'HTML/QuickForm2.php';
|
||||||
require_once 'HTML/QuickForm2/Renderer.php';
|
require_once 'HTML/QuickForm2/Renderer.php';
|
||||||
require_once 'HTML/QuickForm2/Element/BackgroundText.php';
|
require_once 'HTML/QuickForm2/Element/BackgroundText.php';
|
||||||
require_once 'SemanticScuttle/QuickForm2/Rule/ICallback.php';
|
|
||||||
|
|
||||||
HTML_QuickForm2_Factory::registerElement(
|
HTML_QuickForm2_Factory::registerElement(
|
||||||
'backgroundtext',
|
'backgroundtext',
|
||||||
'HTML_QuickForm2_Element_BackgroundText'
|
'HTML_QuickForm2_Element_BackgroundText'
|
||||||
);
|
);
|
||||||
HTML_QuickForm2_Factory::registerRule(
|
|
||||||
'icallback',
|
|
||||||
'SemanticScuttle_QuickForm2_Rule_ICallback'
|
|
||||||
);
|
|
||||||
|
|
||||||
$form = new HTML_QuickForm2(
|
$form = new HTML_QuickForm2(
|
||||||
'registration', 'post',
|
'registration', 'post',
|
||||||
@ -66,12 +61,12 @@ $user->addRule(
|
|||||||
array($userservice, 'isValidUsername')
|
array($userservice, 'isValidUsername')
|
||||||
);
|
);
|
||||||
$user->addRule(
|
$user->addRule(
|
||||||
'icallback',
|
'notcallback',
|
||||||
T_('This username has been reserved, please make another choice.'),
|
T_('This username has been reserved, please make another choice.'),
|
||||||
array($userservice, 'isReserved')
|
array($userservice, 'isReserved')
|
||||||
);
|
);
|
||||||
$user->addRule(
|
$user->addRule(
|
||||||
'icallback',
|
'notcallback',
|
||||||
T_('This username already exists, please make another choice.'),
|
T_('This username already exists, please make another choice.'),
|
||||||
array($userservice, 'existsUserWithUsername')
|
array($userservice, 'existsUserWithUsername')
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user