Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
zottel 2016-07-08 09:10:52 +02:00
commit 806ca4c842
8 changed files with 33 additions and 44 deletions

View File

@ -38,7 +38,7 @@ class Expire {
logger('site_expire: ' . $site_expire); logger('site_expire: ' . $site_expire);
$r = q("SELECT channel_id, channel_address, channel_pageflags, channel_expire_days from channel where true"); $r = q("SELECT channel_id, channel_system, channel_address, channel_expire_days from channel where true");
if ($r) { if ($r) {
foreach ($r as $rr) { foreach ($r as $rr) {

View File

@ -23,7 +23,6 @@ require_once('vendor/autoload.php');
class Cloud extends \Zotlabs\Web\Controller { class Cloud extends \Zotlabs\Web\Controller {
function init() { function init() {
require_once('include/reddav.php');
if (! is_dir('store')) if (! is_dir('store'))
os_mkdir('store', STORAGE_DEFAULT_PERMISSIONS, false); os_mkdir('store', STORAGE_DEFAULT_PERMISSIONS, false);
@ -79,17 +78,6 @@ class Cloud extends \Zotlabs\Web\Controller {
$is_readable = false; $is_readable = false;
if($_SERVER['REQUEST_METHOD'] === 'GET') {
try {
$x = RedFileData('/' . \App::$cmd, $auth);
}
catch(\Exception $e) {
if($e instanceof Sabre\DAV\Exception\Forbidden) {
http_status_exit(401, 'Permission denied.');
}
}
}
// provide a directory view for the cloud in Hubzilla // provide a directory view for the cloud in Hubzilla
$browser = new \Zotlabs\Storage\Browser($auth); $browser = new \Zotlabs\Storage\Browser($auth);
$auth->setBrowserPlugin($browser); $auth->setBrowserPlugin($browser);

View File

@ -44,8 +44,6 @@ class Dav extends \Zotlabs\Web\Controller {
} }
} }
require_once('include/reddav.php');
if (! is_dir('store')) if (! is_dir('store'))
os_mkdir('store', STORAGE_DEFAULT_PERMISSIONS, false); os_mkdir('store', STORAGE_DEFAULT_PERMISSIONS, false);

View File

@ -146,6 +146,7 @@ class Dreport extends \Zotlabs\Web\Controller {
'$title' => sprintf( t('Delivery report for %1$s'),substr($mid,0,32)) . '...', '$title' => sprintf( t('Delivery report for %1$s'),substr($mid,0,32)) . '...',
'$table' => $table, '$table' => $table,
'$mid' => urlencode($mid), '$mid' => urlencode($mid),
'$options' => t('Options'),
'$push' => t('Redeliver'), '$push' => t('Redeliver'),
'$entries' => $entries '$entries' => $entries
)); ));

View File

@ -93,7 +93,7 @@ class Item extends \Zotlabs\Web\Controller {
$origin = (($api_source && array_key_exists('origin',$_REQUEST)) ? intval($_REQUEST['origin']) : 1); $origin = (($api_source && array_key_exists('origin',$_REQUEST)) ? intval($_REQUEST['origin']) : 1);
// To represent message-ids on other networks - this will create an item_id record // To represent message-ids on other networks - this will create an iconfig record
$namespace = (($api_source && array_key_exists('namespace',$_REQUEST)) ? strip_tags($_REQUEST['namespace']) : ''); $namespace = (($api_source && array_key_exists('namespace',$_REQUEST)) ? strip_tags($_REQUEST['namespace']) : '');
$remote_id = (($api_source && array_key_exists('remote_id',$_REQUEST)) ? strip_tags($_REQUEST['remote_id']) : ''); $remote_id = (($api_source && array_key_exists('remote_id',$_REQUEST)) ? strip_tags($_REQUEST['remote_id']) : '');
@ -535,7 +535,7 @@ class Item extends \Zotlabs\Web\Controller {
} }
/** /**
* fix naked links by passing through a callback to see if this is a red site * fix naked links by passing through a callback to see if this is a hubzilla site
* (already known to us) which will get a zrl, otherwise link with url, add bookmark tag to both. * (already known to us) which will get a zrl, otherwise link with url, add bookmark tag to both.
* First protect any url inside certain bbcode tags so we don't double link it. * First protect any url inside certain bbcode tags so we don't double link it.
*/ */
@ -834,21 +834,23 @@ class Item extends \Zotlabs\Web\Controller {
if($orig_post) if($orig_post)
$datarray['edit'] = true; $datarray['edit'] = true;
// suppress duplicates, *unless* you're editing an existing post. This could get picked up
// as a duplicate if you're editing it very soon after posting it initially and you edited
// some attribute besides the content, such as title or categories.
if(feature_enabled($profile_uid,'suppress_duplicates') && (! $orig_post)) { if(feature_enabled($profile_uid,'suppress_duplicates') && (! $orig_post)) {
$z = q("select created from item where uid = %d and body = '%s'", $z = q("select created from item where uid = %d and created > %s - INTERVAL %s and body = '%s' limit 1",
intval($profile_uid), intval($profile_uid),
db_utcnow(),
db_quoteinterval('2 MINUTE'),
dbesc($body) dbesc($body)
); );
if($z) { if($z) {
foreach($z as $zz) { $datarray['cancel'] = 1;
if($zz['created'] > datetime_convert('UTC','UTC', 'now - 2 minutes')) { notice( t('Duplicate post suppressed.') . EOL);
$datarray['cancel'] = 1; logger('Duplicate post. Faking plugin cancel.');
notice( t('Duplicate post suppressed.') . EOL);
logger('Duplicate post. Faking plugin cancel.');
}
}
} }
} }

View File

@ -206,6 +206,8 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota {
throw new DAV\Exception\Forbidden('Permission denied.'); throw new DAV\Exception\Forbidden('Permission denied.');
} }
require_once('include/attach.php');
$mimetype = z_mime_content_type($name); $mimetype = z_mime_content_type($name);
$c = q("SELECT * FROM channel WHERE channel_id = %d AND channel_removed = 0 LIMIT 1", $c = q("SELECT * FROM channel WHERE channel_id = %d AND channel_removed = 0 LIMIT 1",

View File

@ -3286,15 +3286,17 @@ function item_expire($uid,$days) {
$item_normal = item_normal(); $item_normal = item_normal();
$r = q("SELECT * FROM `item` $r = q("SELECT id FROM item
WHERE `uid` = %d WHERE uid = %d
AND `created` < %s - INTERVAL %s AND created < %s - INTERVAL %s
AND `id` = `parent`
$sql_extra
AND item_retained = 0 AND item_retained = 0
$item_normal LIMIT $expire_limit ", AND item_thread_top = 1
AND resource_type = ''
AND item_starred = 0
$sql_extra $item_normal LIMIT $expire_limit ",
intval($uid), intval($uid),
db_utcnow(), db_quoteinterval(intval($days).' DAY') db_utcnow(),
db_quoteinterval(intval($days).' DAY')
); );
if(! $r) if(! $r)
@ -3312,17 +3314,6 @@ function item_expire($uid,$days) {
continue; continue;
} }
// Only expire posts, not photos and photo comments
if($item['resource_type'] === 'photo') {
retain_item($item['id']);
continue;
}
if(intval($item['item_starred'])) {
retain_item($item['id']);
continue;
}
drop_item($item['id'],false); drop_item($item['id'],false);
} }

View File

@ -1,7 +1,14 @@
<div class="generic-content-wrapper"> <div class="generic-content-wrapper">
<div class="section-title-wrapper"> <div class="section-title-wrapper">
{{if $table == 'item'}} {{if $table == 'item'}}
<a href="dreport/push/{{$mid}}"><button class="btn btn-default btn-xs pull-right">{{$push}}</button></a> <div class="dropdown pull-right">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="{{$options}}">
<i class="fa fa-sort-desc"></i>
</button>
<ul class="dropdown-menu">
<li><a href="dreport/push/{{$mid}}">{{$push}}</a></li>
</ul>
</div>
{{/if}} {{/if}}
<h2>{{$title}}</h2> <h2>{{$title}}</h2>
</div> </div>