diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/chat.php | 11 | ||||
-rw-r--r-- | include/conversation.php | 199 | ||||
-rwxr-xr-x | include/diaspora.php | 25 | ||||
-rw-r--r-- | include/follow.php | 2 | ||||
-rwxr-xr-x | include/items.php | 13 | ||||
-rw-r--r-- | include/js_strings.php | 1 | ||||
-rw-r--r-- | include/menu.php | 10 | ||||
-rw-r--r-- | include/nav.php | 15 | ||||
-rw-r--r-- | include/notifier.php | 5 | ||||
-rw-r--r-- | include/onepoll.php | 2 | ||||
-rw-r--r-- | include/permissions.php | 2 | ||||
-rw-r--r-- | include/security.php | 13 |
12 files changed, 166 insertions, 132 deletions
diff --git a/include/chat.php b/include/chat.php index b8fb185df..5c3d0c9d9 100644 --- a/include/chat.php +++ b/include/chat.php @@ -189,6 +189,17 @@ function chatroom_list($uid) { return $r; } +function chatroom_list_count($uid) { + require_once('include/security.php'); + $sql_extra = permissions_sql($uid); + + $r = q("select count(*) as total from chatroom where cr_uid = %d $sql_extra", + intval($uid) + ); + + return $r[0]['total']; +} + /** * create a chat message via API. * It is the caller's responsibility to enter the room. diff --git a/include/conversation.php b/include/conversation.php index 05ae72d61..b0a388a68 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -440,7 +440,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ for($x = 0; $x < count($arr_blocked); $x ++) $arr_blocked[$x] = trim($arr_blocked[$x]); } - } @@ -458,59 +457,53 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ $profile_owner = local_user(); $page_writeable = true; - if(!$update) { - // The special div is needed for liveUpdate to kick in for this page. - // We only launch liveUpdate if you aren't filtering in some incompatible - // way and also you aren't writing a comment (discovered in javascript). - - $live_update_div = '<div id="live-network"></div>' . "\r\n" - . "<script> var profile_uid = " . $_SESSION['uid'] - . "; var netargs = '" . substr($a->cmd,8) - . '?f=' - . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') - . ((x($_GET,'search')) ? '&search=' . $_GET['search'] : '') - . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '') - . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '') - . ((x($_GET,'bmark')) ? '&bmark=' . $_GET['bmark'] : '') - . ((x($_GET,'liked')) ? '&liked=' . $_GET['liked'] : '') - . ((x($_GET,'conv')) ? '&conv=' . $_GET['conv'] : '') - . ((x($_GET,'spam')) ? '&spam=' . $_GET['spam'] : '') - . ((x($_GET,'nets')) ? '&nets=' . $_GET['nets'] : '') - . ((x($_GET,'cmin')) ? '&cmin=' . $_GET['cmin'] : '') - . ((x($_GET,'cmax')) ? '&cmax=' . $_GET['cmax'] : '') - . ((x($_GET,'file')) ? '&file=' . $_GET['file'] : '') - . ((x($_GET,'uri')) ? '&uri=' . $_GET['uri'] : '') - - . "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; - } - - + if(!$update) { + // The special div is needed for liveUpdate to kick in for this page. + // We only launch liveUpdate if you aren't filtering in some incompatible + // way and also you aren't writing a comment (discovered in javascript). + + $live_update_div = '<div id="live-network"></div>' . "\r\n" + . "<script> var profile_uid = " . $_SESSION['uid'] + . "; var netargs = '" . substr($a->cmd,8) + . '?f=' + . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') + . ((x($_GET,'search')) ? '&search=' . $_GET['search'] : '') + . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '') + . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '') + . ((x($_GET,'bmark')) ? '&bmark=' . $_GET['bmark'] : '') + . ((x($_GET,'liked')) ? '&liked=' . $_GET['liked'] : '') + . ((x($_GET,'conv')) ? '&conv=' . $_GET['conv'] : '') + . ((x($_GET,'spam')) ? '&spam=' . $_GET['spam'] : '') + . ((x($_GET,'nets')) ? '&nets=' . $_GET['nets'] : '') + . ((x($_GET,'cmin')) ? '&cmin=' . $_GET['cmin'] : '') + . ((x($_GET,'cmax')) ? '&cmax=' . $_GET['cmax'] : '') + . ((x($_GET,'file')) ? '&file=' . $_GET['file'] : '') + . ((x($_GET,'uri')) ? '&uri=' . $_GET['uri'] : '') + . "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; + } } elseif($mode === 'channel') { $profile_owner = $a->profile['profile_uid']; $page_writeable = ($profile_owner == local_user()); - if(!$update) { - $tab = notags(trim($_GET['tab'])); - if($tab === 'posts') { - // This is ugly, but we can't pass the profile_uid through the session to the ajax updater, - // because browser prefetching might change it on us. We have to deliver it with the page. - - $live_update_div = '<div id="live-channel"></div>' . "\r\n" - . "<script> var profile_uid = " . $a->profile['profile_uid'] - . "; var netargs = '?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; - } - } + if(!$update) { + $tab = notags(trim($_GET['tab'])); + if($tab === 'posts') { + // This is ugly, but we can't pass the profile_uid through the session to the ajax updater, + // because browser prefetching might change it on us. We have to deliver it with the page. + $live_update_div = '<div id="live-channel"></div>' . "\r\n" + . "<script> var profile_uid = " . $a->profile['profile_uid'] + . "; var netargs = '?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; + } + } } elseif($mode === 'display') { $profile_owner = local_user(); $page_writeable = false; - - $live_update_div = '<div id="live-display"></div>' . "\r\n"; - + $live_update_div = '<div id="live-display"></div>' . "\r\n"; } elseif($mode === 'page') { @@ -519,10 +512,10 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ $live_update_div = '<div id="live-page"></div>' . "\r\n"; } + elseif($mode === 'search') { + $live_update_div = '<div id="live-search"></div>' . "\r\n"; + } - elseif($mode === 'search') { - $live_update_div = '<div id="live-search"></div>' . "\r\n"; - } elseif($mode === 'photos') { $profile_onwer = $a->profile['profile_uid']; $page_writeable = ($profile_owner == local_user()); @@ -555,7 +548,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ $alike = array(); $dlike = array(); - // array with html for each thread (parent+comments) $threads = array(); $threadsid = -1; @@ -603,12 +595,11 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ } else $nickname = $a->user['nickname']; - + $profile_name = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']); if($item['author-link'] && (! $item['author-name'])) $profile_name = $item['author-link']; - $tags=array(); $hashtags = array(); @@ -631,7 +622,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ $profile_link = $item['author']['xchan_url']; $profile_avatar = $item['author']['xchan_photo_m']; - $location = format_location($item); localize_item($item); @@ -663,7 +653,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ $unverified = ''; - $tags=array(); $terms = get_terms_oftype($item['term'],array(TERM_HASHTAG,TERM_MENTION,TERM_UNKNOWN)); if(count($terms)) @@ -694,12 +683,11 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ 'verified' => $verified, 'unverified' => $unverified, 'txt_cats' => t('Categories:'), - 'txt_folders' => t('Filed under:'), - 'has_cats' => ((count($categories)) ? 'true' : ''), - 'has_folders' => ((count($folders)) ? 'true' : ''), - 'categories' => $categories, - 'folders' => $folders, - + 'txt_folders' => t('Filed under:'), + 'has_cats' => ((count($categories)) ? 'true' : ''), + 'has_folders' => ((count($folders)) ? 'true' : ''), + 'categories' => $categories, + 'folders' => $folders, 'text' => strip_tags($body), 'ago' => relative_date($item['created']), 'app' => $item['app'], @@ -743,10 +731,10 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ // Normal View // logger('conv: items: ' . print_r($items,true)); - require_once('include/ConversationObject.php'); - require_once('include/ItemObject.php'); + require_once('include/ConversationObject.php'); + require_once('include/ItemObject.php'); - $conv = new Conversation($mode, $preview, $prepared_item); + $conv = new Conversation($mode, $preview, $prepared_item); // In the display mode we don't have a profile owner. @@ -754,12 +742,12 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ $conv->set_profile_owner($items[0]['uid']); - // get all the topmost parents - // this shouldn't be needed, as we should have only them in our array - // But for now, this array respects the old style, just in case + // get all the topmost parents + // this shouldn't be needed, as we should have only them in our array + // But for now, this array respects the old style, just in case - $threads = array(); - foreach($items as $item) { + $threads = array(); + foreach($items as $item) { // Check for any blocked authors @@ -774,7 +762,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ if($blocked) continue; } - + // Check all the kids too if($arr_blocked && $item['children']) { @@ -786,46 +774,43 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ } } + like_puller($a, $item, $alike, 'like'); + if(feature_enabled($profile_owner, 'dislike')) + like_puller($a, $item, $dlike, 'dislike'); - like_puller($a,$item,$alike,'like'); - - if(feature_enabled($profile_owner,'dislike')) - like_puller($a,$item,$dlike,'dislike'); - - if(! visible_activity($item)) { - continue; - } + if(! visible_activity($item)) { + continue; + } - $item['pagedrop'] = $page_dropping; + $item['pagedrop'] = $page_dropping; - if($item['id'] == $item['parent']) { + if($item['id'] == $item['parent']) { // $tx1 = dba_timer(); - $item_object = new Item($item); - $conv->add_thread($item_object); + $item_object = new Item($item); + $conv->add_thread($item_object); if($page_mode === 'list') $item_object->set_template('conv_list.tpl'); // $tx2 = dba_timer(); // if($mode === 'network') // profiler($tx1,$tx2,'add thread ' . $item['id']); - } - } + } + } $t2 = dba_timer(); - $threads = $conv->get_template_data($alike, $dlike); - if(!$threads) { - logger('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG); - $threads = array(); - } + $threads = $conv->get_template_data($alike, $dlike); + if(!$threads) { + logger('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG); + $threads = array(); + } $t3 = dba_timer(); if($mode === 'network') { profiler($t1,$t2,'Conversation prepare'); profiler($t2,$t3,'Conversation get_template'); } - - } - } + } + } if($page_mode === 'traditional' || $page_mode === 'preview') { $page_template = get_markup_template("threaded_conversation.tpl"); @@ -867,8 +852,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ if($page_mode === 'preview') logger('preview: ' . $o); - return $o; - + return $o; } @@ -981,26 +965,43 @@ function item_photo_menu($item){ return $o; } - -function like_puller($a,$item,&$arr,$mode) { +/** + * @brief Returns a like/dislike entry. + * It gives back a HTML link to the channel that liked/disliked. + * + * @param array $a (not used) + * @param array $item + * @param array &$arr + * @param string $mode like/dislike + * @return void + */ +function like_puller($a, $item, &$arr, $mode) { $url = ''; - $sparkle = ''; $verb = (($mode === 'like') ? ACTIVITY_LIKE : ACTIVITY_DISLIKE); - if((activity_match($item['verb'],$verb)) && ($item['id'] != $item['parent'])) { - $url = chanlink_url($item['author']['xchan_url']); + if((activity_match($item['verb'], $verb)) && ($item['id'] != $item['parent'])) { + + if($item['author']['xchan_url']) + $url = chanlink_url($item['author']['xchan_url']); if(! $item['thr_parent']) $item['thr_parent'] = $item['parent_mid']; if(! ((isset($arr[$item['thr_parent'] . '-l'])) && (is_array($arr[$item['thr_parent'] . '-l'])))) $arr[$item['thr_parent'] . '-l'] = array(); + if(! isset($arr[$item['thr_parent']])) $arr[$item['thr_parent']] = 1; else $arr[$item['thr_parent']] ++; - $arr[$item['thr_parent'] . '-l'][] = '<a href="'. $url . '">' . $item['author']['xchan_name'] . '</a>'; + + $name = (($item['author']['xchan_name']) ? $item['author']['xchan_name'] : t('Unknown')); + + if($url) + $arr[$item['thr_parent'] . '-l'][] = '<a href="'. $url . '">' . $name . '</a>'; + else + $arr[$item['thr_parent'] . '-l'][] = '<a href="#" class="disabled">' . $name . '</a>'; } return; } @@ -1545,8 +1546,8 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ } require_once('include/chat.php'); - $chats = chatroom_list($uid); - if (count($chats)) { + $has_chats = chatroom_list_count($uid); + if ($has_chats) { $tabs[] = array( 'label' => t('Chatrooms'), 'url' => $a->get_baseurl() . '/chat/' . $nickname, @@ -1556,7 +1557,9 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ ); } - if($is_owner) { + require_once('include/menu.php'); + $has_bookmarks = menu_list_count(local_user(),'',MENU_BOOKMARK) + menu_list_count(local_user(),'',MENU_SYSTEM|MENU_BOOKMARK); + if($is_owner && $has_bookmarks) { $tabs[] = array( 'label' => t('Bookmarks'), 'url' => $a->get_baseurl() . '/bookmarks', diff --git a/include/diaspora.php b/include/diaspora.php index 3b6321643..6f504b460 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -58,7 +58,7 @@ function diaspora_dispatch($importer,$msg,$attempt=1) { $xmlbase = $parsed_xml->post; - logger('diaspora_dispatch: ' . print_r($xmlbase,true), LOGGER_DEBUG); + logger('diaspora_dispatch: ' . print_r($xmlbase,true), LOGGER_DATA); if($xmlbase->request) { @@ -545,7 +545,7 @@ function diaspora_decode($importer,$xml) { * </decrypted_header> */ - logger('decrypted: ' . $decrypted, LOGGER_DEBUG); + logger('decrypted: ' . $decrypted, LOGGER_DATA); $idom = parse_xml_string($decrypted,false); $inner_iv = base64_decode($idom->iv); @@ -912,7 +912,7 @@ function diaspora_post($importer,$xml,$msg) { function diaspora_reshare($importer,$xml,$msg) { - logger('diaspora_reshare: init: ' . print_r($xml,true)); + logger('diaspora_reshare: init: ' . print_r($xml,true), LOGGER_DATA); $a = get_app(); $guid = notags(unxmlify($xml->guid)); @@ -955,7 +955,7 @@ function diaspora_reshare($importer,$xml,$msg) { logger('diaspora_reshare: unable to fetch source url ' . $source_url); return; } - logger('diaspora_reshare: source: ' . $x['body']); + logger('diaspora_reshare: source: ' . $x['body'], LOGGER_DATA); $source_xml = parse_xml_string($x['body'],false); @@ -1431,7 +1431,8 @@ function diaspora_conversation($importer,$xml,$msg) { return; } - if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) { + + if(! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'post_mail')) { logger('diaspora_conversation: Ignoring this author.'); return 202; } @@ -1531,7 +1532,7 @@ function diaspora_conversation($importer,$xml,$msg) { continue; } - q("insert into mail ( `uid`, `convid`, `from_xchan`,`to_xchan`,`title`,`body`,`mail_flags`,`mid`,`parent_mid`,`created`) values ( %d, %d, '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s')", + q("insert into mail ( `channel_id`, `convid`, `from_xchan`,`to_xchan`,`title`,`body`,`mail_flags`,`mid`,`parent_mid`,`created`) values ( %d, %d, '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s')", intval($importer['channel_id']), intval($conversation['id']), dbesc($person['xchan_hash']), @@ -1645,19 +1646,15 @@ function diaspora_message($importer,$xml,$msg) { return; } - q("insert into mail ( `uid`, `guid`, `convid`, `from-name`,`from-photo`,`from-url`,`contact-id`,`title`,`body`,`seen`,`reply`,`uri`,`parent-uri`,`created`) values ( %d, '%s', %d, '%s', '%s', '%s', %d, '%s', '%s', %d, %d, '%s','%s','%s')", + q("insert into mail ( `channel_id`, `convid`, `from_xchan`,`to_xchan`,`title`,`body`,`mail_flags`,`mid`,`parent_mid`,`created`) values ( %d, %d, '%s', '%s', '%s', '%s', '%d','%s','%s','%s')", intval($importer['channel_id']), - dbesc($msg_guid), intval($conversation['id']), - dbesc($person['name']), - dbesc($person['photo']), - dbesc($person['url']), - intval($contact['id']), + dbesc($person['xchan_hash']), + dbesc($importer['xchan_hash']), dbesc($conversation['subject']), dbesc($body), 0, - 1, - dbesc($message_id), + dbesc($msg_guid), dbesc($parent_uri), dbesc($msg_created_at) ); diff --git a/include/follow.php b/include/follow.php index 3c1fcd890..38525982e 100644 --- a/include/follow.php +++ b/include/follow.php @@ -143,7 +143,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false) if(! $r) { // attempt network auto-discovery - if(strpos($url,'@')) { + if(strpos($url,'@') && (! $is_http)) { $r = discover_by_webbie($url); } elseif($is_http) { diff --git a/include/items.php b/include/items.php index 1fa833eb2..53a0b25a9 100755 --- a/include/items.php +++ b/include/items.php @@ -1791,6 +1791,7 @@ function get_atom_elements($feed,$item,&$author) { call_hooks('parse_atom', $arr); logger('get_atom_elements: author: ' . print_r($author,true),LOGGER_DATA); + logger('get_atom_elements: ' . print_r($res,true),LOGGER_DATA); return $res; @@ -2469,18 +2470,10 @@ function store_diaspora_comment_sig($datarray, $channel, $parent_item, $post_id) return; } - $body = $datarray['body']; - if(array_key_exists('item_flags',$datarray) && ($datarray['item_flags'] & ITEM_OBSCURED)) { - $key = get_config('system','prvkey'); - if($datarray['body']) - $body = crypto_unencapsulate(json_decode($datarray['body'],true),$key); - } - - logger('mod_item: storing diaspora comment signature',LOGGER_DEBUG); - require_once('include/bb2diaspora.php'); + $signed_body = bb2diaspora_itembody($datarray); - $signed_body = html_entity_decode(bb2diaspora($body)); + logger('mod_item: storing diaspora comment signature',LOGGER_DEBUG); $diaspora_handle = $channel['channel_address'] . '@' . get_app()->get_hostname(); diff --git a/include/js_strings.php b/include/js_strings.php index cda66a09c..f4c0a631d 100644 --- a/include/js_strings.php +++ b/include/js_strings.php @@ -15,6 +15,7 @@ function js_strings() { '$passhint' => t('Passphrase hint'), '$permschange' => t('Notice: Permissions have changed but have not yet been submitted.'), '$closeAll' => t('close all'), + '$nothingnew' => t('Nothing new here'), '$t01' => ((t('timeago.prefixAgo') != 'timeago.prefixAgo') ? t('timeago.prefixAgo') : ''), '$t02' => ((t('timeago.prefixFromNow') != 'timeago.prefixFromNow') ? t('timeago.prefixFromNow') : ''), diff --git a/include/menu.php b/include/menu.php index 4b0a11f10..8997d2e39 100644 --- a/include/menu.php +++ b/include/menu.php @@ -124,7 +124,17 @@ function menu_list($channel_id, $name = '', $flags = 0) { return $r; } +function menu_list_count($channel_id, $name = '', $flags = 0) { + $sel_options = ''; + $sel_options .= (($name) ? " and menu_name = '" . protect_sprintf(dbesc($name)) . "' " : ''); + $sel_options .= (($flags) ? " and menu_flags = " . intval($flags) . " " : ''); + + $r = q("select count(*) as total from menu where menu_channel_id = %d $sel_options", + intval($channel_id) + ); + return $r[0]['total']; +} function menu_edit($arr) { diff --git a/include/nav.php b/include/nav.php index 799faf5ce..98d1b644e 100644 --- a/include/nav.php +++ b/include/nav.php @@ -105,14 +105,19 @@ EOT; $nav['usermenu'][] = Array('cloud/' . $channel['channel_address'],t('Files'),"",t('Your files')); require_once('include/chat.php'); - $chats = chatroom_list(local_user()); - if (count($chats)) { + $has_chats = chatroom_list_count(local_user()); + if($has_chats) { $nav['usermenu'][] = Array('chat/' . $channel['channel_address'],t('Chat'),"",t('Your chatrooms')); } - $nav['usermenu'][] = Array('bookmarks', t('Bookmarks'), "", t('Your bookmarks')); + require_once('include/menu.php'); + $has_bookmarks = menu_list_count(local_user(),'',MENU_BOOKMARK) + menu_list_count(local_user(),'',MENU_SYSTEM|MENU_BOOKMARK); + if($has_bookmarks) { + $nav['usermenu'][] = Array('bookmarks', t('Bookmarks'), "", t('Your bookmarks')); + } + if(feature_enabled($channel['channel_id'],'webpages')) - $nav['usermenu'][] = Array('webpages/' . $channel['channel_address'],t('Webpages'),"",t('Your webpages')); + $nav['usermenu'][] = Array('webpages/' . $channel['channel_address'],t('Webpages'),"",t('Your webpages')); } else { if(! get_account_id()) @@ -241,7 +246,7 @@ EOT; '$sitelocation' => $sitelocation, '$nav' => $x['nav'], '$banner' => $banner, - '$emptynotifications' => t('Nothing new here'), + '$emptynotifications' => t('Loading...'), '$userinfo' => $x['usermenu'], '$localuser' => local_user(), '$sel' => $a->nav_sel, diff --git a/include/notifier.php b/include/notifier.php index 3f34d6133..0c7a15452 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -478,8 +478,9 @@ function notifier_run($argv, $argc){ } else { $r = q("select hubloc_guid, hubloc_url, hubloc_sitekey, hubloc_network, hubloc_flags, hubloc_callback, hubloc_host from hubloc - where hubloc_hash in (" . implode(',',$recipients) . ") and not (hubloc_flags & %d) group by hubloc_sitekey", - intval(HUBLOC_FLAGS_DELETED) + where hubloc_hash in (" . implode(',',$recipients) . ") and not (hubloc_flags & %d) and not (hubloc_status & %d) group by hubloc_sitekey", + intval(HUBLOC_FLAGS_DELETED), + intval(HUBLOC_OFFLINE) ); } diff --git a/include/onepoll.php b/include/onepoll.php index 1f28852e9..98d52db93 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -135,7 +135,7 @@ function onepoll_run($argv, $argc){ foreach($j['messages'] as $message) { $results = process_delivery(array('hash' => $contact['xchan_hash']), get_item_elements($message), array(array('hash' => $importer['xchan_hash'])), false); - logger('onepoll: feed_update: process_delivery: ' . print_r($results,true)); + logger('onepoll: feed_update: process_delivery: ' . print_r($results,true), LOGGER_DATA); $total ++; } logger("onepoll: $total messages processed"); diff --git a/include/permissions.php b/include/permissions.php index e25052f95..438b807d0 100644 --- a/include/permissions.php +++ b/include/permissions.php @@ -747,7 +747,7 @@ function role_selector($current) { $selected = (($kk === $current) ? ' selected="selected" ' : ''); $o .= '<option value="' . $kk . '" ' . $selected . '>' . htmlspecialchars($vv) . '</option>'; } - $o .= '<optgroup>'; + $o .= '</optgroup>'; } $o .= '</select>'; return $o; diff --git a/include/security.php b/include/security.php index 0f2edc708..e83cc7061 100644 --- a/include/security.php +++ b/include/security.php @@ -82,6 +82,19 @@ function change_channel($change_channel) { intval(PAGE_REMOVED) ); + // It's not there. Is this an administrator, and is this the sys channel? + if (is_developer()) { + if (! $r) { + if (is_site_admin()) { + $r = q("select channel.*, xchan.* from channel left join xchan on channel.channel_hash = xchan.xchan_hash where channel_id = %d and ( channel_pageflags & %d) and not (channel_pageflags & %d ) limit 1", + intval($change_channel), + intval(PAGE_SYSTEM), + intval(PAGE_REMOVED) + ); + } + } + } + if($r) { $hash = $r[0]['channel_hash']; $_SESSION['uid'] = intval($r[0]['channel_id']); |