]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/register.php
start conversation action
[quix0rs-gnu-social.git] / actions / register.php
index 159daaa737417b73229710b2db8cfbd0ace22f10..5c6fe39d3de3f90cd07375b6b67cf0ac313a1e40 100644 (file)
@@ -131,11 +131,13 @@ class RegisterAction extends Action
 
         $code = $this->trimmed('code');
 
+        $invite = null;
+
         if ($code) {
             $invite = Invitation::staticGet($code);
         }
 
-        if (common_config('site', 'inviteonly') && !($code && $invite)) {
+        if (common_config('site', 'inviteonly') && !($code && !empty($invite))) {
             $this->clientError(_('Sorry, only invited people can register.'));
             return;
         }
@@ -167,13 +169,13 @@ class RegisterAction extends Action
                                         array('http', 'https')))) {
             $this->showForm(_('Homepage is not a valid URL.'));
             return;
-        } else if (!is_null($fullname) && strlen($fullname) > 255) {
+        } else if (!is_null($fullname) && mb_strlen($fullname) > 255) {
             $this->showForm(_('Full name is too long (max 255 chars).'));
             return;
-        } else if (!is_null($bio) && strlen($bio) > 140) {
+        } else if (!is_null($bio) && mb_strlen($bio) > 140) {
             $this->showForm(_('Bio is too long (max 140 chars).'));
             return;
-        } else if (!is_null($location) && strlen($location) > 255) {
+        } else if (!is_null($location) && mb_strlen($location) > 255) {
             $this->showForm(_('Location is too long (max 255 chars).'));
             return;
         } else if (strlen($password) < 6) {
@@ -248,6 +250,25 @@ class RegisterAction extends Action
         return ($user !== false);
     }
 
+    // overrrided to add entry-title class
+    function showPageTitle() {
+        $this->element('h1', array('class' => 'entry-title'), $this->title());
+    }
+
+    // overrided to add hentry, and content-inner class
+    function showContentBlock()
+     {
+         $this->elementStart('div', array('id' => 'content', 'class' => 'hentry'));
+         $this->showPageTitle();
+         $this->showPageNoticeBlock();
+         $this->elementStart('div', array('id' => 'content_inner',
+             'class' => 'entry-content'));
+         // show the actual content (forms, lists, whatever)
+         $this->showContent();
+         $this->elementEnd('div');
+         $this->elementEnd('div');
+     }
+
     /**
      * Instructions or a notice for the page
      *
@@ -322,6 +343,8 @@ class RegisterAction extends Action
     {
         $code = $this->trimmed('code');
 
+        $invite = null;
+
         if ($code) {
             $invite = Invitation::staticGet($code);
         }
@@ -358,7 +381,7 @@ class RegisterAction extends Action
                         _('Same as password above. Required.'));
         $this->elementEnd('li');
         $this->elementStart('li');
-        if ($invite && $invite->address_type == 'email') {
+        if (!empty($invite) && $invite->address_type == 'email') {
             $this->input('email', _('Email'), $invite->address,
                          _('Used only for updates, announcements, '.
                            'and password recovery'));
@@ -407,11 +430,13 @@ class RegisterAction extends Action
         }
         $this->elementStart('li');
         $this->element('input', $attrs);
+        $this->elementStart('label', array('class' => 'checkbox', 'for' => 'license'));
         $this->text(_('My text and files are available under '));
         $this->element('a', array('href' => common_config('license', 'url')),
-                       $config['license']['title']);
+                       common_config('license', 'title'), _("Creative Commons Attribution 3.0"));
         $this->text(_(' except this private data: password, '.
-                      'email address, IM address, phone number.'));
+                      'email address, IM address, and phone number.'));
+        $this->elementEnd('label');
         $this->elementEnd('li');
         $this->elementEnd('ul');
         $this->submit('submit', _('Register'));