diff options
155 files changed, 886 insertions, 886 deletions
diff --git a/app/bookmarks.apd b/app/bookmarks.apd index 6c3d718a8..9581a220c 100644 --- a/app/bookmarks.apd +++ b/app/bookmarks.apd @@ -1,4 +1,4 @@ url: $baseurl/bookmarks -requires: local_user +requires: local_channel name: View bookmarks photo: $baseurl/app/bookmarks.png diff --git a/app/channel.apd b/app/channel.apd index be13ee77b..0b5400ae4 100644 --- a/app/channel.apd +++ b/app/channel.apd @@ -1,4 +1,4 @@ url: $baseurl/channel/$nick -requires: local_user +requires: local_channel name: Channel Home photo: $baseurl/app/home.png diff --git a/app/chat.apd b/app/chat.apd index 249608f57..d4879c0b7 100644 --- a/app/chat.apd +++ b/app/chat.apd @@ -1,4 +1,4 @@ url: $baseurl/chat/$nick -requires: local_user +requires: local_channel name: My chatrooms photo: $baseurl/app/chat.png diff --git a/app/connections.apd b/app/connections.apd index 146e553e5..f4b5ad87a 100644 --- a/app/connections.apd +++ b/app/connections.apd @@ -1,4 +1,4 @@ url: $baseurl/connections -requires: local_user +requires: local_channel name: Connections photo: $baseurl/app/connections.png diff --git a/app/events.apd b/app/events.apd index 2f43efbe1..dd725e177 100644 --- a/app/events.apd +++ b/app/events.apd @@ -1,4 +1,4 @@ url: $baseurl/events -requires: local_user +requires: local_channel name: Events photo: $baseurl/app/events.png diff --git a/app/features.apd b/app/features.apd index 3d01e841c..521df4794 100644 --- a/app/features.apd +++ b/app/features.apd @@ -1,4 +1,4 @@ url: $baseurl/settings/features -requires: local_user +requires: local_channel name: Features photo: $baseurl/app/features.png diff --git a/app/invite.apd b/app/invite.apd index 8526d2d4a..96bafff14 100644 --- a/app/invite.apd +++ b/app/invite.apd @@ -1,4 +1,4 @@ url: $baseurl/invite -requires: local_user +requires: local_channel name: Invite photo: $baseurl/app/invite.png diff --git a/app/mail.apd b/app/mail.apd index e916829ad..b9fdb9967 100644 --- a/app/mail.apd +++ b/app/mail.apd @@ -1,4 +1,4 @@ url: $baseurl/message -requires: local_user +requires: local_channel name: Mail photo: $baseurl/app/mail.png diff --git a/app/manage.apd b/app/manage.apd index 2e0a92d74..27938e4cf 100644 --- a/app/manage.apd +++ b/app/manage.apd @@ -1,4 +1,4 @@ url: $baseurl/manage -requires: local_user +requires: local_channel name: Channel Manager photo: $baseurl/app/manage.png diff --git a/app/matrix.apd b/app/matrix.apd index 96df48690..68188bfd3 100644 --- a/app/matrix.apd +++ b/app/matrix.apd @@ -1,4 +1,4 @@ url: $baseurl/network -requires: local_user +requires: local_channel name: Matrix photo: $baseurl/app/matrix.png diff --git a/app/mood.apd b/app/mood.apd index ef90650f0..6f381fd44 100644 --- a/app/mood.apd +++ b/app/mood.apd @@ -1,4 +1,4 @@ url: $baseurl/mood -requires: local_user +requires: local_channel name: Mood photo: $baseurl/app/mood.png diff --git a/app/photos.apd b/app/photos.apd index d0a314406..3422d5205 100644 --- a/app/photos.apd +++ b/app/photos.apd @@ -1,4 +1,4 @@ url: $baseurl/photos/$nick -requires: local_user +requires: local_channel name: Photos photo: $baseurl/app/photos.png diff --git a/app/poke.apd b/app/poke.apd index b7d189224..7e3bb4ff0 100644 --- a/app/poke.apd +++ b/app/poke.apd @@ -1,4 +1,4 @@ url: $baseurl/poke -requires: local_user +requires: local_channel name: Poke photo: $baseurl/app/poke.png diff --git a/app/pphoto.apd b/app/pphoto.apd index e7da9cf9c..302b85d9e 100644 --- a/app/pphoto.apd +++ b/app/pphoto.apd @@ -1,4 +1,4 @@ url: $baseurl/profile_photo -requires: local_user +requires: local_channel name: Profile Photo photo: $baseurl/app/pphoto.png diff --git a/app/probe.apd b/app/probe.apd index e2d2428a0..e1ab5fc43 100644 --- a/app/probe.apd +++ b/app/probe.apd @@ -1,4 +1,4 @@ url: $baseurl/probe -requires: local_user +requires: local_channel name: Remote diagnostics photo: $baseurl/app/probe.png diff --git a/app/profile.apd b/app/profile.apd index d2bdf23a7..d353d5742 100644 --- a/app/profile.apd +++ b/app/profile.apd @@ -1,4 +1,4 @@ url: $baseurl/profile/$nick -requires: local_user +requires: local_channel name: View profile photo: $baseurl/app/profile.png diff --git a/app/settings.apd b/app/settings.apd index 311f793ff..fbb5eacdd 100644 --- a/app/settings.apd +++ b/app/settings.apd @@ -1,4 +1,4 @@ url: $baseurl/settings -requires: local_user +requires: local_channel name: Settings photo: $baseurl/app/settings.png diff --git a/app/storage.apd b/app/storage.apd index 5900faae8..c959a3cd4 100644 --- a/app/storage.apd +++ b/app/storage.apd @@ -1,4 +1,4 @@ url: $baseurl/cloud/$nick -requires: local_user +requires: local_channel name: Files photo: $baseurl/app/storage.png diff --git a/app/suggest.apd b/app/suggest.apd index f4ca79410..f3d17e0ea 100644 --- a/app/suggest.apd +++ b/app/suggest.apd @@ -1,4 +1,4 @@ url: $baseurl/suggest -requires: local_user +requires: local_channel name: Suggest channels photo: $baseurl/app/suggest.png diff --git a/app/webpages.apd b/app/webpages.apd index 7c7528d6b..78e7abba8 100644 --- a/app/webpages.apd +++ b/app/webpages.apd @@ -1,4 +1,4 @@ url: $baseurl/webpages/$nick -requires: local_user, webpages +requires: local_channel, webpages name: Webpages photo: $baseurl/app/webpages.png @@ -1004,11 +1004,11 @@ class App { function build_pagehead() { - $user_scalable = ((local_user()) ? get_pconfig(local_user(),'system','user_scalable') : 1); + $user_scalable = ((local_channel()) ? get_pconfig(local_channel(),'system','user_scalable') : 1); if ($user_scalable === false) $user_scalable = 1; - $interval = ((local_user()) ? get_pconfig(local_user(),'system','update_interval') : 80000); + $interval = ((local_channel()) ? get_pconfig(local_channel(),'system','update_interval') : 80000); if($interval < 10000) $interval = 80000; @@ -1023,7 +1023,7 @@ class App { $this->page['htmlhead'] = replace_macros($tpl, array( '$user_scalable' => $user_scalable, '$baseurl' => $this->get_baseurl(), - '$local_user' => local_user(), + '$local_channel' => local_channel(), '$generator' => RED_PLATFORM . ' ' . RED_VERSION, '$update_interval' => $interval, '$icon' => head_get_icon(), @@ -1529,7 +1529,7 @@ function login($register = false, $form_id = 'main-login', $hiddens=false) { $dest_url = $a->get_baseurl(true) . '/' . $a->query_string; - if(local_user()) { + if(local_channel()) { $tpl = get_markup_template("logout.tpl"); } else { @@ -1603,7 +1603,7 @@ function get_account_id() { * * @return int|bool channel_id or false */ -function local_user() { +function local_channel() { if((x($_SESSION, 'authenticated')) && (x($_SESSION, 'uid'))) return intval($_SESSION['uid']); @@ -1744,7 +1744,7 @@ function current_theme(){ // Find the theme that belongs to the channel whose stuff we are looking at - if($a->profile_uid && $a->profile_uid != local_user()) { + if($a->profile_uid && $a->profile_uid != local_channel()) { $r = q("select channel_theme from channel where channel_id = %d limit 1", intval($a->profile_uid) ); @@ -1759,8 +1759,8 @@ function current_theme(){ // The default is for channel themes to take precedence over your own on pages belonging // to that channel. - if($page_theme && local_user() && local_user() != $a->profile_url) { - if(get_pconfig(local_user(),'system','always_my_theme')) + if($page_theme && local_channel() && local_channel() != $a->profile_url) { + if(get_pconfig(local_channel(),'system','always_my_theme')) $page_theme = null; } diff --git a/doc/Plugins.md b/doc/Plugins.md index b657f5ceb..e3e4688d9 100644 --- a/doc/Plugins.md +++ b/doc/Plugins.md @@ -93,10 +93,10 @@ Let's go ahead and add some code to implement our post_local hook handler. logger('randplace invoked'); - if(! local_user()) /* non-zero if this is a logged in user of this system */ + if(! local_channel()) /* non-zero if this is a logged in user of this system */ return; - if(local_user() != $item['uid']) /* Does this person own the post? */ + if(local_channel() != $item['uid']) /* Does this person own the post? */ return; if(($item['parent']) || ($item['item_restrict'])) { @@ -106,7 +106,7 @@ Let's go ahead and add some code to implement our post_local hook handler. /* Retrieve our personal config setting */ - $active = get_pconfig(local_user(), 'randplace', 'enable'); + $active = get_pconfig(local_channel(), 'randplace', 'enable'); if(! $active) return; @@ -148,10 +148,10 @@ Now let's add our functions to create and store preference settings. */ function randplace_settings_post($a,$post) { - if(! local_user()) + if(! local_channel()) return; if($_POST['randplace-submit']) - set_pconfig(local_user(),'randplace','enable',intval($_POST['randplace'])); + set_pconfig(local_channel(),'randplace','enable',intval($_POST['randplace'])); } @@ -175,7 +175,7 @@ Now let's add our functions to create and store preference settings. function randplace_settings(&$a,&$s) { - if(! local_user()) + if(! local_channel()) return; /* Add our stylesheet to the page so we can make our settings look nice */ @@ -184,7 +184,7 @@ Now let's add our functions to create and store preference settings. /* Get the current state of our config variable */ - $enabled = get_pconfig(local_user(),'randplace','enable'); + $enabled = get_pconfig(local_channel(),'randplace','enable'); $checked = (($enabled) ? ' checked="checked" ' : ''); diff --git a/doc/dev-function-overview.md b/doc/dev-function-overview.md index 5e382201f..fa2bbac00 100644 --- a/doc/dev-function-overview.md +++ b/doc/dev-function-overview.md @@ -7,7 +7,7 @@ Red development - some useful basic functions Returns numeric account_id if authenticated or 0. It is possible to be authenticated and not connected to a channel. -* local_user() +* local_channel() Returns authenticated numeric channel_id if authenticated and connected to a channel or 0. Sometimes referred to as $uid in the code. diff --git a/doc/developer_function_primer.bb b/doc/developer_function_primer.bb index 3db853b82..33fb1f51f 100644 --- a/doc/developer_function_primer.bb +++ b/doc/developer_function_primer.bb @@ -4,7 +4,7 @@ Returns numeric account_id if authenticated or 0. It is possible to be authenticated and not connected to a channel.
-[b]local_user()[/b]
+[b]local_channel()[/b]
Returns authenticated numeric channel_id if authenticated and connected to a channel or 0. Sometimes referred to as $uid in the code.
diff --git a/doc/html/boot_8php.html b/doc/html/boot_8php.html index 8305436d9..299ee9c48 100644 --- a/doc/html/boot_8php.html +++ b/doc/html/boot_8php.html @@ -160,7 +160,7 @@ Functions</h2></td></tr> <tr class="memitem:afe88b920aa285982edb817a0dd44eb37"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="boot_8php.html#afe88b920aa285982edb817a0dd44eb37">get_account_id</a> ()</td></tr> <tr class="memdesc:afe88b920aa285982edb817a0dd44eb37"><td class="mdescLeft"> </td><td class="mdescRight">Returns the entity id of locally logged in account or false. <a href="#afe88b920aa285982edb817a0dd44eb37">More...</a><br/></td></tr> <tr class="separator:afe88b920aa285982edb817a0dd44eb37"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ad4c9dc2c8a82e8f52b7404c1655eab44"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">local_user</a> ()</td></tr> +<tr class="memitem:ad4c9dc2c8a82e8f52b7404c1655eab44"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">local_channel</a> ()</td></tr> <tr class="memdesc:ad4c9dc2c8a82e8f52b7404c1655eab44"><td class="mdescLeft"> </td><td class="mdescRight">Returns the entity id (channel_id) of locally logged in user or false. <a href="#ad4c9dc2c8a82e8f52b7404c1655eab44">More...</a><br/></td></tr> <tr class="separator:ad4c9dc2c8a82e8f52b7404c1655eab44"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a5542c5c2806ab8bca04bad53d47b5209"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="boot_8php.html#a5542c5c2806ab8bca04bad53d47b5209">remote_user</a> ()</td></tr> @@ -1484,7 +1484,7 @@ Variables</h2></td></tr> <div class="memproto"> <table class="memname"> <tr> - <td class="memname">local_user </td> + <td class="memname">local_channel </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> @@ -1704,7 +1704,7 @@ Variables</h2></td></tr> </dl> <dl class="section return"><dt>Returns</dt><dd>bool|int </dd></dl> -<p>Referenced by <a class="el" href="classFriendicaSmarty.html#af12091b920b95eeef1218cbc48066ca6">FriendicaSmarty\__construct()</a>, <a class="el" href="classApp.html#af6d39f63fb7116bbeb04e51696f99474">App\__construct()</a>, <a class="el" href="account_8php.html#ac70e1d198246b029a3cedb7d6f7868bd">account_service_class_allows()</a>, <a class="el" href="account_8php.html#a4328c40ee4b3d68630cf1ebb7b9d4d89">account_service_class_fetch()</a>, <a class="el" href="acl_8php.html#ac6776dba871806ecdb5d1659bc2eb07a">acl_init()</a>, <a class="el" href="admin_8php.html#a42e628f367c168add8013352ac74d33f">admin_page_channels_post()</a>, <a class="el" href="admin_8php.html#a233b7c8c31776b7020532003c6e44e1c">admin_page_logs_post()</a>, <a class="el" href="admin_8php.html#a54128076986ba80c4a103de3fc3e19a8">admin_page_plugins()</a>, <a class="el" href="admin_8php.html#ac0f3bd12431c056aad77bac9d09fa30e">admin_page_site()</a>, <a class="el" href="admin_8php.html#add865f4ae806ecbf716f423fc3e50e4f">admin_page_site_post()</a>, <a class="el" href="admin_8php.html#af124619fdc278fe2bf14c45ddaa260fb">admin_page_themes()</a>, <a class="el" href="admin_8php.html#a5a696706a3869800e65fb365214241b7">admin_page_users_post()</a>, <a class="el" href="mod_2api_8php.html#a33315b5bbf5418f6850b2038107b526d">api_content()</a>, <a class="el" href="include_2api_8php.html#a7759ccddc8dff012ad168e511ffe5af5">api_direct_messages_box()</a>, <a class="el" href="include_2api_8php.html#a0991f72554f821255397d615e76f3203">api_direct_messages_new()</a>, <a class="el" href="include_2api_8php.html#a2c71b1226ef1283b5370bd1c200fee5f">api_favorites()</a>, <a class="el" href="include_2api_8php.html#ae82608c317421f27446465aa6724733d">api_format_messages()</a>, <a class="el" href="include_2api_8php.html#aa40bae797bcd9ccacffdce5a3b5a1afa">api_get_user()</a>, <a class="el" href="include_2api_8php.html#afe534f826e4282b72d66e8cadca7bb73">api_login()</a>, <a class="el" href="mod_2api_8php.html#a6fe77f05c07cb51048df0d557b4b9bd2">api_post()</a>, <a class="el" href="include_2api_8php.html#aa0d6b29fff0344a8e67f3507a6d01410">api_statuses_f()</a>, <a class="el" href="include_2api_8php.html#a528d8070ee74ea800102936ce73cf366">api_statuses_home_timeline()</a>, <a class="el" href="include_2api_8php.html#a8b25a186bd0893f51aa72a62f655735e">api_statuses_mentions()</a>, <a class="el" href="include_2api_8php.html#ad24ce1bf20867add4c9211a8eaf93f22">api_statuses_public_timeline()</a>, <a class="el" href="include_2api_8php.html#af6f1d89cdb0a0621025efbec1597bc63">api_statuses_show()</a>, <a class="el" href="include_2api_8php.html#ad4d1634df6b35126552324683caaffa2">api_statuses_update()</a>, <a class="el" href="include_2api_8php.html#a32f0dda848d0c11c727fe1c3e741c283">api_statuses_user_timeline()</a>, <a class="el" href="include_2api_8php.html#afb99daa6b731bf497b81f2128084852c">api_user()</a>, <a class="el" href="include_2apps_8php.html#a15626f24069c18816f7cdaf4735f58f9">app_store()</a>, <a class="el" href="include_2apps_8php.html#aeab6a62d2f3dfaa86ed043a006305f46">app_update()</a>, <a class="el" href="include_2attach_8php.html#a84a8a64c4805e1525b42d4add464833f">attach_store()</a>, <a class="el" href="security_8php.html#adc7bf51e3b8d67bd80e9348f9ab03733">authenticate_success()</a>, <a class="el" href="bbcode_8php.html#a009f61aaf78771737ed0765c8463911b">bbcode()</a>, <a class="el" href="event_8php.html#a180cccd63c2a2f00ff432b03113531f3">bbtoevent()</a>, <a class="el" href="conversation_8php.html#ad470fc7766f0db66d138fa1916c7a8b7">best_link_url()</a>, <a class="el" href="include_2bookmarks_8php.html#aef1cb2968c41c759f2d106e1088ca323">bookmark_add()</a>, <a class="el" href="classApp.html#a08f0537964d98958d218066364cff785">App\build_pagehead()</a>, <a class="el" href="channel_8php.html#a9c6a6179e0e626398ebecc6151905ef1">channel_content()</a>, <a class="el" href="chatsvc_8php.html#a7032784215e1f6747cf385a6598770f9">chatsvc_content()</a>, <a class="el" href="security_8php.html#a9c6180e82150a5a9af91a1255d096b5c">check_form_security_token()</a>, <a class="el" href="cli__startup_8php.html#adfdde63686e33ccd4851fa5edc4fc70b">cli_startup()</a>, <a class="el" href="cloud_8php.html#ad2e96e917852f27dedfc263d37e13756">cloud_init()</a>, <a class="el" href="connections_8php.html#aec2e457420fce3e3bf6a9f48e36df25c">connections_content()</a>, <a class="el" href="connections_8php.html#a1224058db8e3fb56463eb312f98e561d">connections_post()</a>, <a class="el" href="connedit_8php.html#a795acb3d9d841f55c255d7611681ab67">connedit_content()</a>, <a class="el" href="boot_8php.html#acc4e0c910af066148b810e5fde55fff1">construct_page()</a>, <a class="el" href="items_8php.html#adc26e08aa61f5666da04ab5d2a9d68a6">consume_feed()</a>, <a class="el" href="conversation_8php.html#affea1afb3f32ca41e966c8ddb4204d81">conversation()</a>, <a class="el" href="account_8php.html#a141fe579c351c78209d425473f978eb5">create_account()</a>, <a class="el" href="identity_8php.html#a345f4c943d84de502ec6e72d2c813945">create_identity()</a>, <a class="el" href="boot_8php.html#ad206598b909e8eb67eb0e0bb5ef69c13">current_theme()</a>, <a class="el" href="boot_8php.html#a926cad0b3d8b9d9ee5da1898fc063ba3">current_theme_url()</a>, <a class="el" href="dav_8php.html#addd46b5ec6cd6c23e065634462b7f040">dav_init()</a>, <a class="el" href="include_2config_8php.html#a7ad2081c5f812ac4387fd76f3762d941">del_pconfig()</a>, <a class="el" href="include_2config_8php.html#a9c171def547deee16738dc58fdeb4b72">del_xconfig()</a>, <a class="el" href="delegate_8php.html#a943eea8996ef348eb845c498f9f354dd">delegate_content()</a>, <a class="el" href="language_8php.html#a632da17c7ac0d2dc1a00a4706870194b">detect_language()</a>, <a class="el" href="diaspora_8php.html#a006731620a5242d410358b32678e48e3">diaspora_asphoto()</a>, <a class="el" href="diaspora_8php.html#adef30b6fac948baedcc7194d5d155b5f">diaspora_conversation()</a>, <a class="el" href="diaspora_8php.html#a7cff2f8f11044c1b3a360f20e1bbee46">diaspora_message()</a>, <a class="el" href="dir__fns_8php.html#ae56881d69bb6f8e828c9e35454386774">dir_sort_links()</a>, <a class="el" href="mod_2directory_8php.html#aac79396570d759da2efac24fcedf5b44">directory_content()</a>, <a class="el" href="mod_2directory_8php.html#a5ee59c213508b6b9787612a8219cb5bf">directory_init()</a>, <a class="el" href="dirsearch_8php.html#aa1fb04e1de4f25b63349ac78f94ceb4c">dirsearch_content()</a>, <a class="el" href="include_2network_8php.html#a5176176ddc1906d91f186df6fbd87b48">discover_by_url()</a>, <a class="el" href="display_8php.html#a37137c98d47bf3306f4c2bb9f5b60de0">display_content()</a>, <a class="el" href="items_8php.html#aa723c0571e314a1853a24c5854b4f54f">encode_rel_links()</a>, <a class="el" href="event_8php.html#ac9f206819186b65952ac1869f0da8c6e">event_addtocal()</a>, <a class="el" href="events_8php.html#a1d293fb217ae6bc9e3858c4b32e363ec">events_content()</a>, <a class="el" href="events_8php.html#ab3e8a8f901175f8e40a8089eea45c075">events_post()</a>, <a class="el" href="feed_8php.html#af86137700b56f33d1d5f25c8dec22c04">feed_init()</a>, <a class="el" href="filerm_8php.html#ae2eb28d2054fa2c37e38689882172208">filerm_content()</a>, <a class="el" href="filestorage_8php.html#ad3b64e3ece9831f9d3a9f00c0ae983cd">filestorage_post()</a>, <a class="el" href="items_8php.html#a5e5be7bf1f8257dec0b2647e60a3f3f1">get_atom_elements()</a>, <a class="el" href="language_8php.html#ace67d6cad57da08d030ad9dc9b8c836e">get_browser_language()</a>, <a class="el" href="items_8php.html#a536d0313b6ffe33b9d2490c4e25c5361">get_item_elements()</a>, <a class="el" href="identity_8php.html#a490972c02fdb638c52ec0e012a30bfd2">get_my_address()</a>, <a class="el" href="identity_8php.html#aa46321e1cd6a3b8dfde8bf9510112fec">get_my_url()</a>, <a class="el" href="text_8php.html#aac0969ae09853205992ba06ab9f9f61a">get_plink()</a>, <a class="el" href="items_8php.html#a079e099e15d88d47aeb6ca6d60da7107">get_public_feed()</a>, <a class="el" href="classItem.html#a50d0fdf47006f47a0dc89cfd0d7e690d">Item\get_template_data()</a>, <a class="el" href="datetime_8php.html#afbb34604d0f6e7d2103da4f42e2487b1">get_timezones()</a>, <a class="el" href="include_2group_8php.html#a06ec565d2b64e79044e7c1bf91a2a4ce">group_add()</a>, <a class="el" href="include_2group_8php.html#a4118f498bbd1530c1d0136d016d197a5">group_rmv()</a>, <a class="el" href="include_2group_8php.html#a6a69bd7be032fa8ce4e49c43a42cc6e9">group_side()</a>, <a class="el" href="home_8php.html#a6e3dbf78f4ed74ab2577de221190b33f">home_content()</a>, <a class="el" href="import_8php.html#af17fef0410518f7eac205d0ea416eaa2">import_post()</a>, <a class="el" href="zot_8php.html#a528e97ca5d69c3b7f35c5d954afde315">import_xchan()</a>, <a class="el" href="boot_8php.html#adfb2fc7be5a4226c0a8e24131da9d498">info()</a>, <a class="el" href="invite_8php.html#aeb0881c0f93c8e8552e5ed756ce6e5a5">invite_post()</a>, <a class="el" href="item_8php.html#a693cd09805755ab85bbb5ecae69a48c3">item_post()</a>, <a class="el" href="items_8php.html#a2541e6861a56d145c9281877cc501615">item_store()</a>, <a class="el" href="items_8php.html#acf0bf7c9d21ac84f32effb754f7ad484">item_store_update()</a>, <a class="el" href="text_8php.html#a71f6952243d3fe1c5a8154f78027e29c">lang_selector()</a>, <a class="el" href="boot_8php.html#a719c7f3972d5f9268f37a41c76cd4ef6">load_contact_links()</a>, <a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">local_user()</a>, <a class="el" href="lostpass_8php.html#a0314d94e48c789b1b3a201d740c9eab3">lostpass_content()</a>, <a class="el" href="magic_8php.html#acea2cc792849ca2d71d4b689f66518bf">magic_init()</a>, <a class="el" href="mail_8php.html#a3c7c485fc69f92371e8b20936040eca1">mail_content()</a>, <a class="el" href="mail_8php.html#acfc2cc0bf4e0b178207758384977f25a">mail_post()</a>, <a class="el" href="items_8php.html#a77da7ce9a117601d49ac4a67c71b514f">mail_store()</a>, <a class="el" href="mood_8php.html#a721b9b6703b3234a005641c92d409b8f">mood_content()</a>, <a class="el" href="mood_8php.html#a7ae136dd7476865b4828136175db5022">mood_init()</a>, <a class="el" href="nav_8php.html#a43be0df73b90647ea70947ce004e231e">nav()</a>, <a class="el" href="acl_8php.html#a57dceff370d4a0e7ae673d50fbfda61f">navbar_complete()</a>, <a class="el" href="mod_2network_8php.html#a43f2f29b90c5e29072c561934bc8f8b4">network_content()</a>, <a class="el" href="new__channel_8php.html#ae585191610f79da129492482ce8e2fee">new_channel_content()</a>, <a class="el" href="session_8php.html#a4c0ead624f95483e386bc80abf570a8f">new_cookie()</a>, <a class="el" href="boot_8php.html#a9255af5ae9c887520091ea04763c1a88">notice()</a>, <a class="el" href="oexchange_8php.html#a2d8b785cd7d041a4e6274f5af370cf26">oexchange_content()</a>, <a class="el" href="openid_8php.html#a9a13827dbcf61ae4e45f0b6b33a88f43">openid_content()</a>, <a class="el" href="parse__url_8php.html#a05a9e8944380ba3cf6bbf5893dd4b74b">parse_url_content()</a>, <a class="el" href="include_2photos_8php.html#a6c40ef58aefef705a5adc84a40e97109">photo_upload()</a>, <a class="el" href="mod_2photos_8php.html#aa87382611a66ec5effdb2d78f13f5812">photos_content()</a>, <a class="el" href="mod_2photos_8php.html#a062bed4d04d14fee8a53f4c9be673080">photos_post()</a>, <a class="el" href="ping_8php.html#a77217b1b190b4c5d8770867b45f0c0a1">ping_init()</a>, <a class="el" href="poco_8php.html#a53def16f75e3d41f1d2bb7cfa4905498">poco_init()</a>, <a class="el" href="socgraph_8php.html#a5ef8bef37161df53718a21e93d02fbd6">poco_load()</a>, <a class="el" href="poke_8php.html#ac9190563a8da9c07a16f9dcd71cf6993">poke_content()</a>, <a class="el" href="poke_8php.html#a9725aab97b3983e6a98bd81c4efe7d3b">poke_init()</a>, <a class="el" href="items_8php.html#a410f9c743877c125ca06312373346903">post_activity_item()</a>, <a class="el" href="post_8php.html#af4b48181ce773ef0cdfc972441445c34">post_init()</a>, <a class="el" href="pubsubhubbub_8php.html#a2006060ce09105d08716154c06aecfcd">post_var()</a>, <a class="el" href="mod_2probe_8php.html#a1f1db3fa6038e451e737964c94bf5e99">probe_content()</a>, <a class="el" href="boot_8php.html#ab346a2ece14993861f3e4206befa94f0">proc_run()</a>, <a class="el" href="profile__photo_8php.html#a4b80234074bd603221aa5364f330e479">profile_photo_post()</a>, <a class="el" href="profile__photo_8php.html#a561103564199da56e58061a4196eb102">profile_photo_set_profile_perms()</a>, <a class="el" href="identity_8php.html#a432259b2cf5b6f59be53e71db9f2c7dc">profile_sidebar()</a>, <a class="el" href="profiles_8php.html#ab0362c81b1d3b0b12a772b9fac446e04">profiles_post()</a>, <a class="el" href="pubsub_8php.html#aa011226f05254e700af8702f78aa6c5e">pubsub_init()</a>, <a class="el" href="rbmark_8php.html#a43fec4960b50926251574762cc491f76">rbmark_content()</a>, <a class="el" href="rbmark_8php.html#ac5a66aa8599fa5dc702bae396d8d1f8c">rbmark_post()</a>, <a class="el" href="include_2api_8php.html#aafa82b65a9f879a1a1197cfe8aaf3898">red_item_new()</a>, <a class="el" href="session_8php.html#a7f0f50576360d9ba52d29364e0b83a8e">ref_session_read()</a>, <a class="el" href="register_8php.html#a0e91f57f111407ea8d3223a05022bb2a">register_content()</a>, <a class="el" href="register_8php.html#a51731dcc1917c58a790eb1c0f6132271">register_post()</a>, <a class="el" href="classApp.html#abf46a653d8499e7c253cc1be894a6d83">App\register_template_engine()</a>, <a class="el" href="regmod_8php.html#a7953df4e32e63946565e90cdd5d50409">regmod_content()</a>, <a class="el" href="boot_8php.html#a5542c5c2806ab8bca04bad53d47b5209">remote_user()</a>, <a class="el" href="removeaccount_8php.html#a26a3325292e932c59793430ab737126a">removeaccount_post()</a>, <a class="el" href="removeme_8php.html#a7be08738beca44bb98a79e01cdb2ee88">removeme_post()</a>, <a class="el" href="rpost_8php.html#a8190354d789000806d9879aea276728f">rpost_content()</a>, <a class="el" href="include_2network_8php.html#a316f318167a039c89719afbd129a8f3c">scrape_feed()</a>, <a class="el" href="plugin_8php.html#a0e8c2ea50bfdbc39e17ccccaea21ddc3">script_path()</a>, <a class="el" href="search__ac_8php.html#a14f90c83a3f2be095e9e2992a8d66138">search_ac_init()</a>, <a class="el" href="search_8php.html#ab2568591359edde5b483a6cd9a24b2cc">search_content()</a>, <a class="el" href="search_8php.html#acf19fd30f07f495781ca0d7a0a08b435">search_init()</a>, <a class="el" href="account_8php.html#a030cec6793b909c439c0336ba39b1571">service_class_allows()</a>, <a class="el" href="account_8php.html#a905b54e10704b283ac64680a8abc0971">service_class_fetch()</a>, <a class="el" href="classApp.html#a78788f6e9d8b713b138f81e457c5cd08">App\set_baseurl()</a>, <a class="el" href="settings_8php.html#aa7ee94d88ac088edb04ccf3a26de3586">settings_post()</a>, <a class="el" href="setup_8php.html#a88247384a96e14516f474d7af6a465c1">setup_content()</a>, <a class="el" href="setup_8php.html#a267555abd17290e659b4bf44b885e4e0">setup_init()</a>, <a class="el" href="suggest_8php.html#a696acf1dd8070e479adcc80c63c6718c">suggest_init()</a>, <a class="el" href="language_8php.html#ac6ae482ee54fa2764d5c2e77305aeb96">t()</a>, <a class="el" href="tagrm_8php.html#a1702f40aa53a2fa93deade1f609abe78">tagrm_post()</a>, <a class="el" href="classApp.html#a94a1ed2dc493c58612d17035b74ae736">App\template_engine()</a>, <a class="el" href="language_8php.html#a686bcafa6b0d5c86d37b38a1db5b6997">tt()</a>, <a class="el" href="identity_8php.html#af2802bc13a00a17b867bba7978ba8f58">validate_channelname()</a>, <a class="el" href="wall__upload_8php.html#a7cbe204244cf9e0380ee932263a74d8f">wall_upload_post()</a>, <a class="el" href="webfinger_8php.html#a17dd28db6d390194bf9ecb809739d1d3">webfinger_content()</a>, <a class="el" href="wfinger_8php.html#ae21e50c8d0a5f3c9be9f43a4e519acd3">wfinger_init()</a>, <a class="el" href="widgets_8php.html#add9b24d3304e529a7975e96122315554">widget_affinity()</a>, <a class="el" href="widgets_8php.html#af37fdad3b2e861d860a4a8c4d8a76c0b">widget_categories()</a>, <a class="el" href="widgets_8php.html#a5ab3b64496e02cab56429978ad55f1c0">widget_filer()</a>, <a class="el" href="widgets_8php.html#a94203eb9bcd63cbdecbbcb15163598d8">widget_savedsearch()</a>, <a class="el" href="widgets_8php.html#a6dbc227aac750774284ee39c45f0a200">widget_tagcloud()</a>, <a class="el" href="xchan_8php.html#a9853348bf1a35c644460221ba75edc2d">xchan_content()</a>, <a class="el" href="include_2network_8php.html#aafd06c0a75402aefb06cfb9f9740fa37">z_fetch_url()</a>, <a class="el" href="include_2network_8php.html#a9129fd55e7fc175b4ea9a195cccc16bc">z_post_url()</a>, and <a class="el" href="zfinger_8php.html#a8139b83a22ef98869adc10aa224027a0">zfinger_init()</a>.</p> +<p>Referenced by <a class="el" href="classFriendicaSmarty.html#af12091b920b95eeef1218cbc48066ca6">FriendicaSmarty\__construct()</a>, <a class="el" href="classApp.html#af6d39f63fb7116bbeb04e51696f99474">App\__construct()</a>, <a class="el" href="account_8php.html#ac70e1d198246b029a3cedb7d6f7868bd">account_service_class_allows()</a>, <a class="el" href="account_8php.html#a4328c40ee4b3d68630cf1ebb7b9d4d89">account_service_class_fetch()</a>, <a class="el" href="acl_8php.html#ac6776dba871806ecdb5d1659bc2eb07a">acl_init()</a>, <a class="el" href="admin_8php.html#a42e628f367c168add8013352ac74d33f">admin_page_channels_post()</a>, <a class="el" href="admin_8php.html#a233b7c8c31776b7020532003c6e44e1c">admin_page_logs_post()</a>, <a class="el" href="admin_8php.html#a54128076986ba80c4a103de3fc3e19a8">admin_page_plugins()</a>, <a class="el" href="admin_8php.html#ac0f3bd12431c056aad77bac9d09fa30e">admin_page_site()</a>, <a class="el" href="admin_8php.html#add865f4ae806ecbf716f423fc3e50e4f">admin_page_site_post()</a>, <a class="el" href="admin_8php.html#af124619fdc278fe2bf14c45ddaa260fb">admin_page_themes()</a>, <a class="el" href="admin_8php.html#a5a696706a3869800e65fb365214241b7">admin_page_users_post()</a>, <a class="el" href="mod_2api_8php.html#a33315b5bbf5418f6850b2038107b526d">api_content()</a>, <a class="el" href="include_2api_8php.html#a7759ccddc8dff012ad168e511ffe5af5">api_direct_messages_box()</a>, <a class="el" href="include_2api_8php.html#a0991f72554f821255397d615e76f3203">api_direct_messages_new()</a>, <a class="el" href="include_2api_8php.html#a2c71b1226ef1283b5370bd1c200fee5f">api_favorites()</a>, <a class="el" href="include_2api_8php.html#ae82608c317421f27446465aa6724733d">api_format_messages()</a>, <a class="el" href="include_2api_8php.html#aa40bae797bcd9ccacffdce5a3b5a1afa">api_get_user()</a>, <a class="el" href="include_2api_8php.html#afe534f826e4282b72d66e8cadca7bb73">api_login()</a>, <a class="el" href="mod_2api_8php.html#a6fe77f05c07cb51048df0d557b4b9bd2">api_post()</a>, <a class="el" href="include_2api_8php.html#aa0d6b29fff0344a8e67f3507a6d01410">api_statuses_f()</a>, <a class="el" href="include_2api_8php.html#a528d8070ee74ea800102936ce73cf366">api_statuses_home_timeline()</a>, <a class="el" href="include_2api_8php.html#a8b25a186bd0893f51aa72a62f655735e">api_statuses_mentions()</a>, <a class="el" href="include_2api_8php.html#ad24ce1bf20867add4c9211a8eaf93f22">api_statuses_public_timeline()</a>, <a class="el" href="include_2api_8php.html#af6f1d89cdb0a0621025efbec1597bc63">api_statuses_show()</a>, <a class="el" href="include_2api_8php.html#ad4d1634df6b35126552324683caaffa2">api_statuses_update()</a>, <a class="el" href="include_2api_8php.html#a32f0dda848d0c11c727fe1c3e741c283">api_statuses_user_timeline()</a>, <a class="el" href="include_2api_8php.html#afb99daa6b731bf497b81f2128084852c">api_user()</a>, <a class="el" href="include_2apps_8php.html#a15626f24069c18816f7cdaf4735f58f9">app_store()</a>, <a class="el" href="include_2apps_8php.html#aeab6a62d2f3dfaa86ed043a006305f46">app_update()</a>, <a class="el" href="include_2attach_8php.html#a84a8a64c4805e1525b42d4add464833f">attach_store()</a>, <a class="el" href="security_8php.html#adc7bf51e3b8d67bd80e9348f9ab03733">authenticate_success()</a>, <a class="el" href="bbcode_8php.html#a009f61aaf78771737ed0765c8463911b">bbcode()</a>, <a class="el" href="event_8php.html#a180cccd63c2a2f00ff432b03113531f3">bbtoevent()</a>, <a class="el" href="conversation_8php.html#ad470fc7766f0db66d138fa1916c7a8b7">best_link_url()</a>, <a class="el" href="include_2bookmarks_8php.html#aef1cb2968c41c759f2d106e1088ca323">bookmark_add()</a>, <a class="el" href="classApp.html#a08f0537964d98958d218066364cff785">App\build_pagehead()</a>, <a class="el" href="channel_8php.html#a9c6a6179e0e626398ebecc6151905ef1">channel_content()</a>, <a class="el" href="chatsvc_8php.html#a7032784215e1f6747cf385a6598770f9">chatsvc_content()</a>, <a class="el" href="security_8php.html#a9c6180e82150a5a9af91a1255d096b5c">check_form_security_token()</a>, <a class="el" href="cli__startup_8php.html#adfdde63686e33ccd4851fa5edc4fc70b">cli_startup()</a>, <a class="el" href="cloud_8php.html#ad2e96e917852f27dedfc263d37e13756">cloud_init()</a>, <a class="el" href="connections_8php.html#aec2e457420fce3e3bf6a9f48e36df25c">connections_content()</a>, <a class="el" href="connections_8php.html#a1224058db8e3fb56463eb312f98e561d">connections_post()</a>, <a class="el" href="connedit_8php.html#a795acb3d9d841f55c255d7611681ab67">connedit_content()</a>, <a class="el" href="boot_8php.html#acc4e0c910af066148b810e5fde55fff1">construct_page()</a>, <a class="el" href="items_8php.html#adc26e08aa61f5666da04ab5d2a9d68a6">consume_feed()</a>, <a class="el" href="conversation_8php.html#affea1afb3f32ca41e966c8ddb4204d81">conversation()</a>, <a class="el" href="account_8php.html#a141fe579c351c78209d425473f978eb5">create_account()</a>, <a class="el" href="identity_8php.html#a345f4c943d84de502ec6e72d2c813945">create_identity()</a>, <a class="el" href="boot_8php.html#ad206598b909e8eb67eb0e0bb5ef69c13">current_theme()</a>, <a class="el" href="boot_8php.html#a926cad0b3d8b9d9ee5da1898fc063ba3">current_theme_url()</a>, <a class="el" href="dav_8php.html#addd46b5ec6cd6c23e065634462b7f040">dav_init()</a>, <a class="el" href="include_2config_8php.html#a7ad2081c5f812ac4387fd76f3762d941">del_pconfig()</a>, <a class="el" href="include_2config_8php.html#a9c171def547deee16738dc58fdeb4b72">del_xconfig()</a>, <a class="el" href="delegate_8php.html#a943eea8996ef348eb845c498f9f354dd">delegate_content()</a>, <a class="el" href="language_8php.html#a632da17c7ac0d2dc1a00a4706870194b">detect_language()</a>, <a class="el" href="diaspora_8php.html#a006731620a5242d410358b32678e48e3">diaspora_asphoto()</a>, <a class="el" href="diaspora_8php.html#adef30b6fac948baedcc7194d5d155b5f">diaspora_conversation()</a>, <a class="el" href="diaspora_8php.html#a7cff2f8f11044c1b3a360f20e1bbee46">diaspora_message()</a>, <a class="el" href="dir__fns_8php.html#ae56881d69bb6f8e828c9e35454386774">dir_sort_links()</a>, <a class="el" href="mod_2directory_8php.html#aac79396570d759da2efac24fcedf5b44">directory_content()</a>, <a class="el" href="mod_2directory_8php.html#a5ee59c213508b6b9787612a8219cb5bf">directory_init()</a>, <a class="el" href="dirsearch_8php.html#aa1fb04e1de4f25b63349ac78f94ceb4c">dirsearch_content()</a>, <a class="el" href="include_2network_8php.html#a5176176ddc1906d91f186df6fbd87b48">discover_by_url()</a>, <a class="el" href="display_8php.html#a37137c98d47bf3306f4c2bb9f5b60de0">display_content()</a>, <a class="el" href="items_8php.html#aa723c0571e314a1853a24c5854b4f54f">encode_rel_links()</a>, <a class="el" href="event_8php.html#ac9f206819186b65952ac1869f0da8c6e">event_addtocal()</a>, <a class="el" href="events_8php.html#a1d293fb217ae6bc9e3858c4b32e363ec">events_content()</a>, <a class="el" href="events_8php.html#ab3e8a8f901175f8e40a8089eea45c075">events_post()</a>, <a class="el" href="feed_8php.html#af86137700b56f33d1d5f25c8dec22c04">feed_init()</a>, <a class="el" href="filerm_8php.html#ae2eb28d2054fa2c37e38689882172208">filerm_content()</a>, <a class="el" href="filestorage_8php.html#ad3b64e3ece9831f9d3a9f00c0ae983cd">filestorage_post()</a>, <a class="el" href="items_8php.html#a5e5be7bf1f8257dec0b2647e60a3f3f1">get_atom_elements()</a>, <a class="el" href="language_8php.html#ace67d6cad57da08d030ad9dc9b8c836e">get_browser_language()</a>, <a class="el" href="items_8php.html#a536d0313b6ffe33b9d2490c4e25c5361">get_item_elements()</a>, <a class="el" href="identity_8php.html#a490972c02fdb638c52ec0e012a30bfd2">get_my_address()</a>, <a class="el" href="identity_8php.html#aa46321e1cd6a3b8dfde8bf9510112fec">get_my_url()</a>, <a class="el" href="text_8php.html#aac0969ae09853205992ba06ab9f9f61a">get_plink()</a>, <a class="el" href="items_8php.html#a079e099e15d88d47aeb6ca6d60da7107">get_public_feed()</a>, <a class="el" href="classItem.html#a50d0fdf47006f47a0dc89cfd0d7e690d">Item\get_template_data()</a>, <a class="el" href="datetime_8php.html#afbb34604d0f6e7d2103da4f42e2487b1">get_timezones()</a>, <a class="el" href="include_2group_8php.html#a06ec565d2b64e79044e7c1bf91a2a4ce">group_add()</a>, <a class="el" href="include_2group_8php.html#a4118f498bbd1530c1d0136d016d197a5">group_rmv()</a>, <a class="el" href="include_2group_8php.html#a6a69bd7be032fa8ce4e49c43a42cc6e9">group_side()</a>, <a class="el" href="home_8php.html#a6e3dbf78f4ed74ab2577de221190b33f">home_content()</a>, <a class="el" href="import_8php.html#af17fef0410518f7eac205d0ea416eaa2">import_post()</a>, <a class="el" href="zot_8php.html#a528e97ca5d69c3b7f35c5d954afde315">import_xchan()</a>, <a class="el" href="boot_8php.html#adfb2fc7be5a4226c0a8e24131da9d498">info()</a>, <a class="el" href="invite_8php.html#aeb0881c0f93c8e8552e5ed756ce6e5a5">invite_post()</a>, <a class="el" href="item_8php.html#a693cd09805755ab85bbb5ecae69a48c3">item_post()</a>, <a class="el" href="items_8php.html#a2541e6861a56d145c9281877cc501615">item_store()</a>, <a class="el" href="items_8php.html#acf0bf7c9d21ac84f32effb754f7ad484">item_store_update()</a>, <a class="el" href="text_8php.html#a71f6952243d3fe1c5a8154f78027e29c">lang_selector()</a>, <a class="el" href="boot_8php.html#a719c7f3972d5f9268f37a41c76cd4ef6">load_contact_links()</a>, <a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">local_channel()</a>, <a class="el" href="lostpass_8php.html#a0314d94e48c789b1b3a201d740c9eab3">lostpass_content()</a>, <a class="el" href="magic_8php.html#acea2cc792849ca2d71d4b689f66518bf">magic_init()</a>, <a class="el" href="mail_8php.html#a3c7c485fc69f92371e8b20936040eca1">mail_content()</a>, <a class="el" href="mail_8php.html#acfc2cc0bf4e0b178207758384977f25a">mail_post()</a>, <a class="el" href="items_8php.html#a77da7ce9a117601d49ac4a67c71b514f">mail_store()</a>, <a class="el" href="mood_8php.html#a721b9b6703b3234a005641c92d409b8f">mood_content()</a>, <a class="el" href="mood_8php.html#a7ae136dd7476865b4828136175db5022">mood_init()</a>, <a class="el" href="nav_8php.html#a43be0df73b90647ea70947ce004e231e">nav()</a>, <a class="el" href="acl_8php.html#a57dceff370d4a0e7ae673d50fbfda61f">navbar_complete()</a>, <a class="el" href="mod_2network_8php.html#a43f2f29b90c5e29072c561934bc8f8b4">network_content()</a>, <a class="el" href="new__channel_8php.html#ae585191610f79da129492482ce8e2fee">new_channel_content()</a>, <a class="el" href="session_8php.html#a4c0ead624f95483e386bc80abf570a8f">new_cookie()</a>, <a class="el" href="boot_8php.html#a9255af5ae9c887520091ea04763c1a88">notice()</a>, <a class="el" href="oexchange_8php.html#a2d8b785cd7d041a4e6274f5af370cf26">oexchange_content()</a>, <a class="el" href="openid_8php.html#a9a13827dbcf61ae4e45f0b6b33a88f43">openid_content()</a>, <a class="el" href="parse__url_8php.html#a05a9e8944380ba3cf6bbf5893dd4b74b">parse_url_content()</a>, <a class="el" href="include_2photos_8php.html#a6c40ef58aefef705a5adc84a40e97109">photo_upload()</a>, <a class="el" href="mod_2photos_8php.html#aa87382611a66ec5effdb2d78f13f5812">photos_content()</a>, <a class="el" href="mod_2photos_8php.html#a062bed4d04d14fee8a53f4c9be673080">photos_post()</a>, <a class="el" href="ping_8php.html#a77217b1b190b4c5d8770867b45f0c0a1">ping_init()</a>, <a class="el" href="poco_8php.html#a53def16f75e3d41f1d2bb7cfa4905498">poco_init()</a>, <a class="el" href="socgraph_8php.html#a5ef8bef37161df53718a21e93d02fbd6">poco_load()</a>, <a class="el" href="poke_8php.html#ac9190563a8da9c07a16f9dcd71cf6993">poke_content()</a>, <a class="el" href="poke_8php.html#a9725aab97b3983e6a98bd81c4efe7d3b">poke_init()</a>, <a class="el" href="items_8php.html#a410f9c743877c125ca06312373346903">post_activity_item()</a>, <a class="el" href="post_8php.html#af4b48181ce773ef0cdfc972441445c34">post_init()</a>, <a class="el" href="pubsubhubbub_8php.html#a2006060ce09105d08716154c06aecfcd">post_var()</a>, <a class="el" href="mod_2probe_8php.html#a1f1db3fa6038e451e737964c94bf5e99">probe_content()</a>, <a class="el" href="boot_8php.html#ab346a2ece14993861f3e4206befa94f0">proc_run()</a>, <a class="el" href="profile__photo_8php.html#a4b80234074bd603221aa5364f330e479">profile_photo_post()</a>, <a class="el" href="profile__photo_8php.html#a561103564199da56e58061a4196eb102">profile_photo_set_profile_perms()</a>, <a class="el" href="identity_8php.html#a432259b2cf5b6f59be53e71db9f2c7dc">profile_sidebar()</a>, <a class="el" href="profiles_8php.html#ab0362c81b1d3b0b12a772b9fac446e04">profiles_post()</a>, <a class="el" href="pubsub_8php.html#aa011226f05254e700af8702f78aa6c5e">pubsub_init()</a>, <a class="el" href="rbmark_8php.html#a43fec4960b50926251574762cc491f76">rbmark_content()</a>, <a class="el" href="rbmark_8php.html#ac5a66aa8599fa5dc702bae396d8d1f8c">rbmark_post()</a>, <a class="el" href="include_2api_8php.html#aafa82b65a9f879a1a1197cfe8aaf3898">red_item_new()</a>, <a class="el" href="session_8php.html#a7f0f50576360d9ba52d29364e0b83a8e">ref_session_read()</a>, <a class="el" href="register_8php.html#a0e91f57f111407ea8d3223a05022bb2a">register_content()</a>, <a class="el" href="register_8php.html#a51731dcc1917c58a790eb1c0f6132271">register_post()</a>, <a class="el" href="classApp.html#abf46a653d8499e7c253cc1be894a6d83">App\register_template_engine()</a>, <a class="el" href="regmod_8php.html#a7953df4e32e63946565e90cdd5d50409">regmod_content()</a>, <a class="el" href="boot_8php.html#a5542c5c2806ab8bca04bad53d47b5209">remote_user()</a>, <a class="el" href="removeaccount_8php.html#a26a3325292e932c59793430ab737126a">removeaccount_post()</a>, <a class="el" href="removeme_8php.html#a7be08738beca44bb98a79e01cdb2ee88">removeme_post()</a>, <a class="el" href="rpost_8php.html#a8190354d789000806d9879aea276728f">rpost_content()</a>, <a class="el" href="include_2network_8php.html#a316f318167a039c89719afbd129a8f3c">scrape_feed()</a>, <a class="el" href="plugin_8php.html#a0e8c2ea50bfdbc39e17ccccaea21ddc3">script_path()</a>, <a class="el" href="search__ac_8php.html#a14f90c83a3f2be095e9e2992a8d66138">search_ac_init()</a>, <a class="el" href="search_8php.html#ab2568591359edde5b483a6cd9a24b2cc">search_content()</a>, <a class="el" href="search_8php.html#acf19fd30f07f495781ca0d7a0a08b435">search_init()</a>, <a class="el" href="account_8php.html#a030cec6793b909c439c0336ba39b1571">service_class_allows()</a>, <a class="el" href="account_8php.html#a905b54e10704b283ac64680a8abc0971">service_class_fetch()</a>, <a class="el" href="classApp.html#a78788f6e9d8b713b138f81e457c5cd08">App\set_baseurl()</a>, <a class="el" href="settings_8php.html#aa7ee94d88ac088edb04ccf3a26de3586">settings_post()</a>, <a class="el" href="setup_8php.html#a88247384a96e14516f474d7af6a465c1">setup_content()</a>, <a class="el" href="setup_8php.html#a267555abd17290e659b4bf44b885e4e0">setup_init()</a>, <a class="el" href="suggest_8php.html#a696acf1dd8070e479adcc80c63c6718c">suggest_init()</a>, <a class="el" href="language_8php.html#ac6ae482ee54fa2764d5c2e77305aeb96">t()</a>, <a class="el" href="tagrm_8php.html#a1702f40aa53a2fa93deade1f609abe78">tagrm_post()</a>, <a class="el" href="classApp.html#a94a1ed2dc493c58612d17035b74ae736">App\template_engine()</a>, <a class="el" href="language_8php.html#a686bcafa6b0d5c86d37b38a1db5b6997">tt()</a>, <a class="el" href="identity_8php.html#af2802bc13a00a17b867bba7978ba8f58">validate_channelname()</a>, <a class="el" href="wall__upload_8php.html#a7cbe204244cf9e0380ee932263a74d8f">wall_upload_post()</a>, <a class="el" href="webfinger_8php.html#a17dd28db6d390194bf9ecb809739d1d3">webfinger_content()</a>, <a class="el" href="wfinger_8php.html#ae21e50c8d0a5f3c9be9f43a4e519acd3">wfinger_init()</a>, <a class="el" href="widgets_8php.html#add9b24d3304e529a7975e96122315554">widget_affinity()</a>, <a class="el" href="widgets_8php.html#af37fdad3b2e861d860a4a8c4d8a76c0b">widget_categories()</a>, <a class="el" href="widgets_8php.html#a5ab3b64496e02cab56429978ad55f1c0">widget_filer()</a>, <a class="el" href="widgets_8php.html#a94203eb9bcd63cbdecbbcb15163598d8">widget_savedsearch()</a>, <a class="el" href="widgets_8php.html#a6dbc227aac750774284ee39c45f0a200">widget_tagcloud()</a>, <a class="el" href="xchan_8php.html#a9853348bf1a35c644460221ba75edc2d">xchan_content()</a>, <a class="el" href="include_2network_8php.html#aafd06c0a75402aefb06cfb9f9740fa37">z_fetch_url()</a>, <a class="el" href="include_2network_8php.html#a9129fd55e7fc175b4ea9a195cccc16bc">z_post_url()</a>, and <a class="el" href="zfinger_8php.html#a8139b83a22ef98869adc10aa224027a0">zfinger_init()</a>.</p> </div> </div> diff --git a/doc/html/boot_8php.js b/doc/html/boot_8php.js index 32cf1e11c..f2cc7a16b 100644 --- a/doc/html/boot_8php.js +++ b/doc/html/boot_8php.js @@ -32,7 +32,7 @@ var boot_8php = [ "killme", "boot_8php.html#aea7fc57a4d8e9dcb42f2601b0b9b761c", null ], [ "load_contact_links", "boot_8php.html#a719c7f3972d5f9268f37a41c76cd4ef6", null ], [ "load_pdl", "boot_8php.html#a50a6707a28c7d05d3f49eaabc7994501", null ], - [ "local_user", "boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44", null ], + [ "local_channel", "boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44", null ], [ "login", "boot_8php.html#aefecf8599036df7f1b95d6820e0e2fa4", null ], [ "notice", "boot_8php.html#a9255af5ae9c887520091ea04763c1a88", null ], [ "os_mkdir", "boot_8php.html#a5fbebdf7a1c0ea8f904dbd9d78c2c06c", null ], diff --git a/doc/html/comanche_8php.html b/doc/html/comanche_8php.html index aec807d58..c3a98f787 100644 --- a/doc/html/comanche_8php.html +++ b/doc/html/comanche_8php.html @@ -164,7 +164,7 @@ Functions</h2></td></tr> </tr> </table> </div><div class="memdoc"> -<p><a class="el" href="comanche_8php.html#aed39ecad69234f3ddf61f0dedb49a58e">comanche_get_channel_id()</a> Returns the channel_id of the profile owner of the page, or the local_user if there is no profile owner. Otherwise returns 0 </p> +<p><a class="el" href="comanche_8php.html#aed39ecad69234f3ddf61f0dedb49a58e">comanche_get_channel_id()</a> Returns the channel_id of the profile owner of the page, or the local_channel if there is no profile owner. Otherwise returns 0 </p> <p>Referenced by <a class="el" href="comanche_8php.html#a5a7ab801717d38e91ac910b933973887">comanche_block()</a>, <a class="el" href="comanche_8php.html#ad5a44e42231759aba1dda49e0490501e">comanche_menu()</a>, and <a class="el" href="boot_8php.html#a50a6707a28c7d05d3f49eaabc7994501">load_pdl()</a>.</p> diff --git a/doc/html/globals_0x6c.html b/doc/html/globals_0x6c.html index ae7d1f29a..a4c4faca2 100644 --- a/doc/html/globals_0x6c.html +++ b/doc/html/globals_0x6c.html @@ -229,7 +229,7 @@ $(document).ready(function(){initNavTree('globals_0x6c.html','');}); <li>local_dir_update() : <a class="el" href="dir__fns_8php.html#acd37b17dce3bdec6d5a6344a20598c1e">dir_fns.php</a> </li> -<li>local_user() +<li>local_channel() : <a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">boot.php</a> </li> <li>localize_item() diff --git a/doc/html/globals_func_0x6c.html b/doc/html/globals_func_0x6c.html index f688879dd..c65719712 100644 --- a/doc/html/globals_func_0x6c.html +++ b/doc/html/globals_func_0x6c.html @@ -222,7 +222,7 @@ $(document).ready(function(){initNavTree('globals_func_0x6c.html','');}); <li>local_dir_update() : <a class="el" href="dir__fns_8php.html#acd37b17dce3bdec6d5a6344a20598c1e">dir_fns.php</a> </li> -<li>local_user() +<li>local_channel() : <a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">boot.php</a> </li> <li>localize_item() diff --git a/doc/html/include_2config_8php.html b/doc/html/include_2config_8php.html index 919350254..1d48f5be0 100644 --- a/doc/html/include_2config_8php.html +++ b/doc/html/include_2config_8php.html @@ -162,7 +162,7 @@ Functions</h2></td></tr> <dl class="todo"><dt><b><a class="el" href="todo.html#_todo000002">Todo:</a></b></dt><dd>There are a few places in the code (such as the admin panel) where boolean configurations need to be fixed as of 10/08/2011.</dd></dl> <ul> <li><b>config</b> is used for hub specific configurations. It overrides the configurations from .htconfig file. The storage is of size TEXT.</li> -<li><b>pconfig</b> is used for channel specific configurations and takes a <em>channel_id</em> as identifier. It stores for example which features are enabled per channel. The storage is of size MEDIUMTEXT. <div class="fragment"><div class="line">$var = <a class="code" href="include_2config_8php.html#ad58a4913937179adb13201c2ee3261ad" title="Get a particular channel's config variable given the category name ($family) and a key...">get_pconfig</a>(<a class="code" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44" title="Returns the entity id (channel_id) of locally logged in user or false.">local_user</a>(), <span class="stringliteral">'category'</span>, <span class="stringliteral">'key'</span>);</div> +<li><b>pconfig</b> is used for channel specific configurations and takes a <em>channel_id</em> as identifier. It stores for example which features are enabled per channel. The storage is of size MEDIUMTEXT. <div class="fragment"><div class="line">$var = <a class="code" href="include_2config_8php.html#ad58a4913937179adb13201c2ee3261ad" title="Get a particular channel's config variable given the category name ($family) and a key...">get_pconfig</a>(<a class="code" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44" title="Returns the entity id (channel_id) of locally logged in user or false.">local_channel</a>(), <span class="stringliteral">'category'</span>, <span class="stringliteral">'key'</span>);</div> </div><!-- fragment --></li> <li><b>xconfig</b> is the same as pconfig, except that it uses <em>xchan</em> as an identifier. This is for example for people who do not have a local account. The storage is of size MEDIUMTEXT. <div class="fragment"><div class="line"> $observer = <a class="code" href="typo_8php.html#acebf83966ef6d7e5645a6b62ba368f9f">$a</a>->get_observer_hash();</div> <div class="line"><span class="keywordflow">if</span> ($observer) {</div> diff --git a/doc/html/redstrap_2php_2style_8php.html b/doc/html/redstrap_2php_2style_8php.html index 2642f697d..997721e19 100644 --- a/doc/html/redstrap_2php_2style_8php.html +++ b/doc/html/redstrap_2php_2style_8php.html @@ -144,7 +144,7 @@ Variables</h2></td></tr> <tr class="separator:a45e6fafa363bc4586fa91dce1786be4f"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a02d39b683a42fffbb27823d3860283bd"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="redstrap_2php_2style_8php.html#a02d39b683a42fffbb27823d3860283bd">$site_colour</a> = <a class="el" href="include_2config_8php.html#af02c96e6b37335774b548914ede1d22e">get_config</a>("redbasic", "colour" )</td></tr> <tr class="separator:a02d39b683a42fffbb27823d3860283bd"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a0c4684da834439885ae2285649d1aaea"><td class="memItemLeft" align="right" valign="top">if(<a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">local_user</a>()) if($line_height===false) <br class="typebreak"/> +<tr class="memitem:a0c4684da834439885ae2285649d1aaea"><td class="memItemLeft" align="right" valign="top">if(<a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">local_channel</a>()) if($line_height===false) <br class="typebreak"/> if($line_height===false) if($redbasic_font_size===false) <br class="typebreak"/> if($redbasic_font_size===false) <br class="typebreak"/> if($colour===false) if($colour===false) <br class="typebreak"/> @@ -365,7 +365,7 @@ if($navcolour==="black") </td><td class="memItemRight" valign="bo <div class="memproto"> <table class="memname"> <tr> - <td class="memname">if (<a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">local_user</a>()) if ($line_height===false) if ($line_height===false) if ($redbasic_font_size===false) if ($redbasic_font_size===false) if ($colour===false) if ($colour===false) if ($navcolour==="black") if(file_exists('view/theme/'.<a class="el" href="boot_8php.html#ad206598b909e8eb67eb0e0bb5ef69c13">current_theme</a>(). '/css/style.css'))</td> + <td class="memname">if (<a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">local_channel</a>()) if ($line_height===false) if ($line_height===false) if ($redbasic_font_size===false) if ($redbasic_font_size===false) if ($colour===false) if ($colour===false) if ($navcolour==="black") if(file_exists('view/theme/'.<a class="el" href="boot_8php.html#ad206598b909e8eb67eb0e0bb5ef69c13">current_theme</a>(). '/css/style.css'))</td> </tr> </table> </div><div class="memdoc"> diff --git a/doc/html/search/all_6c.js b/doc/html/search/all_6c.js index ce2b942e1..2533e2f2e 100644 --- a/doc/html/search/all_6c.js +++ b/doc/html/search/all_6c.js @@ -34,7 +34,7 @@ var searchData= ['load_5ftranslation_5ftable',['load_translation_table',['../language_8php.html#a7e9904c730bb24ddcb0ff50fc96f6b05',1,'language.php']]], ['load_5fxconfig',['load_xconfig',['../include_2config_8php.html#aee4b619839cf4b64220f34edf5c67b52',1,'config.php']]], ['local_5fdir_5fupdate',['local_dir_update',['../dir__fns_8php.html#acd37b17dce3bdec6d5a6344a20598c1e',1,'dir_fns.php']]], - ['local_5fuser',['local_user',['../boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44',1,'boot.php']]], + ['local_5fuser',['local_channel',['../boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44',1,'boot.php']]], ['localize_5fitem',['localize_item',['../conversation_8php.html#a9bd7f9fb6678736c581bcba3b17f471c',1,'conversation.php']]], ['lockview_2ephp',['lockview.php',['../lockview_8php.html',1,'']]], ['lockview_5fcontent',['lockview_content',['../lockview_8php.html#a851e26ab9a1008df5c5ebebea31e9b44',1,'lockview.php']]], diff --git a/doc/html/search/functions_6c.js b/doc/html/search/functions_6c.js index 84ff90de3..7ce236bc0 100644 --- a/doc/html/search/functions_6c.js +++ b/doc/html/search/functions_6c.js @@ -27,7 +27,7 @@ var searchData= ['load_5ftranslation_5ftable',['load_translation_table',['../language_8php.html#a7e9904c730bb24ddcb0ff50fc96f6b05',1,'language.php']]], ['load_5fxconfig',['load_xconfig',['../include_2config_8php.html#aee4b619839cf4b64220f34edf5c67b52',1,'config.php']]], ['local_5fdir_5fupdate',['local_dir_update',['../dir__fns_8php.html#acd37b17dce3bdec6d5a6344a20598c1e',1,'dir_fns.php']]], - ['local_5fuser',['local_user',['../boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44',1,'boot.php']]], + ['local_5fuser',['local_channel',['../boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44',1,'boot.php']]], ['localize_5fitem',['localize_item',['../conversation_8php.html#a9bd7f9fb6678736c581bcba3b17f471c',1,'conversation.php']]], ['lockview_5fcontent',['lockview_content',['../lockview_8php.html#a851e26ab9a1008df5c5ebebea31e9b44',1,'lockview.php']]], ['locs_5fcontent',['locs_content',['../locs_8php.html#a6c900f53970c0d0e738d2fe06d27ca44',1,'locs.php']]], diff --git a/doc/html/style_8php.html b/doc/html/style_8php.html index 93d2929a6..ccd1aee87 100644 --- a/doc/html/style_8php.html +++ b/doc/html/style_8php.html @@ -144,7 +144,7 @@ Variables</h2></td></tr> <tr class="separator:a45e6fafa363bc4586fa91dce1786be4f"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a02d39b683a42fffbb27823d3860283bd"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="style_8php.html#a02d39b683a42fffbb27823d3860283bd">$site_colour</a> = <a class="el" href="include_2config_8php.html#a5d19130818ea4c6b8726ab62cd989c15">get_config</a>("redbasic", "colour" )</td></tr> <tr class="separator:a02d39b683a42fffbb27823d3860283bd"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a0a473a25349f07563d6c56d14031f02a"><td class="memItemLeft" align="right" valign="top">if(<a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">local_user</a>()) if(!<a class="el" href="features_8php.html#a52b5bdfb61b256713efecf7a7b20b0c0">feature_enabled</a>(<a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">local_user</a>(),'expert')) <br class="typebreak"/> +<tr class="memitem:a0a473a25349f07563d6c56d14031f02a"><td class="memItemLeft" align="right" valign="top">if(<a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">local_channel</a>()) if(!<a class="el" href="features_8php.html#a52b5bdfb61b256713efecf7a7b20b0c0">feature_enabled</a>(<a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">local_channel</a>(),'expert')) <br class="typebreak"/> if($line_height===false) if($line_height===false) <br class="typebreak"/> if($redbasic_font_size===false) <br class="typebreak"/> if($redbasic_font_size===false) <br class="typebreak"/> diff --git a/doc/html/theme_2blogga_2view_2theme_2blog_2default_8php.html b/doc/html/theme_2blogga_2view_2theme_2blog_2default_8php.html index 75ab5e589..3abf19ff5 100644 --- a/doc/html/theme_2blogga_2view_2theme_2blog_2default_8php.html +++ b/doc/html/theme_2blogga_2view_2theme_2blog_2default_8php.html @@ -137,7 +137,7 @@ Variables</h2></td></tr> <div class="memproto"> <table class="memname"> <tr> - <td class="memname"><a class="el" href="theme_2mytheme_2php_2default_8php.html#a3987f5547ceb7e36a210a66a06241a5a">if</a> (<a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">local_user</a>()) $headimg = <a class="el" href="include_2config_8php.html#af02c96e6b37335774b548914ede1d22e">get_config</a>('blogtheme', 'headimg')</td> + <td class="memname"><a class="el" href="theme_2mytheme_2php_2default_8php.html#a3987f5547ceb7e36a210a66a06241a5a">if</a> (<a class="el" href="boot_8php.html#ad4c9dc2c8a82e8f52b7404c1655eab44">local_channel</a>()) $headimg = <a class="el" href="include_2config_8php.html#af02c96e6b37335774b548914ede1d22e">get_config</a>('blogtheme', 'headimg')</td> </tr> </table> </div><div class="memdoc"> diff --git a/doc/plugins.bb b/doc/plugins.bb index 06801eb20..7f1684117 100644 --- a/doc/plugins.bb +++ b/doc/plugins.bb @@ -91,10 +91,10 @@ Let's go ahead and add some code to implement our post_local hook handler. logger('randplace invoked');
- if(! local_user()) /* non-zero if this is a logged in user of this system */
+ if(! local_channel()) /* non-zero if this is a logged in user of this system */
return;
- if(local_user() != $item['uid']) /* Does this person own the post? */
+ if(local_channel() != $item['uid']) /* Does this person own the post? */
return;
if(($item['parent']) || ($item['item_restrict'])) {
@@ -104,7 +104,7 @@ Let's go ahead and add some code to implement our post_local hook handler. /* Retrieve our personal config setting */
- $active = get_pconfig(local_user(), 'randplace', 'enable');
+ $active = get_pconfig(local_channel(), 'randplace', 'enable');
if(! $active)
return;
@@ -146,10 +146,10 @@ Now let's add our functions to create and store preference settings. */
function randplace_settings_post($a,$post) {
- if(! local_user())
+ if(! local_channel())
return;
if($_POST['randplace-submit'])
- set_pconfig(local_user(),'randplace','enable',intval($_POST['randplace']));
+ set_pconfig(local_channel(),'randplace','enable',intval($_POST['randplace']));
}
@@ -173,7 +173,7 @@ Now let's add our functions to create and store preference settings. function randplace_settings(&$a,&$s) {
- if(! local_user())
+ if(! local_channel())
return;
/* Add our stylesheet to the page so we can make our settings look nice */
@@ -182,7 +182,7 @@ Now let's add our functions to create and store preference settings. /* Get the current state of our config variable */
- $enabled = get_pconfig(local_user(),'randplace','enable');
+ $enabled = get_pconfig(local_channel(),'randplace','enable');
$checked = (($enabled) ? ' checked="checked" ' : '');
diff --git a/doc/sql_conventions.bb b/doc/sql_conventions.bb index 88539ae19..2deb3cff6 100644 --- a/doc/sql_conventions.bb +++ b/doc/sql_conventions.bb @@ -10,7 +10,7 @@ Worth Repeating: Don't use non-standard SQL. This goes for addons as well. If yo To be written [code]// Example $r = q("SELECT * FROM profile WHERE uid = %d", - local_user() + local_channel() ); [/code][/li] diff --git a/include/Contact.php b/include/Contact.php index 4c80f5d6a..66062c279 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -98,10 +98,10 @@ function vcard_from_xchan($xchan, $observer = null, $mode = '') { // FIXME - show connect button to observer if appropriate $connect = false; - if(local_user()) { + if(local_channel()) { $r = q("select * from abook where abook_xchan = '%s' and abook_channel = %d limit 1", dbesc($xchan['xchan_hash']), - intval(local_user()) + intval(local_channel()) ); if(! $r) $connect = t('Connect'); @@ -351,7 +351,7 @@ function channel_remove($channel_id, $local = true, $unset_session=true) { proc_run('php','include/directory.php',$channel_id); - if($channel_id == local_user() && $unset_session) { + if($channel_id == local_channel() && $unset_session) { unset($_SESSION['authenticated']); unset($_SESSION['uid']); goaway($a->get_baseurl()); diff --git a/include/ConversationObject.php b/include/ConversationObject.php index 7dc4c8c19..af0bb8d2c 100644 --- a/include/ConversationObject.php +++ b/include/ConversationObject.php @@ -33,7 +33,7 @@ class Conversation extends BaseObject { $this->set_mode($mode); $this->preview = $preview; $this->prepared_item = $prepared_item; - $c = ((local_user()) ? get_pconfig(local_user(),'system','default_cipher') : ''); + $c = ((local_channel()) ? get_pconfig(local_channel(),'system','default_cipher') : ''); if($c) $this->cipher = $c; } @@ -57,7 +57,7 @@ class Conversation extends BaseObject { // $this->writable = false; // } // else { - $this->profile_owner = local_user(); + $this->profile_owner = local_channel(); $this->writable = true; // } break; diff --git a/include/ItemObject.php b/include/ItemObject.php index 82a321732..344664fd2 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -84,11 +84,11 @@ class Item extends BaseObject { $conv = $this->get_conversation(); $observer = $conv->get_observer(); - $lock = ((($item['item_private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) + $lock = ((($item['item_private'] == 1) || (($item['uid'] == local_channel()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])))) ? t('Private Message') : false); - $shareable = ((($conv->get_profile_owner() == local_user() && local_user()) && ($item['item_private'] != 1)) ? true : false); + $shareable = ((($conv->get_profile_owner() == local_channel() && local_channel()) && ($item['item_private'] != 1)) ? true : false); // allow an exemption for sharing stuff from your private feeds if($item['author']['xchan_network'] === 'rss') @@ -96,7 +96,7 @@ class Item extends BaseObject { $mode = $conv->get_mode(); - if(local_user() && $observer['xchan_hash'] === $item['author_xchan']) + if(local_channel() && $observer['xchan_hash'] === $item['author_xchan']) $edpost = array($a->get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit")); else $edpost = false; @@ -104,7 +104,7 @@ class Item extends BaseObject { if($observer['xchan_hash'] == $this->get_data_value('author_xchan') || $observer['xchan_hash'] == $this->get_data_value('owner_xchan') - || $this->get_data_value('uid') == local_user()) + || $this->get_data_value('uid') == local_channel()) $dropping = true; @@ -127,7 +127,7 @@ class Item extends BaseObject { ); } - $filer = ((($conv->get_profile_owner() == local_user()) && (! array_key_exists('real_uid',$item))) ? t("Save to Folder") : false); + $filer = ((($conv->get_profile_owner() == local_channel()) && (! array_key_exists('real_uid',$item))) ? t("Save to Folder") : false); $profile_avatar = $item['author']['xchan_photo_m']; $profile_link = chanlink_url($item['author']['xchan_url']); @@ -171,7 +171,7 @@ class Item extends BaseObject { if($this->is_toplevel()) { // FIXME check this permission - if(($conv->get_profile_owner() == local_user()) && (! array_key_exists('real_uid',$item))) { + if(($conv->get_profile_owner() == local_channel()) && (! array_key_exists('real_uid',$item))) { // FIXME we don't need all this stuff, some can be done in the template @@ -198,7 +198,7 @@ class Item extends BaseObject { // FIXME - check this permission - if($conv->get_profile_owner() == local_user()) { + if($conv->get_profile_owner() == local_channel()) { $tagger = array( 'tagit' => t("Add Tag"), 'classtagger' => "", @@ -214,7 +214,7 @@ class Item extends BaseObject { } $has_event = false; - if(($item['obj_type'] === ACTIVITY_OBJ_EVENT) && $conv->get_profile_owner() == local_user()) + if(($item['obj_type'] === ACTIVITY_OBJ_EVENT) && $conv->get_profile_owner() == local_channel()) $has_event = true; if($this->is_commentable()) { @@ -296,7 +296,7 @@ class Item extends BaseObject { 'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''), 'tagger' => ((feature_enabled($conv->get_profile_owner(),'commtag')) ? $tagger : ''), 'filer' => ((feature_enabled($conv->get_profile_owner(),'filing')) ? $filer : ''), - 'bookmark' => (($conv->get_profile_owner() == local_user() && local_user() && $has_bookmarks) ? t('Save Bookmarks') : ''), + 'bookmark' => (($conv->get_profile_owner() == local_channel() && local_channel() && $has_bookmarks) ? t('Save Bookmarks') : ''), 'addtocal' => (($has_event) ? t('Add to Calendar') : ''), 'drop' => $drop, 'multidrop' => ((feature_enabled($conv->get_profile_owner(),'multi_delete')) ? $multidrop : ''), @@ -610,7 +610,7 @@ class Item extends BaseObject { $a = $this->get_app(); $observer = $conv->get_observer(); - $qc = ((local_user()) ? get_pconfig(local_user(),'system','qcomment') : null); + $qc = ((local_channel()) ? get_pconfig(local_channel(),'system','qcomment') : null); $qcomment = (($qc) ? explode("\n",$qc) : null); $comment_box = replace_macros($template,array( diff --git a/include/RedDAV/RedBrowser.php b/include/RedDAV/RedBrowser.php index 8093aebc9..e651562ec 100644 --- a/include/RedDAV/RedBrowser.php +++ b/include/RedDAV/RedBrowser.php @@ -76,7 +76,7 @@ class RedBrowser extends DAV\Browser\Plugin { */ public function generateDirectoryIndex($path) { // (owner_id = channel_id) is visitor owner of this directory? - $is_owner = ((local_user() && $this->auth->owner_id == local_user()) ? true : false); + $is_owner = ((local_channel() && $this->auth->owner_id == local_channel()) ? true : false); if ($this->auth->getTimezone()) date_default_timezone_set($this->auth->getTimezone()); diff --git a/include/account.php b/include/account.php index 88036e2ef..19c13d5bd 100644 --- a/include/account.php +++ b/include/account.php @@ -561,7 +561,7 @@ function downgrade_accounts() { function service_class_allows($uid,$property,$usage = false) { $a = get_app(); - if($uid == local_user()) { + if($uid == local_channel()) { $service_class = $a->account['account_service_class']; } else { @@ -619,7 +619,7 @@ function account_service_class_allows($aid,$property,$usage = false) { function service_class_fetch($uid,$property) { $a = get_app(); - if($uid == local_user()) { + if($uid == local_channel()) { $service_class = $a->account['account_service_class']; } else { diff --git a/include/acl_selectors.php b/include/acl_selectors.php index 243e7a549..ae740b281 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -15,7 +15,7 @@ function group_select($selname,$selclass,$preselected = false,$size = 4) { $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" >\r\n"; $r = q("SELECT * FROM `groups` WHERE `deleted` = 0 AND `uid` = %d ORDER BY `name` ASC", - intval(local_user()) + intval(local_channel()) ); @@ -119,7 +119,7 @@ function contact_selector($selname, $selclass, $preselected = false, $options) { WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0 AND `notify` != '' $sql_extra ORDER BY `name` ASC ", - intval(local_user()) + intval(local_channel()) ); @@ -175,7 +175,7 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p $sql_extra ORDER BY xchan_name ASC ", intval(ABOOK_FLAG_SELF), - intval(local_user()) + intval(local_channel()) ); diff --git a/include/activities.php b/include/activities.php index d770ccb23..ca8863e51 100644 --- a/include/activities.php +++ b/include/activities.php @@ -3,10 +3,10 @@ function profile_activity($changed, $value) { $a = get_app(); - if(! local_user() || ! is_array($changed) || ! count($changed)) + if(! local_channel() || ! is_array($changed) || ! count($changed)) return; - if(! get_pconfig(local_user(),'system','post_profilechange')) + if(! get_pconfig(local_channel(),'system','post_profilechange')) return; require_once('include/items.php'); @@ -18,7 +18,7 @@ function profile_activity($changed, $value) { $arr = array(); $arr['mid'] = $arr['parent_mid'] = item_message_id(); - $arr['uid'] = local_user(); + $arr['uid'] = local_channel(); $arr['aid'] = $self['channel_account_id']; $arr['owner_xchan'] = $arr['author_xchan'] = $self['xchan_hash']; $arr['item_flags'] = ITEM_WALL|ITEM_ORIGIN|ITEM_THREAD_TOP; diff --git a/include/api.php b/include/api.php index 51de412cf..d00cdcf8a 100644 --- a/include/api.php +++ b/include/api.php @@ -48,7 +48,7 @@ require_once('include/items.php'); } } if ($_SESSION["allow_api"]) - return local_user(); + return local_channel(); return false; } @@ -308,7 +308,7 @@ require_once('include/items.php'); api_login($a); return False; } else { - $user = local_user(); + $user = local_channel(); $extra_query = " AND abook_channel = %d AND (abook_flags & " . ABOOK_FLAG_SELF . " )>0 "; } diff --git a/include/apps.php b/include/apps.php index e08e6a6f5..e3120807c 100644 --- a/include/apps.php +++ b/include/apps.php @@ -88,15 +88,15 @@ function parse_app_description($f) { $require = trim(strtolower($require)); switch($require) { case 'nologin': - if(local_user()) + if(local_channel()) unset($ret); break; case 'admin': if(! is_site_admin()) unset($ret); break; - case 'local_user': - if(! local_user()) + case 'local_channel': + if(! local_channel()) unset($ret); break; case 'public_profile': @@ -108,7 +108,7 @@ function parse_app_description($f) { unset($ret); break; default: - if(! (local_user() && feature_enabled(local_user(),$require))) + if(! (local_channel() && feature_enabled(local_channel(),$require))) unset($ret); break; @@ -196,15 +196,15 @@ function app_render($papp,$mode = 'view') { $require = trim(strtolower($require)); switch($require) { case 'nologin': - if(local_user()) + if(local_channel()) return ''; break; case 'admin': if(! is_site_admin()) return ''; break; - case 'local_user': - if(! local_user()) + case 'local_channel': + if(! local_channel()) return ''; break; case 'public_profile': @@ -217,7 +217,7 @@ function app_render($papp,$mode = 'view') { return ''; break; default: - if(! (local_user() && feature_enabled(local_user(),$require))) + if(! (local_channel() && feature_enabled(local_channel(),$require))) return ''; break; @@ -229,8 +229,8 @@ function app_render($papp,$mode = 'view') { $hosturl = ''; - if(local_user()) { - $installed = app_installed(local_user(),$papp); + if(local_channel()) { + $installed = app_installed(local_channel(),$papp); $hosturl = z_root() . '/'; } elseif(remote_user()) { @@ -251,8 +251,8 @@ function app_render($papp,$mode = 'view') { '$hosturl' => $hosturl, '$purchase' => (($papp['page'] && (! $installed)) ? t('Purchase') : ''), '$install' => (($hosturl && $mode == 'view') ? $install_action : ''), - '$edit' => ((local_user() && $installed && $mode == 'edit') ? t('Edit') : ''), - '$delete' => ((local_user() && $installed && $mode == 'edit') ? t('Delete') : '') + '$edit' => ((local_channel() && $installed && $mode == 'edit') ? t('Edit') : ''), + '$delete' => ((local_channel() && $installed && $mode == 'edit') ? t('Delete') : '') )); } diff --git a/include/attach.php b/include/attach.php index c7216df7a..155ddbc96 100644 --- a/include/attach.php +++ b/include/attach.php @@ -985,7 +985,7 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid, dbesc(ACTIVITY_POST), dbesc($objtype), dbesc($object['hash']), - intval(local_user()) + intval(local_channel()) ); if($y) { diff --git a/include/auth.php b/include/auth.php index c4bbaf546..6c9c33861 100644 --- a/include/auth.php +++ b/include/auth.php @@ -124,7 +124,7 @@ if((isset($_SESSION)) && (x($_SESSION, 'authenticated')) && if(((x($_POST, 'auth-params')) && ($_POST['auth-params'] === 'logout')) || ($a->module === 'logout')) { // process logout request - $args = array('channel_id' => local_user()); + $args = array('channel_id' => local_channel()); call_hooks('logging_out', $args); nuke_session(); info( t('Logged out.') . EOL); diff --git a/include/comanche.php b/include/comanche.php index b0eac475d..b181d415a 100644 --- a/include/comanche.php +++ b/include/comanche.php @@ -113,14 +113,14 @@ function comanche_replace_region($match) { /** * @function comanche_get_channel_id() - * Returns the channel_id of the profile owner of the page, or the local_user if there is no profile owner. + * Returns the channel_id of the profile owner of the page, or the local_channel if there is no profile owner. * Otherwise returns 0 */ function comanche_get_channel_id() { $channel_id = ((is_array(get_app()->profile)) ? get_app()->profile['profile_uid'] : 0); - if((! $channel_id) && (local_user())) - $channel_id = local_user(); + if((! $channel_id) && (local_channel())) + $channel_id = local_channel(); return $channel_id; } diff --git a/include/config.php b/include/config.php index 87b91e51a..b459e2c7d 100644 --- a/include/config.php +++ b/include/config.php @@ -18,7 +18,7 @@ * - <b>pconfig</b> is used for channel specific configurations and takes a * <i>channel_id</i> as identifier. It stores for example which features are * enabled per channel. The storage is of size MEDIUMTEXT. - * @code $var = get_pconfig(local_user(), 'category', 'key');@endcode + * @code $var = get_pconfig(local_channel(), 'category', 'key');@endcode * - <b>xconfig</b> is the same as pconfig, except that it uses <i>xchan</i> as * an identifier. This is for example for people who do not have a local account. * The storage is of size MEDIUMTEXT. diff --git a/include/contact_widgets.php b/include/contact_widgets.php index ee9394e95..a02fea523 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -8,7 +8,7 @@ function findpeople_widget() { $a = get_app(); if(get_config('system','invitation_only')) { - $x = get_pconfig(local_user(),'system','invites_remaining'); + $x = get_pconfig(local_channel(),'system','invites_remaining'); if($x || is_site_admin()) { $a->page['aside'] .= '<div class="side-link" id="side-invite-remain">' . sprintf( tt('%d invitation available','%d invitations available',$x), $x) @@ -16,7 +16,7 @@ function findpeople_widget() { } } - $advanced_search = ((local_user() && get_pconfig(local_user(),'feature','expert')) ? t('Advanced') : false); + $advanced_search = ((local_channel() && get_pconfig(local_channel(),'feature','expert')) ? t('Advanced') : false); return replace_macros(get_markup_template('peoplefind.tpl'),array( '$findpeople' => t('Find Channels'), @@ -30,7 +30,7 @@ function findpeople_widget() { '$inv' => t('Invite Friends'), '$advanced_search' => $advanced_search, '$advanced_hint' => "\r\n" . t('Advanced example: name=fred and country=iceland'), - '$loggedin' => local_user() + '$loggedin' => local_channel() )); } @@ -39,12 +39,12 @@ function findpeople_widget() { function fileas_widget($baseurl,$selected = '') { $a = get_app(); - if(! local_user()) + if(! local_channel()) return ''; $terms = array(); $r = q("select distinct(term) from term where uid = %d and type = %d order by term asc", - intval(local_user()), + intval(local_channel()), intval(TERM_FILE) ); if(! $r) @@ -105,7 +105,7 @@ function common_friends_visitor_widget($profile_uid) { $a = get_app(); - if(local_user() == $profile_uid) + if(local_channel() == $profile_uid) return; $observer_hash = get_observer_hash(); diff --git a/include/conversation.php b/include/conversation.php index 25c844fef..9429af754 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -430,16 +430,16 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ require_once('bbcode.php'); - $ssl_state = ((local_user()) ? true : false); + $ssl_state = ((local_channel()) ? true : false); - if(local_user()) - load_pconfig(local_user(),''); + if(local_channel()) + load_pconfig(local_channel(),''); $arr_blocked = null; - if(local_user()) - $str_blocked = get_pconfig(local_user(),'system','blocked'); - if(! local_user() && ($mode == 'network')) { + if(local_channel()) + $str_blocked = get_pconfig(local_channel(),'system','blocked'); + if(! local_channel() && ($mode == 'network')) { $sys = get_sys_channel(); $id = $sys['channel_id']; $str_blocked = get_pconfig($id,'system','blocked'); @@ -461,7 +461,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ if($mode === 'network') { - $profile_owner = local_user(); + $profile_owner = local_channel(); $page_writeable = true; if(!$update) { @@ -492,7 +492,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ elseif($mode === 'channel') { $profile_owner = $a->profile['profile_uid']; - $page_writeable = ($profile_owner == local_user()); + $page_writeable = ($profile_owner == local_channel()); if(!$update) { $tab = notags(trim($_GET['tab'])); @@ -508,14 +508,14 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ } elseif($mode === 'display') { - $profile_owner = local_user(); + $profile_owner = local_channel(); $page_writeable = false; $live_update_div = '<div id="live-display"></div>' . "\r\n"; } elseif($mode === 'page') { $profile_owner = $a->profile['uid']; - $page_writeable = ($profile_owner == local_user()); + $page_writeable = ($profile_owner == local_channel()); $live_update_div = '<div id="live-page"></div>' . "\r\n"; } @@ -525,13 +525,13 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ elseif($mode === 'photos') { $profile_onwer = $a->profile['profile_uid']; - $page_writeable = ($profile_owner == local_user()); + $page_writeable = ($profile_owner == local_channel()); $live_update_div = '<div id="live-photos"></div>' . "\r\n"; // for photos we've already formatted the top-level item (the photo) $content_html = $a->data['photo_html']; } - $page_dropping = ((local_user() && local_user() == $profile_owner) ? true : false); + $page_dropping = ((local_channel() && local_channel() == $profile_owner) ? true : false); if(! feature_enabled($profile_owner,'multi_delete')) $page_dropping = false; @@ -545,7 +545,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ else $return_url = $_SESSION['return_url'] = $a->query_string; - load_contact_links(local_user()); + load_contact_links(local_channel()); $cb = array('items' => $items, 'mode' => $mode, 'update' => $update, 'preview' => $preview); call_hooks('conversation_start',$cb); @@ -863,7 +863,7 @@ function best_link_url($item) { $clean_url = normalise_link($item['author-link']); - if((local_user()) && (local_user() == $item['uid'])) { + if((local_channel()) && (local_channel() == $item['uid'])) { if(isset($a->contacts) && x($a->contacts,$clean_url)) { if($a->contacts[$clean_url]['network'] === NETWORK_DFRN) { $best_url = $a->get_baseurl($ssl_state) . '/redir/' . $a->contacts[$clean_url]['id']; @@ -899,17 +899,17 @@ function item_photo_menu($item){ $follow_url = ""; - $local_user = local_user(); + $local_channel = local_channel(); - if($local_user) { + if($local_channel) { $ssl_state = true; if(! count($a->contacts)) - load_contact_links($local_user); + load_contact_links($local_channel); $channel = $a->get_channel(); $channel_hash = (($channel) ? $channel['channel_hash'] : ''); } - if(($local_user) && $local_user == $item['uid']) { + if(($local_channel) && $local_channel == $item['uid']) { $vsrc_link = 'javascript:viewsrc(' . $item['id'] . '); return false;'; if($item['parent'] == $item['id'] && $channel && ($channel_hash != $item['author_xchan'])) { $sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;'; @@ -923,7 +923,7 @@ function item_photo_menu($item){ if($a->contacts && array_key_exists($item['author_xchan'],$a->contacts)) $contact = $a->contacts[$item['author_xchan']]; else - if($local_user && $item['author']['xchan_addr']) + if($local_channel && $item['author']['xchan_addr']) $follow_url = z_root() . '/follow/?f=&url=' . $item['author']['xchan_addr']; if($contact) { @@ -1075,7 +1075,7 @@ function status_editor($a,$x,$popup=false) { $plaintext = true; -// if(feature_enabled(local_user(),'richtext')) +// if(feature_enabled(local_channel(),'richtext')) // $plaintext = false; $mimeselect = ''; @@ -1467,7 +1467,7 @@ function network_tabs() { 'title' => t('Sort by Post Date'), ); - if(feature_enabled(local_user(),'personal_tab')) { + if(feature_enabled(local_channel(),'personal_tab')) { $tabs[] = array( 'label' => t('Personal'), 'url' => z_root() . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&conv=1', @@ -1476,7 +1476,7 @@ function network_tabs() { ); } - if(feature_enabled(local_user(),'new_tab')) { + if(feature_enabled(local_channel(),'new_tab')) { $tabs[] = array( 'label' => t('New'), 'url' => z_root() . '/' . $cmd . '?f=' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '') . '&new=1' . ((x($_GET,'gid')) ? '&gid=' . $_GET['gid'] : ''), @@ -1485,7 +1485,7 @@ function network_tabs() { ); } - if(feature_enabled(local_user(),'star_posts')) { + if(feature_enabled(local_channel(),'star_posts')) { $tabs[] = array( 'label' => t('Starred'), 'url'=>z_root() . '/' . $cmd . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '') . '&star=1', @@ -1495,7 +1495,7 @@ function network_tabs() { } // Not yet implemented - if(feature_enabled(local_user(),'spam_filter')) { + if(feature_enabled(local_channel(),'spam_filter')) { $tabs[] = array( 'label' => t('Spam'), 'url'=> z_root() . '/network?f=&spam=1', @@ -1527,7 +1527,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ if (is_null($nickname)) $nickname = $channel['channel_address']; - $uid = (($a->profile['profile_uid']) ? $a->profile['profile_uid'] : local_user()); + $uid = (($a->profile['profile_uid']) ? $a->profile['profile_uid'] : local_channel()); if (get_pconfig($uid,'system','noprofiletabs')) return; @@ -1593,7 +1593,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){ } require_once('include/menu.php'); - $has_bookmarks = menu_list_count(local_user(),'',MENU_BOOKMARK) + menu_list_count(local_user(),'',MENU_SYSTEM|MENU_BOOKMARK); + $has_bookmarks = menu_list_count(local_channel(),'',MENU_BOOKMARK) + menu_list_count(local_channel(),'',MENU_SYSTEM|MENU_BOOKMARK); if($is_owner && $has_bookmarks) { $tabs[] = array( 'label' => t('Bookmarks'), diff --git a/include/follow.php b/include/follow.php index 06c0c5c62..2d6791420 100644 --- a/include/follow.php +++ b/include/follow.php @@ -172,7 +172,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false) return $result; } - if((local_user()) && $uid == local_user()) { + if((local_channel()) && $uid == local_channel()) { $aid = get_account_id(); $hash = get_observer_hash(); $ch = $a->get_channel(); diff --git a/include/group.php b/include/group.php index 28cf5d80d..be19f6efe 100644 --- a/include/group.php +++ b/include/group.php @@ -202,8 +202,8 @@ function group_get_members($gid) { LEFT JOIN abook ON abook_xchan = `group_member`.`xchan` left join xchan on xchan_hash = abook_xchan WHERE `gid` = %d AND abook_channel = %d and `group_member`.`uid` = %d and not ( xchan_flags & %d )>0 and not ( abook_flags & %d )>0 and not ( abook_flags & %d )>0 ORDER BY xchan_name ASC ", intval($gid), - intval(local_user()), - intval(local_user()), + intval(local_channel()), + intval(local_channel()), intval(XCHAN_FLAGS_DELETED), intval(ABOOK_FLAG_BLOCKED), intval(ABOOK_FLAG_PENDING) @@ -245,7 +245,7 @@ function group_side($every="connections",$each="group",$edit = false, $group_id $o = ''; - if(! local_user()) + if(! local_channel()) return ''; $groups = array(); @@ -263,7 +263,7 @@ function group_side($every="connections",$each="group",$edit = false, $group_id ); $member_of = array(); if($cid) { - $member_of = groups_containing(local_user(),$cid); + $member_of = groups_containing(local_channel(),$cid); } if(count($r)) { diff --git a/include/identity.php b/include/identity.php index d98f39cb7..67cd4b4af 100644 --- a/include/identity.php +++ b/include/identity.php @@ -705,7 +705,7 @@ function profile_load(&$a, $nickname, $profile = '') { $profile_fields_basic = get_profile_fields_basic(); $profile_fields_advanced = get_profile_fields_advanced(); - $advanced = ((feature_enabled(local_user(),'advanced_profiles')) ? true : false); + $advanced = ((feature_enabled(local_channel(),'advanced_profiles')) ? true : false); if($advanced) $fields = $profile_fields_advanced; else @@ -760,8 +760,8 @@ function profile_load(&$a, $nickname, $profile = '') { } - if(local_user()) { - $a->profile['channel_mobile_theme'] = get_pconfig(local_user(),'system', 'mobile_theme'); + if(local_channel()) { + $a->profile['channel_mobile_theme'] = get_pconfig(local_channel(),'system', 'mobile_theme'); $_SESSION['mobile_theme'] = $a->profile['channel_mobile_theme']; } @@ -783,7 +783,7 @@ function profile_load(&$a, $nickname, $profile = '') { function profile_create_sidebar(&$a,$connect = true) { - $block = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false); + $block = (((get_config('system','block_public')) && (! local_channel()) && (! remote_user())) ? true : false); $a->set_widget('profile',profile_sidebar($a->profile, $block, $connect)); return; @@ -824,7 +824,7 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) { head_set_icon($profile['thumb']); - $is_owner = (($profile['uid'] == local_user()) ? true : false); + $is_owner = (($profile['uid'] == local_channel()) ? true : false); $profile['picdate'] = urlencode($profile['picdate']); @@ -856,7 +856,7 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) { ); - $multi_profiles = feature_enabled(local_user(), 'multi_profiles'); + $multi_profiles = feature_enabled(local_channel(), 'multi_profiles'); if($multi_profiles) { $profile['edit'] = array($a->get_baseurl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles')); $profile['menu']['cr_new'] = t('Create New Profile'); @@ -865,7 +865,7 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) { $profile['edit'] = array($a->get_baseurl() . '/profiles/' . $profile['id'], t('Edit Profile'),'',t('Edit Profile')); $r = q("SELECT * FROM `profile` WHERE `uid` = %d", - local_user()); + local_channel()); if($r) { @@ -905,7 +905,7 @@ logger('online: ' . $profile['online']); $block = true; } - if(($profile['hidewall'] && (! local_user()) && (! remote_user())) || $block ) { + if(($profile['hidewall'] && (! local_channel()) && (! remote_user())) || $block ) { $location = $pdesc = $gender = $marital = $homepage = $online = False; } @@ -973,7 +973,7 @@ logger('online: ' . $profile['online']); $a = get_app(); $o = ''; - if(! local_user()) + if(! local_channel()) return $o; $bd_format = t('g A l F d') ; // 8 AM Friday January 18 @@ -983,7 +983,7 @@ logger('online: ' . $profile['online']); LEFT JOIN `contact` ON `contact`.`id` = `event`.`cid` WHERE `event`.`uid` = %d AND `type` = 'birthday' AND `start` < '%s' AND `finish` > '%s' ORDER BY `start` ASC ", - intval(local_user()), + intval(local_channel()), dbesc(datetime_convert('UTC','UTC','now + 6 days')), dbesc(datetime_convert('UTC','UTC','now')) ); @@ -1053,7 +1053,7 @@ logger('online: ' . $profile['online']); $a = get_app(); - if(! local_user()) + if(! local_channel()) return $o; $bd_format = t('g A l F d') ; // 8 AM Friday January 18 @@ -1062,7 +1062,7 @@ logger('online: ' . $profile['online']); $r = q("SELECT `event`.* FROM `event` WHERE `event`.`uid` = %d AND `type` != 'birthday' AND `start` < '%s' AND `start` > '%s' ORDER BY `start` ASC ", - intval(local_user()), + intval(local_channel()), dbesc(datetime_convert('UTC','UTC','now + 6 days')), dbesc(datetime_convert('UTC','UTC','now - 1 days')) ); @@ -1286,7 +1286,7 @@ function zid_init(&$a) { proc_run('php','include/gprobe.php',bin2hex($tmp_str)); $arr = array('zid' => $tmp_str, 'url' => $a->cmd); call_hooks('zid_init',$arr); - if(! local_user()) { + if(! local_channel()) { $r = q("select * from hubloc where hubloc_addr = '%s' order by hubloc_connected desc limit 1", dbesc($tmp_str) ); @@ -1356,9 +1356,9 @@ function zid($s,$address = '') { function get_theme_uid() { $uid = (($_REQUEST['puid']) ? intval($_REQUEST['puid']) : 0); - if(local_user()) { - if((get_pconfig(local_user(),'system','always_my_theme')) || (! $uid)) - return local_user(); + if(local_channel()) { + if((get_pconfig(local_channel(),'system','always_my_theme')) || (! $uid)) + return local_channel(); } if(! $uid) { $x = get_sys_channel(); @@ -1421,7 +1421,7 @@ function get_online_status($nick) { $ret = array('result' => false); - if(get_config('system','block_public') && ! local_user() && ! remote_user()) + if(get_config('system','block_public') && ! local_channel() && ! remote_user()) return $ret; $r = q("select channel_id, channel_hash from channel where channel_address = '%s' limit 1", @@ -1474,7 +1474,7 @@ function get_channel_by_nick($nick) { function identity_selector() { - if(local_user()) { + if(local_channel()) { $r = q("select channel.*, xchan.* from channel left join xchan on channel.channel_hash = xchan.xchan_hash where channel.channel_account_id = %d and (channel_pageflags & %d) = 0 order by channel_name ", intval(get_account_id()), intval(PAGE_REMOVED) @@ -1484,7 +1484,7 @@ function identity_selector() { $account = get_app()->get_account(); $o = replace_macros(get_markup_template('channel_id_select.tpl'),array( '$channels' => $r, - '$selected' => local_user() + '$selected' => local_channel() )); return $o; } @@ -1495,7 +1495,7 @@ function identity_selector() { function is_public_profile() { - if(! local_user()) + if(! local_channel()) return false; if(intval(get_config('system','block_public'))) return false; diff --git a/include/items.php b/include/items.php index 756625d85..a5a42d23b 100755 --- a/include/items.php +++ b/include/items.php @@ -1967,7 +1967,7 @@ function item_store($arr,$allow_exec = false) { $arr['body'] = z_input_filter($arr['uid'],$arr['body'],$arr['mimetype']); - if(local_user() && (! $arr['sig'])) { + if(local_channel() && (! $arr['sig'])) { $channel = get_app()->get_channel(); if($channel['channel_hash'] === $arr['author_xchan']) { $arr['sig'] = base64url_encode(rsa_sign($arr['body'],$channel['channel_prvkey'])); @@ -2355,7 +2355,7 @@ function item_store_update($arr,$allow_exec = false) { // apply the input filter here - if it is obscured it has been filtered already $arr['body'] = z_input_filter($arr['uid'],$arr['body'],$arr['mimetype']); - if(local_user() && (! $arr['sig'])) { + if(local_channel() && (! $arr['sig'])) { $channel = get_app()->get_channel(); if($channel['channel_hash'] === $arr['author_xchan']) { $arr['sig'] = base64url_encode(rsa_sign($arr['body'],$channel['channel_prvkey'])); @@ -3949,7 +3949,7 @@ function retain_item($id) { function drop_items($items) { $uid = 0; - if(! local_user() && ! remote_user()) + if(! local_channel() && ! remote_user()) return; if(count($items)) { @@ -4005,7 +4005,7 @@ function drop_item($id,$interactive = true,$stage = DROPITEM_NORMAL,$force = fal $ok_to_delete = true; // owner deletion - if(local_user() && local_user() == $item['uid']) + if(local_channel() && local_channel() == $item['uid']) $ok_to_delete = true; // author deletion @@ -4472,7 +4472,7 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C $r = q("SELECT abook.*, xchan.* from abook left join xchan on abook_xchan = xchan_hash where abook_id = %d and abook_channel = %d and not ( abook_flags & " . intval(ABOOK_FLAG_BLOCKED) . ")>0 limit 1", intval($arr['cid']), - intval(local_user()) + intval(local_channel()) ); if($r) { $sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND uid = " . intval($arr['uid']) . " AND ( author_xchan = '" . dbesc($r[0]['abook_xchan']) . "' or owner_xchan = '" . dbesc($r[0]['abook_xchan']) . "' ) and item_restrict = 0 ) "; diff --git a/include/menu.php b/include/menu.php index 9dc236605..81e986132 100644 --- a/include/menu.php +++ b/include/menu.php @@ -223,7 +223,7 @@ function menu_add_item($menu_id, $uid, $arr) { $mitem_order = intval($arr['mitem_order']); $mitem_flags = intval($arr['mitem_flags']); - if(local_user() == $uid) { + if(local_channel() == $uid) { $channel = get_app()->get_channel(); } @@ -279,7 +279,7 @@ function menu_edit_item($menu_id, $uid, $arr) { $mitem_flags = intval($arr['mitem_flags']); - if(local_user() == $uid) { + if(local_channel() == $uid) { $channel = get_app()->get_channel(); } diff --git a/include/message.php b/include/message.php index 49278f273..34fa2cd8d 100644 --- a/include/message.php +++ b/include/message.php @@ -51,7 +51,7 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto=' if(strlen($replyto)) { $r = q("select convid from mail where channel_id = %d and ( mid = '%s' or parent_mid = '%s' ) limit 1", - intval(local_user()), + intval(local_channel()), dbesc($replyto), dbesc($replyto) ); @@ -76,7 +76,7 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto=' $handles = $recip_handle . ';' . $sender_handle; $r = q("insert into conv (uid,guid,creator,created,updated,subject,recips) values(%d, '%s', '%s', '%s', '%s', '%s', '%s') ", - intval(local_user()), + intval(local_channel()), dbesc($conv_guid), dbesc($sender_handle), dbesc(datetime_convert()), @@ -87,7 +87,7 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto=' $r = q("select * from conv where guid = '%s' and uid = %d limit 1", dbesc($conv_guid), - intval(local_user()) + intval(local_channel()) ); if($r) $convid = $r[0]['id']; @@ -261,7 +261,7 @@ function private_messages_list($uid, $mailbox = '', $start = 0, $numitems = 0) { // inside this function or having some preset sorts, but don't wish to limit app developers. $r = q("SELECT * from mail WHERE channel_id = %d $where order by created desc $limit", - intval(local_user()) + intval(local_channel()) ); if(! $r) { return array(); diff --git a/include/nav.php b/include/nav.php index a567f83c5..994ebc597 100644 --- a/include/nav.php +++ b/include/nav.php @@ -23,7 +23,7 @@ EOT; - if(local_user()) { + if(local_channel()) { $channel = $a->get_channel(); $observer = $a->get_observer(); $prof = q("select id from profile where uid = %d and is_default = 1", @@ -78,10 +78,10 @@ EOT; $userinfo = null; $nav['loginmenu']=array(); - if(local_user()) { + if(local_channel()) { - if($chans && count($chans) > 1 && feature_enabled(local_user(),'nav_channel_select')) + if($chans && count($chans) > 1 && feature_enabled(local_channel(),'nav_channel_select')) $nav['channels'] = $chans; $nav['logout'] = Array('logout',t('Logout'), "", t('End this session'),'logout_nav_btn'); @@ -89,7 +89,7 @@ EOT; // user menu $nav['usermenu'][] = Array('channel/' . $channel['channel_address'], t('Home'), "", t('Your posts and conversations'),'channel_nav_btn'); $nav['usermenu'][] = Array('profile/' . $channel['channel_address'], t('View Profile'), "", t('Your profile page'),'profile_nav_btn'); - if(feature_enabled(local_user(),'multi_profiles')) + if(feature_enabled(local_channel(),'multi_profiles')) $nav['usermenu'][] = Array('profiles', t('Edit Profiles'),"", t('Manage/Edit profiles'),'profiles_nav_btn'); else $nav['usermenu'][] = Array('profiles/' . $prof[0]['id'], t('Edit Profile'),"", t('Edit your profile'),'profiles_nav_btn'); @@ -98,13 +98,13 @@ EOT; $nav['usermenu'][] = Array('cloud/' . $channel['channel_address'],t('Files'),"",t('Your files'),'cloud_nav_btn'); require_once('include/chat.php'); - $has_chats = chatroom_list_count(local_user()); + $has_chats = chatroom_list_count(local_channel()); if($has_chats) { $nav['usermenu'][] = Array('chat/' . $channel['channel_address'],t('Chat'),"",t('Your chatrooms'),'chat_nav_btn'); } require_once('include/menu.php'); - $has_bookmarks = menu_list_count(local_user(),'',MENU_BOOKMARK) + menu_list_count(local_user(),'',MENU_SYSTEM|MENU_BOOKMARK); + $has_bookmarks = menu_list_count(local_channel(),'',MENU_BOOKMARK) + menu_list_count(local_channel(),'',MENU_SYSTEM|MENU_BOOKMARK); if($has_bookmarks) { $nav['usermenu'][] = Array('bookmarks', t('Bookmarks'), "", t('Your bookmarks'),'bookmarks_nav_btn'); } @@ -147,11 +147,11 @@ EOT; $homelink = (($observer) ? $observer['xchan_url'] : ''); } - if(($a->module != 'home') && (! (local_user()))) + if(($a->module != 'home') && (! (local_channel()))) $nav['home'] = array($homelink, t('Home'), "", t('Home Page'),'home_nav_btn'); - if(($a->config['system']['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user())) + if(($a->config['system']['register_policy'] == REGISTER_OPEN) && (! local_channel()) && (! remote_user())) $nav['register'] = array('register',t('Register'), "", t('Create an account'),'register_nav_btn'); $help_url = z_root() . '/help?f=&cmd=' . $a->cmd; @@ -174,9 +174,9 @@ EOT; * */ - if(local_user()) { + if(local_channel()) { - $network_options = get_pconfig(local_user(),'system','network_page_default'); + $network_options = get_pconfig(local_channel(),'system','network_page_default'); $nav['network'] = array('network' . (($network_options) ? '?f=&' . $network_options : ''), t('Matrix'), "", t('Your matrix'),'network_nav_btn'); @@ -248,7 +248,7 @@ $powered_by = ''; '$banner' => $banner, '$emptynotifications' => t('Loading...'), '$userinfo' => $x['usermenu'], - '$localuser' => local_user(), + '$localuser' => local_channel(), '$sel' => $a->nav_sel, '$powered_by' => $powered_by, '$help' => t('@name, #tag, content'), diff --git a/include/security.php b/include/security.php index 07b6a96aa..1cb9e827b 100644 --- a/include/security.php +++ b/include/security.php @@ -118,7 +118,7 @@ function change_channel($change_channel) { $_SESSION['uid'] = intval($r[0]['channel_id']); get_app()->set_channel($r[0]); $_SESSION['theme'] = $r[0]['channel_theme']; - $_SESSION['mobile_theme'] = get_pconfig(local_user(),'system', 'mobile_theme'); + $_SESSION['mobile_theme'] = get_pconfig(local_channel(),'system', 'mobile_theme'); date_default_timezone_set($r[0]['channel_timezone']); $ret = $r[0]; } @@ -130,7 +130,7 @@ function change_channel($change_channel) { $_SESSION['my_address'] = $r[0]['channel_address'] . '@' . substr(get_app()->get_baseurl(), strpos(get_app()->get_baseurl(), '://') + 3); get_app()->set_observer($x[0]); - get_app()->set_perms(get_all_perms(local_user(), $hash)); + get_app()->set_perms(get_all_perms(local_channel(), $hash)); } if(! is_dir('store/' . $r[0]['channel_address'])) @os_mkdir('store/' . $r[0]['channel_address'], STORAGE_DEFAULT_PERMISSIONS,true); @@ -153,7 +153,7 @@ function permissions_sql($owner_id, $remote_verified = false, $groups = null) { if(defined('STATUSNET_PRIVACY_COMPATIBILITY')) return ''; - $local_user = local_user(); + $local_channel = local_channel(); $remote_user = remote_user(); /** @@ -172,7 +172,7 @@ function permissions_sql($owner_id, $remote_verified = false, $groups = null) { * Profile owner - everything is visible */ - if(($local_user) && ($local_user == $owner_id)) { + if(($local_channel) && ($local_channel == $owner_id)) { $sql = ''; } @@ -226,7 +226,7 @@ function item_permissions_sql($owner_id, $remote_verified = false, $groups = nul if(defined('STATUSNET_PRIVACY_COMPATIBILITY')) return ''; - $local_user = local_user(); + $local_channel = local_channel(); $remote_user = remote_user(); /** @@ -241,7 +241,7 @@ function item_permissions_sql($owner_id, $remote_verified = false, $groups = nul * Profile owner - everything is visible */ - if(($local_user) && ($local_user == $owner_id)) { + if(($local_channel) && ($local_channel == $owner_id)) { $sql = ''; } @@ -408,8 +408,8 @@ function stream_perms_api_uids($perms = NULL ) { $perms = is_null($perms) ? (PERMS_SITE|PERMS_NETWORK|PERMS_PUBLIC) : $perms; $ret = array(); - if(local_user()) - $ret[] = local_user(); + if(local_channel()) + $ret[] = local_channel(); $r = q("select channel_id from channel where channel_r_stream > 0 and (channel_r_stream & %d)>0 and not (channel_pageflags & %d)>0", intval($perms), intval(PAGE_ADULT|PAGE_CENSORED|PAGE_SYSTEM|PAGE_REMOVED) @@ -437,7 +437,7 @@ function stream_perms_xchans($perms = NULL ) { $perms = is_null($perms) ? (PERMS_SITE|PERMS_NETWORK|PERMS_PUBLIC) : $perms; $ret = array(); - if(local_user()) + if(local_channel()) $ret[] = get_observer_hash(); $r = q("select channel_hash from channel where channel_r_stream > 0 and (channel_r_stream & %d)>0 and not (channel_pageflags & %d)>0", diff --git a/include/socgraph.php b/include/socgraph.php index 542ec7074..9b30429df 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -426,7 +426,7 @@ function poco($a,$extended = false) { $system_mode = false; - if(intval(get_config('system','block_public')) && (! local_user()) && (! remote_user())) { + if(intval(get_config('system','block_public')) && (! local_channel()) && (! remote_user())) { logger('mod_poco: block_public'); http_status_exit(401); } diff --git a/include/text.php b/include/text.php index cfe87991c..5c8242e79 100644 --- a/include/text.php +++ b/include/text.php @@ -96,7 +96,7 @@ function z_input_filter($channel_id,$s,$type = 'text/bbcode') { intval($channel_id) ); if($r && (($r[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) || ($r[0]['channel_pageflags'] & PAGE_ALLOWCODE))) { - if(local_user() && (get_account_id() == $r[0]['account_id'])) { + if(local_channel() && (get_account_id() == $r[0]['account_id'])) { return $s; } } @@ -727,7 +727,7 @@ function contact_block() { if($shown == 0) return; - $is_owner = ((local_user() && local_user() == $a->profile['uid']) ? true : false); + $is_owner = ((local_channel() && local_channel() == $a->profile['uid']) ? true : false); $abook_flags = ABOOK_FLAG_PENDING|ABOOK_FLAG_SELF; $xchan_flags = XCHAN_FLAGS_ORPHAN|XCHAN_FLAGS_DELETED; @@ -835,7 +835,7 @@ function search($s,$id='search-box',$url='/search',$save = false) { '$action_url' => $a->get_baseurl((stristr($url,'network')) ? true : false) . $url, '$search_label' => t('Search'), '$save_label' => t('Save'), - '$savedsearch' => feature_enabled(local_user(),'savedsearch') + '$savedsearch' => feature_enabled(local_channel(),'savedsearch') )); } @@ -847,7 +847,7 @@ function searchbox($s,$id='search-box',$url='/search',$save = false) { '$action_url' => z_root() . '/' . $url, '$search_label' => t('Search'), '$save_label' => t('Save'), - '$savedsearch' => feature_enabled(local_user(),'savedsearch') + '$savedsearch' => feature_enabled(local_channel(),'savedsearch') )); } @@ -1063,7 +1063,7 @@ function smilies($s, $sample = false) { $a = get_app(); if(intval(get_config('system','no_smilies')) - || (local_user() && intval(get_pconfig(local_user(),'system','no_smilies')))) + || (local_channel() && intval(get_pconfig(local_channel(),'system','no_smilies')))) return $s; $s = preg_replace_callback('{<(pre|code)>.*?</\1>}ism','smile_shield',$s); @@ -1359,7 +1359,7 @@ function prepare_body(&$item,$attach = false) { $s .= format_categories($item,$writeable); - if(local_user() == $item['uid']) + if(local_channel() == $item['uid']) $s .= format_filer($item); $s = sslify($s); @@ -1466,14 +1466,14 @@ function prepare_text($text,$content_type = 'text/bbcode') { function zidify_callback($match) { - $is_zid = ((feature_enabled(local_user(),'sendzid')) || (strpos($match[1],'zrl')) ? true : false); + $is_zid = ((feature_enabled(local_channel(),'sendzid')) || (strpos($match[1],'zrl')) ? true : false); $replace = '<a' . $match[1] . ' href="' . (($is_zid) ? zid($match[2]) : $match[2]) . '"'; $x = str_replace($match[0],$replace,$match[0]); return $x; } function zidify_img_callback($match) { - $is_zid = ((feature_enabled(local_user(),'sendzid')) || (strpos($match[1],'zrl')) ? true : false); + $is_zid = ((feature_enabled(local_channel(),'sendzid')) || (strpos($match[1],'zrl')) ? true : false); $replace = '<img' . $match[1] . ' src="' . (($is_zid) ? zid($match[2]) : $match[2]) . '"'; $x = str_replace($match[0],$replace,$match[0]); @@ -1586,7 +1586,7 @@ function mimetype_select($channel_id, $current = 'text/bbcode') { if($r) { if(($r[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) || ($r[0]['channel_pageflags'] & PAGE_ALLOWCODE)) { - if(local_user() && get_account_id() == $r[0]['account_id']) + if(local_channel() && get_account_id() == $r[0]['account_id']) $x[] = 'application/x-php'; } } @@ -2304,7 +2304,7 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) { // access control. The link points to out own channel just so it doesn't look // weird - as all the other tags are linked to something. - if(local_user() && local_user() == $profile_uid) { + if(local_channel() && local_channel() == $profile_uid) { require_once('include/group.php'); $grp = group_byname($profile_uid,$name); diff --git a/include/widgets.php b/include/widgets.php index 9f9268055..2cedc8d9d 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -11,7 +11,7 @@ require_once('include/contact_widgets.php'); function widget_profile($args) { $a = get_app(); - $block = (((get_config('system', 'block_public')) && (! local_user()) && (! remote_user())) ? true : false); + $block = (((get_config('system', 'block_public')) && (! local_channel()) && (! remote_user())) ? true : false); return profile_sidebar($a->profile, $block, true); } @@ -90,7 +90,7 @@ function widget_appselect($arr) { return replace_macros(get_markup_template('app_select.tpl'),array( '$title' => t('Apps'), '$system' => t('System'), - '$authed' => ((local_user()) ? true : false), + '$authed' => ((local_channel()) ? true : false), '$personal' => t('Personal'), '$new' => t('Create Personal App'), '$edit' => t('Edit Personal App') @@ -100,12 +100,12 @@ function widget_appselect($arr) { function widget_suggestions($arr) { - if((! local_user()) || (! feature_enabled(local_user(),'suggest'))) + if((! local_channel()) || (! feature_enabled(local_channel(),'suggest'))) return ''; require_once('include/socgraph.php'); - $r = suggestion_query(local_user(),get_observer_hash(),0,20); + $r = suggestion_query(local_channel(),get_observer_hash(),0,20); if(! $r) { return; @@ -150,7 +150,7 @@ function widget_suggestions($arr) { function widget_follow($args) { - if(! local_user()) + if(! local_channel()) return ''; $a = get_app(); @@ -179,12 +179,12 @@ function widget_follow($args) { function widget_notes($arr) { - if(! local_user()) + if(! local_channel()) return ''; - if(! feature_enabled(local_user(),'private_notes')) + if(! feature_enabled(local_channel(),'private_notes')) return ''; - $text = get_pconfig(local_user(),'notes','text'); + $text = get_pconfig(local_channel(),'notes','text'); $o = replace_macros(get_markup_template('notes.tpl'), array( '$banner' => t('Notes'), @@ -197,7 +197,7 @@ function widget_notes($arr) { function widget_savedsearch($arr) { - if((! local_user()) || (! feature_enabled(local_user(),'savedsearch'))) + if((! local_channel()) || (! feature_enabled(local_channel(),'savedsearch'))) return ''; $a = get_app(); @@ -206,13 +206,13 @@ function widget_savedsearch($arr) { if(x($_GET,'searchsave') && $search) { $r = q("select * from `term` where `uid` = %d and `type` = %d and `term` = '%s' limit 1", - intval(local_user()), + intval(local_channel()), intval(TERM_SAVEDSEARCH), dbesc($search) ); if(! $r) { q("insert into `term` ( `uid`,`type`,`term` ) values ( %d, %d, '%s') ", - intval(local_user()), + intval(local_channel()), intval(TERM_SAVEDSEARCH), dbesc($search) ); @@ -221,7 +221,7 @@ function widget_savedsearch($arr) { if(x($_GET,'searchremove') && $search) { q("delete from `term` where `uid` = %d and `type` = %d and `term` = '%s'", - intval(local_user()), + intval(local_channel()), intval(TERM_SAVEDSEARCH), dbesc($search) ); @@ -246,7 +246,7 @@ function widget_savedsearch($arr) { $o = ''; $r = q("select `tid`,`term` from `term` WHERE `uid` = %d and `type` = %d ", - intval(local_user()), + intval(local_channel()), intval(TERM_SAVEDSEARCH) ); @@ -280,7 +280,7 @@ function widget_savedsearch($arr) { function widget_filer($arr) { - if(! local_user()) + if(! local_channel()) return ''; $a = get_app(); @@ -289,7 +289,7 @@ function widget_filer($arr) { $terms = array(); $r = q("select distinct(term) from term where uid = %d and type = %d order by term asc", - intval(local_user()), + intval(local_channel()), intval(TERM_FILE) ); if(! $r) @@ -362,7 +362,7 @@ function widget_fullprofile($arr) { if(! $a->profile['profile_uid']) return; - $block = (((get_config('system', 'block_public')) && (! local_user()) && (! remote_user())) ? true : false); + $block = (((get_config('system', 'block_public')) && (! local_channel()) && (! remote_user())) ? true : false); return profile_sidebar($a->profile, $block); } @@ -412,13 +412,13 @@ function widget_catcloud_wall($arr) { function widget_affinity($arr) { - if(! local_user()) + if(! local_channel()) return ''; $cmin = ((x($_REQUEST,'cmin')) ? intval($_REQUEST['cmin']) : 0); $cmax = ((x($_REQUEST,'cmax')) ? intval($_REQUEST['cmax']) : 99); - if(feature_enabled(local_user(),'affinity')) { + if(feature_enabled(local_channel(),'affinity')) { $tpl = get_markup_template('main_slider.tpl'); $x = replace_macros($tpl,array( '$val' => $cmin . ',' . $cmax, @@ -442,7 +442,7 @@ function widget_affinity($arr) { function widget_settings_menu($arr) { - if(! local_user()) + if(! local_channel()) return; $a = get_app(); @@ -452,10 +452,10 @@ function widget_settings_menu($arr) { // Retrieve the 'self' address book entry for use in the auto-permissions link - $role = get_pconfig(local_user(),'system','permissions_role'); + $role = get_pconfig(local_channel(),'system','permissions_role'); $abk = q("select abook_id from abook where abook_channel = %d and ( abook_flags & %d )>0 limit 1", - intval(local_user()), + intval(local_channel()), intval(ABOOK_FLAG_SELF) ); if($abk) @@ -514,7 +514,7 @@ function widget_settings_menu($arr) { ); } - if(feature_enabled(local_user(),'premium_channel')) { + if(feature_enabled(local_channel(),'premium_channel')) { $tabs[] = array( 'label' => t('Premium Channel Settings'), 'url' => $a->get_baseurl(true) . '/connect/' . $channel['channel_address'], @@ -522,7 +522,7 @@ function widget_settings_menu($arr) { ); } - if(feature_enabled(local_user(),'channel_sources')) { + if(feature_enabled(local_channel(),'channel_sources')) { $tabs[] = array( 'label' => t('Channel Sources'), 'url' => $a->get_baseurl(true) . '/sources', @@ -540,7 +540,7 @@ function widget_settings_menu($arr) { function widget_mailmenu($arr) { - if (! local_user()) + if (! local_channel()) return; $a = get_app(); @@ -564,13 +564,13 @@ function widget_design_tools($arr) { $a = get_app(); // mod menu doesn't load a profile. For any modules which load a profile, check it. - // otherwise local_user() is sufficient for permissions. + // otherwise local_channel() is sufficient for permissions. if($a->profile['profile_uid']) - if(($a->profile['profile_uid'] != local_user()) && (! $a->is_sys)) + if(($a->profile['profile_uid'] != local_channel()) && (! $a->is_sys)) return ''; - if(! local_user()) + if(! local_channel()) return ''; return design_tools(); diff --git a/include/zot.php b/include/zot.php index 33ac16abf..f3933d030 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2438,7 +2438,7 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) { logger('packet: ' . print_r($packet,true),LOGGER_DATA); if(! $uid) - $uid = local_user(); + $uid = local_channel(); if(! $uid) return; @@ -107,7 +107,7 @@ if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) { if((x($_GET,'zid')) && (! $a->install)) { $a->query_string = strip_zids($a->query_string); - if(! local_user()) { + if(! local_channel()) { $_SESSION['my_address'] = $_GET['zid']; zid_init($a); } @@ -377,7 +377,7 @@ if($a->module_loaded) { if(x($_SESSION,'visitor_home')) $homebase = $_SESSION['visitor_home']; -elseif(local_user()) +elseif(local_channel()) $homebase = $a->get_baseurl() . '/channel/' . $a->channel['channel_address']; if(isset($homebase)) diff --git a/mod/acl.php b/mod/acl.php index 8eff93a9a..5a048ddee 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -24,7 +24,7 @@ function acl_init(&$a){ $search = $_REQUEST['query']; } - if(!(local_user())) + if(!(local_channel())) if(!($type == 'x' || $type == 'c')) killme(); @@ -58,7 +58,7 @@ function acl_init(&$a){ ORDER BY `groups`.`name` LIMIT %d OFFSET %d", db_concat('group_member.xchan', ','), - intval(local_user()), + intval(local_channel()), intval($count), intval($start) ); @@ -88,14 +88,14 @@ function acl_init(&$a){ $extra_channels_sql = substr($extra_channels_sql,1); // Remove initial comma // Getting info from the abook is better for local users because it contains info about permissions - if(local_user()) { + if(local_channel()) { if($extra_channels_sql != '') $extra_channels_sql = " OR (abook_channel IN ($extra_channels_sql)) and not (abook_flags & ". intval(ABOOK_FLAG_HIDDEN) . ') > 0'; $r = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms, abook_flags FROM abook left join xchan on abook_xchan = xchan_hash WHERE (abook_channel = %d $extra_channels_sql) AND not ( abook_flags & %d )>0 and not (xchan_flags & %d )>0 $sql_extra2 order by $order_extra2 xchan_name asc" , - intval(local_user()), + intval(local_channel()), intval(ABOOK_FLAG_BLOCKED|ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVED), intval(XCHAN_FLAGS_DELETED) ); @@ -147,7 +147,7 @@ function acl_init(&$a){ }); } } - if(intval(get_config('system','taganyone')) || intval(get_pconfig(local_user(),'system','taganyone'))) { + if(intval(get_config('system','taganyone')) || intval(get_pconfig(local_channel(),'system','taganyone'))) { if((! $r) && $type == 'c') { $r = q("SELECT substr(xchan_hash,1,18) as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, 0 as abook_their_perms, 0 as abook_flags FROM xchan @@ -165,7 +165,7 @@ function acl_init(&$a){ and not (xchan_flags & %d)>0 $sql_extra3 ORDER BY `xchan_name` ASC ", - intval(local_user()), + intval(local_channel()), intval(PERMS_W_MAIL), intval(XCHAN_FLAGS_DELETED) ); @@ -177,7 +177,7 @@ function acl_init(&$a){ and not (xchan_flags & %d)>0 $sql_extra3 ORDER BY xchan_name ASC ", - intval(local_user()), + intval(local_channel()), intval(XCHAN_FLAGS_DELETED) ); @@ -263,7 +263,7 @@ function navbar_complete(&$a) { // logger('navbar_complete'); - if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { + if((get_config('system','block_public')) && (! local_channel()) && (! remote_user())) { return; } diff --git a/mod/admin.php b/mod/admin.php index 1503bf18e..3efa533c1 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -289,7 +289,7 @@ function admin_page_site_post(&$a){ } else { require_once('include/text.php'); - linkify_tags($a, $admininfo, local_user()); + linkify_tags($a, $admininfo, local_channel()); set_config('system','admininfo', $admininfo); } set_config('system','language', $language); diff --git a/mod/api.php b/mod/api.php index 4fa911f14..08978ee96 100644 --- a/mod/api.php +++ b/mod/api.php @@ -22,12 +22,12 @@ function oauth_get_client($request){ function api_post(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } - if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != local_user()) { + if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != local_channel()) { notice( t('Permission denied.') . EOL); return; } @@ -57,8 +57,8 @@ function api_content(&$a) { if (is_null($app)) return "Invalid request. Unknown token."; $consumer = new OAuthConsumer($app['client_id'], $app['pw'], $app['redirect_uri']); - $verifier = md5($app['secret'].local_user()); - set_config("oauth", $verifier, local_user()); + $verifier = md5($app['secret'].local_channel()); + set_config("oauth", $verifier, local_channel()); if ($consumer->callback_url!=null) { @@ -84,7 +84,7 @@ function api_content(&$a) { } - if(! local_user()) { + if(! local_channel()) { //TODO: we need login form to redirect to this page notice( t('Please login to continue.') . EOL ); return login(false,'api-login',$request->get_parameters()); diff --git a/mod/appman.php b/mod/appman.php index f0a3c8a70..db22df883 100644 --- a/mod/appman.php +++ b/mod/appman.php @@ -4,7 +4,7 @@ require_once('include/apps.php'); function appman_post(&$a) { - if(! local_user()) + if(! local_channel()) return; if($_POST['url']) { @@ -22,9 +22,9 @@ function appman_post(&$a) { 'sig' => escape_tags($_REQUEST['sig']) ); - $_REQUEST['appid'] = app_install(local_user(),$arr); + $_REQUEST['appid'] = app_install(local_channel(),$arr); - if(app_installed(local_user(),$arr)) + if(app_installed(local_channel(),$arr)) info( t('App installed.') . EOL); return; @@ -39,13 +39,13 @@ function appman_post(&$a) { } if($_POST['install']) { - app_install(local_user(),$papp); - if(app_installed(local_user(),$papp)) + app_install(local_channel(),$papp); + if(app_installed(local_channel(),$papp)) info( t('App installed.') . EOL); } if($_POST['delete']) { - app_destroy(local_user(),$papp); + app_destroy(local_channel(),$papp); } if($_POST['edit']) { @@ -62,7 +62,7 @@ function appman_post(&$a) { function appman_content(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } @@ -73,7 +73,7 @@ function appman_content(&$a) { if($_REQUEST['appid']) { $r = q("select * from app where app_id = '%s' and app_channel = %d limit 1", dbesc($_REQUEST['appid']), - dbesc(local_user()) + dbesc(local_channel()) ); if($r) $app = $r[0]; diff --git a/mod/apps.php b/mod/apps.php index 8c9706d2f..be9b54307 100644 --- a/mod/apps.php +++ b/mod/apps.php @@ -13,8 +13,8 @@ function apps_content(&$a) { $syslist = get_system_apps(); - if(local_user()) { - $list = app_list(local_user()); + if(local_channel()) { + $list = app_list(local_channel()); if($list) { foreach($list as $x) { $syslist[] = app_encode($x); diff --git a/mod/authtest.php b/mod/authtest.php index b6d940db2..6ef6c22ad 100644 --- a/mod/authtest.php +++ b/mod/authtest.php @@ -9,7 +9,7 @@ function authtest_content(&$a) { $auth_success = false; $o .= '<h3>Magic-Auth Diagnostic</h3>'; - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return $o; } diff --git a/mod/blocks.php b/mod/blocks.php index 6237a645b..f755f92b0 100644 --- a/mod/blocks.php +++ b/mod/blocks.php @@ -33,7 +33,7 @@ function blocks_content(&$a) { $which = argv(1); - $uid = local_user(); + $uid = local_channel(); $owner = 0; $channel = null; $observer = $a->get_observer(); diff --git a/mod/bookmarks.php b/mod/bookmarks.php index 6b2476a8e..a5b9c473f 100644 --- a/mod/bookmarks.php +++ b/mod/bookmarks.php @@ -1,7 +1,7 @@ <?php function bookmarks_init(&$a) { - if(! local_user()) + if(! local_channel()) return; $item_id = intval($_REQUEST['item']); if(! $item_id) @@ -11,7 +11,7 @@ function bookmarks_init(&$a) { $i = q("select * from item where id = %d and uid = %d limit 1", intval($item_id), - intval(local_user()) + intval(local_channel()) ); if(! $i) @@ -42,7 +42,7 @@ function bookmarks_init(&$a) { } function bookmarks_content(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } @@ -59,11 +59,11 @@ function bookmarks_content(&$a) { $o .= '<h3>' . t('My Bookmarks') . '</h3>'; - $x = menu_list(local_user(),'',MENU_BOOKMARK); + $x = menu_list(local_channel(),'',MENU_BOOKMARK); if($x) { foreach($x as $xx) { - $y = menu_fetch($xx['menu_name'],local_user(),get_observer_hash()); + $y = menu_fetch($xx['menu_name'],local_channel(),get_observer_hash()); $o .= menu_render($y,'',true); } } @@ -71,11 +71,11 @@ function bookmarks_content(&$a) { $o .= '<h3>' . t('My Connections Bookmarks') . '</h3>'; - $x = menu_list(local_user(),'',MENU_SYSTEM|MENU_BOOKMARK); + $x = menu_list(local_channel(),'',MENU_SYSTEM|MENU_BOOKMARK); if($x) { foreach($x as $xx) { - $y = menu_fetch($xx['menu_name'],local_user(),get_observer_hash()); + $y = menu_fetch($xx['menu_name'],local_channel(),get_observer_hash()); $o .= menu_render($y,'',true); } } diff --git a/mod/channel.php b/mod/channel.php index c8ac83baf..493730e8a 100644 --- a/mod/channel.php +++ b/mod/channel.php @@ -15,7 +15,7 @@ function channel_init(&$a) { if(argc() > 1) $which = argv(1); if(! $which) { - if(local_user()) { + if(local_channel()) { $channel = $a->get_channel(); if($channel && $channel['channel_address']) $which = $channel['channel_address']; @@ -29,7 +29,7 @@ function channel_init(&$a) { $profile = 0; $channel = $a->get_channel(); - if((local_user()) && (argc() > 2) && (argv(2) === 'view')) { + if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) { $which = $channel['channel_address']; $profile = argv(1); } @@ -68,12 +68,12 @@ function channel_content(&$a, $update = 0, $load = false) { $a->profile['profile_uid'] = $a->profile_uid = $update; } else { - if($a->profile['profile_uid'] == local_user()) { + if($a->profile['profile_uid'] == local_channel()) { nav_set_selected('home'); } } - $is_owner = (((local_user()) && ($a->profile['profile_uid'] == local_user())) ? true : false); + $is_owner = (((local_channel()) && ($a->profile['profile_uid'] == local_channel())) ? true : false); $channel = $a->get_channel(); $observer = $a->get_observer(); @@ -185,7 +185,7 @@ function channel_content(&$a, $update = 0, $load = false) { $sql_extra2 .= protect_sprintf(sprintf(" AND item.created >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery2)))); } - $itemspage = get_pconfig(local_user(),'system','itemspage'); + $itemspage = get_pconfig(local_channel(),'system','itemspage'); $a->set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20)); $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval($a->pager['itemspage']), intval($a->pager['start'])); @@ -322,7 +322,7 @@ function channel_content(&$a, $update = 0, $load = false) { intval(ITEM_UNSEEN), intval(ITEM_UNSEEN), intval(ITEM_WALL), - intval(local_user()) + intval(local_channel()) ); } diff --git a/mod/chanview.php b/mod/chanview.php index 3bf0f3268..0cbcb2e57 100644 --- a/mod/chanview.php +++ b/mod/chanview.php @@ -20,11 +20,11 @@ function chanview_content(&$a) { dbesc($_REQUEST['address']) ); } - elseif(local_user() && intval($_REQUEST['cid'])) { + elseif(local_channel() && intval($_REQUEST['cid'])) { $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d and abook_id = %d LIMIT 1", - intval(local_user()), + intval(local_channel()), intval($_REQUEST['cid']) ); } @@ -90,7 +90,7 @@ function chanview_content(&$a) { // let somebody over-ride the iframed viewport presentation // or let's just declare this a failed experiment. -// if((! local_user()) || (get_pconfig(local_user(),'system','chanview_full'))) +// if((! local_channel()) || (get_pconfig(local_channel(),'system','chanview_full'))) goaway($url); diff --git a/mod/chat.php b/mod/chat.php index e2428f1f7..c54d29313 100644 --- a/mod/chat.php +++ b/mod/chat.php @@ -9,7 +9,7 @@ function chat_init(&$a) { if(argc() > 1) $which = argv(1); if(! $which) { - if(local_user()) { + if(local_channel()) { $channel = $a->get_channel(); if($channel && $channel['channel_address']) $which = $channel['channel_address']; @@ -23,7 +23,7 @@ function chat_init(&$a) { $profile = 0; $channel = $a->get_channel(); - if((local_user()) && (argc() > 2) && (argv(2) === 'view')) { + if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) { $which = $channel['channel_address']; $profile = argv(1); } @@ -42,7 +42,7 @@ function chat_post(&$a) { if($_POST['room_name']) $room = strip_tags(trim($_POST['room_name'])); - if((! $room) || (! local_user())) + if((! $room) || (! local_channel())) return; $channel = $a->get_channel(); @@ -65,7 +65,7 @@ function chat_post(&$a) { $x = q("select cr_id from chatroom where cr_name = '%s' and cr_uid = %d limit 1", dbesc($room), - intval(local_user()) + intval(local_channel()) ); if($x) @@ -81,7 +81,7 @@ function chat_post(&$a) { function chat_content(&$a) { - if(local_user()) + if(local_channel()) $channel = $a->get_channel(); $ob = $a->get_observer(); @@ -169,7 +169,7 @@ function chat_content(&$a) { } $o = replace_macros(get_markup_template('chat.tpl'),array( - '$is_owner' => ((local_user() && local_user() == $x[0]['cr_uid']) ? true : false), + '$is_owner' => ((local_channel() && local_channel() == $x[0]['cr_uid']) ? true : false), '$room_name' => $room_name, '$room_id' => $room_id, '$baseurl' => z_root(), @@ -190,7 +190,7 @@ function chat_content(&$a) { - if(local_user() && argc() > 2 && argv(2) === 'new') { + if(local_channel() && argc() > 2 && argv(2) === 'new') { @@ -217,7 +217,7 @@ function chat_content(&$a) { require_once('include/conversation.php'); - $o = profile_tabs($a,((local_user() && local_user() == $a->profile['profile_uid']) ? true : false),$a->profile['channel_address']); + $o = profile_tabs($a,((local_channel() && local_channel() == $a->profile['profile_uid']) ? true : false),$a->profile['channel_address']); require_once('include/widgets.php'); @@ -227,7 +227,7 @@ function chat_content(&$a) { '$nickname' => $channel['channel_address'], '$rooms' => widget_chatroom_list(array()), '$newroom' => t('New Chatroom'), - '$is_owner' => ((local_user() && local_user() == $a->profile['profile_uid']) ? 1 : 0) + '$is_owner' => ((local_channel() && local_channel() == $a->profile['profile_uid']) ? 1 : 0) )); return $o; diff --git a/mod/cloud.php b/mod/cloud.php index ad85eba34..b36e6c482 100644 --- a/mod/cloud.php +++ b/mod/cloud.php @@ -58,7 +58,7 @@ function cloud_init(&$a) { $ob_hash = get_observer_hash(); if ($ob_hash) { - if (local_user()) { + if (local_channel()) { $channel = $a->get_channel(); $auth->setCurrentUser($channel['channel_address']); $auth->channel_id = $channel['channel_id']; diff --git a/mod/connect.php b/mod/connect.php index 396fca645..c36aef433 100644 --- a/mod/connect.php +++ b/mod/connect.php @@ -30,7 +30,7 @@ function connect_post(&$a) { if(! array_key_exists('channel', $a->data)) return; - $edit = ((local_user() && (local_user() == $a->data['channel']['channel_id'])) ? true : false); + $edit = ((local_channel() && (local_channel() == $a->data['channel']['channel_id'])) ? true : false); if($edit) { $has_premium = (($a->data['channel']['channel_pageflags'] & PAGE_PREMIUM) ? 1 : 0); @@ -41,7 +41,7 @@ function connect_post(&$a) { $r = q("update channel set channel_pageflags = ( channel_pageflags %s %d ) where channel_id = %d", db_getfunc('^'), intval(PAGE_PREMIUM), - intval(local_user()) + intval(local_channel()) ); proc_run('php','include/notifier.php','refresh_all',$a->data['channel']['channel_id']); } @@ -75,7 +75,7 @@ function connect_post(&$a) { function connect_content(&$a) { - $edit = ((local_user() && (local_user() == $a->data['channel']['channel_id'])) ? true : false); + $edit = ((local_channel() && (local_channel() == $a->data['channel']['channel_id'])) ? true : false); $text = get_pconfig($a->data['channel']['channel_id'],'system','selltext'); diff --git a/mod/connections.php b/mod/connections.php index d36734ccb..469d3a62f 100644 --- a/mod/connections.php +++ b/mod/connections.php @@ -10,7 +10,7 @@ require_once('include/widgets.php'); function connections_init(&$a) { - if(! local_user()) + if(! local_channel()) return; $channel = $a->get_channel(); @@ -21,7 +21,7 @@ function connections_init(&$a) { function connections_post(&$a) { - if(! local_user()) + if(! local_channel()) return; $contact_id = intval(argv(1)); @@ -30,7 +30,7 @@ function connections_post(&$a) { $orig_record = q("SELECT * FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1", intval($contact_id), - intval(local_user()) + intval(local_channel()) ); if(! $orig_record) { @@ -45,7 +45,7 @@ function connections_post(&$a) { if($profile_id) { $r = q("SELECT profile_guid FROM profile WHERE profile_guid = '%s' AND `uid` = %d LIMIT 1", dbesc($profile_id), - intval(local_user()) + intval(local_channel()) ); if(! count($r)) { notice( t('Could not locate selected profile.') . EOL); @@ -87,7 +87,7 @@ function connections_post(&$a) { intval($closeness), intval($abook_flags), intval($contact_id), - intval(local_user()) + intval(local_channel()) ); if($r) @@ -105,9 +105,9 @@ function connections_post(&$a) { $default_group = $channel['channel_default_group']; if($default_group) { require_once('include/group.php'); - $g = group_rec_byhash(local_user(),$default_group); + $g = group_rec_byhash(local_channel(),$default_group); if($g) - group_add_member(local_user(),'',$a->data['abook_xchan'],$g['id']); + group_add_member(local_channel(),'',$a->data['abook_xchan'],$g['id']); } @@ -127,7 +127,7 @@ function connections_post(&$a) { $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d and abook_id = %d LIMIT 1", - intval(local_user()), + intval(local_channel()), intval($contact_id) ); if($r) { @@ -135,7 +135,7 @@ function connections_post(&$a) { } if($new_friend) { - $arr = array('channel_id' => local_user(), 'abook' => $a->data['abook']); + $arr = array('channel_id' => local_channel(), 'abook' => $a->data['abook']); call_hooks('accept_follow', $arr); } @@ -155,7 +155,7 @@ function connections_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_channel */, array('abook' => array($clone))); } @@ -165,7 +165,7 @@ function connections_content(&$a) { $o = ''; - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return login(); } @@ -215,7 +215,7 @@ function connections_content(&$a) { break; case 'ifpending': $r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d)>0 and not ((abook_flags & %d)>0 or (xchan_flags & %d)>0)", - intval(local_user()), + intval(local_channel()), intval(ABOOK_FLAG_PENDING), intval(ABOOK_FLAG_SELF|ABOOK_FLAG_IGNORED), intval(XCHAN_FLAGS_DELETED|XCHAN_FLAGS_ORPHAN) @@ -339,12 +339,12 @@ function connections_content(&$a) { $sql_extra .= (($searching) ? protect_sprintf(" AND xchan_name like '%$search_txt%' ") : ""); if($_REQUEST['gid']) { - $sql_extra .= " and xchan_hash in ( select xchan from group_member where gid = " . intval($_REQUEST['gid']) . " and uid = " . intval(local_user()) . " ) "; + $sql_extra .= " and xchan_hash in ( select xchan from group_member where gid = " . intval($_REQUEST['gid']) . " and uid = " . intval(local_channel()) . " ) "; } $r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and not (abook_flags & %d)>0 and not (xchan_flags & %d )>0 $sql_extra $sql_extra2 ", - intval(local_user()), + intval(local_channel()), intval(ABOOK_FLAG_SELF), intval(XCHAN_FLAGS_DELETED|XCHAN_FLAGS_ORPHAN) ); @@ -355,7 +355,7 @@ function connections_content(&$a) { $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash WHERE abook_channel = %d and not (abook_flags & %d)>0 and not ( xchan_flags & %d)>0 $sql_extra $sql_extra2 ORDER BY xchan_name LIMIT %d OFFSET %d ", - intval(local_user()), + intval(local_channel()), intval(ABOOK_FLAG_SELF), intval(XCHAN_FLAGS_DELETED|XCHAN_FLAGS_ORPHAN), intval($a->pager['itemspage']), diff --git a/mod/connedit.php b/mod/connedit.php index 8270fa981..c082e03a8 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -21,14 +21,14 @@ require_once('include/widgets.php'); function connedit_init(&$a) { - if(! local_user()) + if(! local_channel()) return; if((argc() >= 2) && intval(argv(1))) { $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d and abook_id = %d LIMIT 1", - intval(local_user()), + intval(local_channel()), intval(argv(1)) ); if($r) { @@ -48,7 +48,7 @@ function connedit_init(&$a) { function connedit_post(&$a) { - if(! local_user()) + if(! local_channel()) return; $contact_id = intval(argv(1)); @@ -66,7 +66,7 @@ function connedit_post(&$a) { $orig_record = q("SELECT * FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1", intval($contact_id), - intval(local_user()) + intval(local_channel()) ); if(! $orig_record) { @@ -89,7 +89,7 @@ function connedit_post(&$a) { if($profile_id) { $r = q("SELECT profile_guid FROM profile WHERE profile_guid = '%s' AND `uid` = %d LIMIT 1", dbesc($profile_id), - intval(local_user()) + intval(local_channel()) ); if(! count($r)) { notice( t('Could not locate selected profile.') . EOL); @@ -143,7 +143,7 @@ function connedit_post(&$a) { dbesc($rating_text), intval($abook_flags), intval($contact_id), - intval(local_user()) + intval(local_channel()) ); if($orig_record[0]['abook_profile'] != $profile_id) { @@ -171,9 +171,9 @@ function connedit_post(&$a) { $default_group = $channel['channel_default_group']; if($default_group) { require_once('include/group.php'); - $g = group_rec_byhash(local_user(),$default_group); + $g = group_rec_byhash(local_channel(),$default_group); if($g) - group_add_member(local_user(),'',$a->poi['abook_xchan'],$g['id']); + group_add_member(local_channel(),'',$a->poi['abook_xchan'],$g['id']); } // Check if settings permit ("post new friend activity" is allowed, and @@ -225,7 +225,7 @@ function connedit_post(&$a) { $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d and abook_id = %d LIMIT 1", - intval(local_user()), + intval(local_channel()), intval($contact_id) ); if($r) { @@ -233,12 +233,12 @@ function connedit_post(&$a) { } if($new_friend) { - $arr = array('channel_id' => local_user(), 'abook' => $a->poi); + $arr = array('channel_id' => local_channel(), 'abook' => $a->poi); call_hooks('accept_follow', $arr); } if(! is_null($autoperms)) - set_pconfig(local_user(),'system','autoperms',(($autoperms) ? $abook_my_perms : 0)); + set_pconfig(local_channel(),'system','autoperms',(($autoperms) ? $abook_my_perms : 0)); connedit_clone($a); @@ -261,7 +261,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_channel */, array('abook' => array($clone))); } /* @brief Generate content of connection edit page @@ -274,13 +274,13 @@ function connedit_content(&$a) { $sort_type = 0; $o = ''; - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return login(); } - $my_perms = get_channel_default_perms(local_user()); - $role = get_pconfig(local_user(),'system','permissions_role'); + $my_perms = get_channel_default_perms(local_channel()); + $role = get_pconfig(local_channel(),'system','permissions_role'); if($role) { $x = get_role_perms($role); if($x['perms_accept']) @@ -313,7 +313,7 @@ function connedit_content(&$a) { $orig_record = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_id = %d AND abook_channel = %d AND NOT ( abook_flags & %d )>0 LIMIT 1", intval($contact_id), - intval(local_user()), + intval(local_channel()), intval(ABOOK_FLAG_SELF) ); @@ -412,8 +412,8 @@ function connedit_content(&$a) { // in the background there could be a race condition preventing this packet from being sent in all cases. // PLACEHOLDER - contact_remove(local_user(), $orig_record[0]['abook_id']); - build_sync_packet(0 /* use the current local_user */, + contact_remove(local_channel(), $orig_record[0]['abook_id']); + build_sync_packet(0 /* use the current local_channel */, array('abook' => array(array( 'abook_xchan' => $orig_record[0]['abook_xchan'], 'entry_deleted' => true)) @@ -512,7 +512,7 @@ function connedit_content(&$a) { $tpl = get_markup_template("abook_edit.tpl"); - if(feature_enabled(local_user(),'affinity')) { + if(feature_enabled(local_channel(),'affinity')) { $slider_tpl = get_markup_template('contact_slider.tpl'); $slide = replace_macros($slider_tpl,array( @@ -547,7 +547,7 @@ function connedit_content(&$a) { $channel = $a->get_channel(); $global_perms = get_perms(); - $existing = get_all_perms(local_user(),$contact['abook_xchan']); + $existing = get_all_perms(local_channel(),$contact['abook_xchan']); $unapproved = array('pending', t('Approve this connection'), '', t('Accept connection to allow communication')); @@ -566,7 +566,7 @@ function connedit_content(&$a) { $o .= replace_macros($tpl,array( '$header' => (($self) ? t('Connection Default Permissions') : sprintf( t('Connections: settings for %s'),$contact['xchan_name'])), - '$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_user(),'system','autoperms')) ? 1 : 0), ''), + '$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), ''), '$addr' => $contact['xchan_addr'], '$notself' => (($self) ? '' : '1'), '$self' => (($self) ? '1' : ''), @@ -611,7 +611,7 @@ function connedit_content(&$a) { '$permnote' => t('Some permissions may be inherited from your channel <a href="settings">privacy settings</a>, which have higher priority than individual settings. Changing those inherited settings on this page will have no effect.'), '$advanced' => t('Advanced Permissions'), '$quick' => t('Simple Permissions (select one and submit)'), - '$common_link' => $a->get_baseurl(true) . '/common/loc/' . local_user() . '/' . $contact['id'], + '$common_link' => $a->get_baseurl(true) . '/common/loc/' . local_channel() . '/' . $contact['id'], '$all_friends' => $all_friends, '$relation_text' => $relation_text, '$visit' => sprintf( t('Visit %s\'s profile - %s'),$contact['xchan_name'],$contact['xchan_url']), @@ -630,7 +630,7 @@ function connedit_content(&$a) { '$last_update' => relative_date($contact['abook_connected']), '$udnow' => t('Update now'), '$profile_select' => contact_profile_assign($contact['abook_profile']), - '$multiprofs' => feature_enabled(local_user(),'multi_profiles'), + '$multiprofs' => feature_enabled(local_channel(),'multi_profiles'), '$contact_id' => $contact['abook_id'], '$block_text' => (($contact['blocked']) ? t('Unblock') : t('Block') ), '$ignore_text' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ), diff --git a/mod/contactgroup.php b/mod/contactgroup.php index 4515c4c4c..6138f9e19 100644 --- a/mod/contactgroup.php +++ b/mod/contactgroup.php @@ -4,14 +4,14 @@ require_once('include/group.php'); function contactgroup_content(&$a) { - if(! local_user()) { + if(! local_channel()) { killme(); } if((argc() > 2) && (intval(argv(1))) && (argv(2))) { $r = q("SELECT abook_xchan from abook where abook_xchan = '%s' and abook_channel = %d and not ( abook_flags & %d )>0 limit 1", dbesc(base64url_decode(argv(2))), - intval(local_user()), + intval(local_channel()), intval(ABOOK_FLAG_SELF) ); if($r) @@ -22,7 +22,7 @@ function contactgroup_content(&$a) { $r = q("SELECT * FROM `groups` WHERE `id` = %d AND `uid` = %d AND `deleted` = 0 LIMIT 1", intval(argv(1)), - intval(local_user()) + intval(local_channel()) ); if(! $r) { killme(); @@ -38,10 +38,10 @@ function contactgroup_content(&$a) { if($change) { if(in_array($change,$preselected)) { - group_rmv_member(local_user(),$group['name'],$change); + group_rmv_member(local_channel(),$group['name'],$change); } else { - group_add_member(local_user(),$group['name'],$change); + group_add_member(local_channel(),$group['name'],$change); } } } diff --git a/mod/dav.php b/mod/dav.php index e3719cb93..f7f89b6da 100644 --- a/mod/dav.php +++ b/mod/dav.php @@ -59,7 +59,7 @@ function dav_init(&$a) { $ob_hash = get_observer_hash(); if ($ob_hash) { - if (local_user()) { + if (local_channel()) { $channel = $a->get_channel(); $auth->setCurrentUser($channel['channel_address']); $auth->channel_id = $channel['channel_id']; diff --git a/mod/delegate.php b/mod/delegate.php index c78898b7f..cc399b6e5 100644 --- a/mod/delegate.php +++ b/mod/delegate.php @@ -2,7 +2,7 @@ function delegate_content(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } @@ -22,13 +22,13 @@ function delegate_content(&$a) { ); if(count($r)) { $r = q("select id from contact where uid = %d and nurl = '%s' limit 1", - intval(local_user()), + intval(local_channel()), dbesc(normalise_link($a->get_baseurl() . '/channel/' . $r[0]['nickname'])) ); if(count($r)) { q("insert into manage ( uid, mid ) values ( %d , %d ) ", intval($a->argv[2]), - intval(local_user()) + intval(local_channel()) ); } } @@ -44,7 +44,7 @@ function delegate_content(&$a) { q("delete from manage where uid = %d and mid = %d", intval($a->argv[2]), - intval(local_user()) + intval(local_channel()) ); goaway($a->get_baseurl() . '/delegate'); @@ -66,7 +66,7 @@ function delegate_content(&$a) { // find everybody that currently has delegated management to this account/page $r = q("select * from user where uid in ( select uid from manage where mid = %d ) ", - intval(local_user()) + intval(local_channel()) ); if(count($r)) @@ -87,7 +87,7 @@ function delegate_content(&$a) { $r = q("select nurl from contact where substring_index(contact.nurl,'/',3) = '%s' and contact.uid = %d and contact.self = 0 and network = '%s' ", dbesc(normalise_link($a->get_baseurl())), - intval(local_user()), + intval(local_channel()), dbesc(NETWORK_DFRN) ); diff --git a/mod/directory.php b/mod/directory.php index 2a07208a4..defa8db7e 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -10,7 +10,7 @@ function directory_init(&$a) { if(x($_GET,'ignore')) { q("insert into xign ( uid, xchan ) values ( %d, '%s' ) ", - intval(local_user()), + intval(local_channel()), dbesc($_GET['ignore']) ); } @@ -18,7 +18,7 @@ function directory_init(&$a) { function directory_content(&$a) { - if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { + if((get_config('system','block_public')) && (! local_channel()) && (! remote_user())) { notice( t('Public access denied.') . EOL); return; } @@ -51,17 +51,17 @@ function directory_content(&$a) { $search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : ''); - if(strpos($search,'=') && local_user() && get_pconfig(local_user(),'feature','expert')) + if(strpos($search,'=') && local_channel() && get_pconfig(local_channel(),'feature','expert')) $advanced = $search; $keywords = (($_GET['keywords']) ? $_GET['keywords'] : ''); // Suggest channels if no search terms or keywords are given - $suggest = (local_user() && x($_REQUEST,'suggest')) ? $_REQUEST['suggest'] : ''; + $suggest = (local_channel() && x($_REQUEST,'suggest')) ? $_REQUEST['suggest'] : ''; if($suggest) { - $r = suggestion_query(local_user(),get_observer_hash()); + $r = suggestion_query(local_channel(),get_observer_hash()); // Remember in which order the suggestions were $addresses = array(); @@ -96,9 +96,9 @@ function directory_content(&$a) { $contacts = array(); - if(local_user()) { + if(local_channel()) { $x = q("select abook_xchan from abook where abook_channel = %d", - intval(local_user()) + intval(local_channel()) ); if($x) { foreach($x as $xx) @@ -161,7 +161,7 @@ function directory_content(&$a) { $profile_link = chanlink_url($rr['url']); $pdesc = (($rr['description']) ? $rr['description'] . '<br />' : ''); - $connect_link = ((local_user()) ? z_root() . '/follow?f=&url=' . urlencode($rr['address']) : ''); + $connect_link = ((local_channel()) ? z_root() . '/follow?f=&url=' . urlencode($rr['address']) : ''); // Checking status is disabled ATM until someone checks the performance impact more carefully //$online = remote_online_status($rr['address']); @@ -219,9 +219,9 @@ function directory_content(&$a) { $karr = explode(' ', $keywords); if($karr) { - if(local_user()) { + if(local_channel()) { $r = q("select keywords from profile where uid = %d and is_default = 1 limit 1", - intval(local_user()) + intval(local_channel()) ); if($r) { $keywords = str_replace(',',' ', $r[0]['keywords']); diff --git a/mod/display.php b/mod/display.php index f14aca6da..943af4206 100644 --- a/mod/display.php +++ b/mod/display.php @@ -5,7 +5,7 @@ function display_content(&$a, $update = 0, $load = false) { // logger("mod-display: update = $update load = $load"); - if(intval(get_config('system','block_public')) && (! local_user()) && (! remote_user())) { + if(intval(get_config('system','block_public')) && (! local_channel()) && (! remote_user())) { notice( t('Public access denied.') . EOL); return; } @@ -36,7 +36,7 @@ function display_content(&$a, $update = 0, $load = false) { $observer_is_owner = false; - if(local_user() && (! $update)) { + if(local_channel() && (! $update)) { $channel = $a->get_channel(); @@ -58,7 +58,7 @@ function display_content(&$a, $update = 0, $load = false) { 'acl' => populate_acl($channel_acl), 'bang' => '', 'visitor' => true, - 'profile_uid' => local_user(), + 'profile_uid' => local_channel(), 'return_path' => 'channel/' . $channel['channel_address'] ); @@ -109,7 +109,7 @@ function display_content(&$a, $update = 0, $load = false) { $o .= '<div id="live-display"></div>' . "\r\n"; - $o .= "<script> var profile_uid = " . ((intval(local_user())) ? local_user() : (-1)) + $o .= "<script> var profile_uid = " . ((intval(local_channel())) ? local_channel() : (-1)) . "; var netargs = '?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; $a->page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array( @@ -160,13 +160,13 @@ function display_content(&$a, $update = 0, $load = false) { $sys = get_sys_channel(); $sysid = $sys['channel_id']; - if(local_user()) { + if(local_channel()) { $r = q("SELECT * from item WHERE item_restrict = 0 and uid = %d and mid = '%s' limit 1", - intval(local_user()), + intval(local_channel()), dbesc($target_item['parent_mid']) ); if($r) { @@ -235,7 +235,7 @@ function display_content(&$a, $update = 0, $load = false) { WHERE (item_flags & %d)>0 AND uid = %d and parent = %d ", intval(ITEM_UNSEEN), intval(ITEM_UNSEEN), - intval(local_user()), + intval(local_channel()), intval($r[0]['parent']) ); } diff --git a/mod/editblock.php b/mod/editblock.php index 6ec840af7..46126f94e 100644 --- a/mod/editblock.php +++ b/mod/editblock.php @@ -33,7 +33,7 @@ function editblock_content(&$a) { $which = argv(1); - $uid = local_user(); + $uid = local_channel(); $owner = 0; $channel = null; $observer = $a->get_observer(); diff --git a/mod/editlayout.php b/mod/editlayout.php index d76aa484d..847a64320 100644 --- a/mod/editlayout.php +++ b/mod/editlayout.php @@ -32,7 +32,7 @@ function editlayout_content(&$a) { $which = argv(1); - $uid = local_user(); + $uid = local_channel(); $owner = 0; $channel = null; $observer = $a->get_observer(); diff --git a/mod/editpost.php b/mod/editpost.php index dfbc8766e..1d9855c95 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -9,7 +9,7 @@ function editpost_content(&$a) { $o = ''; - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } @@ -23,7 +23,7 @@ function editpost_content(&$a) { $itm = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d and author_xchan = '%s' LIMIT 1", intval($post_id), - intval(local_user()), + intval(local_channel()), dbesc(get_observer_hash()) ); @@ -33,7 +33,7 @@ function editpost_content(&$a) { } $plaintext = true; -// if(feature_enabled(local_user(),'richtext')) +// if(feature_enabled(local_channel(),'richtext')) // $plaintext = false; $channel = $a->get_channel(); @@ -77,7 +77,7 @@ function editpost_content(&$a) { $category = ''; - $catsenabled = ((feature_enabled(local_user(),'categories')) ? 'categories' : ''); + $catsenabled = ((feature_enabled(local_channel(),'categories')) ? 'categories' : ''); if ($catsenabled){ $itm = fetch_post_tags($itm); @@ -136,8 +136,8 @@ function editpost_content(&$a) { '$lockstate' => $lockstate, '$acl' => '', '$bang' => '', - '$profile_uid' => local_user(), - '$preview' => true, // ((feature_enabled(local_user(),'preview')) ? t('Preview') : ''), + '$profile_uid' => local_channel(), + '$preview' => true, // ((feature_enabled(local_channel(),'preview')) ? t('Preview') : ''), '$jotplugins' => $jotplugins, '$sourceapp' => t($a->sourcename), '$catsenabled' => $catsenabled, diff --git a/mod/editwebpage.php b/mod/editwebpage.php index 191c9a9ac..c07efc7ee 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -32,7 +32,7 @@ function editwebpage_content(&$a) { $which = argv(1); - $uid = local_user(); + $uid = local_channel(); $owner = 0; $channel = null; $observer = $a->get_observer(); diff --git a/mod/events.php b/mod/events.php index 28a816ea4..9347331d8 100755 --- a/mod/events.php +++ b/mod/events.php @@ -8,14 +8,14 @@ require_once('include/items.php'); function events_post(&$a) { - if(! local_user()) + if(! local_channel()) return; $event_id = ((x($_POST,'event_id')) ? intval($_POST['event_id']) : 0); $event_hash = ((x($_POST,'event_hash')) ? $_POST['event_hash'] : ''); $xchan = ((x($_POST,'xchan')) ? dbesc($_POST['xchan']) : ''); - $uid = local_user(); + $uid = local_channel(); $start_text = escape_tags($_REQUEST['start_text']); $finish_text = escape_tags($_REQUEST['finish_text']); @@ -76,8 +76,8 @@ function events_post(&$a) { $type = 'event'; require_once('include/text.php'); - linkify_tags($a, $desc, local_user()); - linkify_tags($a, $location, local_user()); + linkify_tags($a, $desc, local_channel()); + linkify_tags($a, $location, local_channel()); $action = ($event_hash == '') ? 'new' : "event/" . $event_hash; $onerror_url = $a->get_baseurl() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish"; @@ -98,7 +98,7 @@ function events_post(&$a) { if($event_id) { $x = q("select * from event where id = %d and uid = %d limit 1", intval($event_id), - intval(local_user()) + intval(local_channel()) ); if(! $x) { notice( t('Event not found.') . EOL); @@ -166,7 +166,7 @@ function events_post(&$a) { $datarray['type'] = $type; $datarray['adjust'] = $adjust; $datarray['nofinish'] = $nofinish; - $datarray['uid'] = local_user(); + $datarray['uid'] = local_channel(); $datarray['account'] = get_account_id(); $datarray['event_xchan'] = $channel['channel_hash']; $datarray['allow_cid'] = $str_contact_allow; @@ -195,7 +195,7 @@ function events_post(&$a) { function events_content(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } @@ -205,21 +205,21 @@ function events_content(&$a) { if((argc() > 2) && (argv(1) === 'ignore') && intval(argv(2))) { $r = q("update event set ignore = 1 where id = %d and uid = %d", intval(argv(2)), - intval(local_user()) + intval(local_channel()) ); } if((argc() > 2) && (argv(1) === 'unignore') && intval(argv(2))) { $r = q("update event set ignore = 0 where id = %d and uid = %d", intval(argv(2)), - intval(local_user()) + intval(local_channel()) ); } $plaintext = true; -// if(feature_enabled(local_user(),'richtext')) +// if(feature_enabled(local_channel(),'richtext')) // $plaintext = false; @@ -265,7 +265,7 @@ function events_content(&$a) { } if($mode === 'add') { - event_addtocal($item_id,local_user()); + event_addtocal($item_id,local_channel()); killme(); } @@ -326,7 +326,7 @@ function events_content(&$a) { if (x($_GET,'id')){ $r = q("SELECT event.*, item.plink, item.item_flags, item.author_xchan, item.owner_xchan from event left join item on resource_id = event_hash where resource_type = 'event' and event.uid = %d and event.id = %d limit 1", - intval(local_user()), + intval(local_channel()), intval($_GET['id']) ); } else { @@ -341,7 +341,7 @@ function events_content(&$a) { where resource_type = 'event' and event.uid = %d and event.ignore = %d AND (( `adjust` = 0 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' ) OR ( `adjust` = 1 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' )) ", - intval(local_user()), + intval(local_channel()), intval($ignored), dbesc($start), dbesc($finish), @@ -463,7 +463,7 @@ function events_content(&$a) { if($mode === 'edit' && $event_id) { $r = q("SELECT * FROM `event` WHERE event_hash = '%s' AND `uid` = %d LIMIT 1", dbesc($event_id), - intval(local_user()) + intval(local_channel()) ); if(count($r)) $orig_event = $r[0]; @@ -534,14 +534,14 @@ function events_content(&$a) { if(! $f) $f = 'ymd'; - $catsenabled = feature_enabled(local_user(),'categories'); + $catsenabled = feature_enabled(local_channel(),'categories'); $category = ''; if($catsenabled && x($orig_event)){ $itm = q("select * from item where resource_type = 'event' and resource_id = '%s' and uid = %d limit 1", dbesc($orig_event['event_hash']), - intval(local_user()) + intval(local_channel()) ); $itm = fetch_post_tags($itm); if($itm) { diff --git a/mod/fbrowser.php b/mod/fbrowser.php index 19bd77914..90b554edd 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -12,7 +12,7 @@ require_once('include/photo/photo_driver.php'); */ function fbrowser_content($a){ - if (!local_user()) + if (!local_channel()) killme(); if ($a->argc==1) @@ -29,7 +29,7 @@ function fbrowser_content($a){ if ($a->argc==2){ $albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d ", - intval(local_user()) + intval(local_channel()) ); // anon functions only from 5.3.0... meglio tardi che mai.. function folder1($el){return array(bin2hex($el['album']),$el['album']);} @@ -48,7 +48,7 @@ function fbrowser_content($a){ $r = q("SELECT `resource_id`, `id`, `filename`, type, min(`scale`) AS `hiq`,max(`scale`) AS `loq`, `description` FROM `photo` WHERE `uid` = %d $sql_extra GROUP BY `resource_id` $sql_extra2", - intval(local_user()) + intval(local_channel()) ); function files1($rr){ @@ -87,7 +87,7 @@ function fbrowser_content($a){ case "file": if ($a->argc==2){ $files = q("SELECT id, filename, filetype FROM `attach` WHERE `uid` = %d ", - intval(local_user()) + intval(local_channel()) ); function files2($rr){ global $a; diff --git a/mod/filer.php b/mod/filer.php index 9a409177c..e8160bba2 100644 --- a/mod/filer.php +++ b/mod/filer.php @@ -7,7 +7,7 @@ require_once('include/items.php'); function filer_content(&$a) { - if(! local_user()) { + if(! local_channel()) { killme(); } @@ -18,26 +18,26 @@ function filer_content(&$a) { if($item_id && strlen($term)){ // file item - store_item_tag(local_user(),$item_id,TERM_OBJ_POST,TERM_FILE,$term,''); + store_item_tag(local_channel(),$item_id,TERM_OBJ_POST,TERM_FILE,$term,''); // protect the entire conversation from periodic expiration $r = q("select parent from item where id = %d and uid = %d limit 1", intval($item_id), - intval(local_user()) + intval(local_channel()) ); if($r) { $x = q("update item set item_flags = ( item_flags | %d ) where id = %d and uid = %d", intval(ITEM_RETAINED), intval($r[0]['parent']), - intval(local_user()) + intval(local_channel()) ); } } else { $filetags = array(); $r = q("select distinct(term) from term where uid = %d and type = %d order by term asc", - intval(local_user()), + intval(local_channel()), intval(TERM_FILE) ); if(count($r)) { diff --git a/mod/filerm.php b/mod/filerm.php index 900cfe60b..bd8ce7cfc 100644 --- a/mod/filerm.php +++ b/mod/filerm.php @@ -2,7 +2,7 @@ function filerm_content(&$a) { - if(! local_user()) { + if(! local_channel()) { killme(); } @@ -19,7 +19,7 @@ function filerm_content(&$a) { if($item_id && strlen($term)) { $r = q("delete from term where uid = %d and type = %d and oid = %d and term = '%s'", - intval(local_user()), + intval(local_channel()), intval(($category) ? TERM_CATEGORY : TERM_FILE), intval($item_id), dbesc($term) diff --git a/mod/filestorage.php b/mod/filestorage.php index 05f6a79e6..92474f336 100644 --- a/mod/filestorage.php +++ b/mod/filestorage.php @@ -14,7 +14,7 @@ function filestorage_post(&$a) { $channel_id = ((x($_POST, 'uid')) ? intval($_POST['uid']) : 0); - if((! $channel_id) || (! local_user()) || ($channel_id != local_user())) { + if((! $channel_id) || (! local_channel()) || ($channel_id != local_channel())) { notice( t('Permission denied.') . EOL); return; } @@ -76,7 +76,7 @@ function filestorage_content(&$a) { // Since we have ACL'd files in the wild, but don't have ACL here yet, we // need to return for anyone other than the owner, despite the perms check for now. - $is_owner = (((local_user()) && ($owner == local_user())) ? true : false); + $is_owner = (((local_channel()) && ($owner == local_channel())) ? true : false); if(! $is_owner) { info( t('Permission Denied.') . EOL ); return; diff --git a/mod/follow.php b/mod/follow.php index e480a0964..79e2a4fa5 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -5,11 +5,11 @@ require_once('include/follow.php'); function follow_init(&$a) { - if(! local_user()) { + if(! local_channel()) { return; } - $uid = local_user(); + $uid = local_channel(); $url = notags(trim($_REQUEST['url'])); $return_url = $_SESSION['return_url']; $confirm = intval($_REQUEST['confirm']); @@ -35,7 +35,7 @@ function follow_init(&$a) { function follow_content(&$a) { - if(! local_user()) { + if(! local_channel()) { return login(); } }
\ No newline at end of file diff --git a/mod/fsuggest.php b/mod/fsuggest.php index 2f4f9606b..ec87af6ae 100644 --- a/mod/fsuggest.php +++ b/mod/fsuggest.php @@ -3,7 +3,7 @@ function fsuggest_post(&$a) { - if(! local_user()) { + if(! local_channel()) { return; } @@ -14,7 +14,7 @@ function fsuggest_post(&$a) { $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($contact_id), - intval(local_user()) + intval(local_channel()) ); if(! count($r)) { notice( t('Contact not found.') . EOL); @@ -31,13 +31,13 @@ function fsuggest_post(&$a) { if($new_contact) { $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($new_contact), - intval(local_user()) + intval(local_channel()) ); if(count($r)) { $x = q("INSERT INTO `fsuggest` ( `uid`,`cid`,`name`,`url`,`request`,`photo`,`note`,`created`) VALUES ( %d, %d, '%s','%s','%s','%s','%s','%s')", - intval(local_user()), + intval(local_channel()), intval($contact_id), dbesc($r[0]['name']), dbesc($r[0]['url']), @@ -48,14 +48,14 @@ function fsuggest_post(&$a) { ); $r = q("SELECT `id` FROM `fsuggest` WHERE `note` = '%s' AND `uid` = %d LIMIT 1", dbesc($hash), - intval(local_user()) + intval(local_channel()) ); if(count($r)) { $fsuggest_id = $r[0]['id']; q("UPDATE `fsuggest` SET `note` = '%s' WHERE `id` = %d AND `uid` = %d", dbesc($note), intval($fsuggest_id), - intval(local_user()) + intval(local_channel()) ); proc_run('php', 'include/notifier.php', 'suggest' , $fsuggest_id); } @@ -74,7 +74,7 @@ function fsuggest_content(&$a) { require_once('include/acl_selectors.php'); - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } @@ -86,7 +86,7 @@ function fsuggest_content(&$a) { $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($contact_id), - intval(local_user()) + intval(local_channel()) ); if(! count($r)) { notice( t('Contact not found.') . EOL); diff --git a/mod/group.php b/mod/group.php index f67623a83..66297d6ac 100644 --- a/mod/group.php +++ b/mod/group.php @@ -5,7 +5,7 @@ require_once('include/group.php'); function group_post(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } @@ -15,10 +15,10 @@ function group_post(&$a) { $name = notags(trim($_POST['groupname'])); $public = intval($_POST['public']); - $r = group_add(local_user(),$name,$public); + $r = group_add(local_channel(),$name,$public); if($r) { info( t('Collection created.') . EOL ); - $r = group_byname(local_user(),$name); + $r = group_byname(local_channel(),$name); if($r) goaway($a->get_baseurl() . '/group/' . $r); } @@ -32,7 +32,7 @@ function group_post(&$a) { $r = q("SELECT * FROM `groups` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval(argv(1)), - intval(local_user()) + intval(local_channel()) ); if(! $r) { notice( t('Collection not found.') . EOL ); @@ -47,7 +47,7 @@ function group_post(&$a) { $r = q("UPDATE `groups` SET `name` = '%s', visible = %d WHERE `uid` = %d AND `id` = %d", dbesc($groupname), intval($public), - intval(local_user()), + intval(local_channel()), intval($group['id']) ); if($r) @@ -64,14 +64,14 @@ function group_content(&$a) { logger('mod_group: ' . $a->cmd,LOGGER_DEBUG); - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied') . EOL); return; } // Switch to text mode interface if we have more than 'n' contacts or group members - $switchtotext = get_pconfig(local_user(),'system','groupedit_image_limit'); + $switchtotext = get_pconfig(local_channel(),'system','groupedit_image_limit'); if($switchtotext === false) $switchtotext = get_config('system','groupedit_image_limit'); if($switchtotext === false) @@ -99,10 +99,10 @@ function group_content(&$a) { if(intval(argv(2))) { $r = q("SELECT `name` FROM `groups` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval(argv(2)), - intval(local_user()) + intval(local_channel()) ); if($r) - $result = group_rmv(local_user(),$r[0]['name']); + $result = group_rmv(local_channel(),$r[0]['name']); if($result) info( t('Collection removed.') . EOL); else @@ -119,7 +119,7 @@ function group_content(&$a) { $r = q("SELECT abook_xchan from abook left join xchan on abook_xchan = xchan_hash where abook_xchan = '%s' and abook_channel = %d and not (xchan_flags & %d)>0 and not (abook_flags & %d)>0 and not (abook_flags & %d)>0 limit 1", dbesc(base64url_decode(argv(2))), - intval(local_user()), + intval(local_channel()), intval(XCHAN_FLAGS_DELETED), intval(ABOOK_FLAG_BLOCKED), intval(ABOOK_FLAG_PENDING) @@ -134,7 +134,7 @@ function group_content(&$a) { require_once('include/acl_selectors.php'); $r = q("SELECT * FROM `groups` WHERE `id` = %d AND `uid` = %d AND `deleted` = 0 LIMIT 1", intval(argv(1)), - intval(local_user()) + intval(local_channel()) ); if(! $r) { notice( t('Collection not found.') . EOL ); @@ -155,10 +155,10 @@ function group_content(&$a) { if($change) { if(in_array($change,$preselected)) { - group_rmv_member(local_user(),$group['name'],$change); + group_rmv_member(local_channel(),$group['name'],$change); } else { - group_add_member(local_user(),$group['name'],$change); + group_add_member(local_channel(),$group['name'],$change); } $members = group_get_members($group['id']); @@ -208,11 +208,11 @@ function group_content(&$a) { $groupeditor['members'][] = micropro($member,true,'mpgroup', $textmode); } else - group_rmv_member(local_user(),$group['name'],$member['xchan_hash']); + group_rmv_member(local_channel(),$group['name'],$member['xchan_hash']); } $r = q("SELECT abook.*, xchan.* FROM `abook` left join xchan on abook_xchan = xchan_hash WHERE `abook_channel` = %d AND not (abook_flags & %d)>0 and not (xchan_flags & %d)>0 and not (abook_flags & %d)>0 order by xchan_name asc", - intval(local_user()), + intval(local_channel()), intval(ABOOK_FLAG_BLOCKED), intval(XCHAN_FLAGS_DELETED), intval(ABOOK_FLAG_PENDING) diff --git a/mod/hcard.php b/mod/hcard.php index 3cb2fa01e..014a63b35 100644 --- a/mod/hcard.php +++ b/mod/hcard.php @@ -13,12 +13,12 @@ function hcard_init(&$a) { $profile = ''; $channel = $a->get_channel(); - if((local_user()) && (argc() > 2) && (argv(2) === 'view')) { + if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) { $which = $channel['channel_address']; $profile = argv(1); $r = q("select profile_guid from profile where id = %d and uid = %d limit 1", intval($profile), - intval(local_user()) + intval(local_channel()) ); if(! $r) $profile = ''; diff --git a/mod/home.php b/mod/home.php index 2e57a2ab9..733789991 100644 --- a/mod/home.php +++ b/mod/home.php @@ -12,10 +12,10 @@ function home_init(&$a) { $splash = ((argc() > 1 && argv(1) === 'splash') ? true : false); $channel = $a->get_channel(); - if(local_user() && $channel && $channel['xchan_url'] && ! $splash) { + if(local_channel() && $channel && $channel['xchan_url'] && ! $splash) { $dest = $channel['channel_startpage']; if(! $dest) - $dest = get_pconfig(local_user(),'system','startpage'); + $dest = get_pconfig(local_channel(),'system','startpage'); if(! $dest) $dest = get_config('system','startpage'); if(! $dest) @@ -100,7 +100,7 @@ function home_content(&$a, $update = 0, $load = false) { if($sitename) $o .= '<h1>' . sprintf( t("Welcome to %s") ,$sitename) . '</h1>'; - if(intval(get_config('system','block_public')) && (! local_user()) && (! remote_user())) { + if(intval(get_config('system','block_public')) && (! local_channel()) && (! remote_user())) { // If there's nothing special happening, just spit out a login box if (! $a->config['system']['no_login_on_homepage']) @@ -121,14 +121,14 @@ function home_content(&$a, $update = 0, $load = false) { $maxheight = 75; $o .= '<div id="live-home"></div>' . "\r\n"; - $o .= "<script> var profile_uid = " . ((intval(local_user())) ? local_user() : (-1)) + $o .= "<script> var profile_uid = " . ((intval(local_channel())) ? local_channel() : (-1)) . "; var profile_page = " . $a->pager['page'] . "; divmore_height = " . intval($maxheight) . "; </script>\r\n"; $a->page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array( '$baseurl' => z_root(), '$pgtype' => 'home', - '$uid' => ((local_user()) ? local_user() : '0'), + '$uid' => ((local_channel()) ? local_channel() : '0'), '$gid' => '0', '$cid' => '0', '$cmin' => '0', diff --git a/mod/impel.php b/mod/impel.php index 60e80ff9f..1b641b301 100644 --- a/mod/impel.php +++ b/mod/impel.php @@ -7,7 +7,7 @@ function impel_init(&$a) { $ret = array('success' => false); - if(! local_user()) + if(! local_channel()) json_return_and_die($ret); logger('impel: ' . print_r($_REQUEST,true), LOGGER_DATA); @@ -46,7 +46,7 @@ function impel_init(&$a) { logger('mod_impel: unrecognised element type' . print_r($j,true)); break; } - $arr['uid'] = local_user(); + $arr['uid'] = local_channel(); $arr['aid'] = $channel['channel_account_id']; $arr['title'] = $j['title']; $arr['body'] = $j['body']; @@ -76,7 +76,7 @@ function impel_init(&$a) { if($arr['mimetype'] === 'application/x-php') { $z = q("select account_id, account_roles, channel_pageflags from account left join channel on channel_account_id = account_id where channel_id = %d limit 1", - intval(local_user()) + intval(local_channel()) ); if($z && (($z[0]['account_roles'] & ACCOUNT_ROLE_ALLOWCODE) || ($z[0]['channel_pageflags'] & PAGE_ALLOWCODE))) { @@ -89,11 +89,11 @@ function impel_init(&$a) { $z = q("select * from item_id where sid = '%s' and service = '%s' and uid = %d limit 1", dbesc($pagetitle), dbesc($namespace), - intval(local_user()) + intval(local_channel()) ); $i = q("select id from item where mid = '%s' and uid = %d limit 1", dbesc($arr['mid']), - intval(local_user()) + intval(local_channel()) ); if($z && $i) { $remote_id = $z[0]['id']; diff --git a/mod/invite.php b/mod/invite.php index 12080c4d9..e197278d1 100644 --- a/mod/invite.php +++ b/mod/invite.php @@ -9,7 +9,7 @@ function invite_post(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } @@ -20,7 +20,7 @@ function invite_post(&$a) { if(! $max_invites) $max_invites = 50; - $current_invites = intval(get_pconfig(local_user(),'system','sent_invites')); + $current_invites = intval(get_pconfig(local_channel(),'system','sent_invites')); if($current_invites > $max_invites) { notice( t('Total invitation limit exceeded.') . EOL); return; @@ -34,7 +34,7 @@ function invite_post(&$a) { if(get_config('system','invitation_only')) { $invonly = true; - $x = get_pconfig(local_user(),'system','invites_remaining'); + $x = get_pconfig(local_channel(),'system','invites_remaining'); if((! $x) && (! is_site_admin())) return; } @@ -62,7 +62,7 @@ function invite_post(&$a) { if(! is_site_admin()) { $x --; if($x >= 0) - set_pconfig(local_user(),'system','invites_remaining',$x); + set_pconfig(local_channel(),'system','invites_remaining',$x); else return; } @@ -82,7 +82,7 @@ function invite_post(&$a) { if($res) { $total ++; $current_invites ++; - set_pconfig(local_user(),'system','sent_invites',$current_invites); + set_pconfig(local_channel(),'system','sent_invites',$current_invites); if($current_invites > $max_invites) { notice( t('Invitation limit exceeded. Please contact your site administrator.') . EOL); return; @@ -100,7 +100,7 @@ function invite_post(&$a) { function invite_content(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } @@ -110,7 +110,7 @@ function invite_content(&$a) { if(get_config('system','invitation_only')) { $invonly = true; - $x = get_pconfig(local_user(),'system','invites_remaining'); + $x = get_pconfig(local_channel(),'system','invites_remaining'); if((! $x) && (! is_site_admin())) { notice( t('You have no more invitations available') . EOL); return ''; diff --git a/mod/item.php b/mod/item.php index b3370fecf..26f6fb43d 100644 --- a/mod/item.php +++ b/mod/item.php @@ -26,12 +26,12 @@ function item_post(&$a) { // This will change. Figure out who the observer is and whether or not // they have permission to post here. Else ignore the post. - if((! local_user()) && (! remote_user()) && (! x($_REQUEST,'commenter'))) + if((! local_channel()) && (! remote_user()) && (! x($_REQUEST,'commenter'))) return; require_once('include/security.php'); - $uid = local_user(); + $uid = local_channel(); $channel = null; $observer = null; @@ -640,7 +640,7 @@ function item_post(&$a) { } } - if(local_user() != $profile_uid) + if(local_channel() != $profile_uid) $item_flags |= ITEM_UNSEEN; if($post_type === 'wall' || $post_type === 'wall-comment') @@ -905,7 +905,7 @@ function item_post(&$a) { function item_content(&$a) { - if((! local_user()) && (! remote_user())) + if((! local_channel()) && (! remote_user())) return; require_once('include/security.php'); @@ -920,7 +920,7 @@ function item_content(&$a) { if($i) { $can_delete = false; $local_delete = false; - if(local_user() && local_user() == $i[0]['uid']) + if(local_channel() && local_channel() == $i[0]['uid']) $local_delete = true; $ob_hash = get_observer_hash(); diff --git a/mod/layouts.php b/mod/layouts.php index aaf5db0ef..74a713cf1 100644 --- a/mod/layouts.php +++ b/mod/layouts.php @@ -33,7 +33,7 @@ function layouts_content(&$a) { $which = argv(1); - $uid = local_user(); + $uid = local_channel(); $owner = 0; $channel = null; $observer = $a->get_observer(); diff --git a/mod/lockview.php b/mod/lockview.php index e39f2707b..a46fb6d69 100644 --- a/mod/lockview.php +++ b/mod/lockview.php @@ -27,7 +27,7 @@ function lockview_content(&$a) { $item = $r[0]; - if($item['uid'] != local_user()) { + if($item['uid'] != local_channel()) { echo '<li>' . t('Remote privacy information not available.') . '</li>'; killme(); } diff --git a/mod/locs.php b/mod/locs.php index bf2737718..5b04bb343 100644 --- a/mod/locs.php +++ b/mod/locs.php @@ -3,7 +3,7 @@ function locs_post(&$a) { - if(! local_user()) + if(! local_channel()) return; $channel = $a->get_channel(); @@ -73,7 +73,7 @@ function locs_content(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/login.php b/mod/login.php index 8ad4704a3..12c7d339e 100644 --- a/mod/login.php +++ b/mod/login.php @@ -1,7 +1,7 @@ <?php function login_content(&$a) { - if(local_user()) + if(local_channel()) goaway(z_root()); return login(($a->config['system']['register_policy'] == REGISTER_CLOSED) ? false : true); } diff --git a/mod/magic.php b/mod/magic.php index aead559a7..c31fa71ae 100644 --- a/mod/magic.php +++ b/mod/magic.php @@ -76,7 +76,7 @@ function magic_init(&$a) { // By default, we'll proceed without asking. $arr = array( - 'channel_id' => local_user(), + 'channel_id' => local_channel(), 'xchan' => $x[0], 'destination' => $dest, 'proceed' => true @@ -103,7 +103,7 @@ function magic_init(&$a) { goaway($dest); } - if(local_user()) { + if(local_channel()) { $channel = $a->get_channel(); $token = random_string(); diff --git a/mod/mail.php b/mod/mail.php index 37679aebf..1b0ea17c4 100644 --- a/mod/mail.php +++ b/mod/mail.php @@ -9,7 +9,7 @@ require_once('include/Contact.php'); function mail_post(&$a) { - if(! local_user()) + if(! local_channel()) return; $replyto = ((x($_REQUEST,'replyto')) ? notags(trim($_REQUEST['replyto'])) : ''); @@ -79,12 +79,12 @@ function mail_post(&$a) { } } -// if(feature_enabled(local_user(),'richtext')) { +// if(feature_enabled(local_channel(),'richtext')) { // $body = fix_mce_lf($body); // } require_once('include/text.php'); - linkify_tags($a, $body, local_user()); + linkify_tags($a, $body, local_channel()); if(! $recipient) { notice('No recipient found.'); @@ -93,7 +93,7 @@ function mail_post(&$a) { return; } - // We have a local_user, let send_message use the session channel and save a lookup + // We have a local_channel, let send_message use the session channel and save a lookup $ret = send_message(0, $recipient, $body, $subject, $replyto, $expires); @@ -110,7 +110,7 @@ function mail_content(&$a) { $o = ''; nav_set_selected('messages'); - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return login(); } @@ -119,7 +119,7 @@ function mail_content(&$a) { head_set_icon($channel['xchan_photo_s']); - $cipher = get_pconfig(local_user(),'system','default_cipher'); + $cipher = get_pconfig(local_channel(),'system','default_cipher'); if(! $cipher) $cipher = 'aes256'; @@ -134,7 +134,7 @@ function mail_content(&$a) { return; $cmd = argv(1); - $r = private_messages_drop(local_user(), argv(2)); + $r = private_messages_drop(local_channel(), argv(2)); if($r) { info( t('Message deleted.') . EOL ); } @@ -148,7 +148,7 @@ function mail_content(&$a) { $r = q("update mail set mail_flags = mail_flags | %d where id = %d and channel_id = %d", intval(MAIL_RECALLED), intval(argv(2)), - intval(local_user()) + intval(local_channel()) ); proc_run('php','include/notifier.php','mail',intval(argv(2))); @@ -184,7 +184,7 @@ function mail_content(&$a) { if(x($_REQUEST,'hash')) { $r = q("select abook.*, xchan.* from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_xchan = '%s' limit 1", - intval(local_user()), + intval(local_channel()), dbesc($_REQUEST['hash']) ); if($r) { @@ -199,7 +199,7 @@ function mail_content(&$a) { if($preselect) { $r = q("select abook.*, xchan.* from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_id = %d limit 1", - intval(local_user()), + intval(local_channel()), intval(argv(2)) ); if($r) { @@ -241,9 +241,9 @@ function mail_content(&$a) { '$wait' => t('Please wait'), '$submit' => t('Send'), '$defexpire' => '', - '$feature_expire' => ((feature_enabled(local_user(),'content_expire')) ? true : false), + '$feature_expire' => ((feature_enabled(local_channel(),'content_expire')) ? true : false), '$expires' => t('Set expiration date'), - '$feature_encrypt' => ((feature_enabled(local_user(),'content_encrypt')) ? true : false), + '$feature_encrypt' => ((feature_enabled(local_channel(),'content_encrypt')) ? true : false), '$encrypt' => t('Encrypt text'), '$cipher' => $cipher, @@ -260,10 +260,10 @@ function mail_content(&$a) { $plaintext = true; -// if( local_user() && feature_enabled(local_user(),'richtext') ) +// if( local_channel() && feature_enabled(local_channel(),'richtext') ) // $plaintext = false; - $messages = private_messages_fetch_conversation(local_user(), argv(1), true); + $messages = private_messages_fetch_conversation(local_channel(), argv(1), true); if(! $messages) { info( t('Message not found.') . EOL); @@ -355,9 +355,9 @@ function mail_content(&$a) { '$submit' => t('Submit'), '$wait' => t('Please wait'), '$defexpire' => '', - '$feature_expire' => ((feature_enabled(local_user(),'content_expire')) ? true : false), + '$feature_expire' => ((feature_enabled(local_channel(),'content_expire')) ? true : false), '$expires' => t('Set expiration date'), - '$feature_encrypt' => ((feature_enabled(local_user(),'content_encrypt')) ? true : false), + '$feature_encrypt' => ((feature_enabled(local_channel(),'content_encrypt')) ? true : false), '$encrypt' => t('Encrypt text'), '$cipher' => $cipher, diff --git a/mod/manage.php b/mod/manage.php index b6e10bf46..4a7b25068 100644 --- a/mod/manage.php +++ b/mod/manage.php @@ -40,7 +40,7 @@ function manage_content(&$a) { $channels = null; - if(local_user()) { + if(local_channel()) { $r = q("select channel.*, xchan.* from channel left join xchan on channel.channel_hash = xchan.xchan_hash where channel.channel_account_id = %d and not ( channel_pageflags & %d )>0 order by channel_name ", intval(get_account_id()), intval(PAGE_REMOVED) @@ -149,7 +149,7 @@ function manage_content(&$a) { $o = replace_macros(get_markup_template('channels.tpl'), array( '$header' => t('Channel Manager'), '$msg_selected' => t('Current Channel'), - '$selected' => local_user(), + '$selected' => local_channel(), '$desc' => t('Switch to one of your channels by selecting it.'), '$msg_default' => t('Default Channel'), '$msg_make_default' => t('Make Default'), diff --git a/mod/match.php b/mod/match.php index 5447f755d..5a01ba645 100644 --- a/mod/match.php +++ b/mod/match.php @@ -8,7 +8,7 @@ function match_content(&$a) { $o = ''; - if(! local_user()) + if(! local_channel()) return; $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd; @@ -16,7 +16,7 @@ function match_content(&$a) { $o .= '<h2>' . t('Profile Match') . '</h2>'; $r = q("SELECT `keywords` FROM `profile` WHERE `is_default` = 1 AND `uid` = %d LIMIT 1", - intval(local_user()) + intval(local_channel()) ); if(! count($r)) return; diff --git a/mod/menu.php b/mod/menu.php index 92923e1ff..7e9c580a8 100644 --- a/mod/menu.php +++ b/mod/menu.php @@ -5,7 +5,7 @@ require_once('include/identity.php'); function menu_post(&$a) { - $uid = local_user(); + $uid = local_channel(); if(array_key_exists('sys',$_REQUEST) && $_REQUEST['sys'] && is_site_admin()) { $sys = get_sys_channel(); @@ -50,7 +50,7 @@ function menu_post(&$a) { function menu_content(&$a) { - $uid = local_user(); + $uid = local_channel(); if($a->is_sys && is_site_admin()) { $sys = get_sys_channel(); diff --git a/mod/message.php b/mod/message.php index 7f3b6180a..4a1ff26d1 100644 --- a/mod/message.php +++ b/mod/message.php @@ -12,7 +12,7 @@ function message_content(&$a) { $o = ''; nav_set_selected('messages'); - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return login(); } @@ -20,7 +20,7 @@ function message_content(&$a) { $channel = $a->get_channel(); head_set_icon($channel['xchan_photo_s']); - $cipher = get_pconfig(local_user(),'system','default_cipher'); + $cipher = get_pconfig(local_channel(),'system','default_cipher'); if(! $cipher) $cipher = 'aes256'; @@ -36,7 +36,7 @@ function message_content(&$a) { if(! intval(argv(2))) return; $cmd = argv(1); - $r = private_messages_drop(local_user(), argv(2), true); + $r = private_messages_drop(local_channel(), argv(2), true); if($r) info( t('Conversation removed.') . EOL ); goaway($a->get_baseurl(true) . '/message' ); @@ -50,7 +50,7 @@ function message_content(&$a) { // private_messages_list() can do other more complicated stuff, for now keep it simple - $r = private_messages_list(local_user(), '', $a->pager['start'], $a->pager['itemspage']); + $r = private_messages_list(local_channel(), '', $a->pager['start'], $a->pager['itemspage']); if(! $r) { info( t('No messages.') . EOL); diff --git a/mod/mitem.php b/mod/mitem.php index 7098d7489..b561ec7d6 100644 --- a/mod/mitem.php +++ b/mod/mitem.php @@ -5,7 +5,7 @@ require_once('include/acl_selectors.php'); function mitem_init(&$a) { - $uid = local_user(); + $uid = local_channel(); if(array_key_exists('sys',$_REQUEST) && $_REQUEST['sys'] && is_site_admin()) { $sys = get_sys_channel(); @@ -30,7 +30,7 @@ function mitem_init(&$a) { function mitem_post(&$a) { - $uid = local_user(); + $uid = local_channel(); if($a->is_sys && is_site_admin()) { $sys = get_sys_channel(); @@ -89,7 +89,7 @@ function mitem_post(&$a) { function mitem_content(&$a) { - $uid = local_user(); + $uid = local_channel(); $channel = $a->get_channel(); $observer = $a->get_observer(); diff --git a/mod/mood.php b/mod/mood.php index e6f4760e0..4fe1ceb59 100755 --- a/mod/mood.php +++ b/mod/mood.php @@ -7,10 +7,10 @@ require_once('include/items.php'); function mood_init(&$a) { - if(! local_user()) + if(! local_channel()) return; - $uid = local_user(); + $uid = local_channel(); $channel = $a->get_channel(); $verb = notags(trim($_GET['verb'])); @@ -108,7 +108,7 @@ function mood_init(&$a) { function mood_content(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/network.php b/mod/network.php index 65332e3f6..9a4707b4d 100644 --- a/mod/network.php +++ b/mod/network.php @@ -8,13 +8,13 @@ require_once('include/acl_selectors.php'); function network_init(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } $channel = $a->get_channel(); - $a->profile_uid = local_user(); + $a->profile_uid = local_channel(); head_set_icon($channel['xchan_photo_s']); } @@ -22,7 +22,7 @@ function network_init(&$a) { function network_content(&$a, $update = 0, $load = false) { - if(! local_user()) { + if(! local_channel()) { $_SESSION['return_url'] = $a->query_string; return login(false); } @@ -54,7 +54,7 @@ function network_content(&$a, $update = 0, $load = false) { if(strpos($search,'@') === 0) { $r = q("select abook_id from abook left join xchan on abook_xchan = xchan_hash where xchan_name = '%s' and abook_channel = %d limit 1", dbesc(substr($search,1)), - intval(local_user()) + intval(local_channel()) ); if($r) { $_GET['cid'] = $r[0]['abook_id']; @@ -76,7 +76,7 @@ function network_content(&$a, $update = 0, $load = false) { if($gid) { $r = q("SELECT * FROM groups WHERE id = %d AND uid = %d LIMIT 1", intval($gid), - intval(local_user()) + intval(local_channel()) ); if(! $r) { if($update) @@ -140,7 +140,7 @@ function network_content(&$a, $update = 0, $load = false) { 'acl' => populate_acl((($group || $cid) ? $def_acl : $channel_acl)), 'bang' => (($group || $cid) ? '!' : ''), 'visitor' => true, - 'profile_uid' => local_user() + 'profile_uid' => local_channel() ); $o .= status_editor($a,$x); @@ -178,7 +178,7 @@ function network_content(&$a, $update = 0, $load = false) { $sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND (( author_xchan IN ( $contact_str ) OR owner_xchan in ( $contact_str )) or allow_gid like '" . protect_sprintf('%<' . dbesc($group_hash) . '>%') . "' ) and id = parent and item_restrict = 0 ) "; - $x = group_rec_byhash(local_user(), $group_hash); + $x = group_rec_byhash(local_channel(), $group_hash); if($x) $o = '<h2>' . t('Collection: ') . $x['name'] . '</h2>' . $o; @@ -190,10 +190,10 @@ function network_content(&$a, $update = 0, $load = false) { $r = q("SELECT abook.*, xchan.* from abook left join xchan on abook_xchan = xchan_hash where abook_id = %d and abook_channel = %d and not ( abook_flags & " . intval(ABOOK_FLAG_BLOCKED) . ") > 0 limit 1", intval($cid), - intval(local_user()) + intval(local_channel()) ); if($r) { - $sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND uid = " . intval(local_user()) . " AND ( author_xchan = '" . dbesc($r[0]['abook_xchan']) . "' or owner_xchan = '" . dbesc($r[0]['abook_xchan']) . "' ) and item_restrict = 0 ) "; + $sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($r[0]['abook_xchan']) . "' or owner_xchan = '" . dbesc($r[0]['abook_xchan']) . "' ) and item_restrict = 0 ) "; $o = '<h2>' . t('Connection: ') . $r[0]['xchan_name'] . '</h2>' . $o; } else { @@ -217,20 +217,20 @@ function network_content(&$a, $update = 0, $load = false) { if($gid || $cid || $cmin || ($cmax != 99) || $star || $liked || $conv || $spam || $nouveau || $list) $firehose = 0; - $maxheight = get_pconfig(local_user(),'system','network_divmore_height'); + $maxheight = get_pconfig(local_channel(),'system','network_divmore_height'); if(! $maxheight) $maxheight = 400; $o .= '<div id="live-network"></div>' . "\r\n"; - $o .= "<script> var profile_uid = " . local_user() + $o .= "<script> var profile_uid = " . local_channel() . "; var profile_page = " . $a->pager['page'] . "; divmore_height = " . intval($maxheight) . "; </script>\r\n"; $a->page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array( '$baseurl' => z_root(), '$pgtype' => 'network', - '$uid' => ((local_user()) ? local_user() : '0'), + '$uid' => ((local_channel()) ? local_channel() : '0'), '$gid' => (($gid) ? $gid : '0'), '$cid' => (($cid) ? $cid : '0'), '$cmin' => (($cmin) ? $cmin : '0'), @@ -304,7 +304,7 @@ function network_content(&$a, $update = 0, $load = false) { } else { - $itemspage = get_pconfig(local_user(),'system','itemspage'); + $itemspage = get_pconfig(local_channel(),'system','itemspage'); $a->set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20)); $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval($a->pager['itemspage']), intval($a->pager['start'])); } @@ -338,10 +338,10 @@ function network_content(&$a, $update = 0, $load = false) { $a->data['firehose'] = intval($sys['channel_id']); } else { - $uids = " and item.uid = " . local_user() . " "; + $uids = " and item.uid = " . local_channel() . " "; } - if(get_pconfig(local_user(),'system','network_list_mode')) + if(get_pconfig(local_channel(),'system','network_list_mode')) $page_mode = 'list'; else $page_mode = 'client'; @@ -435,7 +435,7 @@ function network_content(&$a, $update = 0, $load = false) { dbesc($parents_str) ); - xchan_query($items,true,(($firehose) ? local_user() : 0)); + xchan_query($items,true,(($firehose) ? local_channel() : 0)); $items = fetch_post_tags($items,true); $items = conv_sort($items,$ordering); } @@ -469,7 +469,7 @@ function network_content(&$a, $update = 0, $load = false) { WHERE (item_flags & %d) > 0 AND uid = %d $update_unseen ", intval(ITEM_UNSEEN), intval(ITEM_UNSEEN), - intval(local_user()) + intval(local_channel()) ); $mode = (($nouveau) ? 'network-new' : 'network'); diff --git a/mod/notes.php b/mod/notes.php index 84f8a7093..4bb97fc9e 100644 --- a/mod/notes.php +++ b/mod/notes.php @@ -2,13 +2,13 @@ function notes_init(&$a) { - if(! local_user()) + if(! local_channel()) return; $ret = array('success' => true); if($_REQUEST['note_text'] || $_REQUEST['note_text'] == '') { $body = escape_tags($_REQUEST['note_text']); - set_pconfig(local_user(),'notes','text',$body); + set_pconfig(local_channel(),'notes','text',$body); } // push updates to channel clones diff --git a/mod/notifications.php b/mod/notifications.php index 5507ee7e2..f679fbb3b 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -2,7 +2,7 @@ function notifications_post(&$a) { - if(! local_user()) { + if(! local_channel()) { goaway(z_root()); } @@ -15,7 +15,7 @@ function notifications_post(&$a) { $r = q("SELECT * FROM `intro` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($request_id), - intval(local_user()) + intval(local_channel()) ); if(count($r)) { @@ -43,7 +43,7 @@ function notifications_post(&$a) { $r = q("DELETE FROM `contact` WHERE `id` = %d AND `uid` = %d AND `self` = 0 AND `blocked` = 1 AND `pending` = 1", intval($contact_id), - intval(local_user()) + intval(local_channel()) ); } goaway($a->get_baseurl(true) . '/notifications/intros'); @@ -62,7 +62,7 @@ function notifications_post(&$a) { function notifications_content(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } @@ -77,7 +77,7 @@ function notifications_content(&$a) { require_once('include/bbcode.php'); $r = q("SELECT * from notify where uid = %d and seen = 0 order by date desc", - intval(local_user()) + intval(local_channel()) ); if (count($r) > 0) { diff --git a/mod/notify.php b/mod/notify.php index 72534c7fd..4c9d1977b 100644 --- a/mod/notify.php +++ b/mod/notify.php @@ -2,20 +2,20 @@ function notify_init(&$a) { - if(! local_user()) + if(! local_channel()) return; if(argc() > 2 && argv(1) === 'view' && intval(argv(2))) { $r = q("select * from notify where id = %d and uid = %d limit 1", intval(argv(2)), - intval(local_user()) + intval(local_channel()) ); if($r) { q("update notify set seen = 1 where (( parent != '' and parent = '%s' and otype = '%s' ) or link = '%s' ) and uid = %d", dbesc($r[0]['parent']), dbesc($r[0]['otype']), dbesc($r[0]['link']), - intval(local_user()) + intval(local_channel()) ); goaway($r[0]['link']); } @@ -27,7 +27,7 @@ function notify_init(&$a) { function notify_content(&$a) { - if(! local_user()) + if(! local_channel()) return login(); $notif_tpl = get_markup_template('notifications.tpl'); @@ -36,7 +36,7 @@ function notify_content(&$a) { require_once('include/bbcode.php'); $r = q("SELECT * from notify where uid = %d and seen = 0 order by date desc", - intval(local_user()) + intval(local_channel()) ); if($r) { diff --git a/mod/oexchange.php b/mod/oexchange.php index 27c8b388d..637f4f384 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -14,7 +14,7 @@ function oexchange_init(&$a) { function oexchange_content(&$a) { - if(! local_user()) { + if(! local_channel()) { if(remote_user()) { $observer = $a->get_observer(); if($observer && $observer['xchan_url']) { @@ -57,7 +57,7 @@ function oexchange_content(&$a) { $post = array(); - $post['profile_uid'] = local_user(); + $post['profile_uid'] = local_channel(); $post['return'] = '/oexchange/done' ; $post['body'] = $s; $post['type'] = 'wall'; diff --git a/mod/pdledit.php b/mod/pdledit.php index 36b9a0c14..93b8d52e6 100644 --- a/mod/pdledit.php +++ b/mod/pdledit.php @@ -1,15 +1,15 @@ <?php function pdledit_post(&$a) { - if(! local_user()) + if(! local_channel()) return; if(! $_REQUEST['module']) return; if(! trim($_REQUEST['content'])) { - del_pconfig(local_user(),'system','mod_' . $_REQUEST['module'] . '.pdl'); + del_pconfig(local_channel(),'system','mod_' . $_REQUEST['module'] . '.pdl'); goaway(z_root() . '/pdledit/' . $_REQUEST['module']); } - set_pconfig(local_user(),'system','mod_' . $_REQUEST['module'] . '.pdl',escape_tags($_REQUEST['content'])); + set_pconfig(local_channel(),'system','mod_' . $_REQUEST['module'] . '.pdl',escape_tags($_REQUEST['content'])); info( t('Layout updated.') . EOL); goaway(z_root() . '/pdledit/' . $_REQUEST['module']); } @@ -17,7 +17,7 @@ function pdledit_post(&$a) { function pdledit_content(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } @@ -41,7 +41,7 @@ function pdledit_content(&$a) { return $o; } - $t = get_pconfig(local_user(),'system',$module); + $t = get_pconfig(local_channel(),'system',$module); if(! $t) $t = file_get_contents(theme_include($module)); if(! $t) { diff --git a/mod/photos.php b/mod/photos.php index b2eb2847f..108f4c524 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -11,7 +11,7 @@ require_once('include/Contact.php'); function photos_init(&$a) { - if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { + if((get_config('system','block_public')) && (! local_channel()) && (! remote_user())) { return; } @@ -122,11 +122,11 @@ function photos_post(&$a) { // get the list of photos we are about to delete - if(remote_user() && (! local_user())) { + if(remote_user() && (! local_channel())) { $str = photos_album_get_db_idstr($page_owner_uid,$album,remote_user()); } - elseif(local_user()) { - $str = photos_album_get_db_idstr(local_user(),$album); + elseif(local_channel()) { + $str = photos_album_get_db_idstr(local_channel(),$album); } else { $str = null; @@ -166,7 +166,7 @@ function photos_post(&$a) { $r = q("SELECT `id`, `resource_id` FROM `photo` WHERE ( xchan = '%s' or `uid` = %d ) AND `resource_id` = '%s' LIMIT 1", dbesc($ob_hash), - intval(local_user()), + intval(local_channel()), dbesc($a->argv[2]) ); @@ -354,7 +354,7 @@ function photos_post(&$a) { require_once('include/text.php'); $profile_uid = $a->profile['profile_uid']; - $results = linkify_tags($a, $rawtags, (local_user()) ? local_user() : $profile_uid); + $results = linkify_tags($a, $rawtags, (local_channel()) ? local_channel() : $profile_uid); $success = $results['success']; $post_tags = array(); @@ -425,7 +425,7 @@ function photos_content(&$a) { // photos/name/image/xxxxx - if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { + if((get_config('system','block_public')) && (! local_channel()) && (! remote_user())) { notice( t('Public access denied.') . EOL); return; } @@ -494,7 +494,7 @@ function photos_content(&$a) { // tabs - $_is_owner = (local_user() && (local_user() == $owner_uid)); + $_is_owner = (local_channel() && (local_channel() == $owner_uid)); $o .= profile_tabs($a,$_is_owner, $a->data['channel']['channel_address']); /** @@ -876,11 +876,11 @@ function photos_content(&$a) { } } - if((local_user()) && (local_user() == $link_item['uid'])) { + if((local_channel()) && (local_channel() == $link_item['uid'])) { q("UPDATE `item` SET item_flags = (item_flags & ~%d) WHERE parent = %d and uid = %d and (item_flags & %d)>0", intval(ITEM_UNSEEN), intval($link_item['parent']), - intval(local_user()), + intval(local_channel()), intval(ITEM_UNSEEN) ); } diff --git a/mod/ping.php b/mod/ping.php index 1cebd152d..c69f42a6f 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -43,9 +43,9 @@ function ping_init(&$a) { $vnotify = false; - if(local_user()) { - $vnotify = get_pconfig(local_user(),'system','vnotify'); - $evdays = intval(get_pconfig(local_user(),'system','evdays')); + if(local_channel()) { + $vnotify = get_pconfig(local_channel(),'system','vnotify'); + $evdays = intval(get_pconfig(local_channel(),'system','evdays')); $ob_hash = get_observer_hash(); } @@ -64,7 +64,7 @@ function ping_init(&$a) { * of the now current channel. */ - $result['invalid'] = ((intval($_GET['uid'])) && (intval($_GET['uid']) != local_user()) ? 1 : 0); + $result['invalid'] = ((intval($_GET['uid'])) && (intval($_GET['uid']) != local_channel()) ? 1 : 0); /** * Send all system messages (alerts) to the browser. @@ -133,7 +133,7 @@ function ping_init(&$a) { db_utcnow(), db_quoteinterval('3 MINUTE') ); - if((! local_user()) || ($result['invalid'])) { + if((! local_channel()) || ($result['invalid'])) { echo json_encode($result); killme(); } @@ -148,13 +148,13 @@ function ping_init(&$a) { */ // mark all items read - if(x($_REQUEST, 'markRead') && local_user()) { + if(x($_REQUEST, 'markRead') && local_channel()) { switch($_REQUEST['markRead']) { case 'network': $r = q("update item set item_flags = ( item_flags & ~%d ) where (item_flags & %d) > 0 and uid = %d", intval(ITEM_UNSEEN), intval(ITEM_UNSEEN), - intval(local_user()) + intval(local_channel()) ); break; case 'home': @@ -162,24 +162,24 @@ function ping_init(&$a) { intval(ITEM_UNSEEN), intval(ITEM_UNSEEN), intval(ITEM_WALL), - intval(local_user()) + intval(local_channel()) ); break; case 'messages': $r = q("update mail set mail_flags = ( mail_flags | %d ) where channel_id = %d and not (mail_flags & %d) > 0", intval(MAIL_SEEN), - intval(local_user()), + intval(local_channel()), intval(MAIL_SEEN) ); break; case 'all_events': $r = q("update event set `ignore` = 1 where `ignore` = 0 and uid = %d", - intval(local_user()) + intval(local_channel()) ); break; case 'notify': $r = q("update notify set seen = 1 where uid = %d", - intval(local_user()) + intval(local_channel()) ); break; default: @@ -187,11 +187,11 @@ function ping_init(&$a) { } } - if(x($_REQUEST, 'markItemRead') && local_user()) { + if(x($_REQUEST, 'markItemRead') && local_channel()) { $r = q("update item set item_flags = ( item_flags & ~%d ) where parent = %d and uid = %d", intval(ITEM_UNSEEN), intval($_REQUEST['markItemRead']), - intval(local_user()) + intval(local_channel()) ); } @@ -204,22 +204,22 @@ function ping_init(&$a) { if(argc() > 1 && argv(1) === 'notify') { $t = q("select count(*) as total from notify where uid = %d and seen = 0", - intval(local_user()) + intval(local_channel()) ); if($t && intval($t[0]['total']) > 49) { $z = q("select * from notify where uid = %d and seen = 0 order by date desc limit 50", - intval(local_user()) + intval(local_channel()) ); } else { $z1 = q("select * from notify where uid = %d and seen = 0 order by date desc limit 50", - intval(local_user()) + intval(local_channel()) ); $z2 = q("select * from notify where uid = %d and seen = 1 order by date desc limit %d", - intval(local_user()), + intval(local_channel()), intval(50 - intval($t[0]['total'])) ); $z = array_merge($z1,$z2); @@ -248,7 +248,7 @@ function ping_init(&$a) { $t = q("select mail.*, xchan.* from mail left join xchan on xchan_hash = from_xchan where channel_id = %d and not ( mail_flags & %d ) > 0 and not (mail_flags & %d ) > 0 and from_xchan != '%s' order by created desc limit 50", - intval(local_user()), + intval(local_channel()), intval(MAIL_SEEN), intval(MAIL_DELETED), dbesc($channel['channel_hash']) @@ -280,7 +280,7 @@ function ping_init(&$a) { and author_xchan != '%s' ORDER BY created DESC", intval(ITEM_VISIBLE), intval(ITEM_UNSEEN), - intval(local_user()), + intval(local_channel()), dbesc($ob_hash) ); @@ -301,7 +301,7 @@ function ping_init(&$a) { $result = array(); $r = q("SELECT * FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d) > 0 and not ((abook_flags & %d) > 0 or (xchan_flags & %d) > 0) ORDER BY abook_created DESC", - intval(local_user()), + intval(local_channel()), intval(ABOOK_FLAG_PENDING), intval(ABOOK_FLAG_SELF|ABOOK_FLAG_IGNORED), intval(XCHAN_FLAGS_DELETED|XCHAN_FLAGS_ORPHAN) @@ -333,7 +333,7 @@ function ping_init(&$a) { $r = q("SELECT * FROM event left join xchan on event_xchan = xchan_hash WHERE `event`.`uid` = %d AND start < '%s' AND start > '%s' and `ignore` = 0 ORDER BY `start` DESC ", - intval(local_user()), + intval(local_channel()), dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now + ' . intval($evdays) . ' days')), dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now - 1 days')) ); @@ -374,7 +374,7 @@ function ping_init(&$a) { if($vnotify & VNOTIFY_SYSTEM) { $t = q("select count(*) as total from notify where uid = %d and seen = 0", - intval(local_user()) + intval(local_channel()) ); if($t) $result['notify'] = intval($t[0]['total']); @@ -388,7 +388,7 @@ function ping_init(&$a) { and author_xchan != '%s'", intval(ITEM_VISIBLE), intval(ITEM_UNSEEN), - intval(local_user()), + intval(local_channel()), dbesc($ob_hash) ); @@ -414,7 +414,7 @@ function ping_init(&$a) { if($vnotify & VNOTIFY_INTRO) { $intr = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d) > 0 and not ((abook_flags & %d) > 0 or (xchan_flags & %d) > 0)", - intval(local_user()), + intval(local_channel()), intval(ABOOK_FLAG_PENDING), intval(ABOOK_FLAG_SELF|ABOOK_FLAG_IGNORED), intval(XCHAN_FLAGS_DELETED|XCHAN_FLAGS_ORPHAN) @@ -432,7 +432,7 @@ function ping_init(&$a) { if($vnotify & VNOTIFY_MAIL) { $mails = q("SELECT count(id) as total from mail WHERE channel_id = %d AND not (mail_flags & %d) > 0 and from_xchan != '%s' ", - intval(local_user()), + intval(local_channel()), intval(MAIL_SEEN), dbesc($channel['channel_hash']) ); @@ -456,7 +456,7 @@ function ping_init(&$a) { $events = q("SELECT type, start, adjust FROM `event` WHERE `event`.`uid` = %d AND start < '%s' AND start > '%s' and `ignore` = 0 ORDER BY `start` ASC ", - intval(local_user()), + intval(local_channel()), dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now + ' . intval($evdays) . ' days')), dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now - 1 days')) ); diff --git a/mod/poke.php b/mod/poke.php index b22f7d9d5..6257a2821 100755 --- a/mod/poke.php +++ b/mod/poke.php @@ -18,10 +18,10 @@ require_once('include/items.php'); function poke_init(&$a) { - if(! local_user()) + if(! local_channel()) return; - $uid = local_user(); + $uid = local_channel(); $channel = $a->get_channel(); $verb = notags(trim($_REQUEST['verb'])); @@ -124,7 +124,7 @@ function poke_init(&$a) { function poke_content(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } @@ -136,7 +136,7 @@ function poke_content(&$a) { $r = q("select abook_id, xchan_name from abook left join xchan on abook_xchan = xchan_hash where abook_id = %d and abook_channel = %d limit 1", intval($_REQUEST['c']), - intval(local_user()) + intval(local_channel()) ); if($r) { $name = $r[0]['xchan_name']; diff --git a/mod/post.php b/mod/post.php index 9e818a7e2..91a1d4877 100644 --- a/mod/post.php +++ b/mod/post.php @@ -219,7 +219,7 @@ function post_init(&$a) { $DNT = $j['DNT']; } // everything is good... maybe - if(local_user()) { + if(local_channel()) { // tell them to logout if they're logged in locally as anything but the target remote account // in which case just shut up because they don't need to be doing this at all. diff --git a/mod/profile.php b/mod/profile.php index 792bf34c5..e37aea863 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -21,12 +21,12 @@ function profile_init(&$a) { $profile = ''; $channel = $a->get_channel(); - if((local_user()) && (argc() > 2) && (argv(2) === 'view')) { + if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) { $which = $channel['channel_address']; $profile = argv(1); $r = q("select profile_guid from profile where id = %d and uid = %d limit 1", intval($profile), - intval(local_user()) + intval(local_channel()) ); if(! $r) $profile = ''; @@ -66,7 +66,7 @@ function profile_content(&$a, $update = 0) { } - $is_owner = ((local_user()) && (local_user() == $a->profile['profile_uid']) ? true : false); + $is_owner = ((local_channel()) && (local_channel() == $a->profile['profile_uid']) ? true : false); if($a->profile['hidewall'] && (! $is_owner) && (! remote_user())) { notice( t('Permission denied.') . EOL); diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 13d3cd756..fd5ea2af2 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -22,8 +22,8 @@ function profile_photo_set_profile_perms($profileid = '') { } else { - logger('Resetting permissions on default-profile-photo for user'.local_user()); - $r = q("SELECT photo, profile_guid, id, is_default, uid FROM profile WHERE profile.uid = %d AND is_default = 1 LIMIT 1", intval(local_user()) ); //If no profile is given, we update the default profile + logger('Resetting permissions on default-profile-photo for user'.local_channel()); + $r = q("SELECT photo, profile_guid, id, is_default, uid FROM profile WHERE profile.uid = %d AND is_default = 1 LIMIT 1", intval(local_channel()) ); //If no profile is given, we update the default profile } $profile = $r[0]; @@ -32,7 +32,7 @@ function profile_photo_set_profile_perms($profileid = '') { $resource_id = $resource_id[0]; if (intval($profile['is_default']) != 1) { - $r0 = q("SELECT channel_hash FROM channel WHERE channel_id = %d LIMIT 1", intval(local_user()) ); + $r0 = q("SELECT channel_hash FROM channel WHERE channel_id = %d LIMIT 1", intval(local_channel()) ); $r1 = q("SELECT abook.abook_xchan FROM abook WHERE abook_profile = '%d' ", intval($profile['id'])); //Should not be needed in future. Catches old int-profile-ids. $r2 = q("SELECT abook.abook_xchan FROM abook WHERE abook_profile = '%s'", dbesc($profile['profile_guid'])); $allowcid = "<" . $r0[0]['channel_hash'] . ">"; @@ -62,7 +62,7 @@ function profile_photo_set_profile_perms($profileid = '') { function profile_photo_init(&$a) { - if(! local_user()) { + if(! local_channel()) { return; } @@ -80,7 +80,7 @@ function profile_photo_init(&$a) { function profile_photo_post(&$a) { - if(! local_user()) { + if(! local_channel()) { return; } @@ -94,7 +94,7 @@ function profile_photo_post(&$a) { if($_REQUEST['profile']) { $r = q("select id, is_default from profile where id = %d and uid = %d limit 1", intval($_REQUEST['profile']), - intval(local_user()) + intval(local_channel()) ); if(($r) && (! intval($r[0]['is_default']))) $is_default_profile = 0; @@ -124,7 +124,7 @@ function profile_photo_post(&$a) { $r = q("SELECT * FROM photo WHERE resource_id = '%s' AND uid = %d AND scale = %d LIMIT 1", dbesc($image_id), - dbesc(local_user()), + dbesc(local_channel()), intval($scale)); if($r) { @@ -139,7 +139,7 @@ function profile_photo_post(&$a) { $aid = get_account_id(); - $p = array('aid' => $aid, 'uid' => local_user(), 'resource_id' => $base_image['resource_id'], + $p = array('aid' => $aid, 'uid' => local_channel(), 'resource_id' => $base_image['resource_id'], 'filename' => $base_image['filename'], 'album' => t('Profile Photos')); $p['scale'] = 4; @@ -162,7 +162,7 @@ function profile_photo_post(&$a) { notice( t('Image resize failed.') . EOL ); $x = q("delete from photo where resource_id = '%s' and uid = %d and scale >= 4 ", dbesc($base_image['resource_id']), - local_user() + local_channel() ); return; } @@ -172,14 +172,14 @@ function profile_photo_post(&$a) { if($is_default_profile) { $r = q("UPDATE photo SET profile = 0 WHERE profile = 1 AND resource_id != '%s' AND `uid` = %d", dbesc($base_image['resource_id']), - intval(local_user()) + intval(local_channel()) ); $r = q("UPDATE photo SET photo_flags = ( photo_flags & ~%d ) WHERE ( photo_flags & %d )>0 AND resource_id != '%s' AND `uid` = %d", intval(PHOTO_PROFILE), intval(PHOTO_PROFILE), dbesc($base_image['resource_id']), - intval(local_user()) + intval(local_channel()) ); } else { @@ -187,7 +187,7 @@ function profile_photo_post(&$a) { dbesc($a->get_baseurl() . '/photo/' . $base_image['resource_id'] . '-4'), dbesc($a->get_baseurl() . '/photo/' . $base_image['resource_id'] . '-5'), intval($_REQUEST['profile']), - intval(local_user()) + intval(local_channel()) ); } @@ -260,7 +260,7 @@ function profile_photo_post(&$a) { if(! function_exists('profile_photo_content')) { function profile_photo_content(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL ); return; } @@ -284,7 +284,7 @@ function profile_photo_content(&$a) { $r = q("SELECT id, album, scale FROM photo WHERE uid = %d AND resource_id = '%s' ORDER BY scale ASC", - intval(local_user()), + intval(local_channel()), dbesc($resource_id) ); if(! $r) { @@ -302,21 +302,21 @@ function profile_photo_content(&$a) { if(($r[0]['album'] == t('Profile Photos')) && ($havescale)) { // unset any existing profile photos $r = q("UPDATE photo SET profile = 0 WHERE profile = 1 AND uid = %d", - intval(local_user())); + intval(local_channel())); $r = q("UPDATE photo SET photo_flags = (photo_flags & ~%d ) WHERE (photo_flags & %d )>0 AND uid = %d", intval(PHOTO_PROFILE), intval(PHOTO_PROFILE), - intval(local_user())); + intval(local_channel())); // set all sizes of this one as profile photos $r = q("UPDATE photo SET profile = 1 WHERE uid = %d AND resource_id = '%s'", - intval(local_user()), + intval(local_channel()), dbesc($resource_id) ); $r = q("UPDATE photo SET photo_flags = ( photo_flags | %d ) WHERE uid = %d AND resource_id = '%s'", intval(PHOTO_PROFILE), - intval(local_user()), + intval(local_channel()), dbesc($resource_id) ); @@ -327,13 +327,13 @@ function profile_photo_content(&$a) { ); profile_photo_set_profile_perms(); //Reset default photo permissions to public - proc_run('php','include/directory.php',local_user()); + proc_run('php','include/directory.php',local_channel()); goaway($a->get_baseurl() . '/profiles'); } $r = q("SELECT `data`, `type` FROM photo WHERE id = %d and uid = %d limit 1", intval($r[0]['id']), - intval(local_user()) + intval(local_channel()) ); if(! $r) { @@ -347,7 +347,7 @@ function profile_photo_content(&$a) { } $profiles = q("select id, profile_name as name, is_default from profile where uid = %d", - intval(local_user()) + intval(local_channel()) ); if(! x($a->data,'imagecrop')) { @@ -420,7 +420,7 @@ function profile_photo_crop_ui_head(&$a, $ph){ $hash = photo_new_resource(); $smallest = 0; - $p = array('aid' => get_account_id(), 'uid' => local_user(), 'resource_id' => $hash, + $p = array('aid' => get_account_id(), 'uid' => local_channel(), 'resource_id' => $hash, 'filename' => $filename, 'album' => t('Profile Photos'), 'scale' => 0); $r = $ph->save($p); diff --git a/mod/profiles.php b/mod/profiles.php index ef5f6b379..19e5ffc50 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -5,14 +5,14 @@ function profiles_init(&$a) { nav_set_selected('profiles'); - if(! local_user()) { + if(! local_channel()) { return; } if((argc() > 2) && (argv(1) === "drop") && intval(argv(2))) { $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is_default` = 0 LIMIT 1", intval(argv(2)), - intval(local_user()) + intval(local_channel()) ); if(! count($r)) { notice( t('Profile not found.') . EOL); @@ -26,13 +26,13 @@ function profiles_init(&$a) { // move every contact using this profile as their default to the user default $r = q("UPDATE abook SET abook_profile = (SELECT profile_guid AS FROM profile WHERE is_default = 1 AND uid = %d LIMIT 1) WHERE abook_profile = '%s' AND abook_channel = %d ", - intval(local_user()), + intval(local_channel()), dbesc($profile_guid), - intval(local_user()) + intval(local_channel()) ); $r = q("DELETE FROM `profile` WHERE `id` = %d AND `uid` = %d", intval(argv(2)), - intval(local_user()) + intval(local_channel()) ); if($r) info( t('Profile deleted.') . EOL); @@ -50,18 +50,18 @@ function profiles_init(&$a) { // check_form_security_token_redirectOnErr('/profiles', 'profile_new', 't'); $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d", - intval(local_user())); + intval(local_channel())); $num_profiles = count($r0); $name = t('Profile-') . ($num_profiles + 1); $r1 = q("SELECT `name`, `photo`, `thumb` FROM `profile` WHERE `uid` = %d AND `is_default` = 1 LIMIT 1", - intval(local_user())); + intval(local_channel())); $r2 = q("INSERT INTO `profile` (`aid`, `uid` , `profile_guid`, `profile_name` , `name`, `photo`, `thumb`) VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s' )", intval(get_account_id()), - intval(local_user()), + intval(local_channel()), dbesc(random_string()), dbesc($name), dbesc($r1[0]['name']), @@ -70,7 +70,7 @@ function profiles_init(&$a) { ); $r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile_name` = '%s' LIMIT 1", - intval(local_user()), + intval(local_channel()), dbesc($name) ); @@ -86,12 +86,12 @@ function profiles_init(&$a) { check_form_security_token_redirectOnErr('/profiles', 'profile_clone', 't'); $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d", - intval(local_user())); + intval(local_channel())); $num_profiles = count($r0); $name = t('Profile-') . ($num_profiles + 1); $r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1", - intval(local_user()), + intval(local_channel()), intval($a->argv[2]) ); if(! count($r1)) { @@ -114,7 +114,7 @@ function profiles_init(&$a) { . "')" ); $r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile_name` = '%s' LIMIT 1", - intval(local_user()), + intval(local_channel()), dbesc($name) ); info( t('New profile created.') . EOL); @@ -129,7 +129,7 @@ function profiles_init(&$a) { if((argc() > 2) && (argv(1) === 'export')) { $r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1", - intval(local_user()), + intval(local_channel()), intval(argv(2)) ); if(! $r1) { @@ -156,19 +156,19 @@ function profiles_init(&$a) { // Run profile_load() here to make sure the theme is set before // we start loading content - if(((argc() > 1) && (intval(argv(1)))) || !feature_enabled(local_user(),'multi_profiles')) { - if(feature_enabled(local_user(),'multi_profiles')) + if(((argc() > 1) && (intval(argv(1)))) || !feature_enabled(local_channel(),'multi_profiles')) { + if(feature_enabled(local_channel(),'multi_profiles')) $id = $a->argv[1]; else { $x = q("select id from profile where uid = %d and is_default = 1", - intval(local_user()) + intval(local_channel()) ); if($x) $id = $x[0]['id']; } $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($id), - intval(local_user()) + intval(local_channel()) ); if(! count($r)) { notice( t('Profile not found.') . EOL); @@ -184,7 +184,7 @@ function profiles_init(&$a) { function profiles_post(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } @@ -225,7 +225,7 @@ function profiles_post(&$a) { if((argc() > 1) && (argv(1) !== "new") && intval(argv(1))) { $orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($a->argv[1]), - intval(local_user()) + intval(local_channel()) ); if(! count($orig)) { notice( t('Profile not found.') . EOL); @@ -299,20 +299,20 @@ function profiles_post(&$a) { $hide_friends = ((intval($_POST['hide_friends'])) ? 1: 0); require_once('include/text.php'); - linkify_tags($a, $likes, local_user()); - linkify_tags($a, $dislikes, local_user()); - linkify_tags($a, $about, local_user()); - linkify_tags($a, $interest, local_user()); - linkify_tags($a, $interest, local_user()); - linkify_tags($a, $contact, local_user()); - linkify_tags($a, $channels, local_user()); - linkify_tags($a, $music, local_user()); - linkify_tags($a, $book, local_user()); - linkify_tags($a, $tv, local_user()); - linkify_tags($a, $film, local_user()); - linkify_tags($a, $romance, local_user()); - linkify_tags($a, $work, local_user()); - linkify_tags($a, $education, local_user()); + linkify_tags($a, $likes, local_channel()); + linkify_tags($a, $dislikes, local_channel()); + linkify_tags($a, $about, local_channel()); + linkify_tags($a, $interest, local_channel()); + linkify_tags($a, $interest, local_channel()); + linkify_tags($a, $contact, local_channel()); + linkify_tags($a, $channels, local_channel()); + linkify_tags($a, $music, local_channel()); + linkify_tags($a, $book, local_channel()); + linkify_tags($a, $tv, local_channel()); + linkify_tags($a, $film, local_channel()); + linkify_tags($a, $romance, local_channel()); + linkify_tags($a, $work, local_channel()); + linkify_tags($a, $education, local_channel()); $with = ((x($_POST,'with')) ? escape_tags(trim($_POST['with'])) : ''); @@ -338,12 +338,12 @@ function profiles_post(&$a) { $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash WHERE xchan_name = '%s' AND abook_channel = %d LIMIT 1", dbesc($newname), - intval(local_user()) + intval(local_channel()) ); if(! $r) { $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash WHERE xchan_addr = '%s' AND abook_channel = %d LIMIT 1", dbesc($lookup . '@%'), - intval(local_user()) + intval(local_channel()) ); } if($r) { @@ -364,7 +364,7 @@ function profiles_post(&$a) { $profile_fields_basic = get_profile_fields_basic(); $profile_fields_advanced = get_profile_fields_advanced(); - $advanced = ((feature_enabled(local_user(),'advanced_profiles')) ? true : false); + $advanced = ((feature_enabled(local_channel(),'advanced_profiles')) ? true : false); if($advanced) $fields = $profile_fields_advanced; else @@ -375,7 +375,7 @@ function profiles_post(&$a) { foreach($z as $zz) { if(array_key_exists($zz['field_name'],$fields)) { $w = q("select * from profext where channel_id = %d and hash = '%s' and k = '%s' limit 1", - intval(local_user()), + intval(local_channel()), dbesc($orig[0]['profile_guid']), dbesc($zz['field_name']) ); @@ -387,7 +387,7 @@ function profiles_post(&$a) { } else { q("insert into profext ( channel_id, hash, k, v ) values ( %d, '%s', '%s', '%s') ", - intval(local_user()), + intval(local_channel()), dbesc($orig[0]['profile_guid']), dbesc($zz['field_name']), dbesc(escape_tags(trim($_POST[$zz['field_name']]))) @@ -530,7 +530,7 @@ function profiles_post(&$a) { dbesc($education), intval($hide_friends), intval(argv(1)), - intval(local_user()) + intval(local_channel()) ); if($r) @@ -538,11 +538,11 @@ function profiles_post(&$a) { $r = q("select * from profile where id = %d and uid = %d limit 1", intval(argv(1)), - intval(local_user()) + intval(local_channel()) ); if($r) { require_once('include/zot.php'); - build_sync_packet(local_user(),array('profile' => $r)); + build_sync_packet(local_channel(),array('profile' => $r)); } $channel = $a->get_channel(); @@ -558,7 +558,7 @@ function profiles_post(&$a) { if($is_default) { // reload the info for the sidebar widget - why does this not work? profile_load($a,$channel['channel_address']); - proc_run('php','include/directory.php',local_user()); + proc_run('php','include/directory.php',local_channel()); } } } @@ -572,7 +572,7 @@ function profiles_content(&$a) { $channel = $a->get_channel(); - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } @@ -582,19 +582,19 @@ function profiles_content(&$a) { $profile_fields_basic = get_profile_fields_basic(); $profile_fields_advanced = get_profile_fields_advanced(); - if(((argc() > 1) && (intval(argv(1)))) || !feature_enabled(local_user(),'multi_profiles')) { - if(feature_enabled(local_user(),'multi_profiles')) + if(((argc() > 1) && (intval(argv(1)))) || !feature_enabled(local_channel(),'multi_profiles')) { + if(feature_enabled(local_channel(),'multi_profiles')) $id = $a->argv[1]; else { $x = q("select id from profile where uid = %d and is_default = 1", - intval(local_user()) + intval(local_channel()) ); if($x) $id = $x[0]['id']; } $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($id), - intval(local_user()) + intval(local_channel()) ); if(! count($r)) { notice( t('Profile not found.') . EOL); @@ -605,7 +605,7 @@ function profiles_content(&$a) { $editselect = 'none'; -// if(feature_enabled(local_user(),'richtext')) +// if(feature_enabled(local_channel(),'richtext')) // $editselect = 'textareas'; $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array( @@ -613,7 +613,7 @@ function profiles_content(&$a) { '$editselect' => $editselect, )); - $advanced = ((feature_enabled(local_user(),'advanced_profiles')) ? true : false); + $advanced = ((feature_enabled(local_channel(),'advanced_profiles')) ? true : false); if($advanced) $fields = $profile_fields_advanced; else @@ -636,7 +636,7 @@ function profiles_content(&$a) { $mine = q("select v from profext where k = '%s' and hash = '%s' and channel_id = %d limit 1", dbesc($qq['field_name']), dbesc($r[0]['profile_guid']), - intval(local_user()) + intval(local_channel()) ); if(array_key_exists($qq['field_name'],$fields)) { @@ -656,7 +656,7 @@ function profiles_content(&$a) { $o .= replace_macros($tpl,array( '$form_security_token' => get_form_security_token("profile_edit"), - '$profile_clone_link' => ((feature_enabled(local_user(),'multi_profiles')) ? 'profiles/clone/' . $r[0]['id'] . '?t=' + '$profile_clone_link' => ((feature_enabled(local_channel(),'multi_profiles')) ? 'profiles/clone/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_clone") : ''), '$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_drop"), @@ -671,7 +671,7 @@ function profiles_content(&$a) { '$cr_prof' => t('Create a new profile using these settings'), '$cl_prof' => t('Clone this profile'), '$del_prof' => t('Delete this profile'), - '$exportable' => feature_enabled(local_user(),'profile_export'), + '$exportable' => feature_enabled(local_channel(),'profile_export'), '$lbl_import' => t('Import profile from file'), '$lbl_export' => t('Export profile to file'), '$lbl_profname' => t('Profile Name:'), @@ -763,7 +763,7 @@ function profiles_content(&$a) { else { $r = q("SELECT * FROM `profile` WHERE `uid` = %d", - local_user()); + local_channel()); if(count($r)) { $tpl_header = get_markup_template('profile_listing_header.tpl'); diff --git a/mod/profperm.php b/mod/profperm.php index 55dc8cc77..4556119a4 100644 --- a/mod/profperm.php +++ b/mod/profperm.php @@ -4,7 +4,7 @@ require_once('include/Contact.php'); function profperm_init(&$a) { - if(! local_user()) + if(! local_channel()) return; $channel = $a->get_channel(); @@ -19,7 +19,7 @@ function profperm_init(&$a) { function profperm_content(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied') . EOL); return; } @@ -32,7 +32,7 @@ function profperm_content(&$a) { // Switch to text mod interface if we have more than 'n' contacts or group members - $switchtotext = get_pconfig(local_user(),'system','groupedit_image_limit'); + $switchtotext = get_pconfig(local_channel(),'system','groupedit_image_limit'); if($switchtotext === false) $switchtotext = get_config('system','groupedit_image_limit'); if($switchtotext === false) @@ -42,7 +42,7 @@ function profperm_content(&$a) { if((argc() > 2) && intval(argv(1)) && intval(argv(2))) { $r = q("SELECT abook_id FROM abook WHERE abook_id = %d and abook_channel = %d limit 1", intval(argv(2)), - intval(local_user()) + intval(local_channel()) ); if($r) $change = intval(argv(2)); @@ -52,7 +52,7 @@ function profperm_content(&$a) { if((argc() > 1) && (intval(argv(1)))) { $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is_default` = 0 LIMIT 1", intval(argv(1)), - intval(local_user()) + intval(local_channel()) ); if(! $r) { notice( t('Invalid profile identifier.') . EOL ); @@ -62,7 +62,7 @@ function profperm_content(&$a) { $profile = $r[0]; $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d AND abook_profile = '%s'", - intval(local_user()), + intval(local_channel()), dbesc($profile['profile_guid']) ); @@ -77,14 +77,14 @@ function profperm_content(&$a) { if(in_array($change,$ingroup)) { q("UPDATE abook SET abook_profile = '' WHERE abook_id = %d AND abook_channel = %d", intval($change), - intval(local_user()) + intval(local_channel()) ); } else { q("UPDATE abook SET abook_profile = '%s' WHERE abook_id = %d AND abook_channel = %d", dbesc($profile['profile_guid']), intval($change), - intval(local_user()) + intval(local_channel()) ); } @@ -95,7 +95,7 @@ function profperm_content(&$a) { profile_photo_set_profile_perms($profile['id']); $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d AND abook_profile = '%s'", - intval(local_user()), + intval(local_channel()), dbesc($profile['profile_guid']) ); @@ -140,7 +140,7 @@ function profperm_content(&$a) { $o .= '</div>'; $o .= '<div id="prof-all-contacts">'; - $r = abook_connections(local_user()); + $r = abook_connections(local_channel()); if($r) { $textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false); diff --git a/mod/rbmark.php b/mod/rbmark.php index e35c2494a..cbd32098b 100644 --- a/mod/rbmark.php +++ b/mod/rbmark.php @@ -48,7 +48,7 @@ function rbmark_content(&$a) { $o = ''; - if(! local_user()) { + if(! local_channel()) { // The login procedure is going to bugger our $_REQUEST variables // so save them in the session. diff --git a/mod/regmod.php b/mod/regmod.php index d75355d5f..bdb794347 100644 --- a/mod/regmod.php +++ b/mod/regmod.php @@ -7,7 +7,7 @@ function regmod_content(&$a) { $_SESSION['return_url'] = $a->cmd; - if(! local_user()) { + if(! local_channel()) { info( t('Please login.') . EOL); $o .= '<br /><br />' . login(($a->config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1); return $o; diff --git a/mod/removeaccount.php b/mod/removeaccount.php index 70979c07d..18aaa2517 100644 --- a/mod/removeaccount.php +++ b/mod/removeaccount.php @@ -2,7 +2,7 @@ function removeaccount_post(&$a) { - if(! local_user()) + if(! local_channel()) return; if(x($_SESSION,'submanage') && intval($_SESSION['submanage'])) @@ -44,7 +44,7 @@ function removeaccount_post(&$a) { function removeaccount_content(&$a) { - if(! local_user()) + if(! local_channel()) goaway(z_root()); $hash = random_string(); diff --git a/mod/removeme.php b/mod/removeme.php index d2ff013b8..492738b77 100644 --- a/mod/removeme.php +++ b/mod/removeme.php @@ -2,7 +2,7 @@ function removeme_post(&$a) { - if(! local_user()) + if(! local_channel()) return; if(x($_SESSION,'submanage') && intval($_SESSION['submanage'])) @@ -35,7 +35,7 @@ function removeme_post(&$a) { $global_remove = intval($_POST['global']); - channel_remove(local_user(),1 - $global_remove,true); + channel_remove(local_channel(),1 - $global_remove,true); } @@ -43,7 +43,7 @@ function removeme_post(&$a) { function removeme_content(&$a) { - if(! local_user()) + if(! local_channel()) goaway(z_root()); $hash = random_string(); diff --git a/mod/rmagic.php b/mod/rmagic.php index de81cdcde..49525bd32 100644 --- a/mod/rmagic.php +++ b/mod/rmagic.php @@ -3,7 +3,7 @@ function rmagic_init(&$a) { - if(local_user()) + if(local_channel()) goaway(z_root()); $me = get_my_address(); diff --git a/mod/rpost.php b/mod/rpost.php index 933db24e3..187605dca 100644 --- a/mod/rpost.php +++ b/mod/rpost.php @@ -29,7 +29,7 @@ function rpost_content(&$a) { $o = ''; - if(! local_user()) { + if(! local_channel()) { if(remote_user()) { // redirect to your own site. // We can only do this with a GET request so you'll need to keep the text short or risk getting truncated @@ -83,7 +83,7 @@ function rpost_content(&$a) { } $plaintext = true; -// if(feature_enabled(local_user(),'richtext')) +// if(feature_enabled(local_channel(),'richtext')) // $plaintext = false; if(array_key_exists('type', $_REQUEST) && $_REQUEST['type'] === 'html') { @@ -119,7 +119,7 @@ function rpost_content(&$a) { 'bang' => '', // 'channel_select' => true, 'visitor' => true, - 'profile_uid' => local_user(), + 'profile_uid' => local_channel(), 'title' => $_REQUEST['title'], 'body' => $_REQUEST['body'], 'source' => ((x($_REQUEST,'source')) ? strip_tags($_REQUEST['source']) : ''), diff --git a/mod/search.php b/mod/search.php index 5b15b0593..ff7eb0731 100644 --- a/mod/search.php +++ b/mod/search.php @@ -9,7 +9,7 @@ function search_init(&$a) { function search_content(&$a,$update = 0, $load = false) { if((get_config('system','block_public')) || (get_config('system','block_public_search'))) { - if ((! local_user()) && (! remote_user())) { + if ((! local_channel()) && (! remote_user())) { notice( t('Public access denied.') . EOL); return; } @@ -44,8 +44,8 @@ function search_content(&$a,$update = 0, $load = false) { $search = ((x($_GET,'tag')) ? trim(rawurldecode($_GET['tag'])) : ''); } - if((! local_user()) || (! feature_enabled(local_user(),'savedsearch'))) - $o .= search($search,'search-box','/search',((local_user()) ? true : false)); + if((! local_channel()) || (! feature_enabled(local_channel(),'savedsearch'))) + $o .= search($search,'search-box','/search',((local_channel()) ? true : false)); if(strpos($search,'#') === 0) { $tag = true; @@ -87,7 +87,7 @@ function search_content(&$a,$update = 0, $load = false) { // because browser prefetching might change it on us. We have to deliver it with the page. $o .= '<div id="live-search"></div>' . "\r\n"; - $o .= "<script> var profile_uid = " . ((intval(local_user())) ? local_user() : (-1)) + $o .= "<script> var profile_uid = " . ((intval(local_channel())) ? local_channel() : (-1)) . "; var netargs = '?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; $a->page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array( @@ -128,7 +128,7 @@ function search_content(&$a,$update = 0, $load = false) { $sys = get_sys_channel(); if(($update) && ($load)) { - $itemspage = get_pconfig(local_user(),'system','itemspage'); + $itemspage = get_pconfig(local_channel(),'system','itemspage'); $a->set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20)); $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval($a->pager['itemspage']), intval($a->pager['start'])); @@ -147,14 +147,14 @@ function search_content(&$a,$update = 0, $load = false) { $prefix = 'distinct'; $suffix = 'group by mid ORDER BY created DESC'; } - if(local_user()) { + if(local_channel()) { $r = q("SELECT $prefix mid, item.id as item_id, item.* from item WHERE item_restrict = 0 AND ((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND item_private = 0 ) OR ( `item`.`uid` = %d )) OR item.owner_xchan = '%s' ) $sql_extra $suffix $pager_sql ", - intval(local_user()), + intval(local_channel()), dbesc($sys['xchan_hash']) ); } diff --git a/mod/search_ac.php b/mod/search_ac.php index b4f5c9600..e42945d43 100644 --- a/mod/search_ac.php +++ b/mod/search_ac.php @@ -2,7 +2,7 @@ // Autocomplete for saved searches. Should probably be put in the same place as the other autocompletes function search_ac_init(&$a){ - if(!local_user()) + if(!local_channel()) killme(); @@ -25,7 +25,7 @@ function search_ac_init(&$a){ $r = q("SELECT `abook_id`, `xchan_name`, `xchan_photo_s`, `xchan_url`, `xchan_addr` FROM `abook` left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d $people_sql_extra ORDER BY `xchan_name` ASC ", - intval(local_user()) + intval(local_channel()) ); $results = array(); diff --git a/mod/service_limits.php b/mod/service_limits.php index 83ae2e06c..ac96668ab 100644 --- a/mod/service_limits.php +++ b/mod/service_limits.php @@ -3,7 +3,7 @@ function service_limits_content(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/settings.php b/mod/settings.php index 902213446..8c927a97c 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -16,10 +16,10 @@ function get_theme_config_file($theme){ } function settings_init(&$a) { - if(! local_user()) + if(! local_channel()) return; - $a->profile_uid = local_user(); + $a->profile_uid = local_channel(); // default is channel settings in the absence of other arguments @@ -36,7 +36,7 @@ function settings_init(&$a) { function settings_post(&$a) { - if(! local_user()) + if(! local_channel()) return; $channel = $a->get_channel(); @@ -53,7 +53,7 @@ function settings_post(&$a) { $key = $_POST['remove']; q("DELETE FROM tokens WHERE id='%s' AND uid=%d", dbesc($key), - local_user()); + local_channel()); goaway($a->get_baseurl(true)."/settings/oauth/"); return; } @@ -92,7 +92,7 @@ function settings_post(&$a) { dbesc($name), dbesc($redirect), dbesc($icon), - local_user(), + local_channel(), dbesc($key)); } else { $r = q("INSERT INTO clients @@ -103,7 +103,7 @@ function settings_post(&$a) { dbesc($name), dbesc($redirect), dbesc($icon), - local_user()); + local_channel()); } } goaway($a->get_baseurl(true)."/settings/oauth/"); @@ -132,9 +132,9 @@ function settings_post(&$a) { } foreach($all_features as $k) { if(x($_POST,"feature_$k")) - set_pconfig(local_user(),'feature',$k, 1); + set_pconfig(local_channel(),'feature',$k, 1); else - set_pconfig(local_user(),'feature',$k, 0); + set_pconfig(local_channel(),'feature',$k, 0); } build_sync_packet(); return; @@ -170,20 +170,20 @@ function settings_post(&$a) { if ($mobile_theme == "---") - del_pconfig(local_user(),'system','mobile_theme'); + del_pconfig(local_channel(),'system','mobile_theme'); else { - set_pconfig(local_user(),'system','mobile_theme',$mobile_theme); + set_pconfig(local_channel(),'system','mobile_theme',$mobile_theme); } - set_pconfig(local_user(),'system','user_scalable',$user_scalable); - set_pconfig(local_user(),'system','update_interval', $browser_update); - set_pconfig(local_user(),'system','itemspage', $itemspage); - set_pconfig(local_user(),'system','no_smilies',$nosmile); - set_pconfig(local_user(),'system','title_tosource',$title_tosource); - set_pconfig(local_user(),'system','channel_list_mode', $channel_list_mode); - set_pconfig(local_user(),'system','network_list_mode', $network_list_mode); - set_pconfig(local_user(),'system','channel_divmore_height', $channel_divmore_height); - set_pconfig(local_user(),'system','network_divmore_height', $network_divmore_height); + set_pconfig(local_channel(),'system','user_scalable',$user_scalable); + set_pconfig(local_channel(),'system','update_interval', $browser_update); + set_pconfig(local_channel(),'system','itemspage', $itemspage); + set_pconfig(local_channel(),'system','no_smilies',$nosmile); + set_pconfig(local_channel(),'system','title_tosource',$title_tosource); + set_pconfig(local_channel(),'system','channel_list_mode', $channel_list_mode); + set_pconfig(local_channel(),'system','network_list_mode', $network_list_mode); + set_pconfig(local_channel(),'system','channel_divmore_height', $channel_divmore_height); + set_pconfig(local_channel(),'system','network_divmore_height', $network_divmore_height); if ($theme == $a->channel['channel_theme']){ // call theme_post only if theme has not been changed @@ -195,7 +195,7 @@ function settings_post(&$a) { $r = q("UPDATE channel SET channel_theme = '%s' WHERE channel_id = %d", dbesc($theme), - intval(local_user()) + intval(local_channel()) ); call_hooks('display_settings_post', $_POST); @@ -284,7 +284,7 @@ function settings_post(&$a) { $set_perms = ''; $role = ((x($_POST,'permissions_role')) ? notags(trim($_POST['permissions_role'])) : ''); - $oldrole = get_pconfig(local_user(),'system','permissions_role'); + $oldrole = get_pconfig(local_channel(),'system','permissions_role'); if(($role != $oldrole) || ($role === 'custom')) { @@ -294,7 +294,7 @@ function settings_post(&$a) { $def_group = ((x($_POST,'group-selection')) ? notags(trim($_POST['group-selection'])) : ''); $r = q("update channel set channel_default_group = '%s' where channel_id = %d", dbesc($def_group), - intval(local_user()) + intval(local_channel()) ); $global_perms = get_perms(); @@ -313,7 +313,7 @@ function settings_post(&$a) { dbesc($str_group_allow), dbesc($str_contact_deny), dbesc($str_group_deny), - intval(local_user()) + intval(local_channel()) ); } else { @@ -325,15 +325,15 @@ function settings_post(&$a) { $hide_presence = 1 - (intval($role_permissions['online'])); if($role_permissions['default_collection']) { $r = q("select hash from groups where uid = %d and name = '%s' limit 1", - intval(local_user()), + intval(local_channel()), dbesc( t('Friends') ) ); if(! $r) { require_once('include/group.php'); - group_add(local_user(), t('Friends')); - group_add_member(local_user(),t('Friends'),$channel['channel_hash']); + group_add(local_channel(), t('Friends')); + group_add_member(local_channel(),t('Friends'),$channel['channel_hash']); $r = q("select hash from groups where uid = %d and name = '%s' limit 1", - intval(local_user()), + intval(local_channel()), dbesc( t('Friends') ) ); } @@ -341,7 +341,7 @@ function settings_post(&$a) { q("update channel set channel_default_group = '%s', channel_allow_gid = '%s', channel_allow_cid = '', channel_deny_gid = '', channel_deny_cid = '' where channel_id = %d", dbesc($r[0]['hash']), dbesc('<' . $r[0]['hash'] . '>'), - intval(local_user()) + intval(local_channel()) ); } else { @@ -353,16 +353,16 @@ function settings_post(&$a) { else { q("update channel set channel_default_group = '', channel_allow_gid = '', channel_allow_cid = '', channel_deny_gid = '', channel_deny_cid = '' where channel_id = %d", - intval(local_user()) + intval(local_channel()) ); } $r = q("update abook set abook_my_perms = %d where abook_channel = %d and (abook_flags & %d)>0", intval(($role_permissions['perms_auto']) ? intval($role_permissions['perms_accept']) : 0), - intval(local_user()), + intval(local_channel()), intval(ABOOK_FLAG_SELF) ); - set_pconfig(local_user(),'system','autoperms',(($role_permissions['perms_auto']) ? intval($role_permissions['perms_accept']) : 0)); + set_pconfig(local_channel(),'system','autoperms',(($role_permissions['perms_auto']) ? intval($role_permissions['perms_accept']) : 0)); foreach($role_permissions as $p => $v) { if(strpos($p,'channel_') !== false) { @@ -374,8 +374,8 @@ function settings_post(&$a) { } } - set_pconfig(local_user(),'system','hide_online_status',$hide_presence); - set_pconfig(local_user(),'system','permissions_role',$role); + set_pconfig(local_channel(),'system','hide_online_status',$hide_presence); + set_pconfig(local_channel(),'system','permissions_role',$role); } $username = ((x($_POST,'username')) ? notags(trim($_POST['username'])) : ''); @@ -481,16 +481,16 @@ function settings_post(&$a) { date_default_timezone_set($timezone); } - set_pconfig(local_user(),'system','use_browser_location',$allow_location); - set_pconfig(local_user(),'system','suggestme', $suggestme); - set_pconfig(local_user(),'system','post_newfriend', $post_newfriend); - set_pconfig(local_user(),'system','post_joingroup', $post_joingroup); - set_pconfig(local_user(),'system','post_profilechange', $post_profilechange); - set_pconfig(local_user(),'system','blocktags',$blocktags); - set_pconfig(local_user(),'system','channel_menu',$channel_menu); - set_pconfig(local_user(),'system','vnotify',$vnotify); - set_pconfig(local_user(),'system','always_show_in_notices',$always_show_in_notices); - set_pconfig(local_user(),'system','evdays',$evdays); + set_pconfig(local_channel(),'system','use_browser_location',$allow_location); + set_pconfig(local_channel(),'system','suggestme', $suggestme); + set_pconfig(local_channel(),'system','post_newfriend', $post_newfriend); + set_pconfig(local_channel(),'system','post_joingroup', $post_joingroup); + set_pconfig(local_channel(),'system','post_profilechange', $post_profilechange); + set_pconfig(local_channel(),'system','blocktags',$blocktags); + set_pconfig(local_channel(),'system','channel_menu',$channel_menu); + set_pconfig(local_channel(),'system','vnotify',$vnotify); + set_pconfig(local_channel(),'system','always_show_in_notices',$always_show_in_notices); + set_pconfig(local_channel(),'system','evdays',$evdays); $r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d $set_perms where channel_id = %d", dbesc($username), @@ -501,7 +501,7 @@ function settings_post(&$a) { intval($unkmail), intval($maxreq), intval($expire), - intval(local_user()) + intval(local_channel()) ); if($r) info( t('Settings updated.') . EOL); @@ -509,7 +509,7 @@ function settings_post(&$a) { if(! is_null($publish)) { $r = q("UPDATE profile SET publish = %d WHERE is_default = 1 AND uid = %d", intval($publish), - intval(local_user()) + intval(local_channel()) ); } @@ -525,7 +525,7 @@ function settings_post(&$a) { ); } - proc_run('php','include/directory.php',local_user()); + proc_run('php','include/directory.php',local_channel()); build_sync_packet(); @@ -550,7 +550,7 @@ function settings_content(&$a) { nav_set_selected('settings'); - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL ); return login(); } @@ -588,7 +588,7 @@ function settings_content(&$a) { if((argc() > 3) && (argv(2) === 'edit')) { $r = q("SELECT * FROM clients WHERE client_id='%s' AND uid=%d", dbesc(argv(3)), - local_user()); + local_channel()); if (!count($r)){ notice(t("You can't edit this application.")); @@ -616,7 +616,7 @@ function settings_content(&$a) { $r = q("DELETE FROM clients WHERE client_id='%s' AND uid=%d", dbesc(argv(3)), - local_user()); + local_channel()); goaway($a->get_baseurl(true)."/settings/oauth/"); return; } @@ -626,8 +626,8 @@ function settings_content(&$a) { FROM clients LEFT JOIN tokens ON clients.client_id=tokens.client_id WHERE clients.uid IN (%d,0)", - local_user(), - local_user()); + local_channel(), + local_channel()); $tpl = get_markup_template("settings_oauth.tpl"); @@ -706,7 +706,7 @@ function settings_content(&$a) { $arr[$fname] = array(); $arr[$fname][0] = $fdata[0]; foreach(array_slice($fdata,1) as $f) { - $arr[$fname][1][] = array('feature_' .$f[0],$f[1],((intval(feature_enabled(local_user(),$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On'))); + $arr[$fname][1][] = array('feature_' .$f[0],$f[1],((intval(feature_enabled(local_channel(),$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On'))); } } @@ -795,19 +795,19 @@ function settings_content(&$a) { $theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']); $mobile_theme_selected = (!x($_SESSION,'mobile_theme')? $default_mobile_theme : $_SESSION['mobile_theme']); - $user_scalable = get_pconfig(local_user(),'system','user_scalable'); + $user_scalable = get_pconfig(local_channel(),'system','user_scalable'); $user_scalable = (($user_scalable===false)? '1': $user_scalable); // default if not set: 1 - $browser_update = intval(get_pconfig(local_user(), 'system','update_interval')); + $browser_update = intval(get_pconfig(local_channel(), 'system','update_interval')); $browser_update = (($browser_update == 0) ? 80 : $browser_update / 1000); // default if not set: 40 seconds - $itemspage = intval(get_pconfig(local_user(), 'system','itemspage')); + $itemspage = intval(get_pconfig(local_channel(), 'system','itemspage')); $itemspage = (($itemspage > 0 && $itemspage < 101) ? $itemspage : 20); // default if not set: 20 items - $nosmile = get_pconfig(local_user(),'system','no_smilies'); + $nosmile = get_pconfig(local_channel(),'system','no_smilies'); $nosmile = (($nosmile===false)? '0': $nosmile); // default if not set: 0 - $title_tosource = get_pconfig(local_user(),'system','title_tosource'); + $title_tosource = get_pconfig(local_channel(),'system','title_tosource'); $title_tosource = (($title_tosource===false)? '0': $title_tosource); // default if not set: 0 $theme_config = ""; @@ -822,7 +822,7 @@ function settings_content(&$a) { '$form_security_token' => get_form_security_token("settings_display"), '$submit' => t('Submit'), '$baseurl' => $a->get_baseurl(true), - '$uid' => local_user(), + '$uid' => local_channel(), '$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes, 'preview'), '$mobile_theme' => array('mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, ''), @@ -833,11 +833,11 @@ function settings_content(&$a) { '$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, ''), '$layout_editor' => t('System Page Layout Editor - (advanced)'), '$theme_config' => $theme_config, - '$expert' => feature_enabled(local_user(),'expert'), - '$channel_list_mode' => array('channel_list_mode', t('Use blog/list mode on channel page'), get_pconfig(local_user(),'system','channel_list_mode'), t('(comments displayed separately)')), - '$network_list_mode' => array('network_list_mode', t('Use blog/list mode on matrix page'), get_pconfig(local_user(),'system','network_list_mode'), t('(comments displayed separately)')), - '$channel_divmore_height' => array('channel_divmore_height', t('Channel page max height of content (in pixels)'), ((get_pconfig(local_user(),'system','channel_divmore_height')) ? get_pconfig(local_user(),'system','channel_divmore_height') : 400), t('click to expand content exceeding this height')), - '$network_divmore_height' => array('network_divmore_height', t('Matrix page max height of content (in pixels)'), ((get_pconfig(local_user(),'system','network_divmore_height')) ? get_pconfig(local_user(),'system','network_divmore_height') : 400) , t('click to expand content exceeding this height')), + '$expert' => feature_enabled(local_channel(),'expert'), + '$channel_list_mode' => array('channel_list_mode', t('Use blog/list mode on channel page'), get_pconfig(local_channel(),'system','channel_list_mode'), t('(comments displayed separately)')), + '$network_list_mode' => array('network_list_mode', t('Use blog/list mode on matrix page'), get_pconfig(local_channel(),'system','network_list_mode'), t('(comments displayed separately)')), + '$channel_divmore_height' => array('channel_divmore_height', t('Channel page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','channel_divmore_height')) ? get_pconfig(local_channel(),'system','channel_divmore_height') : 400), t('click to expand content exceeding this height')), + '$network_divmore_height' => array('network_divmore_height', t('Matrix page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','network_divmore_height')) ? get_pconfig(local_channel(),'system','network_divmore_height') : 400) , t('click to expand content exceeding this height')), )); @@ -856,12 +856,12 @@ function settings_content(&$a) { $p = q("SELECT * FROM `profile` WHERE `is_default` = 1 AND `uid` = %d LIMIT 1", - intval(local_user()) + intval(local_channel()) ); if(count($p)) $profile = $p[0]; - load_pconfig(local_user(),'expire'); + load_pconfig(local_channel(),'expire'); $channel = $a->get_channel(); @@ -910,38 +910,38 @@ function settings_content(&$a) { // $unkmail = $a->user['unkmail']; // $cntunkmail = $a->user['cntunkmail']; - $hide_presence = intval(get_pconfig(local_user(), 'system','hide_online_status')); + $hide_presence = intval(get_pconfig(local_channel(), 'system','hide_online_status')); - $expire_items = get_pconfig(local_user(), 'expire','items'); + $expire_items = get_pconfig(local_channel(), 'expire','items'); $expire_items = (($expire_items===false)? '1' : $expire_items); // default if not set: 1 - $expire_notes = get_pconfig(local_user(), 'expire','notes'); + $expire_notes = get_pconfig(local_channel(), 'expire','notes'); $expire_notes = (($expire_notes===false)? '1' : $expire_notes); // default if not set: 1 - $expire_starred = get_pconfig(local_user(), 'expire','starred'); + $expire_starred = get_pconfig(local_channel(), 'expire','starred'); $expire_starred = (($expire_starred===false)? '1' : $expire_starred); // default if not set: 1 - $expire_photos = get_pconfig(local_user(), 'expire','photos'); + $expire_photos = get_pconfig(local_channel(), 'expire','photos'); $expire_photos = (($expire_photos===false)? '0' : $expire_photos); // default if not set: 0 - $expire_network_only = get_pconfig(local_user(), 'expire','network_only'); + $expire_network_only = get_pconfig(local_channel(), 'expire','network_only'); $expire_network_only = (($expire_network_only===false)? '0' : $expire_network_only); // default if not set: 0 - $suggestme = get_pconfig(local_user(), 'system','suggestme'); + $suggestme = get_pconfig(local_channel(), 'system','suggestme'); $suggestme = (($suggestme===false)? '0': $suggestme); // default if not set: 0 - $post_newfriend = get_pconfig(local_user(), 'system','post_newfriend'); + $post_newfriend = get_pconfig(local_channel(), 'system','post_newfriend'); $post_newfriend = (($post_newfriend===false)? '0': $post_newfriend); // default if not set: 0 - $post_joingroup = get_pconfig(local_user(), 'system','post_joingroup'); + $post_joingroup = get_pconfig(local_channel(), 'system','post_joingroup'); $post_joingroup = (($post_joingroup===false)? '0': $post_joingroup); // default if not set: 0 - $post_profilechange = get_pconfig(local_user(), 'system','post_profilechange'); + $post_profilechange = get_pconfig(local_channel(), 'system','post_profilechange'); $post_profilechange = (($post_profilechange===false)? '0': $post_profilechange); // default if not set: 0 - $blocktags = get_pconfig(local_user(),'system','blocktags'); + $blocktags = get_pconfig(local_channel(),'system','blocktags'); $blocktags = (($blocktags===false) ? '0' : $blocktags); $timezone = date_default_timezone_get(); @@ -985,31 +985,31 @@ function settings_content(&$a) { require_once('include/group.php'); - $group_select = mini_group_select(local_user(),$channel['channel_default_group']); + $group_select = mini_group_select(local_channel(),$channel['channel_default_group']); require_once('include/menu.php'); - $m1 = menu_list(local_user()); + $m1 = menu_list(local_channel()); $menu = false; if($m1) { $menu = array(); - $current = get_pconfig(local_user(),'system','channel_menu'); + $current = get_pconfig(local_channel(),'system','channel_menu'); $menu[] = array('name' => '', 'selected' => ((! $current) ? true : false)); foreach($m1 as $m) { $menu[] = array('name' => htmlspecialchars($m['menu_name'],ENT_COMPAT,'UTF-8'), 'selected' => (($m['menu_name'] === $current) ? ' selected="selected" ' : false)); } } - $evdays = get_pconfig(local_user(),'system','evdays'); + $evdays = get_pconfig(local_channel(),'system','evdays'); if(! $evdays) $evdays = 3; - $permissions_role = get_pconfig(local_user(),'system','permissions_role'); + $permissions_role = get_pconfig(local_channel(),'system','permissions_role'); if(! $permissions_role) $permissions_role = 'custom'; $permissions_set = (($permissions_role != 'custom') ? true : false); - $vnotify = get_pconfig(local_user(),'system','vnotify'); - $always_show_in_notices = get_pconfig(local_user(),'system','always_show_in_notices'); + $vnotify = get_pconfig(local_channel(),'system','vnotify'); + $always_show_in_notices = get_pconfig(local_channel(),'system','always_show_in_notices'); if($vnotify === false) $vnotify = (-1); @@ -1018,7 +1018,7 @@ function settings_content(&$a) { '$submit' => t('Submit'), '$baseurl' => $a->get_baseurl(true), - '$uid' => local_user(), + '$uid' => local_channel(), '$form_security_token' => get_form_security_token("settings"), '$nickname_block' => $prof_addr, '$h_basic' => t('Basic Settings'), @@ -1026,7 +1026,7 @@ function settings_content(&$a) { '$email' => array('email', t('Email Address:'), $email, ''), '$timezone' => array('timezone_select' , t('Your Timezone:'), $timezone, '', get_timezones()), '$defloc' => array('defloc', t('Default Post Location:'), $defloc, t('Geographical location to display on your posts')), - '$allowloc' => array('allow_location', t('Use Browser Location:'), ((get_pconfig(local_user(),'system','use_browser_location')) ? 1 : ''), ''), + '$allowloc' => array('allow_location', t('Use Browser Location:'), ((get_pconfig(local_channel(),'system','use_browser_location')) ? 1 : ''), ''), '$adult' => array('adult', t('Adult Content'), $adult_flag, t('This channel frequently or regularly publishes adult content. (Please tag any adult material and/or nudity with #NSFW)')), @@ -1098,7 +1098,7 @@ function settings_content(&$a) { '$h_advn' => t('Advanced Account/Page Type Settings'), '$h_descadvn' => t('Change the behaviour of this account for special situations'), '$pagetype' => $pagetype, - '$expert' => feature_enabled(local_user(),'expert'), + '$expert' => feature_enabled(local_channel(),'expert'), '$hint' => t('Please enable expert mode (in <a href="settings/features">Settings > Additional features</a>) to adjust!'), '$lbl_misc' => t('Miscellaneous Settings'), '$menus' => $menu, diff --git a/mod/share.php b/mod/share.php index d70336ed1..2fb3d95cc 100644 --- a/mod/share.php +++ b/mod/share.php @@ -10,7 +10,7 @@ function share_init(&$a) { if(! $post_id) killme(); - if(! (local_user() || remote_user())) + if(! (local_channel() || remote_user())) killme(); @@ -39,7 +39,7 @@ function share_init(&$a) { // on your home site. // When that works remove this next bit: - if(! local_user()) + if(! local_channel()) killme(); xchan_query($r); @@ -60,7 +60,7 @@ function share_init(&$a) { $o.= "[/share]"; } - if(local_user()) { + if(local_channel()) { echo $o; killme(); } diff --git a/mod/sharedwithme.php b/mod/sharedwithme.php index 56cbc35ec..d91987027 100644 --- a/mod/sharedwithme.php +++ b/mod/sharedwithme.php @@ -3,20 +3,20 @@ require_once('include/conversation.php'); require_once('include/text.php'); function sharedwithme_content(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } $channel = $a->get_channel(); - $is_owner = (local_user() && (local_user() == $channel['channel_id'])); + $is_owner = (local_channel() && (local_channel() == $channel['channel_id'])); //maintenance - see if a file got dropped and remove it systemwide - this should possibly go to include/poller $x = q("SELECT * FROM item WHERE verb = '%s' AND obj_type = '%s' AND uid = %d", dbesc(ACTIVITY_UPDATE), dbesc(ACTIVITY_OBJ_FILE), - intval(local_user()) + intval(local_channel()) ); if($x) { @@ -47,7 +47,7 @@ function sharedwithme_content(&$a) { q("DELETE FROM item WHERE id = %d AND uid = %d", intval($id), - intval(local_user()) + intval(local_channel()) ); goaway(z_root() . '/sharedwithme'); @@ -59,7 +59,7 @@ function sharedwithme_content(&$a) { q("DELETE FROM item WHERE verb = '%s' AND obj_type = '%s' AND uid = %d", dbesc(ACTIVITY_POST), dbesc(ACTIVITY_OBJ_FILE), - intval(local_user()) + intval(local_channel()) ); goaway(z_root() . '/sharedwithme'); @@ -69,7 +69,7 @@ function sharedwithme_content(&$a) { $r = q("SELECT * FROM item WHERE verb = '%s' AND obj_type = '%s' AND uid = %d AND owner_xchan != '%s'", dbesc(ACTIVITY_POST), dbesc(ACTIVITY_OBJ_FILE), - intval(local_user()), + intval(local_channel()), dbesc($channel['channel_hash']) ); diff --git a/mod/sources.php b/mod/sources.php index 73d78bbbf..0aaaa82b1 100644 --- a/mod/sources.php +++ b/mod/sources.php @@ -1,10 +1,10 @@ <?php /** @file */ function sources_post(&$a) { - if(! local_user()) + if(! local_channel()) return; - if(! feature_enabled(local_user(),'channel_sources')) + if(! feature_enabled(local_channel(),'channel_sources')) return ''; $source = intval($_REQUEST['source']); @@ -22,7 +22,7 @@ function sources_post(&$a) { if($abook) { $r = q("select abook_xchan from abook where abook_id = %d and abook_channel = %d limit 1", intval($abook), - intval(local_user()) + intval(local_channel()) ); if($r) $xchan = $r[0]['abook_xchan']; @@ -36,7 +36,7 @@ function sources_post(&$a) { if(! $source) { $r = q("insert into source ( src_channel_id, src_channel_xchan, src_xchan, src_patt ) values ( %d, '%s', '%s', '%s' ) ", - intval(local_user()), + intval(local_channel()), dbesc($channel['channel_hash']), dbesc($xchan), dbesc($words) @@ -50,7 +50,7 @@ function sources_post(&$a) { $r = q("update source set src_xchan = '%s', src_patt = '%s' where src_channel_id = %d and src_id = %d", dbesc($xchan), dbesc($words), - intval(local_user()), + intval(local_channel()), intval($source) ); if($r) { @@ -62,19 +62,19 @@ function sources_post(&$a) { function sources_content(&$a) { - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return ''; } - if(! feature_enabled(local_user(),'channel_sources')) { + if(! feature_enabled(local_channel(),'channel_sources')) { return ''; } // list sources if(argc() == 1) { $r = q("select source.*, xchan.* from source left join xchan on src_xchan = xchan_hash where src_channel_id = %d", - intval(local_user()) + intval(local_channel()) ); if($r) { for($x = 0; $x < count($r); $x ++) { @@ -111,12 +111,12 @@ function sources_content(&$a) { // edit source $r = q("select source.*, xchan.* from source left join xchan on src_xchan = xchan_hash where src_id = %d and src_channel_id = %d limit 1", intval(argv(1)), - intval(local_user()) + intval(local_channel()) ); if($r) { $x = q("select abook_id from abook where abook_xchan = '%s' and abook_channel = %d limit 1", dbesc($r[0]['src_xchan']), - intval(local_user()) + intval(local_channel()) ); } if(! $r) { @@ -144,7 +144,7 @@ function sources_content(&$a) { if(argc() == 3 && intval(argv(1)) && argv(2) === 'drop') { $r = q("select * from source where src_id = %d and src_channel_id = %d limit 1", intval(argv(1)), - intval(local_user()) + intval(local_channel()) ); if(! $r) { notice( t('Source not found.') . EOL); @@ -152,7 +152,7 @@ function sources_content(&$a) { } $r = q("delete from source where src_id = %d and src_channel_id = %d", intval(argv(1)), - intval(local_user()) + intval(local_channel()) ); if($r) info( t('Source removed') . EOL); diff --git a/mod/starred.php b/mod/starred.php index 05b45bea3..b6736fd85 100644 --- a/mod/starred.php +++ b/mod/starred.php @@ -5,7 +5,7 @@ function starred_init(&$a) { $starred = 0; - if(! local_user()) + if(! local_channel()) killme(); if(argc() > 1) $message_id = intval(argv(1)); @@ -13,7 +13,7 @@ function starred_init(&$a) { killme(); $r = q("SELECT item_flags FROM item WHERE uid = %d AND id = %d LIMIT 1", - intval(local_user()), + intval(local_channel()), intval($message_id) ); if(! count($r)) @@ -23,7 +23,7 @@ function starred_init(&$a) { $r = q("UPDATE item SET item_flags = %d WHERE uid = %d and id = %d", intval($item_flags), - intval(local_user()), + intval(local_channel()), intval($message_id) ); diff --git a/mod/subthread.php b/mod/subthread.php index f0f54f4a6..00ec87070 100755 --- a/mod/subthread.php +++ b/mod/subthread.php @@ -7,7 +7,7 @@ require_once('include/items.php'); function subthread_content(&$a) { - if((! local_user()) && (! remote_user())) { + if((! local_channel()) && (! remote_user())) { return; } diff --git a/mod/suggest.php b/mod/suggest.php index 8a6b50b22..fec0e85a4 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -6,12 +6,12 @@ require_once('include/widgets.php'); function suggest_init(&$a) { - if(! local_user()) + if(! local_channel()) return; if(x($_GET,'ignore')) { q("insert into xign ( uid, xchan ) values ( %d, '%s' ) ", - intval(local_user()), + intval(local_channel()), dbesc($_GET['ignore']) ); } @@ -22,14 +22,14 @@ function suggest_init(&$a) { function suggest_content(&$a) { $o = ''; - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd; - $r = suggestion_query(local_user(),get_observer_hash()); + $r = suggestion_query(local_channel(),get_observer_hash()); if(! $r) { info( t('No suggestions available. If this is a new site, please try again in 24 hours.')); diff --git a/mod/tagger.php b/mod/tagger.php index bfda114d2..68792ab5f 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -7,7 +7,7 @@ require_once('include/items.php'); function tagger_content(&$a) { - if(! local_user() && ! remote_user()) { + if(! local_channel() && ! remote_user()) { return; } @@ -27,7 +27,7 @@ function tagger_content(&$a) { $r = q("SELECT * FROM item left join xchan on xchan_hash = author_xchan WHERE id = '%s' and uid = %d LIMIT 1", dbesc($item_id), - intval(local_user()) + intval(local_channel()) ); if((! $item_id) || (! $r)) { diff --git a/mod/tagrm.php b/mod/tagrm.php index 38787cb0b..56e842fb8 100644 --- a/mod/tagrm.php +++ b/mod/tagrm.php @@ -4,7 +4,7 @@ require_once('bbcode.php'); function tagrm_post(&$a) { - if(! local_user()) + if(! local_channel()) goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); @@ -16,7 +16,7 @@ function tagrm_post(&$a) { $r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($item), - intval(local_user()) + intval(local_channel()) ); if(! $r) @@ -52,7 +52,7 @@ function tagrm_post(&$a) { function tagrm_content(&$a) { - if(! local_user()) { + if(! local_channel()) { goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']); // NOTREACHED } @@ -65,7 +65,7 @@ function tagrm_content(&$a) { $r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($item), - intval(local_user()) + intval(local_channel()) ); if(! $r) @@ -105,7 +105,7 @@ function tagrm_content(&$a) { $r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($item), - intval(local_user()) + intval(local_channel()) ); if(! $r) diff --git a/mod/thing.php b/mod/thing.php index f53a6ab7b..4ec10f5a6 100644 --- a/mod/thing.php +++ b/mod/thing.php @@ -6,7 +6,7 @@ require_once('include/contact_selectors.php'); function thing_init(&$a) { - if(! local_user()) + if(! local_channel()) return; @@ -90,7 +90,7 @@ function thing_init(&$a) { dbesc(($url) ? $url : z_root() . '/thing/' . $term_hash), dbesc($local_photo), dbesc($term_hash), - intval(local_user()) + intval(local_channel()) ); info( t('Thing updated') . EOL); @@ -99,7 +99,7 @@ function thing_init(&$a) { $sql = (($profile_guid) ? " and profile_guid = '" . dbesc($profile_guid) . "' " : " and is_default = 1 "); $p = q("select profile_guid, is_default from profile where uid = %d $sql limit 1", - intval(local_user()) + intval(local_channel()) ); if($p) @@ -117,7 +117,7 @@ function thing_init(&$a) { $r = q("select * from term where uid = %d and otype = %d and type = %d and term = '%s' limit 1", - intval(local_user()), + intval(local_channel()), intval(TERM_OBJ_THING), intval(TERM_THING), dbesc($name) @@ -126,7 +126,7 @@ function thing_init(&$a) { $r = q("insert into term ( aid, uid, oid, otype, type, term, url, imgurl, term_hash ) values( %d, %d, %d, %d, %d, '%s', '%s', '%s', '%s' ) ", intval($account_id), - intval(local_user()), + intval(local_channel()), 0, intval(TERM_OBJ_THING), intval(TERM_THING), @@ -136,7 +136,7 @@ function thing_init(&$a) { dbesc($hash) ); $r = q("select * from term where uid = %d and otype = %d and type = %d and term = '%s' limit 1", - intval(local_user()), + intval(local_channel()), intval(TERM_OBJ_THING), intval(TERM_THING), dbesc($name) @@ -148,7 +148,7 @@ function thing_init(&$a) { dbesc($profile['profile_guid']), dbesc($verb), intval(TERM_OBJ_THING), - intval(local_user()), + intval(local_channel()), dbesc($term['term_hash']) ); @@ -201,7 +201,7 @@ function thing_init(&$a) { $arr['item_private'] = true; $str = ''; $r = q("select abook_xchan from abook where abook_channel = %d and abook_profile = '%s'", - intval(local_user()), + intval(local_channel()), dbesc($profile_guid) ); if($r) { @@ -232,7 +232,7 @@ function thing_content(&$a) { '$header' => t('Show Thing'), '$edit' => t('Edit'), '$delete' => t('Delete'), - '$canedit' => ((local_user() && local_user() == $r[0]['obj_channel']) ? true : false), + '$canedit' => ((local_channel() && local_channel() == $r[0]['obj_channel']) ? true : false), '$thing' => $r[0] )); } else { @@ -243,7 +243,7 @@ function thing_content(&$a) { $channel = $a->get_channel(); - if(! (local_user() && $channel)) { + if(! (local_channel() && $channel)) { notice( t('Permission denied.') . EOL); return; } @@ -260,7 +260,7 @@ function thing_content(&$a) { dbesc($thing_hash) ); - if((! $r) || ($r[0]['obj_channel'] != local_user())) { + if((! $r) || ($r[0]['obj_channel'] != local_channel())) { notice( t('Permission denied.') . EOL); return ''; } @@ -268,7 +268,7 @@ function thing_content(&$a) { $o .= replace_macros(get_markup_template('thing_edit.tpl'),array( '$thing_hdr' => t('Edit Thing'), - '$multiprof' => feature_enabled(local_user(),'multi_profiles'), + '$multiprof' => feature_enabled(local_channel(),'multi_profiles'), '$profile_lbl' => t('Select a profile'), '$profile_select' => contact_profile_assign($r[0]['obj_page']), '$verb_lbl' => $channel['channel_name'], @@ -295,7 +295,7 @@ function thing_content(&$a) { dbesc($thing_hash) ); - if((! $r) || ($r[0]['obj_channel'] != local_user())) { + if((! $r) || ($r[0]['obj_channel'] != local_channel())) { notice( t('Permission denied.') . EOL); return ''; } @@ -304,18 +304,18 @@ function thing_content(&$a) { $x = q("delete from obj where obj_obj = '%s' and obj_type = %d and obj_channel = %d", dbesc($thing_hash), intval(TERM_OBJ_THING), - intval(local_user()) + intval(local_channel()) ); $x = q("delete from term where term_hash = '%s' and uid = %d", dbesc($thing_hash), - intval(local_user()) + intval(local_channel()) ); return $o; } $o .= replace_macros(get_markup_template('thing_input.tpl'),array( '$thing_hdr' => t('Add Thing to your Profile'), - '$multiprof' => feature_enabled(local_user(),'multi_profiles'), + '$multiprof' => feature_enabled(local_channel(),'multi_profiles'), '$profile_lbl' => t('Select a profile'), '$profile_select' => contact_profile_assign(''), '$verb_lbl' => $channel['channel_name'], diff --git a/mod/uexport.php b/mod/uexport.php index 250a001a2..edcb2fa84 100644 --- a/mod/uexport.php +++ b/mod/uexport.php @@ -1,7 +1,7 @@ <?php function uexport_init(&$a) { - if(! local_user()) + if(! local_channel()) killme(); if(argc() > 1) { @@ -14,7 +14,7 @@ function uexport_init(&$a) { if(argc() > 1 && argv(1) === 'basic') { - echo json_encode(identity_basic_export(local_user())); + echo json_encode(identity_basic_export(local_channel())); killme(); } @@ -22,7 +22,7 @@ function uexport_init(&$a) { // It probably needs to be built at the CLI and offered to download as a tarball. Maybe stored in the members dav. if(argc() > 1 && argv(1) === 'complete') { - echo json_encode(identity_basic_export(local_user(),true)); + echo json_encode(identity_basic_export(local_channel(),true)); killme(); } } diff --git a/mod/viewconnections.php b/mod/viewconnections.php index aab136c43..1be5c157f 100644 --- a/mod/viewconnections.php +++ b/mod/viewconnections.php @@ -4,7 +4,7 @@ require_once('include/Contact.php'); function viewconnections_init(&$a) { - if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { + if((get_config('system','block_public')) && (! local_channel()) && (! remote_user())) { return; } if(argc() > 1) @@ -13,7 +13,7 @@ function viewconnections_init(&$a) { function viewconnections_content(&$a) { - if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { + if((get_config('system','block_public')) && (! local_channel()) && (! remote_user())) { notice( t('Public access denied.') . EOL); return; } @@ -28,7 +28,7 @@ function viewconnections_content(&$a) { return; } - $is_owner = ((local_user() && local_user() == $a->profile['uid']) ? true : false); + $is_owner = ((local_channel() && local_channel() == $a->profile['uid']) ? true : false); $abook_flags = ABOOK_FLAG_PENDING|ABOOK_FLAG_SELF; $xchan_flags = XCHAN_FLAGS_ORPHAN|XCHAN_FLAGS_DELETED; diff --git a/mod/viewsrc.php b/mod/viewsrc.php index 982d1c417..983a0e725 100644 --- a/mod/viewsrc.php +++ b/mod/viewsrc.php @@ -10,7 +10,7 @@ function viewsrc_content(&$a) { $item_id = ((argc() > 1) ? intval(argv(1)) : 0); $json = ((argc() > 2 && argv(2) === 'json') ? true : false); - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); } @@ -20,9 +20,9 @@ function viewsrc_content(&$a) { notice( t('Item not found.') . EOL); } - if(local_user() && $item_id) { + if(local_channel() && $item_id) { $r = q("select item_flags, body from item where item_restrict = 0 and uid in (%d , %d) and id = %d limit 1", - intval(local_user()), + intval(local_channel()), intval($sys['channel_id']), intval($item_id) ); diff --git a/mod/webpages.php b/mod/webpages.php index baddebec8..6aff72a5e 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -33,7 +33,7 @@ function webpages_content(&$a) { $which = argv(1); - $uid = local_user(); + $uid = local_channel(); $owner = 0; $channel = null; $observer = $a->get_observer(); diff --git a/mod/zping.php b/mod/zping.php index 76f4470c1..311517701 100644 --- a/mod/zping.php +++ b/mod/zping.php @@ -12,7 +12,7 @@ function zping_content(&$a) { // Remember to add '/post' to the url - if(! local_user()) + if(! local_channel()) return; $url = $_REQUEST['url']; diff --git a/util/fresh b/util/fresh index 7f96a319c..8bee5dff7 100755 --- a/util/fresh +++ b/util/fresh @@ -99,7 +99,7 @@ function process_command($line) { } break; case 'channel': - if(! local_user()) + if(! local_channel()) echo 'Permission denied.'; if(argv(1)) { $r = q("select * from channel where channel_address = '%s' and channel_account_id = %d limit 1", @@ -116,7 +116,7 @@ function process_command($line) { } break; case 'conn': - if(! local_user()) { + if(! local_channel()) { echo "Permission denied."; break; } @@ -124,14 +124,14 @@ function process_command($line) { for($x = 1; $x < argc(); $x ++) { $r = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_id = %d and abook_channel = %d", intval(argv($x)), - intval(local_user()) + intval(local_channel()) ); if($r) echo jindent(json_encode($r[0])) . "\n"; } } else { $r = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d order by abook_id", - intval(local_user()) + intval(local_channel()) ); if($r) { foreach($r as $rr) diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php index bfef8216c..b072f5782 100644 --- a/view/theme/redbasic/php/config.php +++ b/view/theme/redbasic/php/config.php @@ -1,79 +1,79 @@ <?php function theme_content(&$a) { - if(!local_user()) { return;} + if(!local_channel()) { return;} $arr = array(); - $arr['schema'] = get_pconfig(local_user(),'redbasic', 'schema' ); - $arr['narrow_navbar'] = get_pconfig(local_user(),'redbasic', 'narrow_navbar' ); - $arr['nav_bg'] = get_pconfig(local_user(),'redbasic', 'nav_bg' ); - $arr['nav_gradient_top'] = get_pconfig(local_user(),'redbasic', 'nav_gradient_top' ); - $arr['nav_gradient_bottom'] = get_pconfig(local_user(),'redbasic', 'nav_gradient_bottom' ); - $arr['nav_active_gradient_top'] = get_pconfig(local_user(),'redbasic', 'nav_active_gradient_top' ); - $arr['nav_active_gradient_bottom'] = get_pconfig(local_user(),'redbasic', 'nav_active_gradient_bottom' ); - $arr['nav_bd'] = get_pconfig(local_user(),'redbasic', 'nav_bd' ); - $arr['nav_icon_colour'] = get_pconfig(local_user(),'redbasic', 'nav_icon_colour' ); - $arr['nav_active_icon_colour'] = get_pconfig(local_user(),'redbasic', 'nav_active_icon_colour' ); - $arr['link_colour'] = get_pconfig(local_user(),'redbasic', 'link_colour' ); - $arr['banner_colour'] = get_pconfig(local_user(),'redbasic', 'banner_colour' ); - $arr['bgcolour'] = get_pconfig(local_user(),'redbasic', 'background_colour' ); - $arr['background_image'] = get_pconfig(local_user(),'redbasic', 'background_image' ); - $arr['item_colour'] = get_pconfig(local_user(),'redbasic', 'item_colour' ); - $arr['comment_item_colour'] = get_pconfig(local_user(),'redbasic', 'comment_item_colour' ); - $arr['comment_border_colour'] = get_pconfig(local_user(),'redbasic', 'comment_border_colour' ); - $arr['comment_indent'] = get_pconfig(local_user(),'redbasic', 'comment_indent' ); - $arr['toolicon_colour'] = get_pconfig(local_user(),'redbasic','toolicon_colour'); - $arr['toolicon_activecolour'] = get_pconfig(local_user(),'redbasic','toolicon_activecolour'); - $arr['font_size'] = get_pconfig(local_user(),'redbasic', 'font_size' ); - $arr['body_font_size'] = get_pconfig(local_user(),'redbasic', 'body_font_size' ); - $arr['font_colour'] = get_pconfig(local_user(),'redbasic', 'font_colour' ); - $arr['radius'] = get_pconfig(local_user(),'redbasic', 'radius' ); - $arr['shadow'] = get_pconfig(local_user(),'redbasic', 'photo_shadow' ); - $arr['converse_width']=get_pconfig(local_user(),"redbasic","converse_width"); - $arr['converse_center']=get_pconfig(local_user(),"redbasic","converse_center"); - $arr['nav_min_opacity']=get_pconfig(local_user(),"redbasic","nav_min_opacity"); - $arr['top_photo']=get_pconfig(local_user(),"redbasic","top_photo"); - $arr['reply_photo']=get_pconfig(local_user(),"redbasic","reply_photo"); - $arr['sloppy_photos']=get_pconfig(local_user(),"redbasic","sloppy_photos"); + $arr['schema'] = get_pconfig(local_channel(),'redbasic', 'schema' ); + $arr['narrow_navbar'] = get_pconfig(local_channel(),'redbasic', 'narrow_navbar' ); + $arr['nav_bg'] = get_pconfig(local_channel(),'redbasic', 'nav_bg' ); + $arr['nav_gradient_top'] = get_pconfig(local_channel(),'redbasic', 'nav_gradient_top' ); + $arr['nav_gradient_bottom'] = get_pconfig(local_channel(),'redbasic', 'nav_gradient_bottom' ); + $arr['nav_active_gradient_top'] = get_pconfig(local_channel(),'redbasic', 'nav_active_gradient_top' ); + $arr['nav_active_gradient_bottom'] = get_pconfig(local_channel(),'redbasic', 'nav_active_gradient_bottom' ); + $arr['nav_bd'] = get_pconfig(local_channel(),'redbasic', 'nav_bd' ); + $arr['nav_icon_colour'] = get_pconfig(local_channel(),'redbasic', 'nav_icon_colour' ); + $arr['nav_active_icon_colour'] = get_pconfig(local_channel(),'redbasic', 'nav_active_icon_colour' ); + $arr['link_colour'] = get_pconfig(local_channel(),'redbasic', 'link_colour' ); + $arr['banner_colour'] = get_pconfig(local_channel(),'redbasic', 'banner_colour' ); + $arr['bgcolour'] = get_pconfig(local_channel(),'redbasic', 'background_colour' ); + $arr['background_image'] = get_pconfig(local_channel(),'redbasic', 'background_image' ); + $arr['item_colour'] = get_pconfig(local_channel(),'redbasic', 'item_colour' ); + $arr['comment_item_colour'] = get_pconfig(local_channel(),'redbasic', 'comment_item_colour' ); + $arr['comment_border_colour'] = get_pconfig(local_channel(),'redbasic', 'comment_border_colour' ); + $arr['comment_indent'] = get_pconfig(local_channel(),'redbasic', 'comment_indent' ); + $arr['toolicon_colour'] = get_pconfig(local_channel(),'redbasic','toolicon_colour'); + $arr['toolicon_activecolour'] = get_pconfig(local_channel(),'redbasic','toolicon_activecolour'); + $arr['font_size'] = get_pconfig(local_channel(),'redbasic', 'font_size' ); + $arr['body_font_size'] = get_pconfig(local_channel(),'redbasic', 'body_font_size' ); + $arr['font_colour'] = get_pconfig(local_channel(),'redbasic', 'font_colour' ); + $arr['radius'] = get_pconfig(local_channel(),'redbasic', 'radius' ); + $arr['shadow'] = get_pconfig(local_channel(),'redbasic', 'photo_shadow' ); + $arr['converse_width']=get_pconfig(local_channel(),"redbasic","converse_width"); + $arr['converse_center']=get_pconfig(local_channel(),"redbasic","converse_center"); + $arr['nav_min_opacity']=get_pconfig(local_channel(),"redbasic","nav_min_opacity"); + $arr['top_photo']=get_pconfig(local_channel(),"redbasic","top_photo"); + $arr['reply_photo']=get_pconfig(local_channel(),"redbasic","reply_photo"); + $arr['sloppy_photos']=get_pconfig(local_channel(),"redbasic","sloppy_photos"); return redbasic_form($a, $arr); } function theme_post(&$a) { - if(!local_user()) { return;} + if(!local_channel()) { return;} if (isset($_POST['redbasic-settings-submit'])) { - set_pconfig(local_user(), 'redbasic', 'schema', $_POST['redbasic_schema']); - set_pconfig(local_user(), 'redbasic', 'narrow_navbar', $_POST['redbasic_narrow_navbar']); - set_pconfig(local_user(), 'redbasic', 'nav_bg', $_POST['redbasic_nav_bg']); - set_pconfig(local_user(), 'redbasic', 'nav_gradient_top', $_POST['redbasic_nav_gradient_top']); - set_pconfig(local_user(), 'redbasic', 'nav_gradient_bottom', $_POST['redbasic_nav_gradient_bottom']); - set_pconfig(local_user(), 'redbasic', 'nav_active_gradient_top', $_POST['redbasic_nav_active_gradient_top']); - set_pconfig(local_user(), 'redbasic', 'nav_active_gradient_bottom', $_POST['redbasic_nav_active_gradient_bottom']); - set_pconfig(local_user(), 'redbasic', 'nav_bd', $_POST['redbasic_nav_bd']); - set_pconfig(local_user(), 'redbasic', 'nav_icon_colour', $_POST['redbasic_nav_icon_colour']); - set_pconfig(local_user(), 'redbasic', 'nav_active_icon_colour', $_POST['redbasic_nav_active_icon_colour']); - set_pconfig(local_user(), 'redbasic', 'link_colour', $_POST['redbasic_link_colour']); - set_pconfig(local_user(), 'redbasic', 'background_colour', $_POST['redbasic_background_colour']); - set_pconfig(local_user(), 'redbasic', 'banner_colour', $_POST['redbasic_banner_colour']); - set_pconfig(local_user(), 'redbasic', 'background_image', $_POST['redbasic_background_image']); - set_pconfig(local_user(), 'redbasic', 'item_colour', $_POST['redbasic_item_colour']); - set_pconfig(local_user(), 'redbasic', 'comment_item_colour', $_POST['redbasic_comment_item_colour']); - set_pconfig(local_user(), 'redbasic', 'comment_border_colour', $_POST['redbasic_comment_border_colour']); - set_pconfig(local_user(), 'redbasic', 'comment_indent', $_POST['redbasic_comment_indent']); - set_pconfig(local_user(), 'redbasic', 'toolicon_colour', $_POST['redbasic_toolicon_colour']); - set_pconfig(local_user(), 'redbasic', 'toolicon_activecolour', $_POST['redbasic_toolicon_activecolour']); - set_pconfig(local_user(), 'redbasic', 'font_size', $_POST['redbasic_font_size']); - set_pconfig(local_user(), 'redbasic', 'body_font_size', $_POST['redbasic_body_font_size']); - set_pconfig(local_user(), 'redbasic', 'font_colour', $_POST['redbasic_font_colour']); - set_pconfig(local_user(), 'redbasic', 'radius', $_POST['redbasic_radius']); - set_pconfig(local_user(), 'redbasic', 'photo_shadow', $_POST['redbasic_shadow']); - set_pconfig(local_user(), 'redbasic', 'converse_width', $_POST['redbasic_converse_width']); - set_pconfig(local_user(), 'redbasic', 'converse_center', $_POST['redbasic_converse_center']); - set_pconfig(local_user(), 'redbasic', 'nav_min_opacity', $_POST['redbasic_nav_min_opacity']); - set_pconfig(local_user(), 'redbasic', 'top_photo', $_POST['redbasic_top_photo']); - set_pconfig(local_user(), 'redbasic', 'reply_photo', $_POST['redbasic_reply_photo']); - set_pconfig(local_user(), 'redbasic', 'sloppy_photos', $_POST['redbasic_sloppy_photos']); + set_pconfig(local_channel(), 'redbasic', 'schema', $_POST['redbasic_schema']); + set_pconfig(local_channel(), 'redbasic', 'narrow_navbar', $_POST['redbasic_narrow_navbar']); + set_pconfig(local_channel(), 'redbasic', 'nav_bg', $_POST['redbasic_nav_bg']); + set_pconfig(local_channel(), 'redbasic', 'nav_gradient_top', $_POST['redbasic_nav_gradient_top']); + set_pconfig(local_channel(), 'redbasic', 'nav_gradient_bottom', $_POST['redbasic_nav_gradient_bottom']); + set_pconfig(local_channel(), 'redbasic', 'nav_active_gradient_top', $_POST['redbasic_nav_active_gradient_top']); + set_pconfig(local_channel(), 'redbasic', 'nav_active_gradient_bottom', $_POST['redbasic_nav_active_gradient_bottom']); + set_pconfig(local_channel(), 'redbasic', 'nav_bd', $_POST['redbasic_nav_bd']); + set_pconfig(local_channel(), 'redbasic', 'nav_icon_colour', $_POST['redbasic_nav_icon_colour']); + set_pconfig(local_channel(), 'redbasic', 'nav_active_icon_colour', $_POST['redbasic_nav_active_icon_colour']); + set_pconfig(local_channel(), 'redbasic', 'link_colour', $_POST['redbasic_link_colour']); + set_pconfig(local_channel(), 'redbasic', 'background_colour', $_POST['redbasic_background_colour']); + set_pconfig(local_channel(), 'redbasic', 'banner_colour', $_POST['redbasic_banner_colour']); + set_pconfig(local_channel(), 'redbasic', 'background_image', $_POST['redbasic_background_image']); + set_pconfig(local_channel(), 'redbasic', 'item_colour', $_POST['redbasic_item_colour']); + set_pconfig(local_channel(), 'redbasic', 'comment_item_colour', $_POST['redbasic_comment_item_colour']); + set_pconfig(local_channel(), 'redbasic', 'comment_border_colour', $_POST['redbasic_comment_border_colour']); + set_pconfig(local_channel(), 'redbasic', 'comment_indent', $_POST['redbasic_comment_indent']); + set_pconfig(local_channel(), 'redbasic', 'toolicon_colour', $_POST['redbasic_toolicon_colour']); + set_pconfig(local_channel(), 'redbasic', 'toolicon_activecolour', $_POST['redbasic_toolicon_activecolour']); + set_pconfig(local_channel(), 'redbasic', 'font_size', $_POST['redbasic_font_size']); + set_pconfig(local_channel(), 'redbasic', 'body_font_size', $_POST['redbasic_body_font_size']); + set_pconfig(local_channel(), 'redbasic', 'font_colour', $_POST['redbasic_font_colour']); + set_pconfig(local_channel(), 'redbasic', 'radius', $_POST['redbasic_radius']); + set_pconfig(local_channel(), 'redbasic', 'photo_shadow', $_POST['redbasic_shadow']); + set_pconfig(local_channel(), 'redbasic', 'converse_width', $_POST['redbasic_converse_width']); + set_pconfig(local_channel(), 'redbasic', 'converse_center', $_POST['redbasic_converse_center']); + set_pconfig(local_channel(), 'redbasic', 'nav_min_opacity', $_POST['redbasic_nav_min_opacity']); + set_pconfig(local_channel(), 'redbasic', 'top_photo', $_POST['redbasic_top_photo']); + set_pconfig(local_channel(), 'redbasic', 'reply_photo', $_POST['redbasic_reply_photo']); + set_pconfig(local_channel(), 'redbasic', 'sloppy_photos', $_POST['redbasic_sloppy_photos']); } } @@ -91,7 +91,7 @@ function redbasic_form(&$a, $arr) { } } -if(feature_enabled(local_user(),'expert')) +if(feature_enabled(local_channel(),'expert')) $expert = 1; $t = get_markup_template('theme_settings.tpl'); diff --git a/view/tpl/head.tpl b/view/tpl/head.tpl index 8a32bd7f6..ebb52dea9 100755 --- a/view/tpl/head.tpl +++ b/view/tpl/head.tpl @@ -23,7 +23,7 @@ <script> var updateInterval = {{$update_interval}}; - var localUser = {{if $local_user}}{{$local_user}}{{else}}false{{/if}}; + var localUser = {{if $local_channel}}{{$local_channel}}{{else}}false{{/if}}; var zid = {{if $zid}}'{{$zid}}'{{else}}null{{/if}}; var justifiedGalleryActive = false; {{if $channel_hash}}var channelHash = '{{$channel_hash}}';{{/if}} |