# use strict; # ---------------------------------------------------------------- # Plugin for PreCreateForm() sub PreCreateForm() { # ensure, that non admins get no access if(!$oSessionGL->getState("ActualLogin") || !$oSessionGL->getState("IsAdmin")) { &OkForm("ERROR", sprintf(i18n("Sorry, please %s first as WWWdb-admin!"), "" . i18n("login") . ""), "BtnExit"); &MyExit(); } &SetField("CmdChecked", 0); return; } # ---------------------------------------------------------------- # Plugin for Check_UserFormat_SqlCommand() sub Check_UserFormat_SqlCommand() { return; } # ---------------------------------------------------------------- # Plugin for MyBtnNew() sub MyBtnNew() { my $cResult = ""; my $lRecord; my $pStmtHdl; my @lFields; my $cField; my $cSqlCmd = &GetField("SqlCommand"); my $cSqlError = ""; my $iInd = 0; unless(&GetAttr("RecordOk")) { &GenPage(); &MyExit(); } $lRecord = eval { my $pDbHdl = $oDbSessionGL->{"DbHandle"}; local $SIG{'__DIE__'}; local $SIG{'__WARN__'}; $pStmtHdl = $pDbHdl->prepare($cSqlCmd) or die(sprintf(i18n("Prepare: [%s] %s"), $pDbHdl->state(), $pDbHdl->errstr())); print STDERR "SSSSS 1.0\n"; unless ($cResult) { $pStmtHdl->execute() or die(sprintf(i18n("Execute: [%s] %s"), $pDbHdl->state(), $pDbHdl->errstr())); $cResult = $pStmtHdl->fetchall_arrayref(); } print STDERR "SSSSS 2.0\n"; if ($cResult eq "0E0") { $cResult = [[undef]]; } print STDERR "SSSSS 3.0\n"; $cResult; }; if ($DBI::errstr) { &Error(b(i18n("Invalid SQL-statement, please re-enter.")) . p() . ($DBI::errstr? (b(i18n("The SQL-error was: ")) . p() . sprintf(i18n("[%s] %s"), $DBI::state, i($DBI::errstr)) . p()): "")); &MyExit(); } if ($oDbSessionGL->{"DbDriver"} ne "mysql") { $cResult = "