Stud.IP
2.0 Revision 48548
|
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) | |
first_decision ($userid) | |
get_global_visibility_by_id ($user_id) | |
get_global_visibility_by_username ($username) | |
get_local_visibility_by_id ($user_id, $context, $return_user_perm=false) | |
get_local_visibility_by_username ($username, $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) | |
get_homepage_element_visibility ($user_id, $element_name) | |
set_homepage_element_visibility ($user_id, $element_name, $visibility) |
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_global_visibility_by_id | ( | $user_id | ) |
Gets the global visibility for the given user ID.
string | $user_id | user ID to check |
get_global_visibility_by_username | ( | $username | ) |
Gets the global visibility for a given username. This is just a wrapper function for get_global_visibility_by_id
, operating with a usename instead of an ID.
string | $username | username to check |
get_global_visibility_by_id
. get_homepage_element_visibility | ( | $user_id, | |
$element_name | |||
) |
Gets the visibility setting of a special element on a user's homepage. The resulting value is one of the constants VISIBILITY_ME, VISIBILITY_BUDDIES, VISIBILITY_DOMAIN, VISIBILITY_STUDIP and VISIBILITY_EXTERN.
string | $user_id | which user is required? |
string | $element_name | unique name of the homepage element. |
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_local_visibility_by_username | ( | $username, | |
$context, | |||
$return_user_perm = false |
|||
) |
Wrapper function for checking a user's local visibility by username instead of user ID.
string | $username | username 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 |
set_homepage_element_visibility | ( | $user_id, | |
$element_name, | |||
$visibility | |||
) |
Sets the visibility of a homepage element to the given value.
string | $user_id | whose homepage is it? |
string | $element_name | unique name of the homepage element to change |
int | $visibility | new value for element visibility |
vis_chooser | ( | $vis, | |
$new = false |
|||
) |
const VISIBILITY_BUDDIES = 2 |
const VISIBILITY_DOMAIN = 3 |
const VISIBILITY_EXTERN = 5 |
const VISIBILITY_ME = 1 |
const VISIBILITY_STUDIP = 4 |