aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-01-15 21:49:28 -0800
committerzotlabs <mike@macgirvin.com>2018-01-15 21:49:28 -0800
commit05f9f0a393d7e414481f3e33e651d33f341e59b0 (patch)
tree093113813f751891d6f1686e9351727b449c102b /Zotlabs
parent76c8bbf7b83d6cdbd0b16ebbdaa4cab48662221f (diff)
parent746ea5a3691a67ceb176352e8b6fcfe0f2dc99d6 (diff)
downloadvolse-hubzilla-05f9f0a393d7e414481f3e33e651d33f341e59b0.tar.gz
volse-hubzilla-05f9f0a393d7e414481f3e33e651d33f341e59b0.tar.bz2
volse-hubzilla-05f9f0a393d7e414481f3e33e651d33f341e59b0.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Admin/Site.php4
-rw-r--r--Zotlabs/Module/Connedit.php2
-rw-r--r--Zotlabs/Module/Defperms.php2
-rw-r--r--Zotlabs/Module/Item.php14
-rw-r--r--Zotlabs/Module/Owa.php7
-rw-r--r--Zotlabs/Web/HTTPSig.php2
6 files changed, 18 insertions, 13 deletions
diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php
index 50756c654..60cb39277 100644
--- a/Zotlabs/Module/Admin/Site.php
+++ b/Zotlabs/Module/Admin/Site.php
@@ -29,7 +29,7 @@ class Site {
$maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 0);
$register_policy = ((x($_POST,'register_policy')) ? intval(trim($_POST['register_policy'])) : 0);
-
+ $minimum_age = ((x($_POST,'minimum_age')) ? intval(trim($_POST['minimum_age'])) : 13);
$access_policy = ((x($_POST,'access_policy')) ? intval(trim($_POST['access_policy'])) : 0);
$invite_only = ((x($_POST,'invite_only')) ? True : False);
$abandon_days = ((x($_POST,'abandon_days')) ? intval(trim($_POST['abandon_days'])) : 0);
@@ -127,6 +127,7 @@ class Site {
set_config('system','maximagesize', $maximagesize);
set_config('system','register_policy', $register_policy);
+ set_config('system','minimum_age', $minimum_age);
set_config('system','invitation_only', $invite_only);
set_config('system','access_policy', $access_policy);
set_config('system','account_abandon_days', $abandon_days);
@@ -303,6 +304,7 @@ class Site {
'$maximagesize' => array('maximagesize', t("Maximum image size"), intval(get_config('system','maximagesize')), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")),
'$register_policy' => array('register_policy', t("Does this site allow new member registration?"), get_config('system','register_policy'), "", $register_choices),
'$invite_only' => array('invite_only', t("Invitation only"), get_config('system','invitation_only'), t("Only allow new member registrations with an invitation code. Above register policy must be set to Yes.")),
+ '$minimum_age' => array('minimum_age', t("Minimum age"), (x(get_config('system','minimum_age'))?get_config('system','minimum_age'):13), t("Minimum age (in years) for who may register on this site.")),
'$access_policy' => array('access_policy', t("Which best describes the types of account offered by this hub?"), get_config('system','access_policy'), "This is displayed on the public server site list.", $access_choices),
'$register_text' => array('register_text', t("Register text"), htmlspecialchars(get_config('system','register_text'), ENT_QUOTES, 'UTF-8'), t("Will be displayed prominently on the registration page.")),
'$frontpage' => array('frontpage', t("Site homepage to show visitors (default: login box)"), get_config('system','frontpage'), t("example: 'public' to show public stream, 'page/sys/home' to show a system webpage called 'home' or 'include:home.html' to include a file.")),
diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php
index e0511b0d3..8288886cd 100644
--- a/Zotlabs/Module/Connedit.php
+++ b/Zotlabs/Module/Connedit.php
@@ -866,7 +866,7 @@ class Connedit extends \Zotlabs\Web\Controller {
$o .= replace_macros($tpl, [
'$header' => (($self) ? t('Connection Default Permissions') : sprintf( t('Connection: %s'),$contact['xchan_name'])),
'$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), t('Connection requests will be approved without your interaction'), $yes_no),
- '$permcat' => [ 'permcat', t('Permission role'), '', '',$permcats ],
+ '$permcat' => [ 'permcat', t('Permission role'), '', '<span class="loading invisible">' . t('Loading') . '<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span></span>',$permcats ],
'$permcat_new' => t('Add permission role'),
'$permcat_enable' => feature_enabled(local_channel(),'permcats'),
'$addr' => $contact['xchan_addr'],
diff --git a/Zotlabs/Module/Defperms.php b/Zotlabs/Module/Defperms.php
index 9214331e4..422333a50 100644
--- a/Zotlabs/Module/Defperms.php
+++ b/Zotlabs/Module/Defperms.php
@@ -237,7 +237,7 @@ class Defperms extends \Zotlabs\Web\Controller {
$o .= replace_macros($tpl, [
'$header' => t('Connection Default Permissions'),
'$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), t('If enabled, connection requests will be approved without your interaction'), $yes_no),
- '$permcat' => [ 'permcat', t('Permission role'), '', '',$permcats ],
+ '$permcat' => [ 'permcat', t('Permission role'), '', '<span class="loading invisible">' . t('Loading') . '<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span></span>',$permcats ],
'$permcat_new' => t('Add permission role'),
'$permcat_enable' => feature_enabled(local_channel(),'permcats'),
'$section' => $section,
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 6365230f8..ad829137a 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -504,7 +504,12 @@ class Item extends \Zotlabs\Web\Controller {
$body = z_input_filter($body,$mimetype,$execflag);
}
- // Verify ability to use html or php!!!
+
+ $arr = [ 'profile_uid' => $profile_uid, 'content' => $body, 'mimetype' => $mimetype ];
+ call_hooks('post_content',$arr);
+ $body = $arr['content'];
+ $mimetype = $arr['mimetype'];
+
$gacl = $acl->get();
$str_contact_allow = $gacl['allow_cid'];
@@ -516,13 +521,6 @@ class Item extends \Zotlabs\Web\Controller {
require_once('include/text.php');
- if($uid && $uid == $profile_uid && feature_enabled($uid,'markdown')) {
- require_once('include/markdown.php');
- $body = preg_replace_callback('/\[share(.*?)\]/ism','\share_shield',$body);
- $body = markdown_to_bb($body,true,['preserve_lf' => true]);
- $body = preg_replace_callback('/\[share(.*?)\]/ism','\share_unshield',$body);
-
- }
// BBCODE alert: the following functions assume bbcode input
// and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.)
diff --git a/Zotlabs/Module/Owa.php b/Zotlabs/Module/Owa.php
index 9a39fe4c0..23ee14f39 100644
--- a/Zotlabs/Module/Owa.php
+++ b/Zotlabs/Module/Owa.php
@@ -38,14 +38,19 @@ class Owa extends \Zotlabs\Web\Controller {
foreach($r as $hubloc) {
$verified = \Zotlabs\Web\HTTPSig::verify('',$hubloc['xchan_pubkey']);
if($verified && $verified['header_signed'] && $verified['header_valid']) {
+ logger('OWA header: ' . print_r($verified,true),LOGGER_DATA);
+ logger('OWA success: ' . $hubloc['hubloc_addr'],LOGGER_DATA);
$ret['success'] = true;
$token = random_string(32);
- \Zotlabs\Zot\Verify::create('owt',0,$token,$r[0]['hubloc_addr']);
+ \Zotlabs\Zot\Verify::create('owt',0,$token,$hubloc['hubloc_addr']);
$result = '';
openssl_public_encrypt($token,$result,$hubloc['xchan_pubkey']);
$ret['encrypted_token'] = base64url_encode($result);
break;
}
+ else {
+ logger('OWA fail: ' . $hubloc['hubloc_id'] . ' ' . $hubloc['hubloc_addr']);
+ }
}
}
}
diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php
index 9a8c23a9b..63033ce5e 100644
--- a/Zotlabs/Web/HTTPSig.php
+++ b/Zotlabs/Web/HTTPSig.php
@@ -117,7 +117,7 @@ class HTTPSig {
logger('verified: ' . $x, LOGGER_DEBUG);
- if($x === false)
+ if(! $x)
return $result;
if(! $spoofable)