]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-2978 Privacy Statements on signup.php; server validation used instead of client...
authorskodak <skodak>
Sat, 21 Apr 2007 19:47:20 +0000 (19:47 +0000)
committerskodak <skodak>
Sat, 21 Apr 2007 19:47:20 +0000 (19:47 +0000)
lang/en_utf8/moodle.php
login/signup_form.php

index c26b52b7fb6cd703754075a91e33a1d99298fd46..34db40ad16028d1611184fa58c4b089d453fbcf0 100644 (file)
@@ -1105,6 +1105,7 @@ $string['phone'] = 'Phone';
 $string['phpinfo'] = 'PHP info';
 $string['pleaseclose'] = 'Please close this window now.';
 $string['pluginsetup'] = 'Setting up plugin tables';
+$string['policyaccept'] = 'I understand and agree';
 $string['policyagree'] = 'You must agree to this policy to continue using this site.  Do you agree?';
 $string['policyagreement'] = 'Site Policy Agreement';
 $string['policyagreementclick'] = 'Click here to read the Site Policy Agreement';
index 85e31cd3f952646503aa7e9f6112105c927d2c39..e193fac686d3fd8af712f78ef847d0e0406f8b90 100644 (file)
@@ -13,41 +13,48 @@ class login_signup_form extends moodleform {
 
         $mform->addElement('text', 'username', get_string('username'), 'size="12"');
         $mform->setType('username', PARAM_NOTAGS);
-        $mform->addRule('username', get_string('missingusername'), 'required', null, 'client');
+        $mform->addRule('username', get_string('missingusername'), 'required', null, 'server');
 
         $mform->addElement('password', 'password', get_string('password'), 'size="12"');
         $mform->setType('password', PARAM_RAW);
-        $mform->addRule('password', get_string('missingpassword'), 'required', null, 'client');
+        $mform->addRule('password', get_string('missingpassword'), 'required', null, 'server');
 
         $mform->addElement('header', '', get_string('supplyinfo'),'');
 
         $mform->addElement('text', 'email', get_string('email'), 'size="25"');
         $mform->setType('email', PARAM_NOTAGS);
-        $mform->addRule('email', get_string('missingemail'), 'required', null, 'client');
+        $mform->addRule('email', get_string('missingemail'), 'required', null, 'server');
 
         $mform->addElement('text', 'email2', get_string('emailagain'), 'size="25"');
         $mform->setType('email2', PARAM_NOTAGS);
-        $mform->addRule('email2', get_string('missingemail'), 'required', null, 'client');
+        $mform->addRule('email2', get_string('missingemail'), 'required', null, 'server');
 
         $mform->addElement('text', 'firstname', get_string('firstname'), 'size="25"');
         $mform->setType('firstname', PARAM_TEXT);
-        $mform->addRule('firstname', get_string('missingfirstname'), 'required', null, 'client');
+        $mform->addRule('firstname', get_string('missingfirstname'), 'required', null, 'server');
 
         $mform->addElement('text', 'lastname', get_string('lastname'), 'size="25"');
         $mform->setType('lastname', PARAM_TEXT);
-        $mform->addRule('lastname', get_string('missinglastname'), 'required', null, 'client');
+        $mform->addRule('lastname', get_string('missinglastname'), 'required', null, 'server');
 
         $mform->addElement('text', 'city', get_string('city'), 'size="20"');
         $mform->setType('city', PARAM_TEXT);
-        $mform->addRule('city', get_string('missingcity'), 'required', null, 'client');
+        $mform->addRule('city', get_string('missingcity'), 'required', null, 'server');
 
         $country = get_list_of_countries();
         $default_country[''] = get_string('selectacountry');
         $country = array_merge($default_country, $country);
         $mform->addElement('select', 'country', get_string('country'), $country);
-        $mform->addRule('country', get_string('missingcountry'), 'required', null, 'client');
+        $mform->addRule('country', get_string('missingcountry'), 'required', null, 'server');
         $mform->setDefault('country', '');
 
+        if (!empty($CFG->sitepolicy)) {
+            $mform->addElement('header', '', get_string('policyagreement'), '');
+            $mform->addElement('static', 'policylink', '', '<a href="'.$CFG->sitepolicy.'" onclick="this.target=\'_blank\'">'.get_String('policyagreementclick').'</a>');
+            $mform->addElement('checkbox', 'policyagreed', get_string('policyaccept'));
+            $mform->addRule('policyagreed', get_string('policyagree'), 'required', null, 'server');
+        }
+
         // buttons
         $this->add_action_buttons(true, get_string('createaccount'));