The Red Matrix
 All Classes Namespaces Files Functions Variables Pages
identity.php File Reference

Functions

 identity_check_service_class ($account_id)
 
 validate_channelname ($name)
 
 create_sys_channel ()
 
 get_sys_channel ()
 
 channel_total ()
 
 create_identity ($arr)
 
 set_default_login_identity ($account_id, $channel_id, $force=true)
 
 identity_basic_export ($channel_id)
 
 profile_load (&$a, $nickname, $profile= '')
 
 profile_create_sidebar (&$a, $connect=true)
 
 profile_sidebar ($profile, $block=0, $show_connect=true)
 
 get_birthdays ()
 
 get_events ()
 
 advanced_profile (&$a)
 
 get_my_url ()
 
 get_my_address ()
 
 zid_init (&$a)
 
 zid ($s, $address= '')
 
 get_theme_uid ()
 
 get_default_profile_photo ($size=175)
 
 is_foreigner ($s)
 
 is_member ($s)
 
 get_online_status ($nick)
 
 remote_online_status ($webbie)
 
 get_channel_by_nick ($nick)
 

Function Documentation

advanced_profile ( $a)

Referenced by profile_content().

channel_total ( )

() Return the total number of channels on this site. No filtering is performed except to check PAGE_REMOVED

Returns
int on error returns boolean false

Referenced by zfinger_init().

create_identity (   $arr)

create_identity($arr) Create a new channel Also creates the related xchan, hubloc, profile, and "self" abook records, and an empty "Friends" group/collection for the new channel

Parameters
array$arr'name' => full name of channel 'nickname' => "email/url-compliant" nickname 'account_id' => account_id to attach with this channel [other identity fields as desired]
Returns
array 'success' => boolean true or false 'message' => optional error text if success is false 'channel' => if successful the created channel array

Referenced by create_sys_channel(), and new_channel_post().

create_sys_channel ( )

create_sys_channel() Create a system channel - which has no account attached

get_birthdays ( )
get_channel_by_nick (   $nick)
get_default_profile_photo (   $size = 175)

get_default_profile_photo($size = 175) Retrieves the path of the default_profile_photo for this system with the specified size.

Parameters
int$sizeone of (175, 80, 48)
Returns
string

Referenced by avatar_img(), import_profile_photo(), openid_content(), and photo_init().

get_events ( )
get_my_address ( )
get_my_url ( )

Referenced by nav(), and zid().

get_online_status (   $nick)

Referenced by online_init(), and profile_load().

get_sys_channel ( )
get_theme_uid ( )
identity_basic_export (   $channel_id)

identity_basic_export($channel_id) Create an array representing the important channel information which would be necessary to create a nomadic identity clone. This includes most channel resources and connection information with the exception of content.

Parameters
int$channel_idChannel_id to export
Returns
array See function for details

Referenced by api_export_basic(), and uexport_init().

identity_check_service_class (   $account_id)

identity_check_service_class($account_id) Called when creating a new channel. Checks the account's service class and number of current channels to determine whether creating a new channel is within the current service class constraints.

Parameters
int$account_idAccount_id used for this request
Returns
array 'success' => boolean true if creating a new channel is allowed for this account 'message' => if success is false, optional error text

Referenced by create_identity().

is_foreigner (   $s)

is_foreigner($s) Test whether a given identity is NOT a member of the Red Matrix

Parameters
string$s,;xchan_hash of the identity in question
Returns
boolean true or false

Referenced by is_member().

is_member (   $s)

is_member($s) Test whether a given identity is a member of the Red Matrix

Parameters
string$s,;xchan_hash of the identity in question
Returns
boolean true or false
profile_create_sidebar ( $a,
  $connect = true 
)
profile_load ( $a,
  $nickname,
  $profile = '' 
)

: profile_load(&$a, $nickname, $profile) Generate

Parameters
App$a
string$nickname
string$profileSummary: Loads a profile into the App structure. The function requires a writeable copy of the main App structure, and the nickname of a valid channel.

Permissions of the current observer are checked. If a restricted profile is available to the current observer, that will be loaded instead of the channel default profile.

The channel owner can set $profile to a valid profile_guid to preview that profile.

The channel default theme is also selected for use, unless over-riden elsewhere.

load/reload current theme info

Referenced by achievements_content(), block_init(), blocks_content(), channel_init(), chat_init(), cloud_init(), common_init(), connect_init(), layouts_content(), page_init(), photos_init(), profile_init(), profile_photo_init(), profiles_init(), profperm_init(), viewconnections_init(), and webpages_content().

profile_sidebar (   $profile,
  $block = 0,
  $show_connect = true 
)

Function: profile_sidebar

Formats a profile for display in the sidebar. It is very difficult to templatise the HTML completely because of all the conditional logic.

: array $profile

Returns HTML string stuitable for sidebar inclusion Exceptions: Returns empty string if passed $profile is wrong type or not populated

Referenced by profile_create_sidebar(), widget_fullprofile(), and widget_profile().

remote_online_status (   $webbie)

Referenced by dirprofile_init().

set_default_login_identity (   $account_id,
  $channel_id,
  $force = true 
)

set_default_login_identity($account_id, $channel_id, $force = true) Set default channel to be used on login

Parameters
int$account_idlogin account
int$channel_idchannel id to set as default for this account
booleanforce if true, set this default unconditionally if $force is false only do this if there is no existing default
Returns
nil

Referenced by create_identity(), and import_post().

validate_channelname (   $name)

validate_channelname($name) Determine if the channel name is allowed when creating a new channel. This action is pluggable.

Parameters
string$name
Returns
nil return if name is valid, or string describing the error state.

We're currently only checking for an empty name or one that exceeds our storage limit (255 chars). 255 chars is probably going to create a mess on some pages. Plugins can set additional policies such as full name requirements, character sets, multi-byte length, etc.

Referenced by create_identity(), and settings_post().

zid (   $s,
  $address = '' 
)

zid($s,$address = '') Adds a zid parameter to a url

Parameters
string$sThe url to accept the zid
boolean$address$address to use instead of session environment
Returns
string

'zid' string url - url to accept zid string zid - urlencoded zid string result - the return string we calculated, change it if you want to return something else

Referenced by chanview_content(), chatsvc_content(), conversation(), dirprofile_init(), format_categories(), get_plink(), like_puller(), localize_item(), match_content(), menu_render(), new_contact(), oembed_fetch_url(), tryzrlaudio(), tryzrlvideo(), viewconnections_content(), widget_bookmarkedchats(), and widget_suggestedchats().

zid_init ( $a)

zid_init(&$a) If somebody arrives at our site using a zid, add their xchan to our DB if we don't have it already. And if they aren't already authenticated here, attempt reverse magic auth.

'zid_init' string 'zid' - their zid string 'url' - the destination url