Patch and access

From: Date: Sun, 20 Nov 2005 18:05:01 +0000
Subject: Patch and access
Groups: php.pear.webmaster 
Request: Send a blank email to pear-webmaster+get-4623@lists.php.net to get a copy of this message
Hello pear-webmaster, You were so anxious to handle my nthkb errata in user info that simply forgot to correctly handle the situation around it. =) Can I ask for an access to pearweb to install my pile attached and support fainting pearweb support? =) -- anatoly

--- account-edit_old.php Sun Nov 20 18:15:04 2005 +++ account-edit.php Sun Nov 20 19:42:08 2005 @@ -24,6 +24,13 @@ define('HTML_FORM_TD_ATTR', 'class="form-input"'); require_once 'HTML/Form.php'; + +/** local account editing script options */ + +/** chars user allowed to enter into user information field */ +define('PEARWEB_USER_INFO_LIMIT', 512); + + if (isset($_GET['handle'])) { $handle = $_GET['handle']; } elseif (isset($_POST['handle'])) { @@ -82,8 +89,10 @@ $user_data_post[$k] = htmlspecialchars($_POST[$k]); - if ($k == 'userinfo' && strlen($user_data_post[$k]) > 500) { - report_error('User information exceeds the allowed length of 500 characters.'); + if ($k == 'userinfo' && strlen($user_data_post[$k]) > PEARWEB_USER_INFO_LIMIT) { + report_error('User information exceeds the allowed length of ' + .PEARWEB_USER_INFO_LIMIT + .' characters.'); response_footer(); exit(); } @@ -170,6 +179,9 @@ } +/** display form for user information edit */ +/** add some optional dynamics to handle limitations around "user_info_limit" span */ + $form = new HTML_Form(htmlspecialchars($_SERVER['SCRIPT_NAME']), 'post'); $form->addText('name', '<span class="accesskey">N</span>ame:', @@ -185,10 +197,16 @@ $form->addText('pgpkeyid', 'PGP Key ID:' . '<p class="cell_note">(Without leading 0x)</p>', $row['pgpkeyid'], 40, 20); +/** add dhtml around "user_info_limit" span in next element to handle user info limitations */ $form->addTextarea('userinfo', 'Additional User Information:' - . '<p class="cell_note">(limited to 255 chars)</p>', - $row['userinfo'], 40, 5, null); + . '<p class="cell_note">' + . '(limited to <span id="user_info_limit">'.PEARWEB_USER_INFO_LIMIT.'</span> chars)' + . '</p>', + $row['userinfo'], 40, 5, PEARWEB_USER_INFO_LIMIT, + 'id="userinfo" '. + . 'onkeyup="document.getElementById(\'user_info_limit\').innerHTML = '.PEARWEB_USER_INFO_LIMIT.' - this.value.length; + document.getElementById(\'user_info_limit\').style.color = ('.PEARWEB_USER_INFO_LIMIT.' - this.value.length < 0) ? \'darkred\' : \'\'"'); $form->addTextarea('cvs_acl', 'CVS Access:', $cvs_acl, 40, 5, null);
« previous php.pear.webmaster (#4623) next »