summaryrefslogtreecommitdiff
path: root/doc/tips/distributed_wikis
diff options
context:
space:
mode:
Diffstat (limited to 'doc/tips/distributed_wikis')
0 files changed, 0 insertions, 0 deletions
s="hl">#
  • #
  • # This program is free software; you can redistribute it and/or modify
  • # it under the terms of the GNU General Public License as published by
  • # the Free Software Foundation; either version 2 of the License, or
  • # (at your option) any later version.
  • #
  • # This program is distributed in the hope that it will be useful,
  • # but WITHOUT ANY WARRANTY; without even the implied warranty of
  • # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  • # GNU General Public License for more details.
  • # You should have received a copy of the GNU General Public License
  • # along with this program; if not, write to the Free Software
  • # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  • #######################################################################
  • #
  • # this script is the frontend called from bin/$terminal/$script
  • # all the accounting modules are linked to this script which in
  • # turn execute the same script in bin/$terminal/
  • #
  • #######################################################################
  • use LedgerSMB::Sysconfig;
  • use Digest::MD5;
  • use Error qw(:try);
  • $| = 1;
  • use LedgerSMB::User;
  • use LedgerSMB::Form;
  • use LedgerSMB::Locale;
  • use LedgerSMB::Session;
  • use Data::Dumper;
  • require "common.pl";
  • # for custom preprocessing logic
  • eval { require "custom.pl"; };
  • $form = new Form;
  • # name of this script
  • $0 =~ tr/\\/\//;
  • $pos = rindex $0, '/';
  • $script = substr( $0, $pos + 1 );
  • $locale = LedgerSMB::Locale->get_handle( ${LedgerSMB::Sysconfig::language} )
  • or $form->error( __FILE__ . ':' . __LINE__ . ": Locale not loaded: $!\n" );
  • # we use $script for the language module
  • $form->{script} = $script;
  • # strip .pl for translation files
  • $script =~ s/\.pl//;
  • # pull in DBI
  • use DBI qw(:sql_types);
  • # send warnings to browser
  • $SIG{__WARN__} = sub { $form->info( $_[0] ) };
  • # send errors to browser
  • $SIG{__DIE__} =
  • sub { $form->error( __FILE__ . ':' . __LINE__ . ': ' . $_[0] ) };
  • ## did sysadmin lock us out
  • #if (-f "${LedgerSMB::Sysconfig::userspath}/nologin") {
  • # $locale = LedgerSMB::Locale->get_handle(${LedgerSMB::Sysconfig::language}) or
  • # $form->error(__FILE__.':'.__LINE__.": Locale not loaded: $!\n");
  • # $form->{charset} = 'UTF-8';
  • # $locale->encoding('UTF-8');
  • #
  • # $form->{callback} = "";
  • # $form->error(__FILE__.':'.__LINE__.': '.$locale->text('System currently down for maintenance!'));
  • #}
  • &check_password;
  • # grab user config. This is ugly and unecessary if/when
  • # we get rid of myconfig and use User as a real object
  • %myconfig = %{ LedgerSMB::User->fetch_config( $form->{login} ) };
  • $locale = LedgerSMB::Locale->get_handle( $myconfig{countrycode} )