Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / adding radio buttons to login page/restricting login

adding radio buttons to login page/restricting login

Locked

Views: 2,283

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
26 Mar 2007, 9:16 PM
#1
jaxbakers avatar

jaxbakers

New Zenner

Join Date:
Mar 2006
Location:
Jacksonville Fl
Posts:
73
Plugin Contributions:
0

adding radio buttons to login page/restricting login

I have looked all through the forums and do not see an answer for my question. My customer is using the cart to sell services some of which are very sensitive; his lawyers want customers to be required to agree to site terms at login or not be able to log in.

I wanted to use radio buttons for the I Agree/Don't Agree choice but
a) don't see anything to explain how to use radio buttons (I found the function function zen_draw_radio_field($name, $value = '', $checked = false, $parameters = '') {
return zen_draw_selection_field($name, 'radio', $value, $checked, $parameters);
}) on the html_output.php file is this it? If so, what would the parameters be?
b) not sure how to set this up to communicate with the database and to what table(s) I need to add fields.
c) don't know where the login function is to add the restriction

Any help would be greatly appreciated.

26 Mar 2007, 9:25 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,650
Plugin Contributions:
0

Re: adding radio buttons to login page/restricting login

Admin> Configuration> Regulations - Enable the checkbox

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

26 Mar 2007, 9:35 PM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: adding radio buttons to login page/restricting login

I'm not a laywer, but does this have to be every time one logs in?? Or is it sufficient to state that by creating an account that you agree to the terms only once? and then on subsequent logins not be bothered with this.

In example: MS requires acceptance of their EULA whether you actually read it or not once and not on every use of their products.

You can look at a couple of modules for adding things to the signup and while not specifically for terms agreement the text can be altered

Like Confirm Email Address Entry module and/or the captcha module and glean the concept of adding additional requirements

OPPS! Kim states that this is in the admin - live and learn

Zen-Venom Get Bitten

27 Mar 2007, 10:06 AM
#4
jaxbakers avatar

jaxbakers

New Zenner

Join Date:
Mar 2006
Location:
Jacksonville Fl
Posts:
73
Plugin Contributions:
0

Re: adding radio buttons to login page/restricting login

Kim, actually, that has to do with the create account screen and not the login.

The header.php file for the modules/pages/login/ has commented out code to work with the privacy policy requirement but there is no corresponding code in the tpl_login_default.php file and my poor attempts at adding a checkbox to allow it to work have failed. I can login whether the checkbox is checked or not.

I agree that having to do this every time is crazy but that is the requirement I have to work with.

27 Mar 2007, 2:21 PM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: adding radio buttons to login page/restricting login

  /* Privacy-policy-read does not need to be checked during "login"
  if (DISPLAY_PRIVACY_CONDITIONS == 'true') {
  if (!isset($_POST['privacy_conditions']) || ($_POST['privacy_conditions'] != '1')) {
  $error = true;
  $messageStack->add('create_account', ERROR_PRIVACY_STATEMENT_NOT_ACCEPTED, 'error');

I think that this states what I have highlighted and you will have to add a conditional to test for a checked box or radio from the page.

add the draw button in the tpl file and check it with the js

Look at the modules/pages/login/jscript_form_check.php for this:

function check_radio(field_name, message) {
  var isChecked = false;

  if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
    var radio = form.elements[field_name];

    for (var i=0; i<radio.length; i++) {
      if (radio[i].checked == true) {
        isChecked = true;
        break;
      }
    }

    if (isChecked == false) {
      error_message = error_message + "* " + message + "\n";
      error = true;
    }

A new name added (grep for the file location where the above exists) add new name in those places and then similar code as above added to check if checked or not and associated error message...

Zen-Venom Get Bitten