This shows you the differences between two versions of the page.
esmith:accountsdb [2015/05/22 07:19] stephdl created |
esmith:accountsdb [2019/06/05 19:48] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== esmith:: | ||
- | if you want the latest documentation do | ||
- | perldoc esmith:: | ||
- | ===== NAME ===== | ||
- | esmith:: | ||
- | |||
- | In a root terminal you can do the command below if you want to display the up-to-date content | ||
- | | ||
- | |||
- | ===== SYNOPSIS ===== | ||
- | use esmith:: | ||
- | my $a = esmith:: | ||
- | |||
- | my @users | ||
- | my @groups | ||
- | my @ibays | ||
- | my @printers = $a-> | ||
- | my @pseudonyms = $a-> | ||
- | |||
- | | ||
- | my @groups = $a-> | ||
- | | ||
- | | ||
- | |||
- | | ||
- | | ||
- | | ||
- | my $dp = $a-> | ||
- | my $up = $a-> | ||
- | my $uid = $a-> | ||
- | |||
- | ===== DESCRIPTION ===== | ||
- | This module provides an abstracted interface to the esmith accounts database. | ||
- | |||
- | ==== open() ==== | ||
- | |||
- | Loads an existing account database and returns an esmith:: | ||
- | |||
- | ==== open_ro() ==== | ||
- | |||
- | Like esmith:: | ||
- | |||
- | ==== users(), groups(), ibays(), printers(), pseudonyms() ==== | ||
- | |||
- | Returns a list of records (esmith:: | ||
- | |||
- | ===== GROUP MANAGEMENT ===== | ||
- | ==== $a-> | ||
- | |||
- | Returns true if the user is a member of the group, false otherwise. The arguments are a user name and a group name. | ||
- | |||
- | This routine will return undef if there is no such group, false (but defined) if the user is not in the group, and true if the user is in the group. | ||
- | |||
- | ==== $a-> | ||
- | |||
- | Get a list of groups (by name) of which a user is a member. | ||
- | |||
- | ==== $a-> | ||
- | |||
- | Given a list of groups (by name), adds the user to all of them. | ||
- | |||
- | Doesn’t signal the group-modify event, just does the DB work. | ||
- | |||
- | Note: the method used here is a bit kludgy. | ||
- | |||
- | ==== $a-> | ||
- | |||
- | Given a list of groups, removes a user from all of them. Doesn’t signal the group-modify event, just does the DB work. | ||
- | |||
- | ==== $a-> | ||
- | |||
- | Sets the user’s groups in one fell swoop. | ||
- | |||
- | ===== PSEUDONYM MANAGEMENT ===== | ||
- | ==== $a-> | ||
- | |||
- | Given a user name, creates standard pseudonyms (" | ||
- | |||
- | ==== $a-> | ||
- | |||
- | Given a username, remove any pseudonyms related to that user from the accounts database. Also removes any pseudonyms related to a pseudonym being removed. Returns the number of pseudonym records deleted. | ||
- | |||
- | ==== $a-> | ||
- | |||
- | Given a username, remove the dot_pseudonym and underbar_pseudonym related to that user from the accounts database. | ||
- | |||
- | ==== $a-> | ||
- | |||
- | Returns the " | ||
- | |||
- | ==== $a-> | ||
- | |||
- | Returns the " | ||
- | |||
- | ==== $a-> | ||
- | |||
- | Returns the number of active users, ie, accounts which have passwords set and are of type ’user’. | ||
- | |||
- | ==== get_next_uid ==== | ||
- | |||
- | Returns the next available UID from / | ||
- | |||
- | ==== new_record ($key, \%props) ==== | ||
- | |||
- | This method is overridden from esmith:: | ||
- | |||
- | ==== validate_account_name ($name) ==== | ||
- | |||
- | Check $name to see if it is a valid account name. Valid account names start with a letter or number and contain only letters, numbers, underscores, | ||
- | |||
- | === AUTHOR === | ||
- | SME Server Developers < | ||
- | |||
- | {{tag> neth-development sme-development }} | ||