]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/invite.php
Fixes minor remote subscription profile layout
[quix0rs-gnu-social.git] / actions / invite.php
index a51a4044923ca943f26df6b990a3107e82358e52..d0ed64ec9079449ec3d9013973aab5e912257a6b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
- * StatusNet - a distributed open-source microblogging tool
+ * StatusNet - the distributed open-source microblogging tool
  * Copyright (C) 2008, 2009, StatusNet, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
@@ -17,7 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('LACONICA')) { exit(1); }
+if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
 
 class InviteAction extends CurrentUserDesignAction
 {
@@ -68,7 +68,7 @@ class InviteAction extends CurrentUserDesignAction
 
         foreach ($addresses as $email) {
             $email = trim($email);
-            if (!Validate::email($email, true)) {
+            if (!Validate::email($email, common_config('email', 'check_domain'))) {
                 $this->showForm(sprintf(_('Invalid email address: %s'), $email));
                 return;
             }
@@ -98,6 +98,12 @@ class InviteAction extends CurrentUserDesignAction
         $this->showPage();
     }
 
+    function showScripts()
+    {
+        parent::showScripts();
+        $this->autofocus('addresses');
+    }
+
     function title()
     {
         if ($this->mode == 'sent') {
@@ -122,7 +128,7 @@ class InviteAction extends CurrentUserDesignAction
             $this->element('p', null, _('You are already subscribed to these users:'));
             $this->elementStart('ul');
             foreach ($this->already as $other) {
-                $this->element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email));
+                $this->element('li', null, sprintf(_('%1$s (%2$s)'), $other->nickname, $other->email));
             }
             $this->elementEnd('ul');
         }
@@ -130,7 +136,7 @@ class InviteAction extends CurrentUserDesignAction
             $this->element('p', null, _('These people are already users and you were automatically subscribed to them:'));
             $this->elementStart('ul');
             foreach ($this->subbed as $other) {
-                $this->element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email));
+                $this->element('li', null, sprintf(_('%1$s (%2$s)'), $other->nickname, $other->email));
             }
             $this->elementEnd('ul');
         }
@@ -235,7 +241,7 @@ class InviteAction extends CurrentUserDesignAction
                         common_root_url(),
                         $personal,
                         common_local_url('showstream', array('nickname' => $user->nickname)),
-                        common_local_url((!common_config('site', 'openidonly')) ? 'register' : 'openidlogin', array('code' => $invite->code)));
+                        common_local_url('register', array('code' => $invite->code)));
 
         mail_send($recipients, $headers, $body);
     }