Пример #1
0
$row = $dbh->getRow('SELECT * FROM users WHERE handle = ?', array($handle));
$cvs_acl_arr = $dbh->getCol('SELECT path FROM cvs_acl' . ' WHERE username = ? AND access = 1', 0, array($handle));
$cvs_acl = implode("\n", $cvs_acl_arr);
if ($row === null) {
    error_handler($handle . ' is not a valid account name.', 'Invalid Account');
}
$form = new HTML_Form(htmlspecialchars($_SERVER['SCRIPT_NAME'], ENT_QUOTES), 'post');
$form->addText('name', '<span class="accesskey">N</span>ame:', $row['name'], 40, null, 'accesskey="n"');
$form->addText('email', 'Email:', $row['email'], 40, null);
$form->addCheckbox('showemail', 'Show email address?', $row['showemail']);
$form->addText('homepage', 'Homepage:', $row['homepage'], 40, null);
$form->addText('wishlist', 'Wishlist URI:', $row['wishlist'], 40, null);
$form->addText('pgpkeyid', 'PGP Key ID:' . '<p class="cell_note">(Without leading 0x)</p>', $row['pgpkeyid'], 40, 20);
$form->addTextarea('userinfo', 'Additional User Information:' . '<p class="cell_note">(limited to 255 chars)</p>', $row['userinfo'], 40, 5, null);
$form->addTextarea('cvs_acl', 'SVN Access:', $cvs_acl, 40, 5, null);
$form->addSubmit('submit', 'Submit');
$form->addHidden('handle', $handle);
$form->addHidden('command', 'update');
$form->display('class="form-holder" style="margin-bottom: 2em;"' . ' cellspacing="1"', 'Edit Your Information', 'class="form-caption"');
print '<a name="password"></a>' . "\n";
print '<h2>&raquo; Manage your password</h2>' . "\n";
$form = new HTML_Form(htmlspecialchars($_SERVER['SCRIPT_NAME'], ENT_QUOTES), 'post');
$form->addPlaintext('<span class="accesskey">O</span>ld Password:'******'password_old', '', 40, 0, 'accesskey="o"'));
$form->addPassword('password', 'Password', '', 10, null);
$form->addCheckbox('PEAR_PERSIST', 'Remember username and password?', '');
$form->addSubmit('submit', 'Submit');
$form->addHidden('handle', $handle);
$form->addHidden('command', 'change_password');
$form->display('class="form-holder" cellspacing="1"', 'Change Password', 'class="form-caption"');
ob_end_flush();
response_footer();