aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-05 22:00:06 -0700
committerfriendica <info@friendica.com>2013-09-05 22:00:06 -0700
commitc65ea0b97b2dc6fcefa0d2da489f32bdd7d05b65 (patch)
tree6b1e2faaa0a85aa9216d674ebecd48e0df049cd3 /include/zot.php
parentf8801185588a058a26c7aabd6be22ec27ee91b38 (diff)
downloadvolse-hubzilla-c65ea0b97b2dc6fcefa0d2da489f32bdd7d05b65.tar.gz
volse-hubzilla-c65ea0b97b2dc6fcefa0d2da489f32bdd7d05b65.tar.bz2
volse-hubzilla-c65ea0b97b2dc6fcefa0d2da489f32bdd7d05b65.zip
public site list (will take a few days to populate, assuming folks have updated their site access policy which old sites do not have)
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/include/zot.php b/include/zot.php
index 49f58c3bd..33522b485 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -1523,10 +1523,22 @@ function import_site($arr,$pubkey) {
if($arr['register_policy'] == 'approve')
$register_policy = REGISTER_APPROVE;
+ $access_policy = 0;
+ if(array_key_exists('access_policy',$arr)) {
+ if($arr['access_policy'] === 'private')
+ $access_policy = ACCESS_PRIVATE;
+ if($arr['access_policy'] === 'paid')
+ $access_policy = ACCESS_PAID;
+ if($arr['access_policy'] === 'free')
+ $access_policy = ACCESS_FREE;
+ }
+
+
if($update) {
- $r = q("update site set site_flags = %d, site_directory = '%s', site_register = %d, site_update = '%s'
+ $r = q("update site set site_flags = %d, site_access = %d, site_directory = '%s', site_register = %d, site_update = '%s'
where site_url = '%s' limit 1",
intval($site_directory),
+ intval($access_policy),
dbesc(htmlentities($arr['directory_url'],ENT_COMPAT,'UTF-8',false)),
intval($register_policy),
dbesc(datetime_convert()),
@@ -1537,10 +1549,11 @@ function import_site($arr,$pubkey) {
}
}
else {
- $r = q("insert into site ( site_url, site_flags, site_update, site_directory, site_register )
- values ( '%s', %d, '%s', '%s', %d )",
+ $r = q("insert into site ( site_url, site_acccess, site_flags, site_update, site_directory, site_register )
+ values ( '%s', %d, %d, '%s', '%s', %d )",
dbesc(htmlentities($arr['url'],ENT_COMPAT,'UTF-8',false)),
intval($site_directory),
+ intval($access_policy),
dbesc(datetime_convert()),
dbesc(htmlentities($arr['directory_url'],ENT_COMPAT,'UTF-8',false)),
intval($register_policy)