aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/acl.php48
-rw-r--r--mod/admin.php4
-rw-r--r--mod/connections.php3
-rw-r--r--mod/connedit.php9
4 files changed, 22 insertions, 42 deletions
diff --git a/mod/acl.php b/mod/acl.php
index e6733351b..f575db55b 100644
--- a/mod/acl.php
+++ b/mod/acl.php
@@ -182,49 +182,29 @@ function acl_init(&$a){
);
}
elseif($type == 'x') {
-
$r = navbar_complete($a);
- $x = array();
- $x['query'] = $search;
- $x['photos'] = array();
- $x['links'] = array();
- $x['suggestions'] = array();
- $x['data'] = array();
+ $contacts = array();
if($r) {
foreach($r as $g) {
- $x['photos'][] = $g['photo'];
- $x['links'][] = $g['url'];
- $x['suggestions'][] = '@' . $g['name'];
- $x['data'][] = $g['name'];
+ $contacts[] = array(
+ "photo" => $g['photo'],
+ "name" => $g['name'],
+ "nick" => $g['address'],
+ );
}
}
- echo json_encode($x);
- killme();
+ $o = array(
+ 'start' => $start,
+ 'count' => $count,
+ 'items' => $contacts,
+ );
+ echo json_encode($o);
+ killme();
}
else
$r = array();
-
- if($type == 'm' || $type == 'a' || $type == 'p') {
- $x = array();
- $x['query'] = $search;
- $x['photos'] = array();
- $x['links'] = array();
- $x['suggestions'] = array();
- $x['data'] = array();
- if(count($r)) {
- foreach($r as $g) {
- $x['photos'][] = $g['micro'];
- $x['links'][] = $g['url'];
- $x['suggestions'][] = $g['name'];
- $x['data'][] = (($type === 'p') ? '@' . str_replace(' ','_',$g['name']) : $g['id']);
- }
- }
- echo json_encode($x);
- killme();
- }
-
if(count($r)) {
foreach($r as $g){
@@ -284,7 +264,7 @@ function navbar_complete(&$a) {
}
$dirmode = intval(get_config('system','directory_mode'));
- $search = ((x($_REQUEST,'query')) ? htmlentities($_REQUEST['query'],ENT_COMPAT,'UTF-8',false) : '');
+ $search = ((x($_REQUEST,'search')) ? htmlentities($_REQUEST['search'],ENT_COMPAT,'UTF-8',false) : '');
if(! $search || mb_strlen($search) < 2)
return array();
diff --git a/mod/admin.php b/mod/admin.php
index 0e580960a..74a373738 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -827,7 +827,7 @@ function admin_page_channels(&$a){
/* get channels */
$total = q("SELECT count(*) as total FROM channel where not (channel_pageflags & %d)>0",
- intval(PAGE_REMOVED)
+ intval(PAGE_REMOVED|PAGE_SYSTEM)
);
if($total) {
$a->set_pager_total($total[0]['total']);
@@ -837,7 +837,7 @@ function admin_page_channels(&$a){
$order = " order by channel_name asc ";
$channels = q("SELECT * from channel where not ( channel_pageflags & %d )>0 $order limit %d offset %d ",
- intval(PAGE_REMOVED),
+ intval(PAGE_REMOVED|PAGE_SYSTEM),
intval($a->pager['itemspage']),
intval($a->pager['start'])
);
diff --git a/mod/connections.php b/mod/connections.php
index 70e28913a..d36734ccb 100644
--- a/mod/connections.php
+++ b/mod/connections.php
@@ -179,7 +179,8 @@ function connections_content(&$a) {
$unconnected = false;
$all = false;
- $_SESSION['return_url'] = $a->query_string;
+ if(! $_REQUEST['aj'])
+ $_SESSION['return_url'] = $a->query_string;
$search_flags = 0;
$head = '';
diff --git a/mod/connedit.php b/mod/connedit.php
index 6729029ac..abab0416e 100644
--- a/mod/connedit.php
+++ b/mod/connedit.php
@@ -216,10 +216,9 @@ function connedit_post(&$a) {
$arr = array('channel_id' => local_user(), 'abook' => $a->poi);
call_hooks('accept_follow', $arr);
}
-dbg(1);
+
if(! is_null($autoperms))
set_pconfig(local_user(),'system','autoperms',(($autoperms) ? $abook_my_perms : 0));
-dbg(0);
connedit_clone($a);
@@ -242,7 +241,7 @@ function connedit_clone(&$a) {
unset($clone['abook_account']);
unset($clone['abook_channel']);
- build_sync_packet(0 /* use the current local_user */, array('abook' => array($clone)));
+ build_sync_packet(0 /* use the current local_user */, array(array('abook' => array($clone))));
}
/* @brief Generate content of connection edit page
@@ -403,9 +402,9 @@ function connedit_content(&$a) {
contact_remove(local_user(), $orig_record[0]['abook_id']);
build_sync_packet(0 /* use the current local_user */,
- array('abook' => array(
+ array(array('abook' => array(
'abook_xchan' => $orig_record[0]['abook_xchan'],
- 'entry_deleted' => true)
+ 'entry_deleted' => true))
)
);