.TH "KUser" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KUser \- Represents a user on your system.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kuser.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBUIDMode\fP { \fBUseEffectiveUID\fP, \fBUseRealUserID\fP }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKUser\fP (\fBUIDMode\fP mode=UseEffectiveUID)"
.br
.ti -1c
.RI "\fBKUser\fP (long uid)"
.br
.ti -1c
.RI "\fBKUser\fP (const \fBQString\fP &name)"
.br
.ti -1c
.RI "\fBKUser\fP (const char *name)"
.br
.ti -1c
.RI "\fBKUser\fP (struct passwd *p)"
.br
.ti -1c
.RI "\fBKUser\fP (const \fBKUser\fP &user)"
.br
.ti -1c
.RI "\fBKUser\fP & \fBoperator=\fP (const \fBKUser\fP &user)"
.br
.ti -1c
.RI "bool \fBoperator==\fP (const \fBKUser\fP &user) const "
.br
.ti -1c
.RI "bool \fBoperator!=\fP (const \fBKUser\fP &user) const "
.br
.ti -1c
.RI "bool \fBisValid\fP () const "
.br
.ti -1c
.RI "long \fBuid\fP () const "
.br
.ti -1c
.RI "long \fBgid\fP () const "
.br
.ti -1c
.RI "bool \fBisSuperUser\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBloginName\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBfullName\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBroomNumber\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBworkPhone\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBhomePhone\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBhomeDir\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBshell\fP () const "
.br
.ti -1c
.RI "\fBQValueList\fP< \fBKUserGroup\fP > \fBgroups\fP () const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBgroupNames\fP () const "
.br
.ti -1c
.RI "\fB~KUser\fP ()"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBQValueList\fP< \fBKUser\fP > \fBallUsers\fP ()"
.br
.ti -1c
.RI "static \fBQStringList\fP \fBallUserNames\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 

.SS "template<class T> class KUser< T >"
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.
.PP
\fBAuthor:\fP
.RS 4
Tim Jansen <tim@tjansen.de> 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 45 of file kuser.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "template<class T> enum \fBKUser::UIDMode\fP"
.PP
\fBEnumeration values: \fP
.in +1c
.TP
\fB\fIUseEffectiveUID \fP\fP
Use the effective user id. 
.TP
\fB\fIUseRealUserID \fP\fP
Use the real user id. 
.PP
Definition at line 49 of file kuser.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "template<class T> \fBKUser\fP< T >::\fBKUser\fP (\fBUIDMode\fP mode = \fCUseEffectiveUID\fP)"
.PP
Creates an object that contains information about the current user. 
.PP
(as returned by getuid(2) or geteuid(2), taking $LOGNAME/$USER into account). 
.PP
\fBParameters:\fP
.RS 4
\fImode\fP if \fBUseEffectiveUID\fP is passed the effective user is returned. If \fBUseRealUserID\fP is passed the real user will be returned. The real UID will be different than the effective UID in setuid programs; in such a case use the effective UID for checking permissions, and the real UID for displaying information about the user. 
.RE
.PP

.PP
Definition at line 68 of file kuser.cpp.
.PP
References KUser< T >::uid(), and KUser< T >::UseEffectiveUID.
.PP
Referenced by KUser< T >::allUsers().
.SS "template<class T> \fBKUser\fP< T >::\fBKUser\fP (long uid)"
.PP
Creates an object for the user with the given user id. 
.PP
If the user does not exist \fBisValid()\fP will return false. 
.PP
\fBParameters:\fP
.RS 4
\fIuid\fP the user id 
.RE
.PP

.PP
Definition at line 82 of file kuser.cpp.
.SS "template<class T> \fBKUser\fP< T >::\fBKUser\fP (const \fBQString\fP & name)"
.PP
Creates an object that contains information about the user with the given name. 
.PP
If the user does not exist \fBisValid()\fP will return false.
.PP
\fBParameters:\fP
.RS 4
\fIname\fP the name of the user 
.RE
.PP

.PP
Definition at line 86 of file kuser.cpp.
.SS "template<class T> \fBKUser\fP< T >::\fBKUser\fP (const char * name)"
.PP
Creates an object that contains information about the user with the given name. 
.PP
If the user does not exist \fBisValid()\fP will return false.
.PP
\fBParameters:\fP
.RS 4
\fIname\fP the name of the user 
.RE
.PP

.PP
Definition at line 90 of file kuser.cpp.
.SS "template<class T> \fBKUser\fP< T >::\fBKUser\fP (struct passwd * p)"
.PP
Creates an object from a passwd structure. 
.PP
If the pointer is null \fBisValid()\fP will return false.
.PP
\fBParameters:\fP
.RS 4
\fIp\fP the passwd structure to create the user from 
.RE
.PP

.PP
Definition at line 94 of file kuser.cpp.
.SS "template<class T> \fBKUser\fP< T >::\fBKUser\fP (const \fBKUser\fP< T > & user)"
.PP
Creates an object from another KUser object. 
.PP
\fBParameters:\fP
.RS 4
\fIuser\fP the user to create the new object from 
.RE
.PP

.PP
Definition at line 98 of file kuser.cpp.
.SS "template<class T> \fBKUser\fP< T >::~\fBKUser\fP ()"
.PP
Destructor. 
.PP
Definition at line 271 of file kuser.cpp.
.SH "Member Function Documentation"
.PP 
.SS "template<class T> \fBKUser\fP & \fBKUser\fP< T >::operator= (const \fBKUser\fP< T > & user)"
.PP
Copies a user. 
.PP
\fBParameters:\fP
.RS 4
\fIuser\fP the user to copy 
.RE
.PP
\fBReturns:\fP
.RS 4
this object 
.RE
.PP

.PP
Definition at line 103 of file kuser.cpp.
.SS "template<class T> bool \fBKUser\fP< T >::operator== (const \fBKUser\fP< T > & user) const"
.PP
Two KUser objects are equal if \fBisValid()\fP is true and the \fBuid()\fP are identical. 
.PP
Definition at line 109 of file kuser.cpp.
.PP
References KUser< T >::isValid(), and KUser< T >::uid().
.PP
Referenced by KUser< T >::operator!=().
.SS "template<class T> bool \fBKUser\fP< T >::operator!= (const \fBKUser\fP< T > & user) const"
.PP
Two KUser objects are not equal if either \fBisValid()\fP is not true or \fBuid()\fP are not identical. 
.PP
Definition at line 118 of file kuser.cpp.
.PP
References KUser< T >::operator==().
.SS "template<class T> bool \fBKUser\fP< T >::isValid () const"
.PP
Returns true if the user is valid. 
.PP
A KUser object can be invalid if you created it with an non-existing uid or name. 
.PP
\fBReturns:\fP
.RS 4
true if the user is valid 
.RE
.PP

.PP
Definition at line 145 of file kuser.cpp.
.PP
Referenced by KUser< T >::operator==().
.SS "template<class T> long \fBKUser\fP< T >::uid () const"
.PP
Returns the user id of the user. 
.PP
\fBReturns:\fP
.RS 4
the id of the user or -1 if user is invalid 
.RE
.PP

.PP
Definition at line 149 of file kuser.cpp.
.PP
Referenced by KUser< T >::isSuperUser(), KUser< T >::KUser(), and KUser< T >::operator==().
.SS "template<class T> long \fBKUser\fP< T >::gid () const"
.PP
Returns the group id of the user. 
.PP
\fBReturns:\fP
.RS 4
the id of the group or -1 if user is invalid 
.RE
.PP

.PP
Definition at line 156 of file kuser.cpp.
.PP
Referenced by KUserGroup::KUserGroup().
.SS "template<class T> bool \fBKUser\fP< T >::isSuperUser () const"
.PP
Checks whether the user it the super user (root). 
.PP
\fBReturns:\fP
.RS 4
true if the user is root 
.RE
.PP

.PP
Definition at line 163 of file kuser.cpp.
.PP
References KUser< T >::uid().
.SS "template<class T> \fBQString\fP \fBKUser\fP< T >::loginName () const"
.PP
The login name of the user. 
.PP
\fBReturns:\fP
.RS 4
the login name of the user or QString::null if user is invalid 
.RE
.PP

.PP
Definition at line 167 of file kuser.cpp.
.PP
Referenced by KStandardDirs::addCustomized().
.SS "template<class T> \fBQString\fP \fBKUser\fP< T >::fullName () const"
.PP
The full name of the user. 
.PP
\fBReturns:\fP
.RS 4
the full name of the user or QString::null if user is invalid 
.RE
.PP

.PP
Definition at line 174 of file kuser.cpp.
.SS "template<class T> \fBQString\fP \fBKUser\fP< T >::roomNumber () const"
.PP
The user's room number. 
.PP
\fBReturns:\fP
.RS 4
the room number of the user or QString::null if not set or the user is invalid 
.RE
.PP

.PP
Definition at line 181 of file kuser.cpp.
.SS "template<class T> \fBQString\fP \fBKUser\fP< T >::workPhone () const"
.PP
The user's work phone. 
.PP
\fBReturns:\fP
.RS 4
the work phone of the user or QString::null if not set or the user is invalid 
.RE
.PP

.PP
Definition at line 188 of file kuser.cpp.
.SS "template<class T> \fBQString\fP \fBKUser\fP< T >::homePhone () const"
.PP
The user's home phone. 
.PP
\fBReturns:\fP
.RS 4
the home phone of the user or QString::null if not set or the user is invalid 
.RE
.PP

.PP
Definition at line 195 of file kuser.cpp.
.SS "template<class T> \fBQString\fP \fBKUser\fP< T >::homeDir () const"
.PP
The path to the user's home directory. 
.PP
\fBReturns:\fP
.RS 4
the home directory of the user or QString::null if the user is invalid 
.RE
.PP

.PP
Definition at line 202 of file kuser.cpp.
.SS "template<class T> \fBQString\fP \fBKUser\fP< T >::shell () const"
.PP
The path to the user's login shell. 
.PP
\fBReturns:\fP
.RS 4
the login shell of the user or QString::null if the user is invalid 
.RE
.PP

.PP
Definition at line 209 of file kuser.cpp.
.SS "template<class T> \fBQValueList\fP< \fBKUserGroup\fP > \fBKUser\fP< T >::groups () const"
.PP
Returns all groups of the user. 
.PP
\fBReturns:\fP
.RS 4
all groups of the user 
.RE
.PP

.PP
Definition at line 216 of file kuser.cpp.
.PP
References KUserGroup::allGroups(), QValueList::append(), QValueList::begin(), QValueList::end(), and QValueList::find().
.SS "template<class T> \fBQStringList\fP \fBKUser\fP< T >::groupNames () const"
.PP
Returns all group names of the user. 
.PP
\fBReturns:\fP
.RS 4
all group names of the user 
.RE
.PP

.PP
Definition at line 229 of file kuser.cpp.
.PP
References KUserGroup::allGroups(), QValueList::begin(), QValueList::end(), and QValueList::find().
.SS "template<class T> \fBQValueList\fP< \fBKUser\fP > \fBKUser\fP< T >::allUsers ()\fC [static]\fP"
.PP
Returns all users of the system. 
.PP
\fBReturns:\fP
.RS 4
all users of the system. 
.RE
.PP

.PP
Definition at line 243 of file kuser.cpp.
.PP
References QValueList::append(), and KUser< T >::KUser().
.SS "template<class T> \fBQStringList\fP \fBKUser\fP< T >::allUserNames ()\fC [static]\fP"
.PP
Returns all user names of the system. 
.PP
\fBReturns:\fP
.RS 4
all user names of the system. 
.RE
.PP

.PP
Definition at line 257 of file kuser.cpp.

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
