Closed #67
This commit is contained in:
parent
fb5e851a13
commit
a98c61ebf3
2 changed files with 10 additions and 2 deletions
|
@ -13,6 +13,7 @@ salt = "1A2/$_4xVa"
|
||||||
[misc]
|
[misc]
|
||||||
featuredPostMaxDays=7
|
featuredPostMaxDays=7
|
||||||
debugQueries=0
|
debugQueries=0
|
||||||
|
logAnonymousUploads=1
|
||||||
|
|
||||||
[help]
|
[help]
|
||||||
title=Help
|
title=Help
|
||||||
|
|
|
@ -317,6 +317,9 @@ class PostController
|
||||||
$suppliedSource = InputHelper::get('source');
|
$suppliedSource = InputHelper::get('source');
|
||||||
$suppliedSource = Model_Post::validateSource($suppliedSource);
|
$suppliedSource = Model_Post::validateSource($suppliedSource);
|
||||||
|
|
||||||
|
/* anonymous */
|
||||||
|
$anonymous = InputHelper::get('anonymous');
|
||||||
|
|
||||||
/* db storage */
|
/* db storage */
|
||||||
$dbPost = R::dispense('post');
|
$dbPost = R::dispense('post');
|
||||||
$dbPost->type = $postType;
|
$dbPost->type = $postType;
|
||||||
|
@ -331,7 +334,7 @@ class PostController
|
||||||
$dbPost->upload_date = time();
|
$dbPost->upload_date = time();
|
||||||
$dbPost->image_width = $imageWidth;
|
$dbPost->image_width = $imageWidth;
|
||||||
$dbPost->image_height = $imageHeight;
|
$dbPost->image_height = $imageHeight;
|
||||||
if ($this->context->loggedIn and !InputHelper::get('anonymous'))
|
if ($this->context->loggedIn and !$anonymous)
|
||||||
$dbPost->uploader = $this->context->user;
|
$dbPost->uploader = $this->context->user;
|
||||||
$dbPost->ownFavoritee = [];
|
$dbPost->ownFavoritee = [];
|
||||||
$dbPost->sharedTag = $dbTags;
|
$dbPost->sharedTag = $dbTags;
|
||||||
|
@ -345,7 +348,11 @@ class PostController
|
||||||
}
|
}
|
||||||
R::store($dbPost);
|
R::store($dbPost);
|
||||||
|
|
||||||
LogHelper::logEvent('post-new', '{user} added {post} tagged with {tags} marked as {safety}', [
|
$fmt = ($anonymous and !$this->config->misc->logAnonymousUploads)
|
||||||
|
? 'someone'
|
||||||
|
: '{user}';
|
||||||
|
$fmt .= ' added {post} tagged with {tags} marked as {safety}';
|
||||||
|
LogHelper::logEvent('post-new', $fmt, [
|
||||||
'post' => TextHelper::reprPost($dbPost),
|
'post' => TextHelper::reprPost($dbPost),
|
||||||
'tags' => join(', ', array_map(['TextHelper', 'reprTag'], $dbTags)),
|
'tags' => join(', ', array_map(['TextHelper', 'reprTag'], $dbTags)),
|
||||||
'safety' => PostSafety::toString($dbPost->safety)]);
|
'safety' => PostSafety::toString($dbPost->safety)]);
|
||||||
|
|
Loading…
Reference in a new issue