UNA
|
Public Member Functions | |
__clone () | |
getContentByLevelAsCondition ($sContentField, $mixedLevelId) | |
getContentByLevelAsSQLPart ($sContentTable, $sContentField, $mixedLevelId) | |
isMemberLevelInSet ($mixedPermissions, $iProfileId=false) | |
getMemberLevelBit ($iProfileId=0) | |
checkAction ($iProfileId, $iActionId, $bPerformAction=false) | |
getActionNumberLeft ($iProfileId, $iActionId) | |
getMemberships ($bPurchasableOnly=false, $bActiveOnly=false, $isTranslate=true, $bFilterOutSystemAutomaticLevels=false) | |
getMembershipsBy ($aParams) | |
getMembershipInfo ($iLevelId) | |
getMemberMembershipInfo ($iProfileId, $iTime=0, $bClearCache=0) | |
setMembership ($iProfileId, $iLevelId, $mixedPeriod=0, $bStartsNow=false, $sTransactionId='') | |
unsetMembership ($iProfileId, $iLevelId, $sTransactionId) | |
getMembershipActionId ($sAction, $sModule) | |
getExpirationLetter ($iProfileId, $sLevelName, $iLevelExpireDays) | |
maintenance () | |
onProfileDelete ($iProfileId) | |
Static Public Member Functions | |
static | getInstance () |
Protected Member Functions | |
getMemberMembershipInfoCurrent ($iProfileId, $iTime=0, $bClearCache=0) | |
getMemberMembershipInfoLatest ($iProfileId, $iTime=0, $bClearCache=0) | |
Protected Attributes | |
$oDb | |
$_aStandardMemberships | |
$_aProfileStatus2LevelMap | |
$_aLevel2MessageMap | |
Static Protected Attributes | |
static | $_aCacheData = array() |
|
protected |
Reimplemented from BxDolFactory.
BxDolAcl::__clone | ( | ) |
Prevent cloning the instance
BxDolAcl::checkAction | ( | $iProfileId, | |
$iActionId, | |||
$bPerformAction = false ) |
Checks if a given action is allowed for a given profile and updates action information if the action is performed.
int | $iProfileId | ID of a profile that is going to perform an action |
int | $iActionId | ID of the action itself |
boolean | $bPerformAction | if true, then action information is updated, i.e. action is 'performed' |
NOTES:
$aResult[CHECK_ACTION_MESSAGE] contains a message with detailed information about the result, already processed by the language file
if $aResult[CHECK_ACTION_RESULT] === CHECK_ACTION_RESULT_ALLOWED then this node contains an empty string
The error messages themselves are stored in the language file. Additional variables are passed to the languages.inc.php function _t_ext() as an array and can be used there in the form of {0}, {1}, {2} ...
Additional variables passed to the lang. file on errors (can be used in error messages):
For all errors: $arg0[CHECK_ACTION_LANG_FILE_ACTION] = name of the action $arg0[CHECK_ACTION_LANG_FILE_MEMBERSHIP]= name of the current membership CHECK_ACTION_RESULT_LIMIT_REACHED: $arg0[CHECK_ACTION_LANG_FILE_LIMIT] = limit on number of actions allowed for the profile $arg0[CHECK_ACTION_LANG_FILE_PERIOD] = period that the limit is set for (in hours, 0 if unlimited) $arg0[CHECK_ACTION_LANG_FILE_PERIOD_RESTART_AT] = time when new period begins, so counter will be reset CHECK_ACTION_RESULT_NOT_ALLOWED_BEFORE: $arg0[CHECK_ACTION_LANG_FILE_BEFORE] = date/time since when the action is allowed CHECK_ACTION_RESULT_NOT_ALLOWED_AFTER: $arg0[CHECK_ACTION_LANG_FILE_AFTER] = date/time since when the action is not allowed
$aResult[CHECK_ACTION_PARAMETER] contains an additional parameter that can be considered when performing the action (like the number of profiles to show in search result)
membership
check_action
action
- [string] by ref, action name, can be overridden in hook processingperform
- [boolean] by ref, check only or mark action as performed after checking, can be overridden in hook processingresult
- [array] by ref, check action result array, can be overridden in hook processinglang
- [array] by ref, array of parsable into check result message variables, can be overridden in hook processingcontinue
- [boolean] by ref, continue or not the default check operation after the hook, can be overridden in hook processing
Action is not allowed for the current membership
Check fixed period limitations if present (also for non-members)
if non-member, allow action without performing further checks
Check other limitations (for members only)
< Number of allowed actions. Unlimited if not specified or 0
< Period for AllowedCount in hours. If not specified, AllowedCount is treated as total number of actions permitted.
Member is requesting/performing this action for the first time, and there is no corresponding record in sys_acl_actions_track table.
Action has been requested/performed at least once at this point and there is a corresponding record in sys_acl_actions_track table
Action record in sys_acl_actions_track table is out of date.
< Action record is up to date
Action limit reached for now
BxDolAcl::getActionNumberLeft | ( | $iProfileId, | |
$iActionId ) |
Get the number of allowed action
int | $iProfileId | ID of a profile that is going to perform an action |
int | $iActionId | ID of the action itself |
boolean | $bPerformAction | if true, then action information is updated, i.e. action is 'performed' |
< Number of allowed actions. Unlimited if not specified or 0
BxDolAcl::getContentByLevelAsCondition | ( | $sContentField, | |
$mixedLevelId ) |
Get necessary condition array to use membership level in search classes
$sContentField | content table field name |
$mixedLevelId | level ID or array of level IDs |
BxDolAcl::getContentByLevelAsSQLPart | ( | $sContentTable, | |
$sContentField, | |||
$mixedLevelId ) |
Get necessary parts of SQL query to use membership levels in other queries
$sContentTable | content table name |
$sContentField | content table field name |
$mixedLevelId | level ID or array of level IDs |
|
static |
Get singleton instance of the class
Implements iBxDolSingleton.
BxDolAcl::getMemberLevelBit | ( | $iProfileId = 0 | ) |
Get user's membership level bit for bitwise operarions
BxDolAcl::getMemberMembershipInfo | ( | $iProfileId, | |
$iTime = 0, | |||
$bClearCache = 0 ) |
Retrieves information about membership for a given profile at a given moment.
If there are no memberships purchased/assigned to the given profile or all of them have expired at the given point, the profile is assumed to be a standard profile, and the function returns information about the Standard membership. This will also happen if a profile wasnt actually registered in the database at that point - the function will still return info about Standard membership, not the Non-member one.
If there is no profile with the given $iProfileId, the function returns information about the Non-member or Authenticated predefined membership.
The Standard, Authenticated and Non-member memberships have their DateStarts and DateExpires attributes set to NULL.
int | $iProfileId | ID of a profile to get info about |
int | $time | specifies the time to use when determining membership; if not specified, the function takes the current time |
BxDolAcl::getMembershipActionId | ( | $sAction, | |
$sModule ) |
get action id by module and name
$sAction | action name |
$sModule | module name |
$aActions | array of actions from sys_acl_actions table, with default array keys (starting from 0) and text values |
BxDolAcl::getMembershipInfo | ( | $iLevelId | ) |
Get info about a given membership
int | $iLevelId | membership to get info about |
BxDolAcl::getMemberships | ( | $bPurchasableOnly = false, | |
$bActiveOnly = false, | |||
$isTranslate = true, | |||
$bFilterOutSystemAutomaticLevels = false ) |
Get the list of existing memberships
bool | $bPurchasableOnly | if true, fetches only purchasable memberships; 'purchasable' here means that:
|
BxDolAcl::isMemberLevelInSet | ( | $mixedPermissions, | |
$iProfileId = false ) |
Check if member has one of the provided membership levels
$mixedPermissions | - integer value (every bit is matched with some membership ID) or an array of membership IDs to check permissions for |
$iProfileId | - profile to check, if it isn't provided or is false then currently logged in profile is used. |
BxDolAcl::maintenance | ( | ) |
clear expired membership levels
BxDolAcl::setMembership | ( | $iProfileId, | |
$iLevelId, | |||
$mixedPeriod = 0, | |||
$bStartsNow = false, | |||
$sTransactionId = '' ) |
Set a membership for a profile
int | $iProfileId | profile that is going to get the membership |
int | $iLevelId | membership that is going to be assigned to the profile if $iLevelId == MEMBERSHIP_ID_STANDARD then $days and $bStartsNow parameters are not used, so Standard membership is always set immediately and forever |
mixed | $mixedPeriod | number of Days to set membership for or an array with 'period'-'period unit' pair. If number or 'period' in pair equal 0, then the membership is set forever |
boolean | $bStartsNow | if true, the membership will start immediately if false, the membership will start after the current membership expires |
profile
set_membership
mlevel
- [int] membership level idperiod
- [int] number of periodsperiod_unit
- [string] period unit (day, week, month, etc)starts_now
- [boolean] if new membership starts immediately or queuedtxn_id
- [string] related payment transaction id
It's equivalent to 'profile', 'set_membership' - hook after a new membership level was set
|
protected |
|
protected |
|
protected |