11 |
|
|
12 |
use lib '..'; |
use lib '..'; |
13 |
|
|
|
my $dsn = 'Pg:dbname=libdata'; |
|
|
my ($user,$passwd) = ('dpavlin',''); |
|
|
|
|
14 |
my @persistent_vars = qw(p ms s); |
my @persistent_vars = qw(p ms s); |
15 |
|
|
16 |
# read global.conf configuration |
# read global.conf configuration |
17 |
my $cfg_global = new Config::IniFiles( -file => '../global.conf' ) || die "can't open 'global.conf'"; |
my $cfg_global = new Config::IniFiles( -file => '../global.conf' ) || die "can't open 'global.conf'"; |
18 |
|
|
19 |
# configuration options from global.conf |
# configuration options from global.conf |
20 |
my $TEMPLATE_PATH = $cfg_global->val('webpac', 'template_html') || die "need template_html in global.conf, section webpac"; |
my $TEMPLATE_PATH = $cfg_global->val('portal', 'template_html') || die "need template_html in global.conf, section portal"; |
21 |
my $CHARSET = $cfg_global->val('webpac', 'charset') || 'ISO-8859-1'; |
my $CHARSET = $cfg_global->val('portal', 'charset') || 'ISO-8859-1'; |
22 |
|
my $dsn = $cfg_global->val('portal', 'dbi_dsn') || die "need dsn in global.conf, section portal"; |
23 |
|
my ($user,$passwd) = ($cfg_global->val('portal', 'dbi_user'), $cfg_global->val('portal', 'dbi_passwd')); |
24 |
|
my $locale = $cfg_global->val('portal', 'locale') || 'C'; |
25 |
|
|
26 |
|
|
27 |
my $dbh = DBI->connect("DBI:$dsn",$user,$passwd, { RaiseError => 1 }); |
my $dbh = DBI->connect("DBI:".$dsn,$user,$passwd, { RaiseError => 1 }); |
28 |
|
|
29 |
use POSIX qw(locale_h); |
use POSIX qw(locale_h); |
30 |
setlocale(LC_CTYPE, "hr_HR"); |
setlocale(LC_CTYPE, $locale); |
31 |
use locale; |
use locale; |
32 |
|
|
33 |
sub setup { |
sub setup { |