aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorSimon L'nu <simon.lnu@gmail.com>2012-05-20 14:33:15 -0400
committerSimon L'nu <simon.lnu@gmail.com>2012-05-20 14:33:15 -0400
commit18d4cf05833574173f1645e40e68f2c9c775517e (patch)
tree3eefeaf641e91416fa7b43b9a36b829f28ff1983 /mod
parentf48de791813a914d7ce2e1ec00ba041657f3f8ac (diff)
parentf16a1199408d167bbc7c52dc408ef02b36808317 (diff)
downloadvolse-hubzilla-18d4cf05833574173f1645e40e68f2c9c775517e.tar.gz
volse-hubzilla-18d4cf05833574173f1645e40e68f2c9c775517e.tar.bz2
volse-hubzilla-18d4cf05833574173f1645e40e68f2c9c775517e.zip
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master: search with leading @ performs directory search (# for tag search), nothing for text search Darkzero-NS + 'Friendicaland' countries. set comment permissions explicitly to parent permissions * master:
Diffstat (limited to 'mod')
-rw-r--r--mod/dirfind.php3
-rw-r--r--mod/item.php19
-rw-r--r--mod/search.php6
3 files changed, 22 insertions, 6 deletions
diff --git a/mod/dirfind.php b/mod/dirfind.php
index 34c54dd91..5c5d0e933 100644
--- a/mod/dirfind.php
+++ b/mod/dirfind.php
@@ -17,6 +17,9 @@ function dirfind_init(&$a) {
function dirfind_content(&$a) {
$search = notags(trim($_REQUEST['search']));
+
+ if(strpos($search,'@') === 0)
+ $search = substr($search,1);
$o = '';
diff --git a/mod/item.php b/mod/item.php
index 639379fe0..9f6b2aef4 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -218,14 +218,23 @@ function item_post(&$a) {
$private = ((strlen($str_group_allow) || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny)) ? 1 : 0);
- if(($parent_item) &&
- (($parent_item['private'])
+ // If this is a comment, set the permissions from the parent.
+
+ if($parent_item) {
+ $private = 0;
+
+ if(($parent_item['private'])
|| strlen($parent_item['allow_cid'])
|| strlen($parent_item['allow_gid'])
|| strlen($parent_item['deny_cid'])
- || strlen($parent_item['deny_gid'])
- )) {
- $private = 1;
+ || strlen($parent_item['deny_gid'])) {
+ $private = 1;
+ }
+
+ $str_contact_allow = $parent_item['allow_cid'];
+ $str_group_allow = $parent_item['allow_gid'];
+ $str_contact_deny = $parent_item['deny_cid'];
+ $str_group_deny = $parent_item['deny_gid'];
}
$pubmail_enable = ((x($_REQUEST,'pubmail_enable') && intval($_REQUEST['pubmail_enable']) && (! $private)) ? 1 : 0);
diff --git a/mod/search.php b/mod/search.php
index 635c87b70..3e6bf68aa 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -80,7 +80,7 @@ function search_content(&$a) {
$o = '<div id="live-search"></div>' . "\r\n";
- $o .= '<h3>' . t('Search This Site') . '</h3>';
+ $o .= '<h3>' . t('Search') . '</h3>';
if(x($a->data,'search'))
$search = notags(trim($a->data['search']));
@@ -101,6 +101,10 @@ function search_content(&$a) {
$tag = true;
$search = substr($search,1);
}
+ if(strpos($search,'@') === 0) {
+ require_once('mod/dirfind.php');
+ return dirfind_content($a);
+ }
if(! $search)
return $o;