~quam-plures-core/quam-plures/file_manager_limits

« back to all changes in this revision

Viewing changes to qp_inc/antispam/views/_distribute.view.php

  • Committer: EdB
  • Date: 2013-03-04 07:15:41 UTC
  • mfrom: (7655.1.3 qp5_antispam)
  • Revision ID: 1912webworks@gmail.com-20130304071541-x462crs4d531rh69
http://forums.quamplures.net/viewtopic.php?f=6&t=1887

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * This file implements the UI controller for the antispam management
 
4
 *
 
5
 * @author {@link http://wonderwinds.com/ Ed Bennett}
 
6
 * @copyright (c) 2013 by {@link http://quamplures.net/ the Quam Plures project}
 
7
 * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3
 
8
 * @package antispam
 
9
 */
 
10
if(!defined('QP_MAIN_INIT')) die('fail');
 
11
 
 
12
echo '<h2>'.T_('Distributed Antispam').'</h2>';
 
13
 
 
14
// get out if this user is not in the admin group
 
15
if( ! $current_User->group_ID == 1 )
 
16
{
 
17
        return;
 
18
}
 
19
 
 
20
// get out if this user is not allowed to edit the blacklist
 
21
if( ! $current_User->check_perm( 'spamblacklist', 'edit' ) )
 
22
{
 
23
        return; 
 
24
}
 
25
 
 
26
// inbound params tell us if we are being invited
 
27
$cell_baseurl = param( 'cell_baseurl', 'string', '' );
 
28
$cell_user_id = param( 'cell_user_id', 'integer', '' );
 
29
$cell_email = param( 'cell_email', 'string', '' );
 
30
$cell_name = param( 'cell_name', 'string', '' );
 
31
$cell_msg = param( 'cell_msg', 'string', '' );
 
32
$cell_nonce = param( 'cell_nonce', 'string', '' );
 
33
 
 
34
/*
 
35
<p>This page becomes a form that gets sent to another Quam Plures installation via a file that 
 
36
doesn't exist yet. Something like /qp_srvc/cell_join.php I guess. Kinda like how message form 
 
37
works only it doesn't go to an email addy. Probably should be XMLRPC stuff but whatever. An 
 
38
invite to join a cell sends a bunch of info:
 
39
<pre>$app_baseurl
 
40
the sender's User ID#
 
41
the sender's email addy
 
42
the sender's preferred name
 
43
a personal message
 
44
a nonce
 
45
</pre></p>
 
46
 
 
47
<p>Ah okay this is actually a pinger! So someone sends a ping to request joining a cell with 
 
48
the above info bits.  The recipient gets notified of a request to join IF they still have room 
 
49
in their cell.  Each installation has room for 4 but the installation is always the first. So 
 
50
3 more can join the cell.  If the recipient's cell is full then it automatically sends back a 
 
51
"sorry no deal" message. If not full and the admin decides to not play with that person then 
 
52
they send the same message: "sorry no deal".</p>
 
53
 
 
54
<p>If the recipient wants this new domain in their cell then they send back a "yes" with the info 
 
55
they recieved as a serialized array, and a new nonce. A spot in the recipient's cell is now 
 
56
reserved for some period of time.  The initial sender must still have room is the thing. If 
 
57
the sender still has room and gets the "yes" message then automagically another yes with the 
 
58
second nonce is sent back. And yay a cell is born.</p>
 
59
 
 
60
<pre>SO: joiner sends info-with-nonce to target.
 
61
target is full? reject message returned.
 
62
target says no? reject message returned.
 
63
target says yes? accept message plus new nonce returned.
 
64
joiner still has room? cell established.
 
65
joiner filled up already? cancel request sent.</pre>
 
66
*/
 
67
 
 
68
?>
 
69
<p>This is a place-holder for a future option that will allow multiple Quam Plures installations to share information about blocked domains.</p>