aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-10-16 16:19:19 -0700
committerfriendica <info@friendica.com>2014-10-16 16:19:19 -0700
commit7bbe700f3f170cc4527131165a9b9ab1f99e5cd1 (patch)
tree8d04658594fe651637aaad89dda82d6ca3990cc8
parent8391e8b1a179b9bda9198e0eb54171b4b88eb5f0 (diff)
downloadvolse-hubzilla-7bbe700f3f170cc4527131165a9b9ab1f99e5cd1.tar.gz
volse-hubzilla-7bbe700f3f170cc4527131165a9b9ab1f99e5cd1.tar.bz2
volse-hubzilla-7bbe700f3f170cc4527131165a9b9ab1f99e5cd1.zip
mark signature forgeries
-rwxr-xr-xboot.php1
-rw-r--r--include/ItemObject.php4
-rw-r--r--include/conversation.php6
-rw-r--r--view/css/conversation.css5
-rwxr-xr-xview/tpl/conv_item.tpl2
-rwxr-xr-xview/tpl/search_item.tpl2
6 files changed, 16 insertions, 4 deletions
diff --git a/boot.php b/boot.php
index 1824e792f..14d0a61a5 100755
--- a/boot.php
+++ b/boot.php
@@ -555,6 +555,7 @@ define ( 'ITEM_VERIFIED', 0x2000); // Signature verification was success
define ( 'ITEM_RETAINED', 0x4000); // We looked at this item once to decide whether or not to expire it, and decided not to.
define ( 'ITEM_RSS', 0x8000); // Item comes from a feed. Use this to decide whether to link the title
// Don't make us evaluate this same item again.
+
/**
*
* Reverse the effect of magic_quotes_gpc if it is enabled.
diff --git a/include/ItemObject.php b/include/ItemObject.php
index 7c75e35bd..90c036def 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -191,7 +191,8 @@ class Item extends BaseObject {
}
- $verified = (($item['item_flags'] & ITEM_VERIFIED) ? t('Message is verified') : '');
+ $verified = (($item['item_flags'] & ITEM_VERIFIED) ? t('Message signature validated') : '');
+ $forged = ((($item['sig']) && (! ($item['item_flags'] & ITEM_VERIFIED))) ? t('Message signature incorrect') : '');
$unverified = '' ; // (($this->is_wall_to_wall() && (! ($item['item_flags'] & ITEM_VERIFIED))) ? t('Message cannot be verified') : '');
@@ -269,6 +270,7 @@ class Item extends BaseObject {
'lock' => $lock,
'verified' => $verified,
'unverified' => $unverified,
+ 'forged' => $forged,
'location' => $location,
'indent' => $indent,
'owner_url' => $this->get_owner_url(),
diff --git a/include/conversation.php b/include/conversation.php
index 92ba18d13..b22b570a1 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -649,7 +649,10 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
$likebuttons = false;
$shareable = false;
- $verified = (($item['item_flags'] & ITEM_VERIFIED) ? t('Message is verified') : '');
+ $verified = (($item['item_flags'] & ITEM_VERIFIED) ? t('Message signature validated') : '');
+ $forged = ((($item['sig']) && (! ($item['item_flags'] & ITEM_VERIFIED))) ? t('Message signature incorrect') : '');
+
+
$unverified = '';
@@ -682,6 +685,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
'mentions' => $mentions,
'verified' => $verified,
'unverified' => $unverified,
+ 'forged' => $forged,
'txt_cats' => t('Categories:'),
'txt_folders' => t('Filed under:'),
'has_cats' => ((count($categories)) ? 'true' : ''),
diff --git a/view/css/conversation.css b/view/css/conversation.css
index 9fb4093ca..6c9d757b1 100644
--- a/view/css/conversation.css
+++ b/view/css/conversation.css
@@ -258,3 +258,8 @@ a.wall-item-name-link {
pointer-events: none;
cursor: default;
}
+
+.item-forged {
+ color: #FF0000;
+ font-size: 1.5em !important;
+} \ No newline at end of file
diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl
index ff69fd379..00b3b6ced 100755
--- a/view/tpl/conv_item.tpl
+++ b/view/tpl/conv_item.tpl
@@ -28,7 +28,7 @@
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}}&nbsp;{{$item.via}}&nbsp;<a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}}
</div>
<div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">
- {{if $item.verified}}<i class="icon-ok" title="{{$item.verified}}"></i>&nbsp;{{/if}}{{if $item.location}}<span class="wall-item-location" id="wall-item-location-{{$item.id}}">{{$item.location}},&nbsp;</span>{{/if}}<span class="autotime" title="{{$item.isotime}}">{{$item.localtime}}{{if $item.editedtime}}&nbsp;{{$item.editedtime}}{{/if}}{{if $item.expiretime}}&nbsp;{{$item.expiretime}}{{/if}}</span>{{if $item.editedtime}}&nbsp;<i class="icon-pencil"></i>{{/if}}&nbsp;{{if $item.app}}<span class="item.app">{{$item.str_app}}</span>{{/if}}
+ {{if $item.verified}}<i class="icon-ok" title="{{$item.verified}}"></i>&nbsp;{{elseif $item.forged}}<i class="icon-remove item-forged" title="{{$item.forged}}"></i>&nbsp;{{/if}}{{if $item.location}}<span class="wall-item-location" id="wall-item-location-{{$item.id}}">{{$item.location}},&nbsp;</span>{{/if}}<span class="autotime" title="{{$item.isotime}}">{{$item.localtime}}{{if $item.editedtime}}&nbsp;{{$item.editedtime}}{{/if}}{{if $item.expiretime}}&nbsp;{{$item.expiretime}}{{/if}}</span>{{if $item.editedtime}}&nbsp;<i class="icon-pencil"></i>{{/if}}&nbsp;{{if $item.app}}<span class="item.app">{{$item.str_app}}</span>{{/if}}
</div>
<div class="wall-item-content" id="wall-item-content-{{$item.id}}">
<div class="wall-item-title-end"></div>
diff --git a/view/tpl/search_item.tpl b/view/tpl/search_item.tpl
index 6719f2e75..fe683b91a 100755
--- a/view/tpl/search_item.tpl
+++ b/view/tpl/search_item.tpl
@@ -20,7 +20,7 @@
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}}&nbsp;{{$item.via}}&nbsp;<a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}}
</div>
<div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">
- {{if $item.verified}}<i class="icon-ok" title="{{$item.verified}}"></i>&nbsp;{{/if}}{{if $item.location}}<span class="wall-item-location" id="wall-item-location-{{$item.id}}">{{$item.location}},&nbsp;</span>{{/if}}<span class="autotime" title="{{$item.isotime}}">{{$item.localtime}}{{if $item.editedtime}}&nbsp;{{$item.editedtime}}{{/if}}{{if $item.expiretime}}&nbsp;{{$item.expiretime}}{{/if}}</span>{{if $item.editedtime}}&nbsp;<i class="icon-pencil"></i>{{/if}}&nbsp;{{if $item.app}}<span class="item.app">{{$item.str_app}}</span>{{/if}}
+ {{if $item.verified}}<i class="icon-ok" title="{{$item.verified}}"></i>&nbsp;{{elseif $item.forged}}<i class="icon-remove item-forged" title="{{$item.forged}}"></i>&nbsp;{{/if}}{{if $item.location}}<span class="wall-item-location" id="wall-item-location-{{$item.id}}">{{$item.location}},&nbsp;</span>{{/if}}<span class="autotime" title="{{$item.isotime}}">{{$item.localtime}}{{if $item.editedtime}}&nbsp;{{$item.editedtime}}{{/if}}{{if $item.expiretime}}&nbsp;{{$item.expiretime}}{{/if}}</span>{{if $item.editedtime}}&nbsp;<i class="icon-pencil"></i>{{/if}}&nbsp;{{if $item.app}}<span class="item.app">{{$item.str_app}}</span>{{/if}}
</div>
<div class="wall-item-content" id="wall-item-content-{{$item.id}}">
<div class="wall-item-title-end"></div>