my $userBackEnd = ManaTools::Shared::Users->new();
my $userInfo = $userManager->getUserInfo('username');
perldoc ManaTools::Shared::Users
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
optional parameter to set the system face icon directory,
default value is /usr/share/mga/faces/
optional parameter to set the user face icon directory,
default value is /usr/share/mga/faces/
$self: this object
DESCRIPTION
The BUILD method is called after a Moose object is created,
Into this method new optional parameters are tested once,
instead of into any other methods.
path to directory containing face icon
DESCRIPTION
Return the directory containing face icons.
path to directory containing user face icons
DESCRIPTION
Return the directory containing user face icons.
$face: face icon name (usually username)
OUTPUT
pathname to $face named icon with png extension
DESCRIPTION
This method returns the face icon pathname related to username
$namelist: ARRAY reference containing the face name list
DESCRIPTION
Retrieves the list of icon name from facesdir()
$user: username to add
$icon: chosen icon for username $user
DESCRIPTION
Add a $user named icon to $self->user_face_dir. It just copies
$icon to $self->user_face_dir, naming it as $user
$user: username icon to remove
DESCRIPTION
Remove a $user named icon from $self->user_face_dir
$name: User or Group name
$name_length: Max length of $name (default 32)
OUTPUT
1, locale "Ok" if valid
0, and explanation string if not valid:
- Name field is empty please provide a name
- The name must contain only lower cased latin letters, numbers, '.', '-' and '_'
- Name is too long
DESCRIPTION
this internal method return if a name is compliant to
a group or user name.
$username: user name to check
OUTPUT
1 if valid, 0 if not (see _valid)
DESCRIPTION
Checks the valididty of the string $username
$groupname: user name to check
OUTPUT
1 if valid, 0 if not (see _valid)
DESCRIPTION
Checks the valididty of the string $groupname
$name: username
DESCRIPTION
Fixes user deletion into groups.
$groups: ARRAY reference containing all the groups
DESCRIPTION
This method return the configured groups
$groupname: the name of the group to check
OUTPUT
if group exists
DESCRIPTION
This method return if a given group exists
$group: the id of the group to check
OUTPUT
if group exists
DESCRIPTION
This method return if a given group exists
$groupname: group name
OUTPUT
groupid or undef
DESCRIPTION
This method returns the group id for the group name
$gid group identifier
OUTPUT
group name or undef
DESCRIPTION
This method returns the group name for the given group
identifier
$params: HASH reference containing:
groupname => name of teh group to be added
gid => group id of the group to be added
is_system => is a system group?
OUTPUT
$gid the actual group id
DESCRIPTION
This method add a group to system
$groupname: The group name
OUTPUT
$members: ARRAY reference containing all the user belonging
to the given $groupname
DESCRIPTION
This method gets the group name and returns the users
belonging to it
$groupname: the name of the group
OUTPUT
$username: undef if it is primary group or the username for
which the group is the primary one.
DESCRIPTION
This methods check if the given group name is primary group
for any users belonging to the group
$groupname: in_par_description
OUTPUT
0: if error occurred
1: if removed
DESCRIPTION
This method remove the group from the system
$groupInfo: HASH reference containing:
old_groupname => old name of the group (if renaming)
groupname => group name
members => users belonging to the group
OUTPUT
$retval => HASH reference
status => 1 (ok) 0 (error)
error => error message if status is 0
DESCRIPTION
This method modifies the group groupname
$options: HASH reference containing
groupname_filter => groupname search string
filter_system => hides system groups
OUTPUT
$groupsInfo: HASH reference containing
groupname-1 => {
gid => group identifier
members => ARRAY of username
}
groupname-2 => {
...
}
DESCRIPTION
This method get group information (all groups or the
filtered ones)
$users: ARRAY reference containing all the users
DESCRIPTION
This method return the configured users
$username: user name
OUTPUT
$userInfo: HASH reference containing
{
uid => user identifier
gid => group identifier
fullname => user full name
home => home directory
shell => user shell
expire => shadow expire time
locked => is locked?
exp_min => shadow Min
exp_max => shadow Max
exp_warn => shadow Warn
exp_inact => shadow Inact
last_change => Shadow last change
members => groups the user belongs to
}
DESCRIPTION
This method get all the information for the given user
$options: HASH reference containing
username_filter => username search string
filter_system => hides system users
OUTPUT
$usersInfo: HASH reference containing
username-1 => {
uid => user identifier
group => primary group name
gid => group identifier
fullname => user full name
home => home directory
shell => user shell
status => login status (locked, expired, etc)
}
username-2 => {
...
}
DESCRIPTION
This method get user information (all users or filtered ones)
$username: given user name
OUTPUT
$homedir: user home directory
DESCRIPTION
This method return the home directory belonging to the given
username
$username: the name of the user to check
OUTPUT
if user exists
DESCRIPTION
This method return if a given user exists
$l: login user info
OUTPUT
$status: Locked, Expired, or empty string
DESCRIPTION
This method returns if the login is Locked, Expired or ok.
Note this function is meant for internal use only
$params: HASH reference containing:
username => name of teh user to be added
uid => user id of the username to be added
is_system => is a system user?
homedir => user home directory
donotcreatehome => do not create the home directory
shell => user shall
fullname => user full name
gid => group id for the user
shadowMin => min time password validity
shadowMax => max time password validity
shadowInact =>
shadowWarn =>
password => user password
OUTPUT
0 if errors 1 if ok
DESCRIPTION
This method add a user to system
$userInfo: HASH reference containing:
old_username => old name of the user (if renaming)
username => user name
fullname => full name of teh user
password => password
homedir => home directory
shell => user shell
members => groups the user belongs to
gid => primary group identifier
lockuser => lock user
acc_expires => account expire time - containing:
exp_y => year
exp_m => month
exp_d => day
password_expires => password expire time - containing:
exp_min => min
exp_max => max
exp_warn => when warn
exp_inact => when inactive
DESCRIPTION
This method modifies the group groupname
$username: username to be deleted
$options: HASH reference containing
clean_home => if home has to be removed
clean_spool => if sppol has to be removed
OUTPUT
error string or undef if no errors occurred
DESCRIPTION
This method delete a user from the system.
GetUserShells: from libUSER
DESCRIPTION
This method returns the available shell
$name: icon name for the given username
$next: if passed means getting next icon from the given $name
OUTPUT
$user_icon: icon name
DESCRIPTION
This method returns the icon for the given user ($name) or the
following one if $next is passed
$passwd: password to be checked
OUTPUT
1: if password is strong
0: if password is weak
DESCRIPTION
Check for a strong password
$passwd: password to check
OUTPUT
1: if the password is too weak for security level
DESCRIPTION
Check the security level set if /etc/security/msec/security.conf
exists and the level is not 'standard' and if the password
is not at least 6 characters return true
$name: username
OUTPUT
$gid: group id
DESCRIPTION
Adds the given username $name to 'users' group