From 20a317b5b71547913d2eeff941dfc5276276213e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 10 Jun 2015 11:58:45 +0200 Subject: really show login form if it is enabled --- mod/home.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/home.php b/mod/home.php index b22dace8c..4b651d899 100644 --- a/mod/home.php +++ b/mod/home.php @@ -72,7 +72,7 @@ function home_content(&$a, $update = 0, $load = false) { if($sitename) $o .= '

' . sprintf( t("Welcome to %s") ,$sitename) . '

'; - if(intval(get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) { + if((! intval(get_config('system','block_public'))) && (! local_channel()) && (! remote_channel())) { // If there's nothing special happening, just spit out a login box $loginbox = get_config('system','login_on_homepage'); if(intval($loginbox) || $loginbox === false) @@ -81,4 +81,4 @@ function home_content(&$a, $update = 0, $load = false) { return $o; -} \ No newline at end of file +} -- cgit v1.2.3 From edd2d1e8d47be1ef4fe38edf624335472a2e73bd Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 10 Jun 2015 13:24:16 +0200 Subject: show login without checking for block_public, local or remote channel --- mod/home.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'mod') diff --git a/mod/home.php b/mod/home.php index 4b651d899..3091be3a1 100644 --- a/mod/home.php +++ b/mod/home.php @@ -72,12 +72,9 @@ function home_content(&$a, $update = 0, $load = false) { if($sitename) $o .= '

' . sprintf( t("Welcome to %s") ,$sitename) . '

'; - if((! intval(get_config('system','block_public'))) && (! local_channel()) && (! remote_channel())) { - // If there's nothing special happening, just spit out a login box - $loginbox = get_config('system','login_on_homepage'); - if(intval($loginbox) || $loginbox === false) - $o .= login(($a->config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1); - } + $loginbox = get_config('system','login_on_homepage'); + if(intval($loginbox) || $loginbox === false) + $o .= login(($a->config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1); return $o; -- cgit v1.2.3 From a31fdd3fbb0d068f91cc56daa052282f91adf2a2 Mon Sep 17 00:00:00 2001 From: Alexandre Hannud Abdo Date: Wed, 10 Jun 2015 15:37:10 -0300 Subject: correctly fix attachment permissions from private mentions by postponing code that removes the attachment tag from the body --- mod/item.php | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index a9c6ea65b..3ff286268 100644 --- a/mod/item.php +++ b/mod/item.php @@ -586,27 +586,6 @@ function item_post(&$a) { } } - $attachments = ''; - $match = false; - - if(preg_match_all('/(\[attachment\](.*?)\[\/attachment\])/',$body,$match)) { - $attachments = array(); - foreach($match[2] as $mtch) { - $hash = substr($mtch,0,strpos($mtch,',')); - $rev = intval(substr($mtch,strpos($mtch,','))); - $r = attach_by_hash_nodata($hash,$rev); - if($r['success']) { - $attachments[] = array( - 'href' => $a->get_baseurl() . '/attach/' . $r['data']['hash'], - 'length' => $r['data']['filesize'], - 'type' => $r['data']['filetype'], - 'title' => urlencode($r['data']['filename']), - 'revision' => $r['data']['revision'] - ); - } - $body = str_replace($match[1],'',$body); - } - } /** * @@ -643,6 +622,29 @@ function item_post(&$a) { } + + $attachments = ''; + $match = false; + + if(preg_match_all('/(\[attachment\](.*?)\[\/attachment\])/',$body,$match)) { + $attachments = array(); + foreach($match[2] as $mtch) { + $hash = substr($mtch,0,strpos($mtch,',')); + $rev = intval(substr($mtch,strpos($mtch,','))); + $r = attach_by_hash_nodata($hash,$rev); + if($r['success']) { + $attachments[] = array( + 'href' => $a->get_baseurl() . '/attach/' . $r['data']['hash'], + 'length' => $r['data']['filesize'], + 'type' => $r['data']['filetype'], + 'title' => urlencode($r['data']['filename']), + 'revision' => $r['data']['revision'] + ); + } + $body = str_replace($match[1],'',$body); + } + } + } // BBCODE end alert -- cgit v1.2.3