LedgerSMB::User(3) Provides user support and database management functions.


This module provides user support and database management functions.




 # LedgerSMB
 # Small Medium Business Accounting software
 # http://www.ledgersmb.org/
 # Copyright (C) 2006
 # This work contains copyrighted information from a number of sources
 # all used with permission.
 # This file contains source code included with or based on SQL-Ledger
 # which is Copyright Dieter Simader and DWS Systems Inc. 2000-2005
 # and licensed under the GNU General Public License version 2 or, at
 # your option, any later version.  For a full list including contact
 # information of contributors, maintainers, and copyright holders,
 # see the CONTRIBUTORS file.
 # Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork):
 # Copyright (C) 2000
 #  Author: DWS Systems Inc.
 #     Web: http://www.sql-ledger.org
 #  Contributors: Jim Rawlings <[email protected]>
 # This file has undergone whitespace cleanup.
 # user related functions


Create a LedgerSMB::User object. If the user $login exists, set the fields with values retrieved from the database.
Returns a hash where the keys are registered locales and the values are the textual representation of the locale name.
Returns a reference to a hash that contains the user config for the user $login. If that user does not exist, output 'Access denied' if in CGI and die in all cases.
Disused function to return the number of current recurring events.
LedgerSMB::User::dbconnect_vars($form, $db);
Converts individual $form values into $form->{dboptions} and $form->{dbconnect}.
Returns a list of all drivers set up with DBI whose names end in 'Pg'.
Returns a list of all databases in the same cluster as the database that $form is set to. If $form->{only_acc_db} is set, only non-template databases that have a defaults table owned by $form->{dbuser} are returned.
Create the database indicated by $form->{db} and load Pg-database.sql, the chart indicated by $form->{chart} and custom tables and functions (Pg-custom_tables.sql and Pg-custom_functions).
LedgerSMB::User->process_query($form, $dbh, $filename);
Load the file $filename into the database indicated through form using psql. $dbh is ignored.
Disused function to drop the database $form->{db}.
LedgerSMB::User->dbsources_unused($form, $memfile);
Disused function to identify all databases in a cluster with a defaults table that are not mentioned in the memberfile $memfile.
Disused function to locate all databases owned by $form->{dbuser} that are not a template* database which have a defaults table with a version entry.
Applies database upgrade scripts to upgrade the database to the current level.
Returns a numeric form for the version passed in. The numeric form is derived by converting each dotted portion of the version to a three-digit number and appending them.

 | $version |   returned |
 |   1.0.0  |    1000000 |
 |   1.2.33 |    1002033 |
 | 189.2.33 |  189002033 |
 | | 1002003004 |
Sorting function for database upgrade scripts.
Updates the user config in the database for the user $user. If no config for the user exists, the user to the database.
Disused function to delete the user $form->{login}.
Disused function that returns a list of user config variable names.
Privately used error function. Used in places where the more typically used $form->error cannot be used. Always dies.