UI for setting the join policy is in, but not yet used.
$description = $this->trimmed('description');
$location = $this->trimmed('location');
$aliasstring = $this->trimmed('aliases');
+ $join_policy = intval($this->arg('join_policy'));
if ($this->nicknameExists($nickname)) {
// TRANS: Group edit form validation error.
$this->group->description = $description;
$this->group->location = $location;
$this->group->mainpage = common_local_url('showgroup', array('nickname' => $nickname));
+ $this->group->join_policy = $join_policy;
$result = $this->group->update($orig);
$description = $this->trimmed('description');
$location = $this->trimmed('location');
$aliasstring = $this->trimmed('aliases');
+ $join_policy = intval($this->arg('join_policy'));
if ($this->nicknameExists($nickname)) {
// TRANS: Group create form validation error.
'location' => $location,
'aliases' => $aliases,
'userid' => $cur->id,
+ 'join_policy' => $join_policy,
'local' => true));
$this->group = $group;
--- /dev/null
+<?php
+/**
+ * Table Definition for request_queue
+ */
+require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
+
+class Request_queue extends Managed_DataObject
+{
+ ###START_AUTOCODE
+ /* the code below is auto generated do not remove the above tag */
+
+ public $__table = 'request_queue'; // table name
+ public $subscriber;
+ public $subscribed;
+ public $group_id;
+ public $created;
+
+ /* Static get */
+ function staticGet($k,$v=null)
+ { return Memcached_DataObject::staticGet('Confirm_address',$k,$v); }
+
+ /* the code above is auto generated do not remove the tag below */
+ ###END_AUTOCODE
+
+ public static function schemaDef()
+ {
+ return array(
+ 'description' => 'Holder for subscription & group join requests awaiting moderation.',
+ 'fields' => array(
+ 'subscriber' => array('type' => 'int', 'not null' => true, 'description' => 'remote or local profile making the request'),
+ 'subscribed' => array('type' => 'int', 'description' => 'remote or local profile to subscribe to, if any'),
+ 'group_id' => array('type' => 'int', 'description' => 'remote or local group to join, if any'),
+ 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
+ ),
+ 'unique key' => array(
+ 'request_queue_subscriber_subscribed_group_id' => array('subscriber', 'subscribed', 'group_id'),
+ ),
+ 'indexes' => array(
+ 'request_queue_subscriber_created_idx' => array('subscriber', 'created'),
+ 'request_queue_subscribed_created_idx' => array('subscriber', 'created'),
+ 'request_queue_group_id_created_idx' => array('group_id', 'created'),
+ ),
+ 'foreign keys' => array(
+ 'request_queue_subscriber_fkey' => array('profile', array('subscriber' => 'id')),
+ 'request_queue_subscribed_fkey' => array('profile', array('subscribed' => 'id')),
+ 'request_queue_group_id_fkey' => array('user_group', array('group_id' => 'id')),
+ )
+ );
+ }
+}
public $modified; // timestamp not_null default_CURRENT_TIMESTAMP
public $uri; // varchar(255) unique_key
public $mainpage; // varchar(255)
+ public $join_policy; // tinyint
/* Static get */
function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('User_group',$k,$v); }
$group->uri = $uri;
$group->mainpage = $mainpage;
$group->created = common_sql_now();
+ if (isset($fields['join_policy'])) {
+ $group->join_policy = intval($fields['join_policy']);
+ } else {
+ $group->join_policy = 0;
+ }
if (Event::handle('StartGroupSave', array(&$group))) {
modified = 384
uri = 2
mainpage = 2
+join_policy = 1
[user_group__keys]
id = N
'uri' => array('type' => 'varchar', 'length' => 255, 'description' => 'universal identifier'),
'mainpage' => array('type' => 'varchar', 'length' => 255, 'description' => 'page for group info to link to'),
+ 'join_policy' => array('type' => 'int', 'size' => 'tiny', 'description' => '0=open; 1=requires admin approval'),
),
'primary key' => array('id'),
'unique keys' => array(
),
'primary key' => array('table_name'),
);
+
+$schema['request_queue'] = Request_queue::schemaDef();
common_config('group', 'maxaliases')));;
$this->out->elementEnd('li');
}
+ $this->out->elementStart('li');
+ $this->out->dropdown('join_policy',
+ _('Membership policy'),
+ array(0 => _('Open to all'),
+ 1 => _('Admin must approve all members')),
+ _('Whether admin approval is required to join this group.'),
+ false,
+ (empty($this->group->join_policy)) ? 0 : $this->group->join_policy);
+ $this->out->elementEnd('li');
Event::handle('EndGroupEditFormData', array($this));
}
$this->out->elementEnd('ul');