KUser Class Reference
#include <kuser.h>
Detailed Description
Represents a user on your system.This class represents a user on your system. You can either get information about the current user, of fetch information about a user on the system. Instances of this class will be explicitly shared, so copying objects is very cheap and you can safely pass objects by value.
- Author:
- Tim Jansen <tim@tjansen.de>
- Since:
- 3.2
Definition at line 45 of file kuser.h.
Public Types | |
enum | UIDMode { UseEffectiveUID, UseRealUserID } |
Public Member Functions | |
KUser (UIDMode mode=UseEffectiveUID) | |
KUser (long uid) | |
KUser (const QString &name) | |
KUser (const char *name) | |
KUser (struct passwd *p) | |
KUser (const KUser &user) | |
KUser & | operator= (const KUser &user) |
bool | operator== (const KUser &user) const |
bool | operator!= (const KUser &user) const |
bool | isValid () const |
long | uid () const |
long | gid () const |
bool | isSuperUser () const |
QString | loginName () const |
QString | fullName () const |
QString | roomNumber () const |
QString | workPhone () const |
QString | homePhone () const |
QString | homeDir () const |
QString | shell () const |
QValueList< KUserGroup > | groups () const |
QStringList | groupNames () const |
~KUser () | |
Static Public Member Functions | |
static QValueList< KUser > | allUsers () |
static QStringList | allUserNames () |
Member Enumeration Documentation
|
|
Constructor & Destructor Documentation
|
Creates an object that contains information about the current user. (as returned by getuid(2) or geteuid(2), taking $LOGNAME/$USER into account).
|
|
Creates an object for the user with the given user id. If the user does not exist isValid() will return false.
|
|
Creates an object that contains information about the user with the given name. If the user does not exist isValid() will return false.
|
|
Creates an object that contains information about the user with the given name. If the user does not exist isValid() will return false.
|
|
Creates an object from a passwd structure. If the pointer is null isValid() will return false.
|
|
Creates an object from another KUser object.
|
|
Destructor.
|
Member Function Documentation
|
Returns all user names of the system.
|
|
Returns all users of the system.
|
|
The full name of the user.
|
|
Returns the group id of the user.
|
|
Returns all group names of the user.
|
|
Returns all groups of the user.
|
|
The path to the user's home directory.
|
|
The user's home phone.
|
|
Checks whether the user it the super user (root).
|
|
Returns true if the user is valid. A KUser object can be invalid if you created it with an non-existing uid or name.
|
|
The login name of the user.
|
|
Two KUser objects are not equal if either isValid() is not true or uid() are not identical.
|
|
Copies a user.
|
|
Two KUser objects are equal if isValid() is true and the uid() are identical.
|
|
The user's room number.
|
|
The path to the user's login shell.
|
|
Returns the user id of the user.
|
|
The user's work phone.
|
The documentation for this class was generated from the following files: