]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/register.php
better page numbers
[quix0rs-gnu-social.git] / actions / register.php
index c67235f9d8d8d2e618a67764f54e459c15ca5376..d2e54b634596e8ecf3f5077910fafbba65c32d60 100644 (file)
@@ -47,7 +47,9 @@ class RegisterAction extends Action {
                $nickname = common_canonical_nickname($nickname);
                $email = common_canonical_email($email);
 
-               if (!Validate::email($email, true)) {
+               if (!$this->boolean('license')) {
+                       $this->show_form(_t('You can\'t register if you don\'t agree to the license.'));
+               } else if (!Validate::email($email, true)) {
                        $this->show_form(_t('Not a valid email address.'));
                } else if (!Validate::string($nickname, array('min_length' => 1,
                                                                                                          'max_length' => 64,
@@ -103,7 +105,8 @@ class RegisterAction extends Action {
                $user->password = common_munge_password($password, $id);
                $user->email = $email;
                $user->created =  DB_DataObject_Cast::dateTime(); # current time
-
+               $user->uri = common_mint_tag('user:'.$id);
+               
                $result = $user->insert();
                if (!$result) {
                        # Try to clean up...
@@ -113,8 +116,12 @@ class RegisterAction extends Action {
        }
 
        function show_form($error=NULL) {
+               global $config;
 
                common_show_header(_t('Register'));
+               if ($error) {
+                       common_element('div', 'error', $error);
+               }
                common_element_start('form', array('method' => 'POST',
                                                                                   'id' => 'login',
                                                                                   'action' => common_local_url('register')));
@@ -122,6 +129,16 @@ class RegisterAction extends Action {
                common_password('password', _t('Password'));
                common_password('confirm', _t('Confirm'));
                common_input('email', _t('Email'));
+               common_element_start('p');
+               common_element('input', array('type' => 'checkbox',
+                                                                         'id' => 'license',
+                                                                         'name' => 'license',
+                                                                         'value' => 'true'));
+               common_text(_t('My text and files are available under '));
+               common_element('a', array(href => $config['license']['url']),
+                                          $config['license']['title']);
+               common_text(_t(' except this private data: password, email address, IM address, phone number.'));
+               common_element_end('p');
                common_submit('submit', _t('Register'));
                common_element_end('form');
                common_show_footer();