aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Cdav.php2
-rw-r--r--Zotlabs/Module/Dav.php2
-rw-r--r--Zotlabs/Module/Item.php24
-rw-r--r--Zotlabs/Render/Comanche.php19
-rw-r--r--Zotlabs/Widget/Notifications.php2
5 files changed, 39 insertions, 10 deletions
diff --git a/Zotlabs/Module/Cdav.php b/Zotlabs/Module/Cdav.php
index 91d279f7a..6737ac4ee 100644
--- a/Zotlabs/Module/Cdav.php
+++ b/Zotlabs/Module/Cdav.php
@@ -39,7 +39,7 @@ class Cdav extends \Zotlabs\Web\Controller {
$sigblock = \Zotlabs\Web\HTTPSig::parse_sigheader($_SERVER[$head]);
if($sigblock) {
- $keyId = $sigblock['keyId'];
+ $keyId = str_replace('acct:','',$sigblock['keyId']);
if($keyId) {
$r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
dbesc($keyId)
diff --git a/Zotlabs/Module/Dav.php b/Zotlabs/Module/Dav.php
index d506fe9f5..9f64e2fea 100644
--- a/Zotlabs/Module/Dav.php
+++ b/Zotlabs/Module/Dav.php
@@ -48,7 +48,7 @@ class Dav extends \Zotlabs\Web\Controller {
$sigblock = \Zotlabs\Web\HTTPSig::parse_sigheader($_SERVER[$head]);
if($sigblock) {
- $keyId = $sigblock['keyId'];
+ $keyId = str_replace('acct:','',$sigblock['keyId']);
if($keyId) {
$r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
dbesc($keyId)
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 2528645f3..37a3a3a85 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -1139,7 +1139,29 @@ class Item extends \Zotlabs\Web\Controller {
$ret['message'] = t('Unable to obtain post information from database.');
return $ret;
}
-
+
+ // auto-upgrade beginner (techlevel 0) accounts - if they have at least two friends and ten posts
+ // and have uploaded something (like a profile photo), promote them to level 1.
+
+ $a = q("select account_id, account_level from account where account_id = (select channel_account_id from channel where channel_id = %d limit 1)",
+ intval($channel_id)
+ );
+ if((! intval($a[0]['account_level'])) && intval($r[0]['total']) > 10) {
+ $x = q("select count(abook_id) as total from abook where abook_channel = %d",
+ intval($channel_id)
+ );
+ if($x && intval($x[0]['total']) > 2) {
+ $y = q("select count(id) as total from attach where uid = %d",
+ intval($channel_id)
+ );
+ if($y && intval($y[0]['total']) > 1) {
+ q("update account set account_level = 1 where account_id = %d limit 1",
+ intval($a[0]['account_id'])
+ );
+ }
+ }
+ }
+
if (!$iswebpage) {
$max = engr_units_to_bytes(service_class_fetch($channel_id,'total_items'));
if(! service_class_allows($channel_id,'total_items',$r[0]['total'])) {
diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php
index cd06e11a8..fb400b6fe 100644
--- a/Zotlabs/Render/Comanche.php
+++ b/Zotlabs/Render/Comanche.php
@@ -534,7 +534,12 @@ class Comanche {
require_once('widget/' . $clsname . '/' . $clsname . '.php');
elseif(file_exists('Zotlabs/Widget/' . $clsname . '.php'))
require_once('Zotlabs/Widget/' . $clsname . '.php');
-
+ else {
+ $pth = theme_include($clsname . '.php');
+ if($pth) {
+ require_once($pth);
+ }
+ }
if(class_exists($nsname)) {
$x = new $nsname;
$f = 'widget';
@@ -550,11 +555,13 @@ class Comanche {
require_once('widget/' . trim($name) . '.php');
elseif(file_exists('widget/' . trim($name) . '/' . trim($name) . '.php'))
require_once('widget/' . trim($name) . '/' . trim($name) . '.php');
- }
- else {
- $theme_widget = $func . '.php';
- if((! function_exists($func)) && theme_include($theme_widget))
- require_once(theme_include($theme_widget));
+
+ if(! function_exists($func)) {
+ $theme_widget = $func . '.php';
+ if(theme_include($theme_widget)) {
+ require_once(theme_include($theme_widget));
+ }
+ }
}
if(function_exists($func))
diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php
index 450d3565e..a677d84c9 100644
--- a/Zotlabs/Widget/Notifications.php
+++ b/Zotlabs/Widget/Notifications.php
@@ -144,7 +144,7 @@ class Notifications {
$o = replace_macros(get_markup_template('notifications_widget.tpl'), array(
'$module' => \App::$module,
'$notifications' => $notifications,
- '$loading' => t('Loading...')
+ '$loading' => t('Loading')
));
return $o;