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 diff --git a/boot.php b/boot.php index 6822e8388..36c266541 100755 --- a/boot.php +++ b/boot.php @@ -958,11 +958,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; @@ -977,7 +977,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(), @@ -1483,7 +1483,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 { @@ -1557,25 +1557,37 @@ 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']); return false; } +function local_user() { + // DEPRECATED + return local_channel(); +} + + /** * @brief Returns contact id (visitor_id) of authenticated site visitor or false. * * @return int|bool visitor_id or false */ -function remote_user() { +function remote_channel() { if((x($_SESSION, 'authenticated')) && (x($_SESSION, 'visitor_id'))) return $_SESSION['visitor_id']; return false; } +function remote_user() { + // DEPRECATED + return remote_channel(); +} + + /** * Contents of $s are displayed prominently on the page the next time * a page is loaded. Usually used for errors or alerts. @@ -1698,7 +1710,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) ); @@ -1713,8 +1725,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..e228268dd 100644 --- a/doc/dev-function-overview.md +++ b/doc/dev-function-overview.md @@ -7,11 +7,11 @@ 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. -* remote_user() +* remote_channel() Returns authenticated string hash of Red global identifier, if authenticated via remote auth, or an empty string. diff --git a/doc/developer_function_primer.bb b/doc/developer_function_primer.bb index 3db853b82..373454440 100644 --- a/doc/developer_function_primer.bb +++ b/doc/developer_function_primer.bb @@ -4,11 +4,11 @@ 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. -[b]remote_user()[/b] +[b]remote_channel()[/b] Returns authenticated string hash of Red global identifier, if authenticated via remote auth, or an empty string. diff --git a/doc/html/boot_8php.html b/doc/html/boot_8php.html index 8305436d9..e24055b71 100644 --- a/doc/html/boot_8php.html +++ b/doc/html/boot_8php.html @@ -160,10 +160,10 @@ Functions  get_account_id ()  Returns the entity id of locally logged in account or false. More...
  - local_user () + local_channel ()  Returns the entity id (channel_id) of locally logged in user or false. More...
  - remote_user () + remote_channel ()  Returns contact id (visitor_id) of authenticated site visitor or false. More...
   notice ($s) @@ -1484,7 +1484,7 @@ Variables
- + @@ -1620,7 +1620,7 @@ Variables
local_user local_channel ( )
- + @@ -1704,7 +1704,7 @@ Variables
Returns
bool|int
-

Referenced by FriendicaSmarty\__construct(), App\__construct(), account_service_class_allows(), account_service_class_fetch(), acl_init(), admin_page_channels_post(), admin_page_logs_post(), admin_page_plugins(), admin_page_site(), admin_page_site_post(), admin_page_themes(), admin_page_users_post(), api_content(), api_direct_messages_box(), api_direct_messages_new(), api_favorites(), api_format_messages(), api_get_user(), api_login(), api_post(), api_statuses_f(), api_statuses_home_timeline(), api_statuses_mentions(), api_statuses_public_timeline(), api_statuses_show(), api_statuses_update(), api_statuses_user_timeline(), api_user(), app_store(), app_update(), attach_store(), authenticate_success(), bbcode(), bbtoevent(), best_link_url(), bookmark_add(), App\build_pagehead(), channel_content(), chatsvc_content(), check_form_security_token(), cli_startup(), cloud_init(), connections_content(), connections_post(), connedit_content(), construct_page(), consume_feed(), conversation(), create_account(), create_identity(), current_theme(), current_theme_url(), dav_init(), del_pconfig(), del_xconfig(), delegate_content(), detect_language(), diaspora_asphoto(), diaspora_conversation(), diaspora_message(), dir_sort_links(), directory_content(), directory_init(), dirsearch_content(), discover_by_url(), display_content(), encode_rel_links(), event_addtocal(), events_content(), events_post(), feed_init(), filerm_content(), filestorage_post(), get_atom_elements(), get_browser_language(), get_item_elements(), get_my_address(), get_my_url(), get_plink(), get_public_feed(), Item\get_template_data(), get_timezones(), group_add(), group_rmv(), group_side(), home_content(), import_post(), import_xchan(), info(), invite_post(), item_post(), item_store(), item_store_update(), lang_selector(), load_contact_links(), local_user(), lostpass_content(), magic_init(), mail_content(), mail_post(), mail_store(), mood_content(), mood_init(), nav(), navbar_complete(), network_content(), new_channel_content(), new_cookie(), notice(), oexchange_content(), openid_content(), parse_url_content(), photo_upload(), photos_content(), photos_post(), ping_init(), poco_init(), poco_load(), poke_content(), poke_init(), post_activity_item(), post_init(), post_var(), probe_content(), proc_run(), profile_photo_post(), profile_photo_set_profile_perms(), profile_sidebar(), profiles_post(), pubsub_init(), rbmark_content(), rbmark_post(), red_item_new(), ref_session_read(), register_content(), register_post(), App\register_template_engine(), regmod_content(), remote_user(), removeaccount_post(), removeme_post(), rpost_content(), scrape_feed(), script_path(), search_ac_init(), search_content(), search_init(), service_class_allows(), service_class_fetch(), App\set_baseurl(), settings_post(), setup_content(), setup_init(), suggest_init(), t(), tagrm_post(), App\template_engine(), tt(), validate_channelname(), wall_upload_post(), webfinger_content(), wfinger_init(), widget_affinity(), widget_categories(), widget_filer(), widget_savedsearch(), widget_tagcloud(), xchan_content(), z_fetch_url(), z_post_url(), and zfinger_init().

+

Referenced by FriendicaSmarty\__construct(), App\__construct(), account_service_class_allows(), account_service_class_fetch(), acl_init(), admin_page_channels_post(), admin_page_logs_post(), admin_page_plugins(), admin_page_site(), admin_page_site_post(), admin_page_themes(), admin_page_users_post(), api_content(), api_direct_messages_box(), api_direct_messages_new(), api_favorites(), api_format_messages(), api_get_user(), api_login(), api_post(), api_statuses_f(), api_statuses_home_timeline(), api_statuses_mentions(), api_statuses_public_timeline(), api_statuses_show(), api_statuses_update(), api_statuses_user_timeline(), api_user(), app_store(), app_update(), attach_store(), authenticate_success(), bbcode(), bbtoevent(), best_link_url(), bookmark_add(), App\build_pagehead(), channel_content(), chatsvc_content(), check_form_security_token(), cli_startup(), cloud_init(), connections_content(), connections_post(), connedit_content(), construct_page(), consume_feed(), conversation(), create_account(), create_identity(), current_theme(), current_theme_url(), dav_init(), del_pconfig(), del_xconfig(), delegate_content(), detect_language(), diaspora_asphoto(), diaspora_conversation(), diaspora_message(), dir_sort_links(), directory_content(), directory_init(), dirsearch_content(), discover_by_url(), display_content(), encode_rel_links(), event_addtocal(), events_content(), events_post(), feed_init(), filerm_content(), filestorage_post(), get_atom_elements(), get_browser_language(), get_item_elements(), get_my_address(), get_my_url(), get_plink(), get_public_feed(), Item\get_template_data(), get_timezones(), group_add(), group_rmv(), group_side(), home_content(), import_post(), import_xchan(), info(), invite_post(), item_post(), item_store(), item_store_update(), lang_selector(), load_contact_links(), local_channel(), lostpass_content(), magic_init(), mail_content(), mail_post(), mail_store(), mood_content(), mood_init(), nav(), navbar_complete(), network_content(), new_channel_content(), new_cookie(), notice(), oexchange_content(), openid_content(), parse_url_content(), photo_upload(), photos_content(), photos_post(), ping_init(), poco_init(), poco_load(), poke_content(), poke_init(), post_activity_item(), post_init(), post_var(), probe_content(), proc_run(), profile_photo_post(), profile_photo_set_profile_perms(), profile_sidebar(), profiles_post(), pubsub_init(), rbmark_content(), rbmark_post(), red_item_new(), ref_session_read(), register_content(), register_post(), App\register_template_engine(), regmod_content(), remote_channel(), removeaccount_post(), removeme_post(), rpost_content(), scrape_feed(), script_path(), search_ac_init(), search_content(), search_init(), service_class_allows(), service_class_fetch(), App\set_baseurl(), settings_post(), setup_content(), setup_init(), suggest_init(), t(), tagrm_post(), App\template_engine(), tt(), validate_channelname(), wall_upload_post(), webfinger_content(), wfinger_init(), widget_affinity(), widget_categories(), widget_filer(), widget_savedsearch(), widget_tagcloud(), xchan_content(), z_fetch_url(), z_post_url(), and zfinger_init().

diff --git a/doc/html/boot_8php.js b/doc/html/boot_8php.js index 32cf1e11c..1cfaebcb4 100644 --- a/doc/html/boot_8php.js +++ b/doc/html/boot_8php.js @@ -32,12 +32,12 @@ 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 ], [ "proc_run", "boot_8php.html#ab346a2ece14993861f3e4206befa94f0", null ], - [ "remote_user", "boot_8php.html#a5542c5c2806ab8bca04bad53d47b5209", null ], + [ "remote_channel", "boot_8php.html#a5542c5c2806ab8bca04bad53d47b5209", null ], [ "startup", "boot_8php.html#aca47505b8732177f52bb2d647eb2741c", null ], [ "system_unavailable", "boot_8php.html#ac608a34f3bc180e7724192e0fd31f9b0", null ], [ "x", "boot_8php.html#ae97836b0547953be182a2334c9c91d3c", 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
remote_user remote_channel ( )
-

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. Otherwise returns 0

+

comanche_get_channel_id() Returns the channel_id of the profile owner of the page, or the local_channel if there is no profile owner. Otherwise returns 0

Referenced by comanche_block(), comanche_menu(), and load_pdl().

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','');});
  • local_dir_update() : dir_fns.php
  • -
  • local_user() +
  • local_channel() : boot.php
  • localize_item() diff --git a/doc/html/globals_0x72.html b/doc/html/globals_0x72.html index 1665b356e..26447682d 100644 --- a/doc/html/globals_0x72.html +++ b/doc/html/globals_0x72.html @@ -316,7 +316,7 @@ $(document).ready(function(){initNavTree('globals_0x72.html','');});
  • remote_online_status() : identity.php
  • -
  • remote_user() +
  • remote_channel() : boot.php
  • remove_all_xchan_resources() 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','');});
  • local_dir_update() : dir_fns.php
  • -
  • local_user() +
  • local_channel() : boot.php
  • localize_item() diff --git a/doc/html/globals_func_0x72.html b/doc/html/globals_func_0x72.html index 6eea866f1..75559eca2 100644 --- a/doc/html/globals_func_0x72.html +++ b/doc/html/globals_func_0x72.html @@ -273,7 +273,7 @@ $(document).ready(function(){initNavTree('globals_func_0x72.html','');});
  • remote_online_status() : identity.php
  • -
  • remote_user() +
  • remote_channel() : boot.php
  • remove_all_xchan_resources() 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
    Todo:
    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.