From 2c6e1b7aee2928c077bc090b1c4fe65c599d5d12 Mon Sep 17 00:00:00 2001 From: tuscanhobbit Date: Sat, 23 Nov 2013 20:01:11 +0100 Subject: replaced rhash icon --- include/api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/api.php') diff --git a/include/api.php b/include/api.php index 1dd970cbc..8f7be37c7 100644 --- a/include/api.php +++ b/include/api.php @@ -233,7 +233,7 @@ require_once('include/photos.php'); 'updated' => api_date(null), 'atom_updated' => datetime_convert('UTC','UTC','now',ATOM_TIME), 'language' => $user_info['language'], - 'logo' => $a->get_baseurl()."/images/rhash-64.png", + 'logo' => $a->get_baseurl()."/images/rm-64.png", ); return $arr; @@ -1581,7 +1581,7 @@ require_once('include/photos.php'); $name = get_config('system','sitename'); $server = $a->get_hostname(); - $logo = $a->get_baseurl() . '/images/rhash-64.png'; + $logo = $a->get_baseurl() . '/images/rm-64.png'; $email = get_config('system','admin_email'); $closed = ((get_config('system','register_policy') == REGISTER_CLOSED) ? 'true' : 'false'); $private = ((get_config('system','block_public')) ? 'true' : 'false'); -- cgit v1.2.3 From 6f6fcddfc3fc9bb2e63dd615f29116ced49838d5 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 26 Nov 2013 16:38:48 -0800 Subject: api fixes --- include/api.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'include/api.php') diff --git a/include/api.php b/include/api.php index 8f7be37c7..717f1572a 100644 --- a/include/api.php +++ b/include/api.php @@ -739,7 +739,7 @@ require_once('include/photos.php'); 'created_at' => api_date($lastwall['created']), 'in_reply_to_status_id' => $in_reply_to_status_id, 'source' => (($lastwall['app']) ? $lastwall['app'] : 'web'), - 'id' => (($w) ? $w[0]['abook_id'] : $user_info['id']), + 'id' => ($lastwall['id']), 'in_reply_to_user_id' => $in_reply_to_user_id, 'in_reply_to_screen_name' => $in_reply_to_screen_name, 'geo' => '', @@ -1081,10 +1081,18 @@ require_once('include/photos.php'); // params $id = intval(argv(3)); - logger('API: api_statuses_destroy: '.$id); + // first prove that we own the item + + $r = q("select * from item where id = %d and uid = %d limit 1", + intval($id), + intval($user_info['uid']) + ); - require_once('include/items.php'); - drop_item($id, false); + if($r) { + logger('API: api_statuses_destroy: '.$id); + require_once('include/items.php'); + drop_item($id, false); + } if ($type == 'xml') $ok = "true"; -- cgit v1.2.3 From ef53c72a708ed2b1ba4cc1ffc6a926a33ba6a2f2 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 26 Nov 2013 17:02:49 -0800 Subject: delete from the wp side as well as from the red side --- include/api.php | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'include/api.php') diff --git a/include/api.php b/include/api.php index 717f1572a..ca5592d08 100644 --- a/include/api.php +++ b/include/api.php @@ -1080,19 +1080,35 @@ require_once('include/photos.php'); // params $id = intval(argv(3)); + if($id) { + // first prove that we own the item - // first prove that we own the item + $r = q("select * from item where id = %d and uid = %d limit 1", + intval($id), + intval($user_info['uid']) + ); + if(! $r) + return false; + } + else { + if($_REQUEST['namespace'] && $_REQUEST['remote_id']) { + $r = q("select * from item_id where service = '%s' and sid = '%s' and uid = %d limit 1", + dbesc($_REQUEST['namespace']), + dbesc($_REQUEST['remote_id']), + intval($user_info['uid']) + ); + if(! $r) + return false; + $id = $r[0]['iid']; + } + } + if(! $id) + return false; - $r = q("select * from item where id = %d and uid = %d limit 1", - intval($id), - intval($user_info['uid']) - ); + logger('API: api_statuses_destroy: '.$id); + require_once('include/items.php'); + drop_item($id, false); - if($r) { - logger('API: api_statuses_destroy: '.$id); - require_once('include/items.php'); - drop_item($id, false); - } if ($type == 'xml') $ok = "true"; @@ -1114,7 +1130,7 @@ require_once('include/photos.php'); if (api_user()===false) return false; $user_info = api_get_user($a); - // get last newtork messages + // get last network messages // params -- cgit v1.2.3 From aab9b30d03e2cad7be2207fa22dcd6ddad224369 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 28 Nov 2013 00:16:13 -0800 Subject: synchronise deletion of comments between red and wp --- include/api.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/api.php') diff --git a/include/api.php b/include/api.php index ca5592d08..093839875 100644 --- a/include/api.php +++ b/include/api.php @@ -1101,6 +1101,16 @@ require_once('include/photos.php'); return false; $id = $r[0]['iid']; } + if($_REQUEST['namespace'] && $_REQUEST['comment_id']) { + $r = q("select * from item_id left join item on item.id = item_id.iid where service = '%s' and sid = '%s' and uid = %d and item.id != item.parent limit 1", + dbesc($_REQUEST['namespace']), + dbesc($_REQUEST['comment_id']), + intval($user_info['uid']) + ); + if(! $r) + return false; + $id = $r[0]['iid']; + } } if(! $id) return false; -- cgit v1.2.3 From 38fd8410eb5c66928cb24bb87ad38657f53aec3a Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 18 Dec 2013 01:00:08 -0800 Subject: split off mod_connections into mod_connections & mod_connedit - lots of links to fix --- include/api.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/api.php') diff --git a/include/api.php b/include/api.php index 093839875..463d29cf8 100644 --- a/include/api.php +++ b/include/api.php @@ -362,7 +362,8 @@ require_once('include/photos.php'); 'location' => ($usr) ? $usr[0]['channel_location'] : '', 'profile_image_url' => $uinfo[0]['xchan_photo_l'], 'url' => $uinfo[0]['xchan_url'], - 'contact_url' => $a->get_baseurl()."/connections/".$uinfo[0]['abook_id'], +//FIXME + 'contact_url' => $a->get_baseurl() . "/connections/".$uinfo[0]['abook_id'], 'protected' => false, 'friends_count' => intval($countfriends), 'created_at' => api_date($uinfo[0]['abook_created']), -- cgit v1.2.3