Example #1
0
 /**
  * Standard stage of pointstore item purchase.
  *
  * @return tempcode		The UI
  */
 function newpop3()
 {
     if (get_option('is_on_pop3_buy') == '0') {
         return new ocp_tempcode();
     }
     $title = get_page_title('TITLE_NEWPOP3');
     pointstore_handle_error_already_has('pop3');
     // What addresses are there?
     $member_id = get_member();
     $pointsleft = available_points($member_id);
     // the number of points this member has left
     $list = get_mail_domains('pop3_', $pointsleft);
     if ($list->is_empty()) {
         return warn_screen($title, do_lang_tempcode('NO_POP3S'));
     }
     // Build up fields
     $fields = new ocp_tempcode();
     require_code('form_templates');
     $fields->attach(form_input_line(do_lang_tempcode('ADDRESS_DESIRED_STUB'), '', 'email-prefix', $GLOBALS['FORUM_DRIVER']->get_username(get_member()), true));
     $fields->attach(form_input_list(do_lang_tempcode('ADDRESS_DESIRED_DOMAIN'), '', 'esuffix', $list));
     $fields->attach(form_input_password(do_lang_tempcode('PASSWORD'), '', 'pass1', true));
     $fields->attach(form_input_password(do_lang_tempcode('CONFIRM_PASSWORD'), '', 'pass2', true));
     $javascript = "\n\t\t\tvar form=document.getElementById('pass1').form;\n\t\t\tform.old_submit=form.onsubmit;\n\t\t\tform.onsubmit=function()\n\t\t\t\t{\n\t\t\t\t\tif ((form.elements['pass1'].value!=form.elements['pass2'].value))\n\t\t\t\t\t{\n\t\t\t\t\t\twindow.fauxmodal_alert('" . php_addslashes(do_lang('PASSWORD_MISMATCH')) . "');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof form.old_submit!='undefined' && form.old_submit) return form.old_submit();\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\t\t";
     // Return template
     $newpop_url = build_url(array('page' => '_SELF', 'type' => '_newpop3', 'id' => 'pop3'), '_SELF');
     return do_template('FORM_SCREEN', array('_GUID' => 'addf1563770845ba5fe4aaf2e60ca6fc', 'JAVASCRIPT' => $javascript, 'HIDDEN' => '', 'TITLE' => $title, 'TEXT' => paragraph(do_lang_tempcode('ADDRESSES_ABOUT')), 'URL' => $newpop_url, 'SUBMIT_NAME' => do_lang_tempcode('PURCHASE'), 'FIELDS' => $fields));
 }
Example #2
0
 /**
  * Standard stage of pointstore item purchase.
  *
  * @return tempcode		The UI
  */
 function newforwarding()
 {
     if (get_option('is_on_forw_buy') == '0') {
         return new ocp_tempcode();
     }
     $title = get_page_title('TITLE_NEWFORWARDING');
     $member_id = get_member();
     pointstore_handle_error_already_has('forwarding');
     // What addresses are there?
     $pointsleft = available_points($member_id);
     // the number of points this member has left
     $list = get_mail_domains('forw_', $pointsleft);
     if ($list->is_empty()) {
         return warn_screen($title, do_lang_tempcode('NO_FORWARDINGS'));
     }
     // Build up fields
     $fields = new ocp_tempcode();
     require_code('form_templates');
     $fields->attach(form_input_line(do_lang_tempcode('ADDRESS_DESIRED_STUB'), '', 'email-prefix', '', true));
     $fields->attach(form_input_list(do_lang_tempcode('ADDRESS_DESIRED_DOMAIN'), '', 'esuffix', $list));
     $fields->attach(form_input_line(do_lang_tempcode('ADDRESS_CURRENT'), '', 'email', $GLOBALS['FORUM_DRIVER']->get_member_email_address($member_id), true));
     // Return template
     $newfor_url = build_url(array('page' => '_SELF', 'type' => '_newforwarding', 'id' => 'forwarding'), '_SELF');
     return do_template('FORM_SCREEN', array('_GUID' => '1fcc6083db18c996fabb51d0ac10bc88', 'HIDDEN' => '', 'TITLE' => $title, 'ACTION' => do_lang_tempcode('TITLE_NEWFORWARDING'), 'TEXT' => paragraph(do_lang_tempcode('ADDRESSES_ABOUT')), 'URL' => $newfor_url, 'SUBMIT_NAME' => do_lang_tempcode('PURCHASE'), 'FIELDS' => $fields));
 }