aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-06-20 18:36:02 -0700
committerfriendica <info@friendica.com>2013-06-20 18:36:02 -0700
commit61601dc23d3e8305720bfc4e4e6b6dbd7b85f546 (patch)
tree63d9e661fdeb1bbf83e6ec19187b852657383191
parentdd9d32bcb3dc8ab8a4cf0c9658f01dfba24f7db4 (diff)
downloadvolse-hubzilla-61601dc23d3e8305720bfc4e4e6b6dbd7b85f546.tar.gz
volse-hubzilla-61601dc23d3e8305720bfc4e4e6b6dbd7b85f546.tar.bz2
volse-hubzilla-61601dc23d3e8305720bfc4e4e6b6dbd7b85f546.zip
Add site registration policy to site record. This is not yet used or stored, but potentially can be exchanged through directory mirrors to automatically create "open site" lists.
-rwxr-xr-xboot.php2
-rw-r--r--install/database.sql4
-rw-r--r--install/update.php11
-rw-r--r--mod/zfinger.php9
4 files changed, 22 insertions, 4 deletions
diff --git a/boot.php b/boot.php
index 661a77f2a..9ff4bad7a 100755
--- a/boot.php
+++ b/boot.php
@@ -43,7 +43,7 @@ require_once('include/taxonomy.php');
define ( 'RED_PLATFORM', 'Red Matrix' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 );
-define ( 'DB_UPDATE_VERSION', 1045 );
+define ( 'DB_UPDATE_VERSION', 1046 );
define ( 'EOL', '<br />' . "\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
diff --git a/install/database.sql b/install/database.sql
index 9964e98ea..056124649 100644
--- a/install/database.sql
+++ b/install/database.sql
@@ -797,10 +797,12 @@ CREATE TABLE IF NOT EXISTS `site` (
`site_flags` int(11) NOT NULL DEFAULT '0',
`site_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`site_directory` char(255) NOT NULL DEFAULT '',
+ `site_register` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`site_url`),
KEY `site_flags` (`site_flags`),
KEY `site_update` (`site_update`),
- KEY `site_directory` (`site_directory`)
+ KEY `site_directory` (`site_directory`),
+ KEY `site_register` (`site_register`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `spam` (
diff --git a/install/update.php b/install/update.php
index ba5ec0262..c57b8562e 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1045 );
+define( 'UPDATE_VERSION' , 1046 );
/**
*
@@ -556,3 +556,12 @@ ADD INDEX ( `imgurl` ) ");
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
+
+function update_r1045() {
+ $r = q("ALTER TABLE `site` ADD `site_register` INT NOT NULL DEFAULT '0',
+ADD INDEX ( `site_register` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
diff --git a/mod/zfinger.php b/mod/zfinger.php
index 48582b3d6..460f157b6 100644
--- a/mod/zfinger.php
+++ b/mod/zfinger.php
@@ -181,7 +181,14 @@ function zfinger_init(&$a) {
$ret['site']['directory_mode'] = 'standalone';
if($dirmode != DIRECTORY_MODE_NORMAL)
$ret['site']['directory_url'] = z_root() . '/dirsearch';
-
+ $register_policy = intval(get_config('system','register_policy'));
+ if($register_policy == REGISTER_CLOSED)
+ $ret['site']['register_policy'] = 'closed';
+ if($register_policy == REGISTER_APPROVE)
+ $ret['site']['register_policy'] = 'approve';
+ if($register_policy == REGISTER_OPEN)
+ $ret['site']['register_policy'] = 'open';
+
json_return_and_die($ret);
} \ No newline at end of file