]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/invite.php
gc inboxes on a regular basis
[quix0rs-gnu-social.git] / actions / invite.php
index bb74d68e442ccef20f6577cff492905113a9c266..bdea4807d8a2f2ac0f7f8c1043d35c6d56d6595d 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
 
 if (!defined('LACONICA')) { exit(1); }
 
-class InviteAction extends Action
+class InviteAction extends CurrentUserDesignAction
 {
     var $mode = null;
+    var $error = null;
+    var $already = null;
+    var $subbed = null;
+    var $sent = null;
 
-    function isReadOnly()
+    function isReadOnly($args)
     {
         return false;
     }
@@ -31,7 +35,9 @@ class InviteAction extends Action
     function handle($args)
     {
         parent::handle($args);
-        if (!common_logged_in()) {
+        if (!common_config('invite', 'enabled')) {
+            $this->clientError(_('Invites have been disabled.'));
+        } else if (!common_logged_in()) {
             $this->clientError(sprintf(_('You must be logged in to invite other users to use %s'),
                                         common_config('site', 'name')));
             return;
@@ -163,20 +169,27 @@ class InviteAction extends Action
     function showInviteForm()
     {
         $this->elementStart('form', array('method' => 'post',
-                                           'id' => 'invite',
+                                           'id' => 'form_invite',
+                                           'class' => 'form_settings',
                                            'action' => common_local_url('invite')));
+        $this->elementStart('fieldset');
+        $this->element('legend', null, 'Send an invitation');
         $this->hidden('token', common_session_token());
 
+        $this->elementStart('ul', 'form_data');
+        $this->elementStart('li');
         $this->textarea('addresses', _('Email addresses'),
                         $this->trimmed('addresses'),
                         _('Addresses of friends to invite (one per line)'));
-
+        $this->elementEnd('li');
+        $this->elementStart('li');
         $this->textarea('personal', _('Personal message'),
                         $this->trimmed('personal'),
                         _('Optionally add a personal message to the invitation.'));
-
+        $this->elementEnd('li');
+        $this->elementEnd('ul');
         $this->submit('send', _('Send'));
-
+        $this->elementEnd('fieldset');
         $this->elementEnd('form');
     }