$user = $log_in_manager->get_user();
     $name_input->set_attribute_str('value', $user->get_first_name());
 }
 $comment_adding_form->add_input_tag('', $name_input, 'Name');
 /*
  * email input
  */
 if ($log_in_manager->is_logged_in()) {
     $user = $log_in_manager->get_user();
     $email_input = new HTMLTags_Input();
     $email_input->set_attribute_str('type', 'hidden');
     $email_input->set_attribute_str('name', 'email');
     $email_input->set_attribute_str('value', $user->get_email_address());
     $comment_adding_form->add_input_tag('', $email_input);
 } else {
     $comment_adding_form->add_input_name('email');
 }
 /*
  * The comment input.
  */
 $comment_field = $comments_table->get_field('comment');
 $comment_field_renderer = $comment_field->get_renderer();
 $comment_input_tag = $comment_field_renderer->get_form_input();
 $comment_adding_form->add_input_tag('comment', $comment_input_tag);
 /*
  * Hidden product_id input
  */
 $product_id_input = new HTMLTags_Input();
 $product_id_input->set_attribute_str('type', 'hidden');
 $product_id_input->set_attribute_str('name', 'product_id');
 $product_id_input->set_attribute_str('value', $_GET['product_id']);
 public function get_password_reset_form(HTMLTags_URL $form_location, HTMLTags_URL $redirect_script_location, HTMLTags_URL $desired_location, HTMLTags_URL $cancel_page_location)
 {
     $password_reset_form = new HTMLTags_SimpleOLForm('create_new_account');
     $password_reset_form->set_attribute_str('id', $this->get_password_reset_form_id());
     $password_reset_form->set_attribute_str('class', $this->get_password_reset_form_css_class());
     $svm = Caching_SessionVarManager::get_instance();
     /*
      * The action.
      */
     $password_reset_script_location = clone $redirect_script_location;
     $password_reset_script_location->set_get_variable('password_reset');
     $password_reset_script_location->set_get_variable('desired_location', urlencode($desired_location->get_as_string()));
     $password_reset_script_location->set_get_variable('form_location', urlencode($form_location->get_as_string()));
     $password_reset_form->set_action($password_reset_script_location);
     $password_reset_form->set_legend_text('Reset Password');
     /*
      * The input tags.
      */
     if ($svm->is_set('password-reset: email')) {
         $password_reset_form->add_input_name_with_value('email', $svm->get('password-reset: email'));
     } else {
         if ($this->is_logged_in()) {
             $password_reset_form->add_input_name_with_value('email', $this->get_name());
         } else {
             $password_reset_form->add_input_name('email');
         }
     }
     /*
      * The submit button.
      */
     $password_reset_form->set_submit_text('Reset');
     /*
      * The cancel button
      */
     $cancel_location = clone $redirect_script_location;
     $cancel_location->set_get_variable('cancel');
     $cancel_location->set_get_variable('cancel_page_location', urlencode($cancel_page_location->get_as_string()));
     $password_reset_form->set_cancel_location($cancel_location);
     return $password_reset_form;
 }
 public function get_add_new_user_form()
 {
     $add_new_user_form = new HTMLTags_SimpleOLForm('add_new_user');
     $redirect_script = Admin_AdminIncluderURLFactory::get_url('haddock', 'admin', 'manage-users', 'redirect-script');
     $action_href = clone $redirect_script;
     $action_href->set_get_variable('add-new-user');
     $add_new_user_form->set_action($action_href);
     $add_new_user_form->set_legend_text('Add new user');
     /*
      * The user's name
      */
     $svm = Caching_SessionVarManager::get_instance();
     if ($svm->is_set('manage-users-form: name')) {
         $add_new_user_form->add_input_name_with_value('name', $svm->get('manage-users-form: name'));
     } else {
         $add_new_user_form->add_input_name('name');
     }
     /*
      * The user's password.
      */
     $password_input = new HTMLTags_Input();
     $password_input->set_attribute_str('type', 'password');
     $password_input->set_attribute_str('id', 'password');
     $password_input->set_attribute_str('name', 'password');
     $add_new_user_form->add_input_tag('password', $password_input);
     $password_confirm_input = new HTMLTags_Input();
     $password_confirm_input->set_attribute_str('type', 'password');
     $password_confirm_input->set_attribute_str('id', 'confirm_password');
     $password_confirm_input->set_attribute_str('name', 'confirm_password');
     $add_new_user_form->add_input_tag('confirm_password', $password_confirm_input);
     /*
      * The type of admin user.
      */
     $login_manager = Admin_LoginManager::get_instance();
     $user_types = $login_manager->get_user_types();
     $user_types_select = HTMLTags_SelectFactory::make_select_for_str_array($user_types);
     $user_types_select->set_attribute_str('id', 'type');
     $user_types_select->set_attribute_str('name', 'type');
     if ($svm->is_set('manage-users-form: type')) {
         $user_types_select->set_value($svm->get('manage-users-form: type'));
     }
     $add_new_user_form->add_input_tag('type', $user_types_select);
     /*
      * The user's real name
      */
     if ($svm->is_set('manage-users-form: real_name')) {
         $add_new_user_form->add_input_name_with_value('real_name', $svm->get('manage-users-form: real_name'));
     } else {
         $add_new_user_form->add_input_name('real_name');
     }
     /*
      * The user's email
      */
     if ($svm->is_set('manage-users-form: email')) {
         $add_new_user_form->add_input_name_with_value('email', $svm->get('manage-users-form: email'));
     } else {
         $add_new_user_form->add_input_name('email');
     }
     $add_new_user_form->set_submit_text('Add');
     $cancel_href = clone $redirect_script;
     $cancel_href->set_get_variable('cancel');
     $add_new_user_form->set_cancel_location($cancel_href);
     return $add_new_user_form;
 }
 public function get_login_form_div($name = NULL)
 {
     $login_form_div = new HTMLTags_Div();
     $login_form = new HTMLTags_SimpleOLForm('login');
     $login_form->set_attribute_str('class', $this->get_login_form_css_class());
     $login_form->set_attribute_str('id', $this->get_login_form_id());
     $login_form->set_action($this->get_login_script_url());
     $login_form->set_legend_text($this->get_login_form_legend_text());
     if ($name == NULL) {
         $login_form->add_input_name($this->get_login_name_field_name());
     } else {
         $login_form->add_input_name_with_value($this->get_login_name_field_name(), $name);
     }
     $password_input = new HTMLTags_Input();
     $password_input->set_attribute_str('name', 'password');
     $password_input->set_attribute_str('type', 'password');
     $login_form->add_input_tag('password', $password_input);
     $login_form->set_submit_text('Login');
     $login_form->set_cancel_location($this->get_login_cancel_url());
     $login_form_div->append_tag_to_content($login_form);
     return $login_form_div;
 }
 * The Password Generator Page.
 *
 * @copyright Clear Line Web Design, 2007-01-26
 */
require_once PROJECT_ROOT . '/haddock/html-tags/classes/' . 'HTMLTags_URL.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_Div.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_P.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_Pre.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/extensions/' . 'HTMLTags_SimpleOLForm.inc.php';
require_once PROJECT_ROOT . '/haddock/security/classes/' . 'Security_PasswordGenerator.inc.php';
$content_div = new HTMLTags_Div();
$content_div->set_attribute_str('id', 'content');
if (isset($_GET['length'])) {
    $password_p = new HTMLTags_P();
    $password_p->append_str_to_content('The password: '******'length'])));
    $content_div->append_tag_to_content($password_p);
} else {
    $password_details_form = new HTMLTags_SimpleOLForm('password_details', 'GET');
    $action_url = new HTMLTags_URL('/admin/index.php');
    $password_details_form->set_action($action_url);
    $password_details_form->set_legend_text('Password Details');
    $password_details_form->add_input_name('length');
    $password_details_form->add_hidden_input('module', 'security');
    $password_details_form->add_hidden_input('page', 'password-generator');
    $password_details_form->set_submit_text('Go');
    $password_details_form->set_cancel_location(new HTMLTags_URL('/admin/security/home.html'));
    $content_div->append_tag_to_content($password_details_form);
}
echo $content_div->get_as_string();