This class encapsulates core LnBlog system functions.
The system class exists in order to provide functions that are global to the installation rather then particular to a blog or user. This includes things such as listing blogs and users, maintaining user permissions, and so forth.
This may not be the best way to accomplish this particular purpose. However, it is very convenient and doesn't cause any design problems for the time being.
Get a list of blogs handled by LnBlog.
An array of blog objects.
Gets a list of installed system and user themes.
An array of theme names.
public function getUserBlogs( |
| ) |
Gets the list of blogs to which a given user can add posts.
usr | A User object for the user to check. |
An array of Blog objects.
Get a list of all users.
An array of user objects.
Gets a list of groups.
usr | The user whose groups we want to get. |
An array of group names.
public function getGroups( |
| ) |
Gets the groups to which a particular user belongs.
usrid | The username of the user in question. |
An array of group names.
public function inGroup( |
| ) |
Determines whether or not a particular user belongs to a given group.
usrid | The username of the user to check. |
grp | The group name to which the user should belong. |
True if usrid is in grp or if everyone is in grp, false otherwise.
public function groupExists( |
| ) |
Determines if a specified group exists or not.
grp | The group name to check. |
True if the group exists, false otherwise.
public function addToGroup( |
| ) |
Adds a user to a group.
usr | A user object representing the user to add. |
group | The group name to add the user to. |
True on success, false on failure. If the user is already in the group, then the return value is true. If the group does not exist, the value is false.
Determines if there is at least one user who is a system administrator.
True if the user defined by the ADMIN_USER constant exists or if there is at least one existing user in the administrators group, false otherwise.
public function isOwner( |
| ) |
Determines if a given user owns an object.
usrid | The username of the user to check. |
obj | The object to check. Must have a uid or owner property. |
True if the user is the object's owner, false otherwise.
public function canAddTo( |
| ) |
Determines if a given user has permissions to add child objects to some particular object.
parm | An object of some kind, usually a Blog, BlogEntry, or Article. |
usr | A User object for the user whose permissions we want to check. Returns: True if the |
public function canModify( |
| ) |
Like canAddTo, except determines if the user can perform updates.
public function canDelete( |
| ) |
Like canAddTo, except determines if the user can delete the object.