[horde] Re: Adding Users

Neal Timm neal.timm at trillion.net
Wed Mar 2 11:06:28 PST 2005


Yea I saw that but I am not much a php coder  I added some custom fields
but don't know how to get the imput read from the form data.  Below is
what I have.  I also want to pass a few variables that the user won't
input such as home directory which is created with user and domain + a
couple default vaulues.  I am in a virtual domain enviorment.


$vars = &Variables::getDefaultVariables();
$addForm = &new Horde_Form($vars, _("Add a new user:"), 'adduser');
$addForm->setButtons(_("Add user"), _("Reset"));

$vars->set('form', 'add');
$addForm->addHidden('', 'form', 'text', true, true);
$addForm->addVariable(_("Username"), 'user_name', 'text', true);
$addForm->addVariable(_("Domain"), 'Domain', 'text', true, false,
_("Login will be username at domain"));
$addForm->addVariable(_("Password"), 'password', 'passwordconfirm',
true, false, _("Type the password twice to confirm."));
$addForm->addVariable(_("Full Name"), 'full_name', 'text', false);
$addForm->addVariable(_("Quota"), 'quota', 'text', true true _("Setting
to 0 is unlimited otherwise number is amount in MB"));

/* Use hooks get any extra fields for new accounts. */
$extra = Horde::callHook('_horde_hook_signup_getextra');
if (!is_a($extra, 'PEAR_Error') && !empty($extra)) {
    foreach ($extra as $field_name => $field) {
        $readonly = isset($field['readonly']) ? $field['readonly'] :
null;
        $desc = isset($field['desc']) ? $field['desc'] : null;
        $field_params = isset($field['params']) ? $field['params'] :
array();

        $addForm->addVariable($field['label'], 'extra[' . $Domain . ']',
$field['type'], $field['required'], $readonly, $desc, $field_params);
        $addForm->addVariable($field['label'], 'extra[' . $full_name .
']', $field['type'], $field['required'], $readonly, $desc,
$field_params);
    }
}
Subject: [horde] Re: Adding Users

Zitat von Neal Timm <neal.timm at trillion.net>:

> I am using horde 3.x and is working fine.  The one thing I would like
to
> do is add a few extra fields on the administration users page for when
> adding a user cause I need to more values put into a custom user data
> base such as Maildir location and domain.  I have added a few more
text

You can do that with the _horde_hook_signup_getextra and 
_horde_hook_signup_addextra hooks.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/
-- 
Horde mailing list - Join the hunt: http://horde.org/bounties/#horde
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: horde-unsubscribe at lists.horde.org


More information about the horde mailing list