---
name: "LedgerSMB::DBObject::Admin"
section: "3pm"
platform: "linux"
package: "ledgersmb"
version: "1.3.40-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/LedgerSMB::DBObject::Admin"
---

# LedgerSMB::DBObject::Admin(3pm)

User/group management for LedgerSMB

## NAME

LedgerSMB::DBObject::Admin - User/group management for LedgerSMB

## SYNOPSIS

User/group management for LedgerSMB

## INHERITS

- Universal

  - LedgerSMB

  - LedgerSMB::DBObject

  ## METHODS

- save\_user

  Saves a user optionally with location and contact data.

  If the password or import hash values is set, will not save contact or address information.

  This API is not fully documented at this time because it is expected that it will be broken down into more manageable chunks in future versions.  Please do not  count on the behavior.

- delete\_user($delete\_role)

  Deletes a user specified by `$self`-\>{user\_id}.

  if `$delete_role` is true, deletes the role too.

- search\_users

  Returns a list of users matching search criteria, and attaches that list to the  user\_results hash value.

  Search criteria:

  - username

    - first\_name

    - last\_name

    - ssn

    - dob

    Undef matches all values.  All matches exact except username which allows for partial matches.

- list\_sessions

  returns a list of active sessions, when they were last used, and how many  discretionary locks they hold.  The list is also attached to the active\_sessions hash value.  No inputs required or used.

- delete\_session

  Deletes a session identified by the session\_id hashref.

- save\_roles

  Saves the roles assigned to a user. Each role is specified as a hashref true value, where the key is the full name of the role (i.e. starting with lsmb\_\[dbname\]\_\_).

- get\_salutations

  Returns a list of salutation records from the db for the dropdowns.

- get\_roles

  Returns a list of role names with the following format:

  {role =\> `$full_role_name`, description =\> `$short_role_name`}

  The short role name is the full role name with the prefix removed (i.e. without the lsmb\_\[dbname\]\_\_ prefix).

- get\_countries

  Returns a reference to an array of hashrefs including the country data in the db.

  Sets the same reference to the countries hash value.

- get\_contact\_classes

  Returns a list of hashrefs ({id =\>, class =\>}) relating to the contact classes.

## COPYRIGHT

Copyright (c) 2009, the LedgerSMB Core Team.  This is licensed under the GNU  General Public License, version 2, or at your option any later version.  Please  see the accompanying License.txt for more information.
