aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-10-21 11:20:23 +0200
committerMario <mario@mariovavti.com>2022-10-21 11:20:23 +0200
commit5edd13c6bb89c7434d8437f8cc74c038371fdbf8 (patch)
treebc7f29762e9aa306f80b4881128607a49b5bb74f
parent7ca289edd0d568a51dfdf225a5ef0e9663c38838 (diff)
downloadvolse-hubzilla-5edd13c6bb89c7434d8437f8cc74c038371fdbf8.tar.gz
volse-hubzilla-5edd13c6bb89c7434d8437f8cc74c038371fdbf8.tar.bz2
volse-hubzilla-5edd13c6bb89c7434d8437f8cc74c038371fdbf8.zip
fix various issues
-rw-r--r--Zotlabs/Daemon/Gprobe.php6
-rw-r--r--Zotlabs/Lib/Activity.php8
-rw-r--r--Zotlabs/Lib/Libzot.php2
-rw-r--r--Zotlabs/Module/Admin/Addons.php3
-rw-r--r--Zotlabs/Module/Admin/Dbsync.php30
-rw-r--r--Zotlabs/Module/Admin/Site.php2
-rw-r--r--Zotlabs/Module/Connections.php2
-rw-r--r--Zotlabs/Module/Cover_photo.php218
-rw-r--r--Zotlabs/Module/Defperms.php1
-rw-r--r--Zotlabs/Module/Display.php2
-rw-r--r--Zotlabs/Module/Fhublocs.php2
-rw-r--r--Zotlabs/Module/Item.php1
-rw-r--r--Zotlabs/Module/Lostpass.php66
-rw-r--r--Zotlabs/Module/Poke.php1
-rw-r--r--Zotlabs/Module/Profile_photo.php1
-rw-r--r--Zotlabs/Module/Regate.php2
-rw-r--r--Zotlabs/Module/Register.php6
-rw-r--r--Zotlabs/Module/Tagger.php64
-rw-r--r--Zotlabs/Module/Tokens.php4
-rw-r--r--Zotlabs/Module/Viewconnections.php6
-rw-r--r--Zotlabs/Module/Well_known.php17
-rw-r--r--Zotlabs/Storage/Directory.php5
22 files changed, 213 insertions, 236 deletions
diff --git a/Zotlabs/Daemon/Gprobe.php b/Zotlabs/Daemon/Gprobe.php
index c12ae4631..9483cb5f1 100644
--- a/Zotlabs/Daemon/Gprobe.php
+++ b/Zotlabs/Daemon/Gprobe.php
@@ -32,20 +32,16 @@ class Gprobe {
}
if (!$r) {
-
-
-
if ($is_webbie) {
$url = Webfinger::zot_url(punify($url));
}
if ($url) {
$zf = Zotfinger::exec($url, null);
- if (is_array($zf) && array_path_exists('signature/signer', $zf) && $zf['signature']['signer'] === $href && intval($zf['signature']['header_valid'])) {
+ if (is_array($zf) && array_path_exists('signature/signer', $zf) && $zf['signature']['signer'] === $url && intval($zf['signature']['header_valid'])) {
Libzot::import_xchan($zf['data']);
}
}
-
}
return;
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 8380e2287..e3306ca3e 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -1609,6 +1609,9 @@ class Activity {
}
$webfinger_addr = '';
+ $hostname = '';
+ $baseurl = '';
+ $site_url = '';
$m = parse_url($url);
if ($m) {
@@ -1617,7 +1620,7 @@ class Activity {
$site_url = $m['scheme'] . '://' . $m['host'];
}
- if (!empty($person_obj['preferredUsername']) && isset($parsed_url['host'])) {
+ if (!empty($person_obj['preferredUsername']) && $hostname) {
$webfinger_addr = escape_tags($person_obj['preferredUsername']) . '@' . $hostname;
}
@@ -2331,9 +2334,6 @@ class Activity {
if ($remainder) {
$s['comment_policy'] = $remainder;
}
- if (!(isset($item['comment_policy']) && strlen($item['comment_policy']))) {
- $s['comment_policy'] = 'contacts';
- }
}
}
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index ee551f6b8..c86eb29cd 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -1911,7 +1911,7 @@ class Libzot {
$stored = (($item_result && $item_result['item']) ? $item_result['item'] : false);
if ((is_array($stored)) && ($stored['id'] != $stored['parent'])
- && ($stored['author_xchan'] === $channel['channel_hash'] || $stored['author_xchan'] === $channel['channel_hash'])) {
+ && ($stored['author_xchan'] === $channel['channel_hash'])) {
retain_item($stored['item']['parent']);
}
diff --git a/Zotlabs/Module/Admin/Addons.php b/Zotlabs/Module/Admin/Addons.php
index b67ab7b3a..e088353e3 100644
--- a/Zotlabs/Module/Admin/Addons.php
+++ b/Zotlabs/Module/Admin/Addons.php
@@ -77,6 +77,7 @@ class Addons {
} catch (\PHPGit\Exception\GitException $e) {
json_return_and_die(array('message' => 'Error updating addon repo.', 'success' => false));
}
+ break;
case 'removerepo':
if (array_key_exists('repoName', $_REQUEST)) {
$repoName = $_REQUEST['repoName'];
@@ -111,6 +112,7 @@ class Addons {
} else {
json_return_and_die(array('message' => 'Error deleting addon repo.', 'success' => false));
}
+ break;
case 'installrepo':
if (array_key_exists('repoURL', $_REQUEST)) {
require_once('library/PHPGit.autoload.php'); // Load PHPGit dependencies
@@ -172,6 +174,7 @@ class Addons {
$repo = $git->probeRepo();
json_return_and_die(array('repo' => $repo, 'message' => '', 'success' => true));
}
+ break;
case 'addrepo':
if (array_key_exists('repoURL', $_REQUEST)) {
require_once('library/PHPGit.autoload.php'); // Load PHPGit dependencies
diff --git a/Zotlabs/Module/Admin/Dbsync.php b/Zotlabs/Module/Admin/Dbsync.php
index 183834301..b68e7bbc2 100644
--- a/Zotlabs/Module/Admin/Dbsync.php
+++ b/Zotlabs/Module/Admin/Dbsync.php
@@ -5,11 +5,11 @@ namespace Zotlabs\Module\Admin;
class Dbsync {
-
+
function get() {
$o = '';
-
+
if(argc() > 3 && intval(argv(3)) && argv(2) === 'mark') {
// remove the old style config if it exists
del_config('database', 'update_r' . intval(argv(3)));
@@ -29,7 +29,7 @@ class Dbsync {
if(method_exists($c,'verify')) {
$retval = $c->verify();
if($retval === UPDATE_FAILED) {
- $o .= sprintf( t('Verification of update %s failed. Check system logs.'), $s);
+ $o .= sprintf( t('Verification of update %s failed. Check system logs.'), $s);
}
elseif($retval === UPDATE_SUCCESS) {
$o .= sprintf( t('Update %s was successfully applied.'), $s);
@@ -44,20 +44,8 @@ class Dbsync {
}
else
$o .= sprintf( t('Update function %s could not be found.'), $s);
-
- return $o;
-
-
-
-
- // remove the old style config if it exists
- del_config('database', 'update_r' . intval(argv(3)));
- set_config('database', '_' . intval(argv(3)), 'success');
- if(intval(get_config('system','db_version')) < intval(argv(3)))
- set_config('system','db_version',intval(argv(3)));
- info( t('Update has been marked successful') . EOL);
- goaway(z_root() . '/admin/dbsync');
+ return $o;
}
if(argc() > 2 && intval(argv(2))) {
@@ -68,7 +56,7 @@ class Dbsync {
$c = new $cls();
$retval = $c->run();
if($retval === UPDATE_FAILED) {
- $o .= sprintf( t('Executing update procedure %s failed. Check system logs.'), $s);
+ $o .= sprintf( t('Executing update procedure %s failed. Check system logs.'), $s);
}
elseif($retval === UPDATE_SUCCESS) {
$o .= sprintf( t('Update %s was successfully applied.'), $s);
@@ -79,10 +67,10 @@ class Dbsync {
}
else
$o .= sprintf( t('Update function %s could not be found.'), $s);
-
+
return $o;
}
-
+
$failed = array();
$r = q("select * from config where cat = 'database' ");
if(count($r)) {
@@ -107,7 +95,7 @@ class Dbsync {
else {
return '<div class="generic-content-wrapper-styled"><h3>' . t('No failed updates.') . '</h3></div>';
}
-
+
return $o;
}
-} \ No newline at end of file
+}
diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php
index f6e3ab12b..85f81e344 100644
--- a/Zotlabs/Module/Admin/Site.php
+++ b/Zotlabs/Module/Admin/Site.php
@@ -129,7 +129,7 @@ class Site {
set_config('system', 'register_duty', $this->register_duty);
set_config('system', 'register_duty_jso', $this->joo);
} else {
- notice('ZAR0130E,'.t('Errors') . ': ' . $this->error) . EOL . $this->msgfg;
+ notice('ZAR0130E,' . t('Errors') . ': ' . $this->error . EOL . $this->msgfg . EOL);
}
}
}
diff --git a/Zotlabs/Module/Connections.php b/Zotlabs/Module/Connections.php
index 0effcdfc3..0101bf8a8 100644
--- a/Zotlabs/Module/Connections.php
+++ b/Zotlabs/Module/Connections.php
@@ -368,7 +368,7 @@ class Connections extends \Zotlabs\Web\Controller {
$limit = service_class_fetch(local_channel(),'total_channels');
if($limit !== false) {
- $abook_usage_message = sprintf( t("You have %1$.0f of %2$.0f allowed connections."), $$total, $limit);
+ $abook_usage_message = sprintf( t("You have %1$.0f of %2$.0f allowed connections."), $total, $limit);
}
else {
$abook_usage_message = '';
diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php
index dff645f2b..1ecbfce3e 100644
--- a/Zotlabs/Module/Cover_photo.php
+++ b/Zotlabs/Module/Cover_photo.php
@@ -3,7 +3,7 @@ namespace Zotlabs\Module;
use Zotlabs\Lib\Libsync;
-/*
+/*
@file cover_photo.php
@brief Module-file with functions for handling of cover-photos
@@ -29,43 +29,43 @@ class Cover_photo extends \Zotlabs\Web\Controller {
if(! local_channel()) {
return;
}
-
+
$channel = \App::get_channel();
- profile_load($channel['channel_address']);
+ profile_load($channel['channel_address']);
}
-
+
/**
* @brief Evaluate posted values
*
* @return void
*
*/
-
+
function post() {
-
+
if(! local_channel()) {
return;
}
-
+
$channel = \App::get_channel();
-
+
check_form_security_token_redirectOnErr('/cover_photo', 'cover_photo');
// Remove cover photo
if(isset($_POST['remove'])) {
-
+
$r = q("SELECT resource_id FROM photo WHERE photo_usage = %d AND uid = %d LIMIT 1",
intval(PHOTO_COVER),
intval(local_channel())
);
-
+
if($r) {
q("update photo set photo_usage = %d where photo_usage = %d and uid = %d",
intval(PHOTO_NORMAL),
intval(PHOTO_COVER),
intval(local_channel())
);
-
+
$sync = attach_export_data($channel,$r[0]['resource_id']);
if($sync)
Libsync::build_sync_packet($channel['channel_id'],array('file' => array($sync)));
@@ -76,47 +76,47 @@ class Cover_photo extends \Zotlabs\Web\Controller {
goaway(z_root() . '/cover_photo');
}
-
+
if((array_key_exists('cropfinal',$_POST)) && ($_POST['cropfinal'] == 1)) {
-
+
// phase 2 - we have finished cropping
-
+
if(argc() != 2) {
notice( t('Image uploaded but image cropping failed.') . EOL );
return;
}
-
+
$image_id = argv(1);
-
+
if(substr($image_id,-2,1) == '-') {
$scale = substr($image_id,-1,1);
$image_id = substr($image_id,0,-2);
}
-
+
$srcX = intval($_POST['xstart']);
$srcY = intval($_POST['ystart']);
$srcW = intval($_POST['xfinal']) - $srcX;
$srcH = intval($_POST['yfinal']) - $srcY;
-
+
$r = q("select gender from profile where uid = %d and is_default = 1 limit 1",
intval(local_channel())
);
if($r) {
$profile = $r[0];
}
-
+
$r = q("SELECT * FROM photo WHERE resource_id = '%s' AND uid = %d AND imgscale = 0 LIMIT 1",
dbesc($image_id),
intval(local_channel())
);
-
+
if($r) {
$max_thumb = intval(get_config('system','max_thumbnail',1600));
$iscaled = false;
- if(intval($r[0]['height']) > $max_thumb || intval($r[0]['width']) > $max_thumb) {
+ if(intval($r[0]['height']) > $max_thumb || intval($r[0]['width']) > $max_thumb) {
$imagick_path = get_config('system','imagick_convert_path');
if($imagick_path && @file_exists($imagick_path) && intval($r[0]['os_storage'])) {
@@ -150,63 +150,63 @@ class Cover_photo extends \Zotlabs\Web\Controller {
$im = photo_factory($base_image['content'], $base_image['mimetype']);
if($im->is_valid()) {
-
- // We are scaling and cropping the relative pixel locations to the original photo instead of the
+
+ // We are scaling and cropping the relative pixel locations to the original photo instead of the
// scaled photo we operated on.
-
+
// First load the scaled photo to check its size. (Should probably pass this in the post form and save
// a query.)
-
+
$g = q("select width, height from photo where resource_id = '%s' and uid = %d and imgscale = 3",
dbesc($image_id),
intval(local_channel())
);
-
-
+
+
$scaled_width = $g[0]['width'];
$scaled_height = $g[0]['height'];
-
+
if((! $scaled_width) || (! $scaled_height)) {
logger('potential divide by zero scaling cover photo');
return;
}
-
+
// unset all other cover photos
-
+
q("update photo set photo_usage = %d where photo_usage = %d and uid = %d",
intval(PHOTO_NORMAL),
intval(PHOTO_COVER),
intval(local_channel())
);
-
+
$orig_srcx = ( $base_image['width'] / $scaled_width ) * $srcX;
$orig_srcy = ( $base_image['height'] / $scaled_height ) * $srcY;
$orig_srcw = ( $srcW / $scaled_width ) * $base_image['width'];
$orig_srch = ( $srcH / $scaled_height ) * $base_image['height'];
-
+
$im->cropImageRect(1200,435,$orig_srcx, $orig_srcy, $orig_srcw, $orig_srch);
-
+
$aid = get_account_id();
-
- $p = [
- 'aid' => $aid,
- 'uid' => local_channel(),
+
+ $p = [
+ 'aid' => $aid,
+ 'uid' => local_channel(),
'resource_id' => $base_image['resource_id'],
- 'filename' => $base_image['filename'],
+ 'filename' => $base_image['filename'],
'album' => t('Cover Photos'),
'os_path' => $base_image['os_path'],
'display_path' => $base_image['display_path'],
'photo_usage' => PHOTO_COVER
];
-
+
$r1 = $im->storeThumbnail($p, PHOTO_RES_COVER_1200);
-
+
$im->doScaleImage(850,310);
$r2 = $im->storeThumbnail($p, PHOTO_RES_COVER_850);
-
+
$im->doScaleImage(425,160);
$r3 = $im->storeThumbnail($p, PHOTO_RES_COVER_425);
-
+
if($r1 === false || $r2 === false || $r3 === false) {
// if one failed, delete them all so we can start over.
notice( t('Image resize failed.') . EOL );
@@ -214,7 +214,7 @@ class Cover_photo extends \Zotlabs\Web\Controller {
dbesc($base_image['resource_id']),
local_channel()
);
-
+
$x = q("SELECT content FROM photo WHERE resource_id = '%s' AND uid = %d AND os_storage = 1 AND imgscale >= 7",
dbesc($base_image['resource_id']),
local_channel()
@@ -229,7 +229,7 @@ class Cover_photo extends \Zotlabs\Web\Controller {
}
$this->send_cover_photo_activity($channel,$base_image,$profile);
-
+
$sync = attach_export_data($channel,$base_image['resource_id']);
if($sync)
Libsync::build_sync_packet($channel['channel_id'],array('file' => array($sync)));
@@ -240,33 +240,33 @@ class Cover_photo extends \Zotlabs\Web\Controller {
else
notice( t('Unable to process image') . EOL);
}
-
+
goaway(z_root() . '/channel/' . $channel['channel_address']);
-
+
}
-
-
+
+
$hash = photo_new_resource();
$smallest = 0;
-
+
require_once('include/attach.php');
-
+
$res = attach_store(\App::get_channel(), get_observer_hash(), '', array('album' => t('Cover Photos'), 'hash' => $hash, 'nosync' => true));
-
+
logger('attach_store: ' . print_r($res,true));
-
+
if($res && intval($res['data']['is_photo'])) {
$i = q("select * from photo where resource_id = '%s' and uid = %d and imgscale = 0",
dbesc($hash),
intval(local_channel())
);
-
+
if(! $i) {
notice( t('Image upload failed.') . EOL );
return;
}
$os_storage = false;
-
+
foreach($i as $ii) {
$smallest = intval($ii['imgscale']);
$os_storage = intval($ii['os_storage']);
@@ -274,91 +274,91 @@ class Cover_photo extends \Zotlabs\Web\Controller {
$filetype = $ii['mimetype'];
}
}
-
+
$imagedata = (($os_storage) ? @file_get_contents(dbunescbin($imagedata)) : dbunescbin($imagedata));
$ph = photo_factory($imagedata, $filetype);
-
+
if(! $ph->is_valid()) {
notice( t('Unable to process image.') . EOL );
return;
}
-
+
return $this->cover_photo_crop_ui_head($a, $ph, $hash, $smallest);
-
+
}
-
+
function send_cover_photo_activity($channel,$photo,$profile) {
-
+
$arr = array();
$arr['item_thread_top'] = 1;
$arr['item_origin'] = 1;
$arr['item_wall'] = 1;
-
+
if($profile && stripos($profile['gender'],t('female')) !== false)
$t = t('%1$s updated her %2$s');
elseif($profile && stripos($profile['gender'],t('male')) !== false)
$t = t('%1$s updated his %2$s');
else
$t = t('%1$s updated their %2$s');
-
+
$ptext = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo['resource_id'] . ']' . t('cover photo') . '[/zrl]';
-
- $ltext = '[zrl=' . z_root() . '/profile/' . $channel['channel_address'] . ']' . '[zmg]' . z_root() . '/photo/' . $photo['resource_id'] . '-8[/zmg][/zrl]';
-
+
+ $ltext = '[zrl=' . z_root() . '/profile/' . $channel['channel_address'] . ']' . '[zmg]' . z_root() . '/photo/' . $photo['resource_id'] . '-8[/zmg][/zrl]';
+
$arr['body'] = sprintf($t,$channel['channel_name'],$ptext) . "\n\n" . $ltext;
-
+
$acl = new \Zotlabs\Access\AccessList($channel);
$x = $acl->get();
$arr['allow_cid'] = $x['allow_cid'];
-
+
$arr['allow_gid'] = $x['allow_gid'];
$arr['deny_cid'] = $x['deny_cid'];
$arr['deny_gid'] = $x['deny_gid'];
-
+
$arr['uid'] = $channel['channel_id'];
$arr['aid'] = $channel['channel_account_id'];
-
+
$arr['owner_xchan'] = $channel['channel_hash'];
$arr['author_xchan'] = $channel['channel_hash'];
-
+
post_activity_item($arr);
-
-
+
+
}
-
-
+
+
/**
* @brief Generate content of profile-photo view
*
* @return string
*
*/
-
-
+
+
function get() {
-
+
if(! local_channel()) {
notice( t('Permission denied.') . EOL );
return;
}
-
+
$channel = \App::get_channel();
-
+
$newuser = false;
-
+
if(argc() == 2 && argv(1) === 'new')
$newuser = true;
-
+
if(argv(1) === 'use') {
if (argc() < 3) {
notice( t('Permission denied.') . EOL );
return;
};
-
+
// check_form_security_token_redirectOnErr('/cover_photo', 'cover_photo');
-
+
$resource_id = argv(2);
-
+
$r = q("SELECT id, album, imgscale FROM photo WHERE uid = %d AND resource_id = '%s' ORDER BY imgscale ASC",
intval(local_channel()),
dbesc($resource_id)
@@ -372,22 +372,22 @@ class Cover_photo extends \Zotlabs\Web\Controller {
if($rr['imgscale'] == 7)
$havescale = true;
}
-
+
$r = q("SELECT content, mimetype, resource_id, os_storage FROM photo WHERE id = %d and uid = %d limit 1",
intval($r[0]['id']),
intval(local_channel())
-
+
);
if(! $r) {
notice( t('Photo not available.') . EOL );
return;
}
-
+
if(intval($r[0]['os_storage']))
$data = @file_get_contents(dbunescbin($r[0]['content']));
else
- $data = dbunescbin($r[0]['content']);
-
+ $data = dbunescbin($r[0]['content']);
+
$ph = photo_factory($data, $r[0]['mimetype']);
$smallest = 0;
if($ph->is_valid()) {
@@ -396,7 +396,7 @@ class Cover_photo extends \Zotlabs\Web\Controller {
dbesc($r[0]['resource_id']),
intval(local_channel())
);
-
+
if($i) {
$hash = $i[0]['resource_id'];
foreach($i as $ii) {
@@ -404,15 +404,15 @@ class Cover_photo extends \Zotlabs\Web\Controller {
}
}
}
-
+
$this->cover_photo_crop_ui_head($a, $ph, $hash, $smallest);
}
-
-
+
+
if(! x(\App::$data,'imagecrop')) {
-
+
$tpl = get_markup_template('cover_photo.tpl');
-
+
$o .= replace_macros($tpl,array(
'$user' => \App::$channel['channel_address'],
'$info' => t('Your cover photo may be visible to anybody on the internet'),
@@ -422,7 +422,7 @@ class Cover_photo extends \Zotlabs\Web\Controller {
'$title' => t('Change Cover Photo'),
'$submit' => t('Upload'),
'$remove' => t('Remove'),
- '$profiles' => $profiles,
+ '$profiles' => false,
'$embedPhotos' => t('Use a photo from your albums'),
'$embedPhotosModalTitle' => t('Use a photo from your albums'),
'$embedPhotosModalCancel' => t('Cancel'),
@@ -434,13 +434,13 @@ class Cover_photo extends \Zotlabs\Web\Controller {
'$modalerrorlink' => t('Error getting photo link'),
'$modalerroralbum' => t('Error getting album'),
'$form_security_token' => get_form_security_token("cover_photo"),
- /// @FIXME - yuk
+ /// @FIXME - yuk
'$select' => t('Select existing photo'),
));
-
+
call_hooks('cover_photo_content_end', $o);
-
+
return $o;
}
else {
@@ -459,10 +459,8 @@ class Cover_photo extends \Zotlabs\Web\Controller {
));
return $o;
}
-
- return; // NOTREACHED
}
-
+
/* @brief Generate the UI for photo-cropping
*
* @param $a Current application
@@ -470,30 +468,30 @@ class Cover_photo extends \Zotlabs\Web\Controller {
* @return void
*
*/
-
+
function cover_photo_crop_ui_head(&$a, $ph, $hash, $smallest){
-
+
$max_length = get_config('system','max_image_length');
if(! $max_length)
$max_length = MAX_IMAGE_LENGTH;
if($max_length > 0)
$ph->scaleImage($max_length);
-
+
$width = $ph->getWidth();
$height = $ph->getHeight();
-
+
if($width < 300 || $height < 300) {
$ph->scaleImageUp(240);
$width = $ph->getWidth();
$height = $ph->getHeight();
}
-
-
+
+
\App::$data['imagecrop'] = $hash;
\App::$data['imagecrop_resolution'] = $smallest;
\App::$page['htmlhead'] .= replace_macros(get_markup_template("crophead.tpl"), array());
return;
}
-
-
+
+
}
diff --git a/Zotlabs/Module/Defperms.php b/Zotlabs/Module/Defperms.php
index 70270d36b..3ca5c6252 100644
--- a/Zotlabs/Module/Defperms.php
+++ b/Zotlabs/Module/Defperms.php
@@ -258,7 +258,6 @@ class Defperms extends Controller {
'$sections' => $sections,
'$autolbl' => t('The permissions indicated on this page will be applied to all new connections.'),
'$autoapprove' => t('Automatic approval settings'),
- '$unapproved' => $unapproved,
'$inherited' => t('inherited'),
'$submit' => t('Submit'),
'$me' => t('My Settings'),
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index 29d592e19..4e7c1587c 100644
--- a/Zotlabs/Module/Display.php
+++ b/Zotlabs/Module/Display.php
@@ -74,7 +74,7 @@ class Display extends \Zotlabs\Web\Controller {
'allow_location' => ((intval(get_pconfig($channel['channel_id'],'system','use_browser_location'))) ? '1' : ''),
'default_location' => $channel['channel_location'],
'nickname' => $channel['channel_address'],
- 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
+ 'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => populate_acl($channel_acl,true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'),
'permissions' => $channel_acl,
'bang' => '',
diff --git a/Zotlabs/Module/Fhublocs.php b/Zotlabs/Module/Fhublocs.php
index 9dcece715..df847c835 100644
--- a/Zotlabs/Module/Fhublocs.php
+++ b/Zotlabs/Module/Fhublocs.php
@@ -78,7 +78,7 @@ class Fhublocs extends \Zotlabs\Web\Controller {
);
if($h)
- $o . 'local hubloc created for ' . $rr['channel_name'] . EOL;
+ $o .= 'local hubloc created for ' . $rr['channel_name'] . EOL;
else
$o .= 'DB update failed for ' . $rr['channel_name'] . EOL;
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 3104ce9fb..a5e7b31ea 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -1099,7 +1099,6 @@ class Item extends Controller {
$datarray['item_type'] = $webpage;
$datarray['item_private'] = intval($private);
$datarray['item_thread_top'] = intval($item_thread_top);
- $datarray['item_unseen'] = intval($item_unseen);
$datarray['item_starred'] = intval($item_starred);
$datarray['item_uplink'] = intval($item_uplink);
$datarray['item_consensus'] = intval($item_consensus);
diff --git a/Zotlabs/Module/Lostpass.php b/Zotlabs/Module/Lostpass.php
index 072657d7b..83478bb10 100644
--- a/Zotlabs/Module/Lostpass.php
+++ b/Zotlabs/Module/Lostpass.php
@@ -6,32 +6,32 @@ namespace Zotlabs\Module;
class Lostpass extends \Zotlabs\Web\Controller {
function post() {
-
+
$loginame = notags(trim($_POST['login-name']));
if(! $loginame)
goaway(z_root());
-
+
$r = q("SELECT * FROM account WHERE account_email = '%s' LIMIT 1",
dbesc($loginame)
);
-
+
if(! $r) {
notice( t('No valid account found.') . EOL);
goaway(z_root());
}
-
+
$aid = $r[0]['account_id'];
$email = $r[0]['account_email'];
-
+
$hash = random_string();
-
+
$r = q("UPDATE account SET account_reset = '%s' WHERE account_id = %d",
dbesc($hash),
intval($aid)
);
if($r)
info( t('Password reset request issued. Check your email.') . EOL);
-
+
$email_tpl = get_intltext_template("lostpass_eml.tpl");
$message = replace_macros($email_tpl, array(
'$sitename' => get_config('system','sitename'),
@@ -40,11 +40,11 @@ class Lostpass extends \Zotlabs\Web\Controller {
'$email' => $email,
'$reset_link' => z_root() . '/lostpass?verify=' . $hash
));
-
+
$subject = email_header_encode(sprintf( t('Password reset requested at %s'),get_config('system','sitename')), 'UTF-8');
-
+
$res = z_mail(
- [
+ [
'toEmail' => $email,
'messageSubject' => sprintf( t('Password reset requested at %s'), get_config('system','sitename')),
'textVersion' => $message,
@@ -53,14 +53,14 @@ class Lostpass extends \Zotlabs\Web\Controller {
goaway(z_root());
}
-
-
+
+
function get() {
-
-
+
+
if(x($_GET,'verify')) {
$verify = $_GET['verify'];
-
+
$r = q("SELECT * FROM account WHERE account_reset = '%s' LIMIT 1",
dbesc($verify)
);
@@ -69,22 +69,22 @@ class Lostpass extends \Zotlabs\Web\Controller {
goaway(z_root());
return;
}
-
+
$aid = $r[0]['account_id'];
$email = $r[0]['account_email'];
-
+
$new_password = autoname(6) . mt_rand(100,9999);
-
+
$salt = random_string(32);
$password_encoded = hash('whirlpool', $salt . $new_password);
-
+
$r = q("UPDATE account SET account_salt = '%s', account_password = '%s', account_reset = '', account_flags = (account_flags & ~%d) where account_id = %d",
dbesc($salt),
dbesc($password_encoded),
intval(ACCOUNT_UNVERIFIED),
intval($aid)
);
-
+
if($r) {
$tpl = get_markup_template('pwdreset.tpl');
$o .= replace_macros($tpl,array(
@@ -96,23 +96,23 @@ class Lostpass extends \Zotlabs\Web\Controller {
'$lbl6' => t('Your password may be changed from the <em>Settings</em> page after successful login.'),
'$newpass' => $new_password,
'$baseurl' => z_root()
-
+
));
-
+
info("Your password has been reset." . EOL);
-
+
$email_tpl = get_intltext_template("passchanged_eml.tpl");
$message = replace_macros($email_tpl, array(
'$sitename' => \App::$config['sitename'],
'$siteurl' => z_root(),
'$username' => sprintf( t('Site Member (%s)'), $email),
'$email' => $email,
- '$new_password' => $new_password,
- '$uid' => $newuid )
+ '$new_password' => $new_password
+ )
);
-
+
$res = z_mail(
- [
+ [
'toEmail' => $email,
'messageSubject' => sprintf( t('Your password has changed at %s'), get_config('system','sitename')),
'textVersion' => $message,
@@ -121,21 +121,21 @@ class Lostpass extends \Zotlabs\Web\Controller {
return $o;
}
-
+
}
else {
$tpl = get_markup_template('lostpass.tpl');
-
+
$o .= replace_macros($tpl,array(
'$title' => t('Forgot your Password?'),
'$desc' => t('Enter your email address and submit to have your password reset. Then check your email for further instructions.'),
'$name' => t('Email Address'),
- '$submit' => t('Reset')
+ '$submit' => t('Reset')
));
-
+
return $o;
}
-
+
}
-
+
}
diff --git a/Zotlabs/Module/Poke.php b/Zotlabs/Module/Poke.php
index 596de58a3..c46896e52 100644
--- a/Zotlabs/Module/Poke.php
+++ b/Zotlabs/Module/Poke.php
@@ -121,7 +121,6 @@ class Poke extends Controller {
$arr['obj_type'] = ACTIVITY_OBJ_NOTE;
$arr['body'] = '[zrl=' . $channel['xchan_url'] . ']' . $channel['xchan_name'] . '[/zrl]' . ' ' . t($verbs[$verb][0]) . ' ' . '[zrl=' . $target['xchan_url'] . ']' . $target['xchan_name'] . '[/zrl]';
$arr['item_origin'] = 1;
- $arr['item_wall'] = 1;
$arr['item_unseen'] = 1;
if(! $parent_item)
$arr['item_thread_top'] = 1;
diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php
index a5e87bbe2..d7e2bbce1 100644
--- a/Zotlabs/Module/Profile_photo.php
+++ b/Zotlabs/Module/Profile_photo.php
@@ -587,7 +587,6 @@ class Profile_photo extends Controller {
return $o;
}
- return; // NOTREACHED
}
/* @brief Generate the UI for photo-cropping
diff --git a/Zotlabs/Module/Regate.php b/Zotlabs/Module/Regate.php
index 33bb8d957..ac6273951 100644
--- a/Zotlabs/Module/Regate.php
+++ b/Zotlabs/Module/Regate.php
@@ -443,7 +443,7 @@ class Regate extends \Zotlabs\Web\Controller {
$msg = t('Unknown or expired ID');
zar_log('ZAR1132E ' . $msg . ':' . $did2 . ',' . $didx);
$o = replace_macros(get_markup_template('plain.tpl'), [
- '$title' => $title,
+ '$title' => $msg,
'$now' => $nowfmt,
'$infos' => $msg
]);
diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php
index 683fcdc36..0d423e0cd 100644
--- a/Zotlabs/Module/Register.php
+++ b/Zotlabs/Module/Register.php
@@ -87,7 +87,7 @@ class Register extends Controller {
$name_error = validate_channelname($name);
if($name_error) {
notice($name_error . EOL);
- return $ret;
+ return;
}
$nick = mb_strtolower(escape_tags(trim($arr['nickname'])));
@@ -166,7 +166,7 @@ class Register extends Controller {
if(!empty($password_result['error'])) {
$msg = $password_result['message'];
notice($msg);
- zar_log($msg . ' ' . $did2);
+ zar_log($msg);
return;
}
@@ -239,7 +239,7 @@ class Register extends Controller {
);
$msg = t('Invitation code succesfully applied');
- zar_log('ZAR0237I ' . $msg) . ', ' . $email;
+ zar_log('ZAR0237I ' . $msg . ', ' . $email);
// msg!
info($msg . EOL);
diff --git a/Zotlabs/Module/Tagger.php b/Zotlabs/Module/Tagger.php
index 4fbfb7070..4aaae5885 100644
--- a/Zotlabs/Module/Tagger.php
+++ b/Zotlabs/Module/Tagger.php
@@ -12,11 +12,11 @@ require_once('include/items.php');
class Tagger extends \Zotlabs\Web\Controller {
function get() {
-
+
if(! local_channel()) {
return;
}
-
+
$sys = get_sys_channel();
$observer_hash = get_observer_hash();
@@ -25,23 +25,23 @@ class Tagger extends \Zotlabs\Web\Controller {
//check if empty
if(! $term)
return;
-
+
$item_id = ((argc() > 1) ? notags(trim(argv(1))) : 0);
-
+
logger('tagger: tag ' . $term . ' item ' . $item_id);
-
+
$r = q("select * from item where id = %d and uid = %d limit 1",
intval($item_id),
intval(local_channel())
- );
+ );
if(! $r) {
$r = q("select * from item where id = %d and uid = %d limit 1",
intval($item_id),
intval($sys['channel_id'])
- );
+ );
if($r) {
- $r = [ copy_of_pubitem($channel, $i[0]['mid']) ];
+ $r = [ copy_of_pubitem($channel, $r[0]['mid']) ];
$item_id = (($r) ? $r[0]['id'] : 0);
}
}
@@ -55,16 +55,16 @@ class Tagger extends \Zotlabs\Web\Controller {
intval($item_id),
intval(local_channel())
);
-
+
if((! $item_id) || (! $r)) {
logger('tagger: no item ' . $item_id);
return;
}
-
+
$item = $r[0];
-
+
$owner_uid = $item['uid'];
-
+
switch($item['resource_type']) {
case 'photo':
$targettype = ACTIVITY_OBJ_PHOTO;
@@ -81,13 +81,13 @@ class Tagger extends \Zotlabs\Web\Controller {
$post_type = t('comment');
break;
}
-
+
$clean_term = trim($term,'"\' ');
-
- $links = array(array('rel' => 'alternate','type' => 'text/html',
+
+ $links = array(array('rel' => 'alternate','type' => 'text/html',
'href' => z_root() . '/display/' . gen_link_id($item['mid'])));
-
+
$target = json_encode(array(
'type' => $targettype,
'id' => $item['mid'],
@@ -106,10 +106,10 @@ class Tagger extends \Zotlabs\Web\Controller {
array('rel' => 'photo', 'type' => $item['xchan_photo_mimetype'], 'href' => $item['xchan_photo_m'])),
),
));
-
+
$tagid = z_root() . '/search?tag=' . $clean_term;
$objtype = ACTIVITY_OBJ_TAGTERM;
-
+
$obj = json_encode(array(
'type' => $objtype,
'id' => $tagid,
@@ -117,30 +117,30 @@ class Tagger extends \Zotlabs\Web\Controller {
'title' => $clean_term,
'content' => $clean_term
));
-
+
$bodyverb = t('%1$s tagged %2$s\'s %3$s with %4$s');
-
+
// saving here for reference
// also check out x22d5 and x2317 and x0d6b and x0db8 and x24d0 and xff20 !!!
-
+
$termlink = html_entity_decode('&#x22d5;') . '[zrl=' . z_root() . '/search?tag=' . urlencode($clean_term) . ']'. $clean_term . '[/zrl]';
-
+
$channel = \App::get_channel();
-
+
$arr = array();
-
+
$arr['owner_xchan'] = $item['owner_xchan'];
$arr['author_xchan'] = $channel['channel_hash'];
-
+
$arr['item_origin'] = 1;
$arr['item_wall'] = ((intval($item['item_wall'])) ? 1 : 0);
-
+
$ulink = '[zrl=' . $channel['xchan_url'] . ']' . $channel['channel_name'] . '[/zrl]';
$alink = '[zrl=' . $item['xchan_url'] . ']' . $item['xchan_name'] . '[/zrl]';
$plink = '[zrl=' . $item['plink'] . ']' . $post_type . '[/zrl]';
-
+
$arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink, $termlink );
-
+
$arr['verb'] = ACTIVITY_TAG;
$arr['tgt_type'] = $targettype;
$arr['target'] = $target;
@@ -152,14 +152,14 @@ class Tagger extends \Zotlabs\Web\Controller {
if($ret['success']) {
Libsync::build_sync_packet(local_channel(),
- [
+ [
'item' => [ encode_item($ret['activity'],true) ]
]
);
}
-
+
killme();
-
+
}
-
+
}
diff --git a/Zotlabs/Module/Tokens.php b/Zotlabs/Module/Tokens.php
index 701f29c19..90681180e 100644
--- a/Zotlabs/Module/Tokens.php
+++ b/Zotlabs/Module/Tokens.php
@@ -90,8 +90,8 @@ class Tokens extends Controller {
$r = q("select count(atoken_id) as total where atoken_uid = %d",
intval($channel['channel_id'])
);
- if($r && intval($r[0]['total']) >= $max_tokens) {
- notice( sprintf( t('This channel is limited to %d tokens'), $max_tokens) . EOL);
+ if($r && intval($r[0]['total']) >= $max_atokens) {
+ notice( sprintf( t('This channel is limited to %d tokens'), $max_atokens) . EOL);
return;
}
}
diff --git a/Zotlabs/Module/Viewconnections.php b/Zotlabs/Module/Viewconnections.php
index d54f61c36..d321ca8fe 100644
--- a/Zotlabs/Module/Viewconnections.php
+++ b/Zotlabs/Module/Viewconnections.php
@@ -37,7 +37,7 @@ class Viewconnections extends \Zotlabs\Web\Controller {
if(! $_REQUEST['aj'])
$_SESSION['return_url'] = \App::$query_string;
-
+ $o = '';
$is_owner = ((local_channel() && local_channel() == \App::$profile['uid']) ? true : false);
$abook_flags = " and abook_pending = 0 and abook_self = 0 and abook_blocked = 0 and abook_ignored = 0 ";
@@ -118,12 +118,12 @@ class Viewconnections extends \Zotlabs\Web\Controller {
if($_REQUEST['aj']) {
if($contacts) {
- $o = replace_macros(get_markup_template('viewcontactsajax.tpl'),array(
+ $o .= replace_macros(get_markup_template('viewcontactsajax.tpl'),array(
'$contacts' => $contacts
));
}
else {
- $o = '<div id="content-complete"></div>';
+ $o .= '<div id="content-complete"></div>';
}
echo $o;
killme();
diff --git a/Zotlabs/Module/Well_known.php b/Zotlabs/Module/Well_known.php
index af59b76e0..9cc31a7d3 100644
--- a/Zotlabs/Module/Well_known.php
+++ b/Zotlabs/Module/Well_known.php
@@ -34,7 +34,6 @@ class Well_known extends \Zotlabs\Web\Controller {
$module = new \Zotlabs\Module\Wfinger();
$module->init();
break;
-
case 'host-meta':
\App::$argc -= 1;
array_shift(\App::$argv);
@@ -42,7 +41,6 @@ class Well_known extends \Zotlabs\Web\Controller {
$module = new \Zotlabs\Module\Hostxrd();
$module->init();
break;
-
case 'oauth-authorization-server':
case 'openid-configuration':
\App::$argc -= 1;
@@ -51,18 +49,17 @@ class Well_known extends \Zotlabs\Web\Controller {
$module = new \Zotlabs\Module\Oauthinfo();
$module->init();
break;
-
case 'dnt-policy.txt':
echo file_get_contents('doc/dnt-policy.txt');
killme();
-
+ break;
case 'caldav':
case 'carddav':
- if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') {
- http_status('301', 'moved permanently');
- goaway(z_root() . '/cdav');
- };
-
+ if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') {
+ http_status('301', 'moved permanently');
+ goaway(z_root() . '/cdav');
+ };
+ break;
default:
if(file_exists(\App::$cmd)) {
echo file_get_contents(\App::$cmd);
@@ -71,10 +68,8 @@ class Well_known extends \Zotlabs\Web\Controller {
elseif(file_exists(\App::$cmd . '.php'))
require_once(\App::$cmd . '.php');
break;
-
}
}
-
http_status_exit(404);
}
}
diff --git a/Zotlabs/Storage/Directory.php b/Zotlabs/Storage/Directory.php
index 87ca220d6..683887b31 100644
--- a/Zotlabs/Storage/Directory.php
+++ b/Zotlabs/Storage/Directory.php
@@ -270,7 +270,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo
dbesc($mimetype),
intval($filesize),
intval(0),
- intval($is_photo),
+ intval(0),
dbesc($f),
dbesc(datetime_convert()),
dbesc(datetime_convert()),
@@ -319,8 +319,9 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo
// If we know it's a photo, over-ride the type in case the source system could not determine what it was
if($is_photo) {
- q("update attach set filetype = '%s' where hash = '%s' and uid = %d",
+ q("update attach set filetype = '%s', is_photo = %d where hash = '%s' and uid = %d",
dbesc($gis['mime']),
+ intval($is_photo),
dbesc($hash),
intval($c[0]['channel_id'])
);