Merge branch 'master' into tres
This commit is contained in:
commit
aafed50a0e
15
boot.php
15
boot.php
@ -49,7 +49,7 @@ define ( 'RED_PLATFORM', 'redmatrix' );
|
||||
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
|
||||
define ( 'ZOT_REVISION', 1 );
|
||||
|
||||
define ( 'DB_UPDATE_VERSION', 1135 );
|
||||
define ( 'DB_UPDATE_VERSION', 1136 );
|
||||
|
||||
/**
|
||||
* Constant with a HTML line break.
|
||||
@ -2148,6 +2148,19 @@ function get_directory_realm() {
|
||||
return DIRECTORY_REALM;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the primary directory server.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_directory_primary() {
|
||||
if($x = get_config('system', 'directory_primary'))
|
||||
return $x;
|
||||
|
||||
return DIRECTORY_FALLBACK_MASTER;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief return relative date of last completed poller execution
|
||||
|
@ -688,7 +688,7 @@ function diaspora_request($importer,$xml) {
|
||||
$default_perms = $x['perms_accept'];
|
||||
}
|
||||
if(! $default_perms)
|
||||
$default_perms = intval(get_pconfig($channel['channel_id'],'system','autoperms'));
|
||||
$default_perms = intval(get_pconfig($importer['channel_id'],'system','autoperms'));
|
||||
|
||||
$their_perms = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK|PERMS_W_STREAM|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT|PERMS_R_STORAGE|PERMS_R_PAGES;
|
||||
|
||||
|
@ -163,6 +163,10 @@ function poller_run($argv, $argc){
|
||||
db_utcnow(), db_quoteinterval('14 DAY')
|
||||
);
|
||||
|
||||
$dirmode = intval(get_config('system','directory_mode'));
|
||||
if($dirmode == DIRECTORY_MODE_SECONDARY) {
|
||||
logger('regdir: ' . print_r(z_fetch_url(get_directory_primary() . '/regdir?f=&url=' . z_root() . '&realm=' . get_directory_realm()),true));
|
||||
}
|
||||
|
||||
/**
|
||||
* End Cron Weekly
|
||||
|
@ -2387,6 +2387,7 @@ function getIconFromType($type) {
|
||||
$iconMap = array(
|
||||
//Folder
|
||||
t('Collection') => 'icon-folder-close',
|
||||
'multipart/mixed' => 'icon-folder-close', //dirs in attach use this mime type
|
||||
//Common file
|
||||
'application/octet-stream' => 'icon-file-alt',
|
||||
//Text
|
||||
|
@ -1533,6 +1533,7 @@ CREATE TABLE IF NOT EXISTS `xlink` (
|
||||
`xlink_rating_text` TEXT NOT NULL DEFAULT '',
|
||||
`xlink_updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`xlink_static` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`xlink_sig` text NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`xlink_id`),
|
||||
KEY `xlink_xchan` (`xlink_xchan`),
|
||||
KEY `xlink_link` (`xlink_link`),
|
||||
|
@ -1146,6 +1146,7 @@ CREATE TABLE "xlink" (
|
||||
"xlink_rating_text" TEXT NOT NULL DEFAULT '',
|
||||
"xlink_updated" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
|
||||
"xlink_static" numeric(1) NOT NULL DEFAULT '0',
|
||||
"xlink_sig" text NOT NULL DEFAULT '',
|
||||
PRIMARY KEY ("xlink_id")
|
||||
);
|
||||
create index "xlink_xchan" on xlink ("xlink_xchan");
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
define( 'UPDATE_VERSION' , 1135 );
|
||||
define( 'UPDATE_VERSION' , 1136 );
|
||||
|
||||
/**
|
||||
*
|
||||
@ -1550,3 +1550,10 @@ function update_r1134() {
|
||||
return UPDATE_SUCCESS;
|
||||
return UPDATE_FAILED;
|
||||
}
|
||||
|
||||
function update_r1135() {
|
||||
$r = q("ALTER TABLE xlink ADD xlink_sig TEXT NOT NULL DEFAULT ''");
|
||||
if($r)
|
||||
return UPDATE_SUCCESS;
|
||||
return UPDATE_FAILED;
|
||||
}
|
||||
|
@ -562,7 +562,7 @@ function admin_page_dbsync(&$a) {
|
||||
if(count($r)) {
|
||||
foreach($r as $rr) {
|
||||
$upd = intval(substr($rr['k'],8));
|
||||
if($upd < 1139 || $rr['v'] === 'success')
|
||||
if($rr['v'] === 'success')
|
||||
continue;
|
||||
$failed[] = $upd;
|
||||
}
|
||||
|
64
mod/regdir.php
Normal file
64
mod/regdir.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
|
||||
function regdir_init(&$a) {
|
||||
|
||||
$result = array('success' => false);
|
||||
|
||||
$url = $_REQUEST['url'];
|
||||
|
||||
|
||||
// we probably don't need the realm as we will find out in the probe.
|
||||
// What we may want to die is throw an error if you're trying to register in a different realm
|
||||
// so this configuration issue can be discovered.
|
||||
|
||||
$realm = $_REQUEST['realm'];
|
||||
if(! $realm)
|
||||
$realm = DIRECTORY_REALM;
|
||||
|
||||
$dirmode = intval(get_config('system','directory_mode'));
|
||||
|
||||
if($dirmode == DIRECTORY_MODE_NORMAL) {
|
||||
$ret['message'] = t('This site is not a directory server');
|
||||
json_return_and_die($ret);
|
||||
}
|
||||
|
||||
$m = null;
|
||||
if($url) {
|
||||
$m = parse_url($url);
|
||||
|
||||
if((! $m) || (! @dns_get_record($m['host'], DNS_A + DNS_CNAME + DNS_PTR)) || (! filter_var($m['host'], FILTER_VALIDATE_IP) )) {
|
||||
$result['message'] = 'unparseable url';
|
||||
json_return_and_die($result);
|
||||
}
|
||||
|
||||
$f = zot_finger('sys@' . $m['host']);
|
||||
if($f['success']) {
|
||||
$j = json_decode($f['body'],true);
|
||||
if($j['success'] && $j['guid']) {
|
||||
$x = import_xchan($j);
|
||||
if($x['success']) {
|
||||
$result['success'] = true;
|
||||
json_return_and_die($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
json_return_and_die($result);
|
||||
}
|
||||
else {
|
||||
$r = q("select site_url from site where site_flags in ( 1, 2 ) and site_realm = '%s'",
|
||||
dbesc(get_directory_realm())
|
||||
);
|
||||
if($r) {
|
||||
$result['success'] = true;
|
||||
$result['directories'] = array();
|
||||
foreach($r as $rr)
|
||||
$result['directories'][] = $rr['site_url'];
|
||||
json_return_and_die($result);
|
||||
}
|
||||
}
|
||||
json_return_and_die($result);
|
||||
|
||||
|
||||
}
|
@ -99,13 +99,14 @@ function zfinger_init(&$a) {
|
||||
|
||||
$id = $e['channel_id'];
|
||||
|
||||
$sys_channel = (($e['channel_pageflags'] & PAGE_SYSTEM) ? true : false);
|
||||
$special_channel = (($e['channel_pageflags'] & PAGE_PREMIUM) ? true : false);
|
||||
$adult_channel = (($e['channel_pageflags'] & PAGE_ADULT) ? true : false);
|
||||
$censored = (($e['channel_pageflags'] & PAGE_CENSORED) ? true : false);
|
||||
$searchable = (($e['channel_pageflags'] & PAGE_HIDDEN) ? false : true);
|
||||
$deleted = (intval($e['xchan_deleted']) ? true : false);
|
||||
|
||||
if($deleted || $censored)
|
||||
if($deleted || $censored || $sys_channel)
|
||||
$searchable = false;
|
||||
|
||||
$public_forum = false;
|
||||
@ -237,6 +238,12 @@ function zfinger_init(&$a) {
|
||||
$dirmode = get_config('system','directory_mode');
|
||||
if(($dirmode === false) || ($dirmode == DIRECTORY_MODE_NORMAL))
|
||||
$ret['site']['directory_mode'] = 'normal';
|
||||
|
||||
// downgrade mis-configured primaries
|
||||
|
||||
if($dirmode == DIRECTORY_MODE_PRIMARY && z_root() != get_directory_primary())
|
||||
$dirmode = DIRECTORY_MODE_SECONDARY;
|
||||
|
||||
if($dirmode == DIRECTORY_MODE_PRIMARY)
|
||||
$ret['site']['directory_mode'] = 'primary';
|
||||
elseif($dirmode == DIRECTORY_MODE_SECONDARY)
|
||||
|
@ -1 +1 @@
|
||||
2015-01-30.932
|
||||
2015-02-01.934
|
||||
|
@ -11,9 +11,9 @@ bezoeken en een nieuwe wachtwoord aanvragen. Je kan daarna inloggen, een kanaal
|
||||
meteen via 'instellingen > account' (linksboven) het account verwijderen (onderaan).
|
||||
Excuses voor het eventuele ongemak.
|
||||
|
||||
Wanneer dit account wel door jou is aangemaakt: Dank je en welkom op de {{sitename}}.
|
||||
Wanneer dit account wel door jou is aangemaakt: Dank je en welkom op de {{$sitename}}.
|
||||
|
||||
Vriendelijke groet,
|
||||
Beheerder {{sitename}} ({{$siteurl}})
|
||||
Beheerder {{$sitename}} ({{$siteurl}})
|
||||
|
||||
|
Reference in New Issue
Block a user