User class.
User class.This structure describes one user class. Classes are there to help you manage your users in a large system, with many different types of people and services. For instance, you can design a monthly subscription system whereby users pay to get full access for a month. Or, you could make a class where people are allowed two hours a day online time for a month, then are moved to a full-access class where the normal credit charging system applies. The possibilities are endless.
The set of classes in use define a graph. Transitions between classes happen based on various events: the user's absence from the system; the user staying in a class for a number of days; the user running out of credits; and the user receiving credits. The operator can also move a user to an arbitrary class.
Here are the class fields. They'll show exactly what you can do with classes.
- name
- The name of the class. For no reason in particular, convention is to make class names upper case.
- notaround, nadays
- This pair of fields define the name of a class (notaround) the user will be moved to if they don't use the system for {\nadays} days. This is useful for revoking privileges of people who've stopped using the system. Setting notaround to be equal to name effectively disables this class transition.
- around, ardays
- Like above, but the user is moved to class around if they've been in their current class for at least ardays. Setting around to be equal to name effectively disables this class transition.
- nocreds, credpost
- Users running out of credits are temporarily moved to class specified by nocreds for the rest of the day (provided the coming cleanup posts credits to them). Users receiving credits are moved to the class specified by credpost. Disabling this transitions is done in the usual manner, setting the target class to name.
- limpercall, limperday
- Denote respectively the maximum online time per call and maximum daily online time for a user in this class. Regardless of the amount of credits a user has, they will be (politely) kicked out when they exceed their time limits. For time limits on a per-call basis, the user can redial later and get another limpercall minutes online, as long as they have credits. These values may be set to -1 to denote no limitations on time.
- crdperday
- Specifies the minimum number of credits the user should have at the beginning of each day. If the user has less credits than crdperday, the cleanup process posts enough credits to bring the user to the minimum. If the user has more credits than the minimum, nothing is done.
- crdperweek, crdpermonth
- These fields specify bonuses (or taxes, if negative) given to users on a weekly and monthly basis. Unlike the above field, these amounts are posted to the user's account (i.e. they don't work as minima).
- flags
- A set of flags describing minor features of the class, given by zero or more CLF_x flags ORred together.
- users
- The number of users in this class. Updated every cleanup.
- keys
- The class keyring. This is combined with users' personal keyrings to provide the full set of keys owned by the user.