From 7bbe700f3f170cc4527131165a9b9ab1f99e5cd1 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 16 Oct 2014 16:19:19 -0700 Subject: mark signature forgeries --- boot.php | 1 + include/ItemObject.php | 4 +++- include/conversation.php | 6 +++++- view/css/conversation.css | 5 +++++ view/tpl/conv_item.tpl | 2 +- view/tpl/search_item.tpl | 2 +- 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 @@ {{$item.name}}{{if $item.owner_url}} {{$item.via}} {{$item.owner_name}}{{/if}}
- {{if $item.verified}} {{/if}}{{if $item.location}}{{$item.location}}, {{/if}}{{$item.localtime}}{{if $item.editedtime}} {{$item.editedtime}}{{/if}}{{if $item.expiretime}} {{$item.expiretime}}{{/if}}{{if $item.editedtime}} {{/if}} {{if $item.app}}{{$item.str_app}}{{/if}} + {{if $item.verified}} {{elseif $item.forged}} {{/if}}{{if $item.location}}{{$item.location}}, {{/if}}{{$item.localtime}}{{if $item.editedtime}} {{$item.editedtime}}{{/if}}{{if $item.expiretime}} {{$item.expiretime}}{{/if}}{{if $item.editedtime}} {{/if}} {{if $item.app}}{{$item.str_app}}{{/if}}
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 @@ {{$item.name}}{{if $item.owner_url}} {{$item.via}} {{$item.owner_name}}{{/if}}
- {{if $item.verified}} {{/if}}{{if $item.location}}{{$item.location}}, {{/if}}{{$item.localtime}}{{if $item.editedtime}} {{$item.editedtime}}{{/if}}{{if $item.expiretime}} {{$item.expiretime}}{{/if}}{{if $item.editedtime}} {{/if}} {{if $item.app}}{{$item.str_app}}{{/if}} + {{if $item.verified}} {{elseif $item.forged}} {{/if}}{{if $item.location}}{{$item.location}}, {{/if}}{{$item.localtime}}{{if $item.editedtime}} {{$item.editedtime}}{{/if}}{{if $item.expiretime}} {{$item.expiretime}}{{/if}}{{if $item.editedtime}} {{/if}} {{if $item.app}}{{$item.str_app}}{{/if}}
-- cgit v1.2.3