Horde_Core_Auth_Signup_Form::getInfo PHP Method

getInfo() public method

Fetch the field values of the submitted form.
public getInfo ( Variables $vars, array &$info )
$vars Variables A Variables instance (Needed?).
$info array Array to be filled with the submitted field values.
    public function getInfo($vars, &$info)
    {
        parent::getInfo($vars, $info);
        if (!isset($info['user_name']) && isset($info['extra']['user_name'])) {
            $info['user_name'] = $info['extra']['user_name'];
        }
        if (!isset($info['password']) && isset($info['extra']['password'])) {
            $info['password'] = $info['extra']['password'];
        }
    }

Usage Example

Beispiel #1
0
// Make sure signups are enabled before proceeding
if ($conf['signup']['allow'] !== true || !$auth->hasCapability('add')) {
    $notification->push(_("User Registration has been disabled for this site."), 'horde.error');
    $registry->getServiceLink('login')->redirect();
}
try {
    $signup = $injector->getInstance('Horde_Core_Auth_Signup');
} catch (Horde_Exception $e) {
    Horde::log($e, 'ERR');
    $notification->push(_("User Registration is not properly configured for this site."), 'horde.error');
    $registry->getServiceLink('login')->redirect();
}
$vars = $injector->getInstance('Horde_Variables');
$formsignup = new Horde_Core_Auth_Signup_Form($vars);
if ($formsignup->validate()) {
    $formsignup->getInfo($vars, $info);
    $error = $success_message = null;
    if ($info instanceof PEAR_Error) {
        $notification->push(sprintf(_("There was a problem adding \"%s\" to the system: %s"), $vars->get('user_name'), $info->getMessage()), 'horde.error');
    } else {
        if (!$conf['signup']['approve']) {
            /* User can sign up directly, no intervention necessary. */
            try {
                $signup->addSignup($info);
                $success_message = sprintf(_("Added \"%s\" to the system. You can log in now."), $info['user_name']);
            } catch (Horde_Exception $e) {
                $error = $e;
            }
        } elseif ($conf['signup']['approve']) {
            /* Insert this user into a queue for admin approval. */
            try {
All Usage Examples Of Horde_Core_Auth_Signup_Form::getInfo
Horde_Core_Auth_Signup_Form