$section = new Form_Section('User Properties'); $section->addInput(new Form_StaticText('Defined by', strtoupper($pconfig['utype']))); $form->addGlobal(new Form_Input('utype', null, 'hidden', $pconfig['utype'])); $section->addInput(new Form_Checkbox('disabled', 'Disabled', 'This user cannot login', $pconfig['disabled'])); $section->addInput($input = new Form_Input('usernamefld', 'Username', 'text', $pconfig['usernamefld'])); if ($ro) { $input->setReadonly(); } $form->addGlobal(new Form_Input('oldusername', null, 'hidden', $pconfig['usernamefld'])); $group = new Form_Group('Password'); $group->add(new Form_Input('passwordfld1', 'Password', 'password')); $group->add(new Form_Input('passwordfld2', 'Confirm Password', 'password')); $section->add($group); $section->addInput($input = new Form_Input('descr', 'Full name', 'text', htmlspecialchars($pconfig['descr'])))->setHelp('User\'s full name, for your own information only'); if ($ro) { $input->setDisabled(); } $section->addInput(new Form_Input('expires', 'Expiration date', 'date', $pconfig['expires']))->setHelp('Leave blank if the account shouldn\'t expire, otherwise enter ' . 'the expiration date'); // ==== Group membership ================================================== $group = new Form_Group('Group membership'); // Make a list of all the groups configured on the system, and a list of // those which this user is a member of $systemGroups = array(); $usersGroups = array(); $usergid = [$pconfig['usernamefld']]; foreach ($config['system']['group'] as $Ggroup) { if ($Ggroup['name'] != "all") { if ($act == 'edit' && $Ggroup['member'] && in_array($pconfig['uid'], $Ggroup['member'])) { $usersGroups[$Ggroup['name']] = $Ggroup['name']; // Add it to the user's list } else {