aboutsummaryrefslogtreecommitdiffstats
path: root/mod/contacts.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-08-19 05:20:30 -0700
committerFriendika <info@friendika.com>2011-08-19 05:20:30 -0700
commit9a52b152719e0e3e224fa19379f7f5e78dd986ce (patch)
tree8045df4275a39ce43cef1cdcdf8dd57065afe363 /mod/contacts.php
parentef98c7e02097258916deb06039827f4898d4078a (diff)
downloadvolse-hubzilla-9a52b152719e0e3e224fa19379f7f5e78dd986ce.tar.gz
volse-hubzilla-9a52b152719e0e3e224fa19379f7f5e78dd986ce.tar.bz2
volse-hubzilla-9a52b152719e0e3e224fa19379f7f5e78dd986ce.zip
don't allow removal of self contact
Diffstat (limited to 'mod/contacts.php')
-rw-r--r--mod/contacts.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/mod/contacts.php b/mod/contacts.php
index f130b74c0..efb0dc75b 100644
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -141,7 +141,7 @@ function contacts_content(&$a) {
$cmd = $a->argv[2];
- $orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
+ $orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d AND `self` = 0 LIMIT 1",
intval($contact_id),
intval(local_user())
);
@@ -222,7 +222,7 @@ function contacts_content(&$a) {
}
- contact_remove($contact_id);
+ contact_remove($orig_record[0]['id']);
info( t('Contact has been removed.') . EOL );
goaway($a->get_baseurl() . '/contacts');
return; // NOTREACHED