Add a site access policy (to determine if this is really a public site or just an open site) and add an orphan flag to xchans in case all their hublocs go away. Get rid of a couple of DO NOT EDIT template messages which were still lurking in the tree.

This commit is contained in:
friendica 2013-08-06 17:15:41 -07:00
parent 687ea0ca24
commit 99bd0712b6
7 changed files with 42 additions and 15 deletions

View File

@ -140,6 +140,16 @@ define ( 'REGISTER_CLOSED', 0 );
define ( 'REGISTER_APPROVE', 1 );
define ( 'REGISTER_OPEN', 2 );
/**
* site access policy
*/
define ( 'ACCESS_PRIVATE', 0 );
define ( 'ACCESS_PAID', 1 );
define ( 'ACCESS_FREE', 2 );
/**
* relationship types
*/
@ -322,6 +332,7 @@ define ( 'HUBLOC_FLAGS_UNVERIFIED', 0x0002);
define ( 'XCHAN_FLAGS_HIDDEN', 0x0001);
define ( 'XCHAN_FLAGS_ORPHAN', 0x0002);
/**

View File

@ -95,8 +95,9 @@ function dirsearch_content(&$a) {
else {
$qlimit = " LIMIT " . intval($startrec) . " , " . intval($perpage);
if($return_total) {
$r = q("SELECT COUNT(xchan_hash) AS `total` FROM xchan left join xprof on xchan_hash = xprof_hash where $logic $sql_extra and not ( xchan_flags & %d) ",
intval(XCHAN_FLAGS_HIDDEN)
$r = q("SELECT COUNT(xchan_hash) AS `total` FROM xchan left join xprof on xchan_hash = xprof_hash where $logic $sql_extra and not ( xchan_flags & %d) and not ( xchan_flags & %d ) ",
intval(XCHAN_FLAGS_HIDDEN),
intval(XCHAN_FLAGS_ORPHAN)
);
if($r) {
$ret['total_items'] = $r[0]['total'];
@ -118,8 +119,9 @@ function dirsearch_content(&$a) {
$r = q("SELECT xchan.*, xprof.*, updates.* from xchan left join xprof on xchan_hash = xprof_hash left join updates on xchan_hash = ud_hash where $logic $sql_extra and not ( xchan_flags & %d ) $order $qlimit ",
intval(XCHAN_FLAGS_HIDDEN)
$r = q("SELECT xchan.*, xprof.*, updates.* from xchan left join xprof on xchan_hash = xprof_hash left join updates on xchan_hash = ud_hash where $logic $sql_extra and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) $order $qlimit ",
intval(XCHAN_FLAGS_HIDDEN),
intval(XCHAN_FLAGS_ORPHAN)
);
$ret['page'] = $page + 1;

View File

@ -202,6 +202,16 @@ function zfinger_init(&$a) {
if($register_policy == REGISTER_OPEN)
$ret['site']['register_policy'] = 'open';
$access_policy = intval(get_config('system','access_policy'));
if($access_policy == ACCESS_PRIVATE)
$ret['site']['access_policy'] = 'private';
if($access_policy == ACCESS_PAID)
$ret['site']['access_policy'] = 'paid';
if($access_policy == ACCESS_FREE)
$ret['site']['access_policy'] = 'free';
require_once('include/account.php');
$ret['site']['accounts'] = account_total();

View File

@ -33,6 +33,7 @@ $a->config['system']['baseurl'] = '{{$siteurl}}';
$a->config['system']['sitename'] = "Red Matrix";
$a->config['system']['location_hash'] = '{{$site_id}}';
// Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED.
// Be certain to create your own personal account before setting
// REGISTER_CLOSED. 'register_text' (if set) will be displayed prominently on
@ -44,6 +45,19 @@ $a->config['system']['register_policy'] = REGISTER_OPEN;
$a->config['system']['register_text'] = '';
$a->config['system']['admin_email'] = '{{$adminmail}}';
// Site access restrictions. By default we will create private sites.
// Your choices are ACCESS_PRIVATE, ACCESS_PAID, and ACCESS_FREE.
// If you leave REGISTER_OPEN above, anybody may register on your
// site, however your site will not be listed anywhere as an open
// registration hub. We will use the system access policy (below)
// to determine whether or not to list your site in the directory
// as an open hub where anybody may create accounts. Your choice of
// paid or free determines how these listings will be presented.
$a->config['system']['access_policy'] = ACCESS_PRIVATE;
// Maximum size of an imported message, 0 is unlimited
$a->config['system']['max_import_size'] = 200000;

View File

@ -1172,7 +1172,7 @@ $a->strings["Connections: settings for %s"] = "";
$a->strings["When receiving a channel introduction, any permissions provided here will be applied to the new connection automatically and the introduction approved. Leave this page if you do not wish to use this feature."] = "";
$a->strings["Slide to adjust your degree of friendship"] = "";
$a->strings["Connection has no individual permissions!"] = "";
$a->strings["This may be appropriate based on your <a href=\"settings\">privacy settings</a>, though you may wish to review the \"Advanced Permissions\"] = "";
$a->strings["This may be appropriate based on your <a href=\"settings\">privacy settings</a>, though you may wish to review the \"Advanced Permissions\""] = "";
$a->strings["Profile Visibility"] = "";
$a->strings["Please choose the profile you would like to display to %s when viewing your profile securely."] = "";
$a->strings["Contact Information / Notes"] = "";

View File

@ -1,8 +1,3 @@
{{*
* AUTOMATICALLY GENERATED TEMPLATE
* DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
*
*}}
<div id='adminpage'>
<h1>{{$title}} - {{$page}}</h1>

View File

@ -1,8 +1,3 @@
{{*
* AUTOMATICALLY GENERATED TEMPLATE
* DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
*
*}}
<user>
<id>{{$user.id}}</id>
<name>{{$user.name}}</name>