UserDB — adjust default behavior of Interchange user database functions
The directive sets parameters to adjust the behavior of Interchange's built-in user database functions.
| Parameter | Explanation | Default |
|---|---|---|
| acl | Field name for the simple page access control |
acl
|
| addr_field | Field name for the address book |
address_book
|
| assign_username | Automatically assign username if not provided? | 0 |
| bill_field | Field name for billing accounts |
accounts
|
| captcha | ||
| cart_field | Field name for carts storage |
carts
|
| clear_cookie | List of cookies to clear on explicit logout, separated by space, a comma or null-character | None |
| clear_session | Clear user session completely upon logout? | 0 |
| counter | Counter filename for assign_username function
|
etc/username.counter
|
| crypt | Encrypt passwords? | 1 |
| database | Name of the user database |
userdb
|
| db_acl | Field name for database access control |
db_acl
|
| expire_field | Field name for account expiration data |
expiration
|
| file_acl | Field name for file access control |
file_acl
|
| force_lower | Force possibly upper-case database fields to lower case session variable names? | 0 |
| ignore_case | Ignore case in usernames and passwords? | 0 |
| indirect_login | Field name used as login field if different from the primary table key | None |
| logfile | Filename to which successful and unsuccessful authentication messages should be sent |
error.log
|
| md5 | Use MD5 for encryption algorithm instead of the standard (and aging) Unix crypt? | 0 |
| no_get | Do not load values from the database into the user's values space at login time? | 0 |
| no_login | Successfully perform login even if already logged in? | 0 |
| outboard_key_col | Field name providing key for outboard tables | None |
| outboard | List of fields that live in another table | None |
| pass_field | Field name for password |
password
|
| passminlen | Minimum password length | 2 |
| postlogin_action | Macro to run after the user is logged in | None |
| pref_field | Field name for preferences |
preferences
|
| scratch | List of UserDB fields to load into scratch space, instead of the default values space | None |
| secure_cookies | Forces the MV_PASSWORD cookie to be set secure | 1, if using https |
| sql_counter | SQL counter spec (sequence or AUTO_INCREMENT) for assign_username function
|
|
| super_field | Field name that, when set to 1, indicates account's superuser status
|
super
|
| time_field | Field name for storing last login time |
time
|
| unix_time | In log files, use seconds since Unix epoch instead of human-readable time? | 0 |
| userminlen | Minimum username length | 2 |
| username_email | ||
| username_mask | Regular expression that usernames must not match in order to be allowed | None |
| validchars | Character classes that usernames must match in order to be allowed |
-A-Za-z0-9_@.
|
Example: Minimum lengths
Set minimum lengths in characters for username and password.
UserDB default userminlen 8 UserDB default passminlen 6
Interchange 5.9.0:
Source: lib/Vend/Config.pm
Line 3071 (context shows lines 3071-3135)
sub parse_locale {
my($item,$settings) = @_;
return ($settings || '') unless $settings =~ /[^\d.]/;
$settings = '' if "\L$settings" eq 'default';
my $name;
my ($c, $store);
if(defined $C) {
$c = $C->{$item} || { };
$C->{$item . "_repository"} = {}
unless $C->{$item . "_repository"};
$store = $C->{$item . "_repository"};
}
else {
no strict 'refs';
$c = ${"Global::$item"} || {};
${"Global::$item" . "_repository"} = {}
unless ${"Global::$item" . "_repository"};
$store = ${"Global::$item" . "_repository"};
}
my ($eval, $safe);
if ($settings =~ s/^\s*([-\w.@]+)(?:\s+)?//) {
$name = $1;
undef $eval;
$settings =~ /^\s*{/
and $settings =~ /}\s*$/
and $eval = 1;
$eval and ! $safe and $safe = new Vend::Safe;
if(! defined $store->{$name} and $item eq 'Locale') {
my $past = POSIX::setlocale(POSIX::LC_ALL);
if(POSIX::setlocale(POSIX::LC_ALL, $name) ) {
$store->{$name} = POSIX::localeconv();
}
POSIX::setlocale(POSIX::LC_ALL, $past);
}
my($sethash);
if ($eval) {
$sethash = $safe->reval($settings)
or config_warn("bad Locale setting in %s: %s", $name, $@),
$sethash = {};
}
else {
$settings =~ s/^\s+//;
$settings =~ s/\s+$//;
$sethash = {};
%{$sethash} = Text::ParseWords::shellwords($settings);
}
$c = $store->{$name} || {};
my $nodefaults = delete $sethash->{MV_LOCALE_NO_DEFAULTS};
for (keys %{$sethash}) {
$c->{$_} = $sethash->{$_};
}
}
else {
config_error("Bad locale setting $settings.\n");
}
$C->{LastLocale} = $name if $C and $item eq 'Locale';
$store->{$name} = $c unless $store->{$name};
return $c;
}