diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-07-14 16:55:58 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-07-14 16:55:58 -0700 |
commit | 3687fef53c5eeef7153306f45c5f187d5bfca68c (patch) | |
tree | fbf8d14b53d0cad61305886b8160a11afbe51df4 /include | |
parent | a5989b0f310b117238fc4728d359a2151f3de6e7 (diff) | |
parent | 104cbcab722477340961d45a93a441bb9fbc7e7a (diff) | |
download | volse-hubzilla-3687fef53c5eeef7153306f45c5f187d5bfca68c.tar.gz volse-hubzilla-3687fef53c5eeef7153306f45c5f187d5bfca68c.tar.bz2 volse-hubzilla-3687fef53c5eeef7153306f45c5f187d5bfca68c.zip |
Merge https://github.com/redmatrix/redmatrix into pending_merge
Diffstat (limited to 'include')
-rw-r--r-- | include/Contact.php | 18 | ||||
-rw-r--r-- | include/contact_selectors.php | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/include/Contact.php b/include/Contact.php index 9490fd2da..035e83a82 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -311,6 +311,24 @@ function channel_remove($channel_id, $local = true, $unset_session=true) { intval(PAGE_REMOVED), intval($channel_id) ); + // if this was the default channel, set another one as default + if($a->account['account_default_channel'] == $channel_id) { + $r = q("select channel_id from channel where channel_account_id = %d and not ( channel_pageflags & %d)>0 limit 1", + intval($a->account['account_id']), + intval(PAGE_REMOVED)); + if ($r) { + $rr = q("update account set account_default_channel = %d where account_id = %d", + intval($r[0]['channel_id']), + intval($a->account['account_id'])); + logger("Default channel deleted, changing default to channel_id " . $r[0]['channel_id']); + } + else { + $rr = q("update account set account_default_channel = 0 where account_id = %d", + intval($r[0]['channel_id']), + intval($a->account['account_id'])); + } + } + $r = q("update hubloc set hubloc_flags = (hubloc_flags | %d) where hubloc_hash = '%s' and hubloc_url = '%s' ", intval(HUBLOC_FLAGS_DELETED), diff --git a/include/contact_selectors.php b/include/contact_selectors.php index 726efce9d..8671f1bd1 100644 --- a/include/contact_selectors.php +++ b/include/contact_selectors.php @@ -5,7 +5,7 @@ function contact_profile_assign($current) { $o = ''; - $o .= "<select id=\"contact-profile-selector\" name=\"profile_assign\" />\r\n"; + $o .= "<select id=\"contact-profile-selector\" name=\"profile_assign\" class=\"form-control\"/>\r\n"; $r = q("SELECT profile_guid, profile_name FROM `profile` WHERE `uid` = %d", intval($_SESSION['uid'])); |