allow zot public providers to list their location, as a non US-based server could be a strong selling point.
This commit is contained in:
parent
8da4da37cc
commit
2035a5dd76
2
boot.php
2
boot.php
@ -45,7 +45,7 @@ define ( 'RED_PLATFORM', 'Red Matrix' );
|
|||||||
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
|
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
|
||||||
define ( 'ZOT_REVISION', 1 );
|
define ( 'ZOT_REVISION', 1 );
|
||||||
|
|
||||||
define ( 'DB_UPDATE_VERSION', 1079 );
|
define ( 'DB_UPDATE_VERSION', 1080 );
|
||||||
|
|
||||||
define ( 'EOL', '<br />' . "\r\n" );
|
define ( 'EOL', '<br />' . "\r\n" );
|
||||||
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
|
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
|
||||||
|
@ -1640,20 +1640,23 @@ function import_site($arr,$pubkey) {
|
|||||||
$directory_url = htmlentities($arr['directory_url'],ENT_COMPAT,'UTF-8',false);
|
$directory_url = htmlentities($arr['directory_url'],ENT_COMPAT,'UTF-8',false);
|
||||||
$url = htmlentities($arr['url'],ENT_COMPAT,'UTF-8',false);
|
$url = htmlentities($arr['url'],ENT_COMPAT,'UTF-8',false);
|
||||||
$sellpage = htmlentities($arr['sellpage'],ENT_COMPAT,'UTF-8',false);
|
$sellpage = htmlentities($arr['sellpage'],ENT_COMPAT,'UTF-8',false);
|
||||||
|
$site_location = htmlentities($arr['location'],ENT_COMPAT,'UTF-8',false);
|
||||||
|
|
||||||
if($exists) {
|
if($exists) {
|
||||||
if(($siterecord['site_flags'] != $site_directory)
|
if(($siterecord['site_flags'] != $site_directory)
|
||||||
|| ($siterecord['site_access'] != $access_policy)
|
|| ($siterecord['site_access'] != $access_policy)
|
||||||
|| ($siterecord['site_directory'] != $directory_url)
|
|| ($siterecord['site_directory'] != $directory_url)
|
||||||
|| ($siterecord['site_sellpage'] != $sellpage)
|
|| ($siterecord['site_sellpage'] != $sellpage)
|
||||||
|
|| ($siterecord['site_location'] != $site_location)
|
||||||
|| ($siterecord['site_register'] != $register_policy)) {
|
|| ($siterecord['site_register'] != $register_policy)) {
|
||||||
$update = true;
|
$update = true;
|
||||||
|
|
||||||
// logger('import_site: input: ' . print_r($arr,true));
|
// logger('import_site: input: ' . print_r($arr,true));
|
||||||
// logger('import_site: stored: ' . print_r($siterecord,true));
|
// logger('import_site: stored: ' . print_r($siterecord,true));
|
||||||
|
|
||||||
$r = q("update site set site_flags = %d, site_access = %d, site_directory = '%s', site_register = %d, site_update = '%s', site_sellpage = '%s'
|
$r = q("update site set site_location = '%s', site_flags = %d, site_access = %d, site_directory = '%s', site_register = %d, site_update = '%s', site_sellpage = '%s'
|
||||||
where site_url = '%s' limit 1",
|
where site_url = '%s' limit 1",
|
||||||
|
dbesc($site_location),
|
||||||
intval($site_directory),
|
intval($site_directory),
|
||||||
intval($access_policy),
|
intval($access_policy),
|
||||||
dbesc($directory_url),
|
dbesc($directory_url),
|
||||||
@ -1669,8 +1672,9 @@ function import_site($arr,$pubkey) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$update = true;
|
$update = true;
|
||||||
$r = q("insert into site ( site_url, site_access, site_flags, site_update, site_directory, site_register, site_sellpage )
|
$r = q("insert into site ( site_location, site_url, site_access, site_flags, site_update, site_directory, site_register, site_sellpage )
|
||||||
values ( '%s', %d, %d, '%s', '%s', %d, '%s' )",
|
values ( '%s', '%s', %d, %d, '%s', '%s', %d, '%s' )",
|
||||||
|
dbesc($site_location),
|
||||||
dbesc($url),
|
dbesc($url),
|
||||||
intval($access_policy),
|
intval($access_policy),
|
||||||
intval($site_directory),
|
intval($site_directory),
|
||||||
|
@ -832,6 +832,7 @@ CREATE TABLE IF NOT EXISTS `site` (
|
|||||||
`site_directory` char(255) NOT NULL DEFAULT '',
|
`site_directory` char(255) NOT NULL DEFAULT '',
|
||||||
`site_register` int(11) NOT NULL DEFAULT '0',
|
`site_register` int(11) NOT NULL DEFAULT '0',
|
||||||
`site_sellpage` char(255) NOT NULL DEFAULT '',
|
`site_sellpage` char(255) NOT NULL DEFAULT '',
|
||||||
|
`site_location` char(255 NOT NULL DEFAULT '',
|
||||||
PRIMARY KEY (`site_url`),
|
PRIMARY KEY (`site_url`),
|
||||||
KEY `site_access` (`site_access`),
|
KEY `site_access` (`site_access`),
|
||||||
KEY `site_flags` (`site_flags`),
|
KEY `site_flags` (`site_flags`),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
define( 'UPDATE_VERSION' , 1079 );
|
define( 'UPDATE_VERSION' , 1080 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -881,3 +881,10 @@ function update_r1078() {
|
|||||||
return UPDATE_SUCCESS;
|
return UPDATE_SUCCESS;
|
||||||
return UPDATE_FAILED;
|
return UPDATE_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function update_r1079() {
|
||||||
|
$r = q("ALTER TABLE `site` ADD `site_location` CHAR( 255 ) NOT NULL DEFAULT ''");
|
||||||
|
if($r)
|
||||||
|
return UPDATE_SUCCESS;
|
||||||
|
return UPDATE_FAILED;
|
||||||
|
}
|
||||||
|
@ -242,7 +242,7 @@ function list_public_sites() {
|
|||||||
else
|
else
|
||||||
$register = 'closed';
|
$register = 'closed';
|
||||||
|
|
||||||
$ret['sites'][] = array('url' => $rr['site_url'], 'access' => $access, 'register' => $register, 'sellpage' => $rr['site_sellpage']);
|
$ret['sites'][] = array('url' => $rr['site_url'], 'access' => $access, 'register' => $register, 'sellpage' => $rr['site_sellpage'], 'location' => $rr['site_location']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
|
@ -21,13 +21,16 @@ function pubsites_content(&$a) {
|
|||||||
|
|
||||||
$o .= '<h1>' . t('Public Sites') . '</h1>';
|
$o .= '<h1>' . t('Public Sites') . '</h1>';
|
||||||
|
|
||||||
|
$o .= '<div class="descriptive-text">' .
|
||||||
|
t('The listed sites allow public registration. Some may require subscription or provide tiered service plans. The provider links may provide additional details.') . '</div>' . EOL;
|
||||||
|
|
||||||
$ret = z_fetch_url($url);
|
$ret = z_fetch_url($url);
|
||||||
if($ret['success']) {
|
if($ret['success']) {
|
||||||
$j = json_decode($ret['body'],true);
|
$j = json_decode($ret['body'],true);
|
||||||
if($j) {
|
if($j) {
|
||||||
$o .= '<table border="1"><tr><td>' . t('Site URL') . '</td><td>' . t('Access Type') . '</td><td>' . t('Registration Policy') . '</td></tr>';
|
$o .= '<table border="1"><tr><td>' . t('Site URL') . '</td><td>' . t('Access Type') . '</td><td>' . t('Registration Policy') . '</td><td>' . t('Location') . '</td></tr>';
|
||||||
foreach($j['sites'] as $jj) {
|
foreach($j['sites'] as $jj) {
|
||||||
$o .= '<tr><td>' . '<a href="'. (($jj['sellpage']) ? $jj['sellpage'] : $jj['url']) . '" >' . $jj['url'] . '</a>' . '</td><td>' . $jj['access'] . '</td><td>' . $jj['register'] . '</td></tr>';
|
$o .= '<tr><td>' . '<a href="'. (($jj['sellpage']) ? $jj['sellpage'] : $jj['url']) . '" >' . $jj['url'] . '</a>' . '</td><td>' . $jj['access'] . '</td><td>' . $jj['register'] . '</td><td>' . $jj['location'] . '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$o .= '</table>';
|
$o .= '</table>';
|
||||||
|
@ -248,6 +248,7 @@ function zfinger_init(&$a) {
|
|||||||
$ret['site']['sitehash'] = get_config('system','location_hash');
|
$ret['site']['sitehash'] = get_config('system','location_hash');
|
||||||
$ret['site']['sitename'] = get_config('system','sitename');
|
$ret['site']['sitename'] = get_config('system','sitename');
|
||||||
$ret['site']['sellpage'] = get_config('system','sellpage');
|
$ret['site']['sellpage'] = get_config('system','sellpage');
|
||||||
|
$ret['site']['location'] = get_config('system','site_location');
|
||||||
|
|
||||||
}
|
}
|
||||||
json_return_and_die($ret);
|
json_return_and_die($ret);
|
||||||
|
Reference in New Issue
Block a user