Stud.IP
6.0
|
Functions | |
get_visibility_by_id ($user_id) | |
get_visibility_by_username ($username) | |
get_visibility_by_state ($state, $user_id) | |
get_vis_query ($table_alias='auth_user_md5', $context='') | |
get_ext_vis_query ($table_alias='aum') | |
vis_chooser ($vis, $new=false, $id=false) | |
first_decision ($userid) | |
get_local_visibility_by_id ($user_id, $context, $return_user_perm=false) | |
is_element_visible_for_user ($user_id, $owner_id, $element_visibility) | |
is_element_visible_externally ($owner_id, $owner_perm, $field_name, $element_visibility) | |
get_default_homepage_visibility ($user_id) | |
get_visible_email ($user_id) | |
Variables | |
const | VISIBILITY_ME 1 |
const | VISIBILITY_BUDDIES 2 |
const | VISIBILITY_DOMAIN 3 |
const | VISIBILITY_STUDIP 4 |
const | VISIBILITY_EXTERN 5 |
first_decision | ( | $userid | ) |
get_default_homepage_visibility | ( | $user_id | ) |
Retrieves the standard visibility level for a homepage element if the user hasn't specified anything explicitly. This default can be set via the global configuration (variable "HOMEPAGE_VISIBILITY_DEFAULT").
get_ext_vis_query | ( | $table_alias = 'aum' | ) |
get_local_visibility_by_id | ( | $user_id, | |
$context, | |||
$return_user_perm = false |
|||
) |
Gets a user's visibility settings for special context. Valid contexts are at the moment:
string | $user_id | user ID to check |
string | $context | local visibility in which context? |
boolean | $return_user_perm | return not only visibility, but also the user's global permission level |
get_vis_query | ( | $table_alias = 'auth_user_md5' , |
|
$context = '' |
|||
) |
get_visibility_by_id | ( | $user_id | ) |
get_visibility_by_state | ( | $state, | |
$user_id | |||
) |
get_visibility_by_username | ( | $username | ) |
get_visible_email | ( | $user_id | ) |
Gets a user's email address. If the address should not be shown according to the user's privacy settings, we try to get the email address of the default institute (this can be one of the institutes the user is assigned to). If no default institute is found, the email address of the first found institute is given. If the user isn't assigned to any institute, an empty string is returned.
string | $user_id | which user's email address is required? |
is_element_visible_externally | ( | $owner_id, | |
$owner_perm, | |||
$field_name, | |||
$element_visibility | |||
) |
Checks whether a homepage element is visible on external pages. We do not give an element name and look up its visibility setting in the database, because that would generate many database requests for a single user homepage. Instead, the homepage itself loads all element visibilities and we only need to check if the given element visibility allows showing it.
string | $owner_id | user ID of the homepage owner |
string | $owner_perm | permission level of the homepage owner, needed because every permission level can have its own not hideable fields. |
string | $field_name | Name of the homepage field to check, needed for checking if the element is not hideable |
int | $element_visibility | visibility level of the element, one of the constants VISIBILITY_ME, VISIBILITY_BUDDIES, VISIBILITY_DOMAIN, VISIBILITY_STUDIP, VISIBILITY_EXTERN |
is_element_visible_for_user | ( | $user_id, | |
$owner_id, | |||
$element_visibility | |||
) |
Checks whether an element of a user homepage is visible for another user. We do not give an element name and look up its visibility setting in the database, because that would generate many database requests for a single user homepage. Instead, the homepage itself loads all element visibilities and we only need to check if the given element visibility allows showing it to the visiting user. We need not check for not hideable fields here, because that is already done when loading the element visibilities.
string | $user_id | ID of the user who wants to see the element |
string | $owner_id | ID of the homepage owner |
int | $element_visibility | visibility level of the element, one of the constants VISIBILITY_ME, VISIBILITY_BUDDIES, VISIBILITY_DOMAIN, VISIBILITY_STUDIP, VISIBILITY_EXTERN |
const VISIBILITY_BUDDIES 2 |
const VISIBILITY_DOMAIN 3 |
const VISIBILITY_EXTERN 5 |
const VISIBILITY_ME 1 |
const VISIBILITY_STUDIP 4 |