From 62e7fa6a2326def16760a952f9c8ba180e911424 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 7 Feb 2016 15:38:54 -0800 Subject: [PATCH 01/13] update UI template for 'mood' module --- version.inc | 2 +- view/tpl/mood_content.tpl | 25 ++++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/version.inc b/version.inc index d5a47f11b..edcf6442a 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2016-02-05.1300H +2016-02-07.1302H diff --git a/view/tpl/mood_content.tpl b/view/tpl/mood_content.tpl index 63eaa2d8d..4059620ce 100755 --- a/view/tpl/mood_content.tpl +++ b/view/tpl/mood_content.tpl @@ -1,6 +1,15 @@ -

{{$title}}

-
{{$desc}}
+
+
+

{{$title}}

+
+
+ +
{{$desc}}
+ +
+
+

@@ -8,11 +17,13 @@ - +
+ +


From ec950de2054243f22e7d6b30e4d7b9b41f293d4e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 7 Feb 2016 15:44:42 -0800 Subject: [PATCH 02/13] block public was still referenced in admin/site template --- view/tpl/admin_site.tpl | 1 - 1 file changed, 1 deletion(-) diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl index 0e65dfa69..54f625e0b 100755 --- a/view/tpl/admin_site.tpl +++ b/view/tpl/admin_site.tpl @@ -68,7 +68,6 @@ {{include file="field_input.tpl" field=$maximagesize}}

{{$corporate}}

- {{include file="field_checkbox.tpl" field=$block_public}} {{include file="field_checkbox.tpl" field=$verify_email}} {{include file="field_checkbox.tpl" field=$feed_contacts}} {{include file="field_checkbox.tpl" field=$force_publish}} From d8e6fd5df0713ef4f52277944d15fd8230deec81 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 7 Feb 2016 18:11:10 -0800 Subject: [PATCH 03/13] provide get_server_role() to abstract different roles and capabilities --- boot.php | 6 ++++++ include/identity.php | 2 +- include/network.php | 1 + mod/import.php | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/boot.php b/boot.php index 1628dd0fd..1f214c400 100755 --- a/boot.php +++ b/boot.php @@ -2394,3 +2394,9 @@ function get_site_icon() { return z_root() . '/images/hz-32.png'; } + +function get_server_role() { + if(UNO) + return 'basic'; + return 'advanced'; +} diff --git a/include/identity.php b/include/identity.php index 0b9842caf..641f188f4 100644 --- a/include/identity.php +++ b/include/identity.php @@ -484,7 +484,7 @@ function identity_basic_export($channel_id, $items = false) { // use constants here as otherwise we will have no idea if we can import from a site // with a non-standard platform and version. - $ret['compatibility'] = array('project' => PLATFORM_NAME, 'version' => RED_VERSION, 'database' => DB_UPDATE_VERSION, 'server_role' => UNO ); + $ret['compatibility'] = array('project' => PLATFORM_NAME, 'version' => RED_VERSION, 'database' => DB_UPDATE_VERSION, 'server_role' => get_server_role()); $r = q("select * from channel where channel_id = %d limit 1", intval($channel_id) diff --git a/include/network.php b/include/network.php index fe6b553e9..1d0159ea5 100644 --- a/include/network.php +++ b/include/network.php @@ -1805,6 +1805,7 @@ function get_site_info() { $data = Array( 'version' => $version, 'version_tag' => $tag, + 'server_role' => get_server_role(), 'commit' => $commit, 'url' => z_root(), 'plugins' => $visible_plugins, diff --git a/mod/import.php b/mod/import.php index 1a2c87a63..0bbd38ffe 100644 --- a/mod/import.php +++ b/mod/import.php @@ -120,7 +120,7 @@ function import_account(&$a, $account_id) { notice($t); } if(array_key_exists('server_role',$data['compatibility']) - && $data['compatibility']['server_role'] != UNO) { + && $data['compatibility']['server_role'] != get_server_role()) { notice( t('Server platform is not compatible. Operation not permitted.') . EOL); return; } From a606173e07cfb1e9dda56d65e304f0ad53b934e6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 7 Feb 2016 20:11:08 -0800 Subject: [PATCH 04/13] change register workflow if uno is set --- mod/register.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/register.php b/mod/register.php index 63f09a9b8..49b010cc7 100644 --- a/mod/register.php +++ b/mod/register.php @@ -146,7 +146,7 @@ function register_post(&$a) { $new_channel = false; - if(get_config('system','auto_channel_create')) { + if(get_config('system','auto_channel_create') || UNO) { $new_channel = auto_channel_create($result['account']['account_id']); if($new_channel['success']) { $channel_id = $new_channel['channel']['channel_id']; From 00ae6bdac6062594d16870dbd9ca0593f534198e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 7 Feb 2016 21:06:17 -0800 Subject: [PATCH 05/13] a few tweaks to uno settings page to allow a default ACL to be created --- mod/settings.php | 2 ++ view/tpl/settings.tpl | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mod/settings.php b/mod/settings.php index eea3d9995..3ca2d1218 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -1013,6 +1013,7 @@ function settings_content(&$a) { $permissions_role = 'custom'; $permissions_set = (($permissions_role != 'custom') ? true : false); + $vnotify = get_pconfig(local_channel(),'system','vnotify'); $always_show_in_notices = get_pconfig(local_channel(),'system','always_show_in_notices'); if($vnotify === false) @@ -1037,6 +1038,7 @@ function settings_content(&$a) { '$h_prv' => t('Security and Privacy Settings'), '$permissions_set' => $permissions_set, + '$server_role' => get_server_role(), '$perms_set_msg' => t('Your permissions are already configured. Click to view/adjust'), '$hide_presence' => array('hide_presence', t('Hide my online presence'),$hide_presence, t('Prevents displaying in your profile that you are online'), $yes_no), diff --git a/view/tpl/settings.tpl b/view/tpl/settings.tpl index af5f222fe..820ffd711 100755 --- a/view/tpl/settings.tpl +++ b/view/tpl/settings.tpl @@ -42,8 +42,12 @@
+ {{if $server_role != 'basic'}} {{include file="field_select_grouped.tpl" field=$role}} -
+ {{/if}} +
+ + {{if $server_role != 'basic'}}
@@ -65,6 +69,7 @@
+ {{/if}}
{{$aclselect}} From 48963f62f974ce4f2d8e26c344b65e87f704e4d6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 8 Feb 2016 22:19:38 +0100 Subject: [PATCH 06/13] avoid collapsing only above the viewport --- view/js/main.js | 4 ++-- view/theme/redbasic/php/style.php | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/view/js/main.js b/view/js/main.js index 2b13acc3d..d1bf34699 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -641,7 +641,7 @@ function collapseHeight() { if(orgHeight > divmore_height) { if(! $(this).hasClass('divmore')) { - var trigger = $(window).scrollTop() + ($(window).height() - divmore_height) < $(this).offset().top ? true : false; + var trigger = $(window).scrollTop() < $(this).offset().top ? true : false; if(trigger) { $(this).readmore({ @@ -653,7 +653,7 @@ function collapseHeight() { beforeToggle: function(trigger, element, expanded) { if(expanded) { if((($(element).offset().top + divmore_height) - $(window).scrollTop()) < 65 ) { - $('html, body').animate( { scrollTop: $(window).scrollTop() - (orgHeight - divmore_height) }, {duration: 0 } ); + $(window).scrollTop($(window).scrollTop() - (orgHeight - divmore_height)); } } } diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php index 443ebb1fb..0ca47b1fb 100644 --- a/view/theme/redbasic/php/style.php +++ b/view/theme/redbasic/php/style.php @@ -40,7 +40,6 @@ if(! $a->install) { $nav_min_opacity=get_pconfig($uid,'redbasic','nav_min_opacity'); $top_photo=get_pconfig($uid,'redbasic','top_photo'); $reply_photo=get_pconfig($uid,'redbasic','reply_photo'); - } // Now load the scheme. If a value is changed above, we'll keep the settings From be99c7fe12cc68bba1716a0b708bb171cfd223e6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 8 Feb 2016 13:57:40 -0800 Subject: [PATCH 07/13] sort out the well-known acme-challenge mess - at least on apache --- .htaccess | 1 + mod/_well_known.php | 15 ++++----------- version.inc | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.htaccess b/.htaccess index 5f6414882..4c1d2c82c 100644 --- a/.htaccess +++ b/.htaccess @@ -24,6 +24,7 @@ AddType audio/ogg .oga # Also place auth information into REMOTE_USER for sites running # in CGI mode. + RewriteCond %{REQUEST_URI} ^/\.well\-known/.* RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA] diff --git a/mod/_well_known.php b/mod/_well_known.php index 47cfe1512..46714deaa 100644 --- a/mod/_well_known.php +++ b/mod/_well_known.php @@ -49,19 +49,12 @@ function _well_known_init(&$a){ break; default: - // look in $WEBROOT/well_known for the requested file in case it is - // something a site requires and for which we do not have a module - - // @fixme - we may need to determine the content-type and stick it in the header - // for now this can be done with a php script masquerading as the requested file - - $wk_file = str_replace('.well-known','well_known',$a->cmd); - if(file_exists($wk_file)) { - echo file_get_contents($wk_file); + if(file_exists($a->cmd)) { + echo file_get_contents($a->cmd); killme(); } - elseif(file_exists($wk_file . '.php')) - require_once($wk_file . '.php'); + elseif(file_exists($a->cmd . '.php')) + require_once($a->cmd . '.php'); break; } diff --git a/version.inc b/version.inc index edcf6442a..6778af819 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2016-02-07.1302H +2016-02-08.1303H From d96e985be0b316019fa26340a60c7247baa1090e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 8 Feb 2016 14:06:44 -0800 Subject: [PATCH 08/13] Revert "sort out the well-known acme-challenge mess - at least on apache" This reverts commit be99c7fe12cc68bba1716a0b708bb171cfd223e6. --- .htaccess | 1 - mod/_well_known.php | 15 +++++++++++---- version.inc | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.htaccess b/.htaccess index 4c1d2c82c..5f6414882 100644 --- a/.htaccess +++ b/.htaccess @@ -24,7 +24,6 @@ AddType audio/ogg .oga # Also place auth information into REMOTE_USER for sites running # in CGI mode. - RewriteCond %{REQUEST_URI} ^/\.well\-known/.* RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA] diff --git a/mod/_well_known.php b/mod/_well_known.php index 46714deaa..47cfe1512 100644 --- a/mod/_well_known.php +++ b/mod/_well_known.php @@ -49,12 +49,19 @@ function _well_known_init(&$a){ break; default: - if(file_exists($a->cmd)) { - echo file_get_contents($a->cmd); + // look in $WEBROOT/well_known for the requested file in case it is + // something a site requires and for which we do not have a module + + // @fixme - we may need to determine the content-type and stick it in the header + // for now this can be done with a php script masquerading as the requested file + + $wk_file = str_replace('.well-known','well_known',$a->cmd); + if(file_exists($wk_file)) { + echo file_get_contents($wk_file); killme(); } - elseif(file_exists($a->cmd . '.php')) - require_once($a->cmd . '.php'); + elseif(file_exists($wk_file . '.php')) + require_once($wk_file . '.php'); break; } diff --git a/version.inc b/version.inc index 6778af819..edcf6442a 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2016-02-08.1303H +2016-02-07.1302H From 90fd23e0cd1fe3b6d3471411f650b9b276473c68 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 8 Feb 2016 14:19:49 -0800 Subject: [PATCH 09/13] try that patch again --- .htaccess | 3 +++ mod/_well_known.php | 15 ++++----------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.htaccess b/.htaccess index 5f6414882..3420313a5 100644 --- a/.htaccess +++ b/.htaccess @@ -24,6 +24,9 @@ AddType audio/ogg .oga # Also place auth information into REMOTE_USER for sites running # in CGI mode. + RewriteCond %{REQUEST_URI} ^/\.well\-known/.* + RewriteRule ^(.*)$ index.php?q=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA] + RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA] diff --git a/mod/_well_known.php b/mod/_well_known.php index 47cfe1512..46714deaa 100644 --- a/mod/_well_known.php +++ b/mod/_well_known.php @@ -49,19 +49,12 @@ function _well_known_init(&$a){ break; default: - // look in $WEBROOT/well_known for the requested file in case it is - // something a site requires and for which we do not have a module - - // @fixme - we may need to determine the content-type and stick it in the header - // for now this can be done with a php script masquerading as the requested file - - $wk_file = str_replace('.well-known','well_known',$a->cmd); - if(file_exists($wk_file)) { - echo file_get_contents($wk_file); + if(file_exists($a->cmd)) { + echo file_get_contents($a->cmd); killme(); } - elseif(file_exists($wk_file . '.php')) - require_once($wk_file . '.php'); + elseif(file_exists($a->cmd . '.php')) + require_once($a->cmd . '.php'); break; } From a14b87baf25e8a4747318efa7a7b52ad04966af7 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 8 Feb 2016 14:48:11 -0800 Subject: [PATCH 10/13] make yet another recommended security header optional - this time because of piwik. Personally I think if you want to track people you really don't understand this project and its history, but whatever.... --- boot.php | 3 ++- install/htconfig.sample.php | 9 +++++++++ view/cs/htconfig.tpl | 9 +++++++++ view/de/htconfig.tpl | 9 +++++++++ view/en-au/htconfig.tpl | 9 +++++++++ view/en-gb/htconfig.tpl | 7 +++++++ view/en/htconfig.tpl | 17 +++++++++++++++++ view/eo/htconfig.tpl | 9 +++++++++ view/fr/htconfig.tpl | 9 +++++++++ view/it/htconfig.tpl | 9 +++++++++ view/nb-no/htconfig.tpl | 9 +++++++++ view/pt-br/htconfig.tpl | 9 +++++++++ 12 files changed, 107 insertions(+), 1 deletion(-) diff --git a/boot.php b/boot.php index 1f214c400..ce26f3a09 100755 --- a/boot.php +++ b/boot.php @@ -2167,7 +2167,8 @@ function construct_page(&$a) { if($a->get_scheme() === 'https' && $a->config['system']['transport_security_header']) header("Strict-Transport-Security: max-age=31536000"); - header("Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'"); + if($a->config['system']['content_security_policy']) + header("Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'"); if($a->config['system']['x_security_headers']) { header("X-Frame-Options: SAMEORIGIN"); diff --git a/install/htconfig.sample.php b/install/htconfig.sample.php index 50ce9658b..f64e2571b 100755 --- a/install/htconfig.sample.php +++ b/install/htconfig.sample.php @@ -46,6 +46,15 @@ $a->config['system']['sitename'] = "Hubzilla"; $a->config['system']['location_hash'] = 'if the auto install failed, put a unique random string here'; +// These lines set additional security headers to be sent with all responses +// You may wish to set transport_security_header to 0 if your server already sends +// this header. content_security_policy may need to be disabled if you wish to +// run the piwik analytics plugin or include other offsite resources on a page + +$a->config['system']['transport_security_header'] = 1; +$a->config['system']['content_security_policy'] = 1; + + // Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED. // Be certain to create your own personal account before setting // REGISTER_CLOSED. 'register_text' (if set) will be displayed prominently on diff --git a/view/cs/htconfig.tpl b/view/cs/htconfig.tpl index 8f26ec7b0..b809aebdf 100644 --- a/view/cs/htconfig.tpl +++ b/view/cs/htconfig.tpl @@ -36,6 +36,15 @@ $a->config['system']['baseurl'] = '{{$siteurl}}'; $a->config['system']['sitename'] = "Hubzilla"; $a->config['system']['location_hash'] = '{{$site_id}}'; +// These lines set additional security headers to be sent with all responses +// You may wish to set transport_security_header to 0 if your server already sends +// this header. content_security_policy may need to be disabled if you wish to +// run the piwik analytics plugin or include other offsite resources on a page + +$a->config['system']['transport_security_header'] = 1; +$a->config['system']['content_security_policy'] = 1; + + // Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED. // Be certain to create your own personal account before setting // REGISTER_CLOSED. 'register_text' (if set) will be displayed prominently on diff --git a/view/de/htconfig.tpl b/view/de/htconfig.tpl index a81c34741..fb5d6232c 100644 --- a/view/de/htconfig.tpl +++ b/view/de/htconfig.tpl @@ -37,6 +37,15 @@ $a->config['system']['sitename'] = "Hubzilla"; $a->config['system']['location_hash'] = '{{$site_id}}'; +// These lines set additional security headers to be sent with all responses +// You may wish to set transport_security_header to 0 if your server already sends +// this header. content_security_policy may need to be disabled if you wish to +// run the piwik analytics plugin or include other offsite resources on a page + +$a->config['system']['transport_security_header'] = 1; +$a->config['system']['content_security_policy'] = 1; + + // Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED. // Be certain to create your own personal account before setting // REGISTER_CLOSED. 'register_text' (if set) will be displayed prominently on diff --git a/view/en-au/htconfig.tpl b/view/en-au/htconfig.tpl index 9611decf9..13fa550a2 100644 --- a/view/en-au/htconfig.tpl +++ b/view/en-au/htconfig.tpl @@ -37,6 +37,15 @@ $a->config['system']['sitename'] = "Hubzilla"; $a->config['system']['location_hash'] = '{{$site_id}}'; +// These lines set additional security headers to be sent with all responses +// You may wish to set transport_security_header to 0 if your server already sends +// this header. content_security_policy may need to be disabled if you wish to +// run the piwik analytics plugin or include other offsite resources on a page + +$a->config['system']['transport_security_header'] = 1; +$a->config['system']['content_security_policy'] = 1; + + // Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED. // Be certain to create your own personal account before setting // REGISTER_CLOSED. 'register_text' (if set) will be displayed prominently on diff --git a/view/en-gb/htconfig.tpl b/view/en-gb/htconfig.tpl index 9611decf9..ccb6c5eca 100644 --- a/view/en-gb/htconfig.tpl +++ b/view/en-gb/htconfig.tpl @@ -36,6 +36,13 @@ $a->config['system']['baseurl'] = '{{$siteurl}}'; $a->config['system']['sitename'] = "Hubzilla"; $a->config['system']['location_hash'] = '{{$site_id}}'; +// These lines set additional security headers to be sent with all responses +// You may wish to set transport_security_header to 0 if your server already sends +// this header. content_security_policy may need to be disabled if you wish to +// run the piwik analytics plugin or include other offsite resources on a page + +$a->config['system']['transport_security_header'] = 1; +$a->config['system']['content_security_policy'] = 1; // Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED. // Be certain to create your own personal account before setting diff --git a/view/en/htconfig.tpl b/view/en/htconfig.tpl index 50e05fc3e..5c05111f3 100644 --- a/view/en/htconfig.tpl +++ b/view/en/htconfig.tpl @@ -36,6 +36,23 @@ $a->config['system']['baseurl'] = '{{$siteurl}}'; $a->config['system']['sitename'] = "Hubzilla"; $a->config['system']['location_hash'] = '{{$site_id}}'; +// These lines set additional security headers to be sent with all responses +// You may wish to set transport_security_header to 0 if your server already sends +// this header. content_security_policy may need to be disabled if you wish to +// run the piwik analytics plugin or include other offsite resources on a page + +$a->config['system']['transport_security_header'] = 1; +$a->config['system']['content_security_policy'] = 1; + +// These lines set additional security headers to be sent with all responses +// You may wish to set transport_security_header to 0 if your server already sends +// this header. content_security_policy may need to be disabled if you wish to +// run the piwik analytics plugin or include other offsite resources on a page + +$a->config['system']['transport_security_header'] = 1; +$a->config['system']['content_security_policy'] = 1; + + // Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED. // Be certain to create your own personal account before setting diff --git a/view/eo/htconfig.tpl b/view/eo/htconfig.tpl index 8f26ec7b0..0695462eb 100644 --- a/view/eo/htconfig.tpl +++ b/view/eo/htconfig.tpl @@ -36,6 +36,15 @@ $a->config['system']['baseurl'] = '{{$siteurl}}'; $a->config['system']['sitename'] = "Hubzilla"; $a->config['system']['location_hash'] = '{{$site_id}}'; + +// These lines set additional security headers to be sent with all responses +// You may wish to set transport_security_header to 0 if your server already sends +// this header. content_security_policy may need to be disabled if you wish to +// run the piwik analytics plugin or include other offsite resources on a page + +$a->config['system']['transport_security_header'] = 1; +$a->config['system']['content_security_policy'] = 1; + // Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED. // Be certain to create your own personal account before setting // REGISTER_CLOSED. 'register_text' (if set) will be displayed prominently on diff --git a/view/fr/htconfig.tpl b/view/fr/htconfig.tpl index 5171fd327..799cdaa71 100644 --- a/view/fr/htconfig.tpl +++ b/view/fr/htconfig.tpl @@ -37,6 +37,15 @@ $a->config['system']['baseurl'] = '{{$siteurl}}'; $a->config['system']['sitename'] = "Hubzilla"; $a->config['system']['location_hash'] = '{{$site_id}}'; + +// These lines set additional security headers to be sent with all responses +// You may wish to set transport_security_header to 0 if your server already sends +// this header. content_security_policy may need to be disabled if you wish to +// run the piwik analytics plugin or include other offsite resources on a page + +$a->config['system']['transport_security_header'] = 1; +$a->config['system']['content_security_policy'] = 1; + // Vos choix sont REGISTER_OPEN, REGISTER_APPROVE, ou REGISTER_CLOSED. // Soyez certains de créer votre compte personnel avant de déclarer // votre site REGISTER_CLOSED. 'register_text' (si vous décider de l'utiliser) diff --git a/view/it/htconfig.tpl b/view/it/htconfig.tpl index 8f26ec7b0..b809aebdf 100644 --- a/view/it/htconfig.tpl +++ b/view/it/htconfig.tpl @@ -36,6 +36,15 @@ $a->config['system']['baseurl'] = '{{$siteurl}}'; $a->config['system']['sitename'] = "Hubzilla"; $a->config['system']['location_hash'] = '{{$site_id}}'; +// These lines set additional security headers to be sent with all responses +// You may wish to set transport_security_header to 0 if your server already sends +// this header. content_security_policy may need to be disabled if you wish to +// run the piwik analytics plugin or include other offsite resources on a page + +$a->config['system']['transport_security_header'] = 1; +$a->config['system']['content_security_policy'] = 1; + + // Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED. // Be certain to create your own personal account before setting // REGISTER_CLOSED. 'register_text' (if set) will be displayed prominently on diff --git a/view/nb-no/htconfig.tpl b/view/nb-no/htconfig.tpl index 8f26ec7b0..b809aebdf 100644 --- a/view/nb-no/htconfig.tpl +++ b/view/nb-no/htconfig.tpl @@ -36,6 +36,15 @@ $a->config['system']['baseurl'] = '{{$siteurl}}'; $a->config['system']['sitename'] = "Hubzilla"; $a->config['system']['location_hash'] = '{{$site_id}}'; +// These lines set additional security headers to be sent with all responses +// You may wish to set transport_security_header to 0 if your server already sends +// this header. content_security_policy may need to be disabled if you wish to +// run the piwik analytics plugin or include other offsite resources on a page + +$a->config['system']['transport_security_header'] = 1; +$a->config['system']['content_security_policy'] = 1; + + // Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED. // Be certain to create your own personal account before setting // REGISTER_CLOSED. 'register_text' (if set) will be displayed prominently on diff --git a/view/pt-br/htconfig.tpl b/view/pt-br/htconfig.tpl index 8f26ec7b0..b809aebdf 100644 --- a/view/pt-br/htconfig.tpl +++ b/view/pt-br/htconfig.tpl @@ -36,6 +36,15 @@ $a->config['system']['baseurl'] = '{{$siteurl}}'; $a->config['system']['sitename'] = "Hubzilla"; $a->config['system']['location_hash'] = '{{$site_id}}'; +// These lines set additional security headers to be sent with all responses +// You may wish to set transport_security_header to 0 if your server already sends +// this header. content_security_policy may need to be disabled if you wish to +// run the piwik analytics plugin or include other offsite resources on a page + +$a->config['system']['transport_security_header'] = 1; +$a->config['system']['content_security_policy'] = 1; + + // Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED. // Be certain to create your own personal account before setting // REGISTER_CLOSED. 'register_text' (if set) will be displayed prominently on From 3da8f9b13c92adab25507ab5cd36cdec27889cac Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 8 Feb 2016 14:51:03 -0800 Subject: [PATCH 11/13] duplicated lines in en config file --- view/en/htconfig.tpl | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/view/en/htconfig.tpl b/view/en/htconfig.tpl index 5c05111f3..0ab7b6510 100644 --- a/view/en/htconfig.tpl +++ b/view/en/htconfig.tpl @@ -44,16 +44,6 @@ $a->config['system']['location_hash'] = '{{$site_id}}'; $a->config['system']['transport_security_header'] = 1; $a->config['system']['content_security_policy'] = 1; -// These lines set additional security headers to be sent with all responses -// You may wish to set transport_security_header to 0 if your server already sends -// this header. content_security_policy may need to be disabled if you wish to -// run the piwik analytics plugin or include other offsite resources on a page - -$a->config['system']['transport_security_header'] = 1; -$a->config['system']['content_security_policy'] = 1; - - - // Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED. // Be certain to create your own personal account before setting // REGISTER_CLOSED. 'register_text' (if set) will be displayed prominently on From 315ce6d880855444c0cea683810b9b2fbd80c0d3 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 8 Feb 2016 18:16:42 -0800 Subject: [PATCH 12/13] lots more zcard tweaks --- boot.php | 1 - include/identity.php | 10 +++++---- include/widgets.php | 23 +++++++++++++++++++- library/jgrowl/jquery.jgrowl.map | 0 view/tpl/profile_vcard.tpl | 6 ++++++ view/tpl/zcard.tpl | 37 ++++++++++++++++++++------------ 6 files changed, 57 insertions(+), 20 deletions(-) create mode 100644 library/jgrowl/jquery.jgrowl.map diff --git a/boot.php b/boot.php index ce26f3a09..cc46cf870 100755 --- a/boot.php +++ b/boot.php @@ -650,7 +650,6 @@ class App { private $perms = null; // observer permissions private $widgets = array(); // widgets for this page - public $groups; public $language; public $module_loaded = false; diff --git a/include/identity.php b/include/identity.php index 641f188f4..9d41e9633 100644 --- a/include/identity.php +++ b/include/identity.php @@ -913,7 +913,7 @@ function profile_load(&$a, $nickname, $profile = '') { * @return HTML string suitable for sidebar inclusion * Exceptions: Returns empty string if passed $profile is wrong type or not populated */ -function profile_sidebar($profile, $block = 0, $show_connect = true) { +function profile_sidebar($profile, $block = 0, $show_connect = true, $zcard = false) { $a = get_app(); @@ -1056,8 +1056,9 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) { if(! feature_enabled($profile['uid'],'hide_rating')) $z = widget_rating(array('target' => $profile['channel_hash'])); - + $o .= replace_macros($tpl, array( + '$zcard' => $zcard, '$profile' => $profile, '$connect' => $connect, '$connect_url' => $connect_url, @@ -1796,8 +1797,8 @@ function get_zcard($channel,$observer_hash = '',$args = array()) { $cover_size = PHOTO_RES_COVER_425; $pphoto = array('type' => $channel['xchan_photo_mimetype'], 'width' => 80 , 'height' => 80, 'href' => $channel['xchan_photo_m']); } - elseif($maxwidth <= 850) { - $width = 850; + elseif($maxwidth <= 900) { + $width = 900; $size = 'hz_medium'; $cover_size = PHOTO_RES_COVER_850; $pphoto = array('type' => $channel['xchan_photo_mimetype'], 'width' => 160 , 'height' => 160, 'href' => $channel['xchan_photo_l']); @@ -1832,6 +1833,7 @@ function get_zcard($channel,$observer_hash = '',$args = array()) { } $o .= replace_macros(get_markup_template('zcard.tpl'),array( + '$maxwidth' => $maxwidth, '$scale' => $scale, '$translate' => $translate, '$size' => $size, diff --git a/include/widgets.php b/include/widgets.php index 8073058c6..fa2b3de4d 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -8,7 +8,7 @@ require_once('include/dir_fns.php'); require_once('include/contact_widgets.php'); require_once('include/attach.php'); - +require_once('include/Contact.php'); function widget_profile($args) { $a = get_app(); @@ -16,6 +16,16 @@ function widget_profile($args) { return profile_sidebar($a->profile, $block, true); } +function widget_zcard($args) { + $a = get_app(); + $block = (((get_config('system', 'block_public')) && (! local_channel()) && (! remote_channel())) ? true : false); + $channel = channelx_by_n($a->profile_uid); + return get_zcard($channel,get_observer_hash(),array('width' => 875)); +} + + + + // FIXME The problem with the next widget is that we don't have a search function for webpages that we can send the links to. // Then we should also provide an option to search webpages and conversations. @@ -369,6 +379,17 @@ function widget_fullprofile($arr) { return profile_sidebar($a->profile, $block); } +function widget_shortprofile($arr) { + $a = get_app(); + if(! $a->profile['profile_uid']) + return; + + $block = (((get_config('system', 'block_public')) && (! local_channel()) && (! remote_channel())) ? true : false); + + return profile_sidebar($a->profile, $block, true, true); +} + + function widget_categories($arr) { $a = get_app(); diff --git a/library/jgrowl/jquery.jgrowl.map b/library/jgrowl/jquery.jgrowl.map new file mode 100644 index 000000000..e69de29bb diff --git a/view/tpl/profile_vcard.tpl b/view/tpl/profile_vcard.tpl index 5857ae5d1..56c262564 100755 --- a/view/tpl/profile_vcard.tpl +++ b/view/tpl/profile_vcard.tpl @@ -1,8 +1,11 @@
+ {{if ! $zcard}}
{{$profile.name}}
+ {{/if}} {{if $connect}} {{/if}} + {{if ! $zcard}} {{if $profile.edit}} {{/if}} + {{/if}} + {{if ! $zcard}}
{{$profile.name}}{{if $profile.online}} {{/if}}
{{if $reddress}}
{{$profile.reddress}}
{{/if}} + {{/if}} {{if $pdesc}}
{{$profile.pdesc}}
{{/if}} diff --git a/view/tpl/zcard.tpl b/view/tpl/zcard.tpl index b73b1011c..908f07631 100644 --- a/view/tpl/zcard.tpl +++ b/view/tpl/zcard.tpl @@ -41,41 +41,50 @@ } {{elseif $size == 'hz_medium'}} .hz_card { - -moz-transform: translate(-{{$translate}}%, -{{$translate}}%) scale({{$scale}}, {{$scale}}); - transform: translate(-{{$translate}}%, -{{$translate}}%) scale({{$scale}}, {{$scale}}); +/* -moz-transform: translate(-{{$translate}}%, -{{$translate}}%) scale({{$scale}}, {{$scale}}); + transform: translate(-{{$translate}}%, -{{$translate}}%) scale({{$scale}}, {{$scale}}); */ font-family: sans-serif, arial, freesans; + width: 100%; + overflow: hidden; + height: 390px; } -.hz_cover_photo { - max-width: 100%; +.hz_cover_photo img { + width: {{$maxwidth}}px; +/* max-width: 100%; */ } .hz_profile_photo { position: relative; - top: -300px; + top: -165px; left: 30px; + + width: 150px; + height: 150px; +} +.hz_profile_photo img { background-color: white; border: 1px solid #ddd; border-radius: 5px; -moz-border-radius: 5px; - padding: 10px; - width: 320px; - height: 320px; + padding: 5px; + width: 150px; + height: 150px; } .hz_name { position: relative; top: -100px; - left: 400px; + left: 210px; color: #fff; - font-size: 48px; + font-size: 32px; text-rendering: optimizelegibility; text-shadow: 0 0 3px rgba(0, 0, 0, 0.8); } .hz_addr { position: relative; - top: -110px; - left: 400px; + top: -100px; + left: 210px; color: #fff; - font-size: 24px; + font-size: 18px; text-rendering: optimizelegibility; text-shadow: 0 0 3px rgba(0, 0, 0, 0.8); } @@ -130,6 +139,6 @@
{{$zcard.chan.xchan_name}}
{{$zcard.chan.channel_addr}}
-
{{$zcard.chan.xchan_name}}
+
{{$zcard.chan.xchan_name}}
From f984502499c836cde0be647907be505508c04e0c Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 8 Feb 2016 19:33:25 -0800 Subject: [PATCH 13/13] need to re-arrange a few things for a short vcard --- include/identity.php | 5 +++- view/tpl/profile_vcard_short.tpl | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100755 view/tpl/profile_vcard_short.tpl diff --git a/include/identity.php b/include/identity.php index 9d41e9633..51744f7bf 100644 --- a/include/identity.php +++ b/include/identity.php @@ -1050,7 +1050,10 @@ function profile_sidebar($profile, $block = 0, $show_connect = true, $zcard = fa $channel_menu .= comanche_block($menublock); } - $tpl = get_markup_template('profile_vcard.tpl'); + if($zcard) + $tpl = get_markup_template('profile_vcard_short.tpl'); + else + $tpl = get_markup_template('profile_vcard.tpl'); require_once('include/widgets.php'); diff --git a/view/tpl/profile_vcard_short.tpl b/view/tpl/profile_vcard_short.tpl new file mode 100755 index 000000000..91102306c --- /dev/null +++ b/view/tpl/profile_vcard_short.tpl @@ -0,0 +1,42 @@ +{{$contact_block}} + + {{if $connect}} + + {{/if}} + + +{{$rating}} + + {{if $pdesc}}
{{$profile.pdesc}}
{{/if}} + + {{if $location}} +
{{$location}}
+
+ {{if $profile.address}}
{{$profile.address}}
{{/if}} + + {{$profile.locality}}{{if $profile.locality}}, {{/if}} + {{$profile.region}} + {{$profile.postal_code}} + + {{if $profile.country_name}}{{$profile.country_name}}{{/if}} +
+
+ {{/if}} + + {{if $gender}}
{{$gender}}
{{$profile.gender}}
{{/if}} + + + {{if $marital}}
{{$marital}}
{{$profile.marital}}
{{/if}} + + {{if $homepage}}
{{$homepage}}
{{$profile.homepage}}
{{/if}} + + {{if $diaspora}} + {{include file="diaspora_vcard.tpl"}} + {{/if}} + +
+ +{{$chanmenu}} + + +