X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fadmin.php;h=6c65f9e20984547e164fcadcc03d08769b23b020;hb=312a6acc00ec7f331ab461894c319776eec95cae;hp=58686fd5da17ea73a531e7d7d203b9dbe8ca6255;hpb=fd0382ef2ff8216bc3880fc61cf0178d9f0f75e9;p=brisk.git diff --git a/web/admin.php b/web/admin.php index 58686fd..6c65f9e 100644 --- a/web/admin.php +++ b/web/admin.php @@ -2,7 +2,7 @@ /* * brisk - admin.php * - * Copyright (C) 2006-2011 Matteo Nastasi + * Copyright (C) 2011 Matteo Nastasi * mailto: nastasi@alternativeoutput.it * matteo.nastasi@milug.org * web: http://www.alternativeoutput.it @@ -101,7 +101,11 @@ function main() $cont .= sprintf("Loading failed.
\n"); break; } - $newdb = new BriskDB(); + + if (($newdb = BriskDB::create()) == FALSE) { + $cont .= sprintf("Database connection failed.
\n"); + break; + } $newdb->users_load(); if ($newdb->addusers_from_olddb($olddb, $cont) == FALSE) { $cont .= sprintf("Insert failed.
\n"); @@ -123,7 +127,11 @@ function main() break; } - $newdb = new BriskDB(); + if (($newdb = BriskDB::create()) == FALSE) { + $cont .= sprintf("Database connection failed.
\n"); + break; + } + $newdb->users_load(); $dbconn = $newdb->getdbconn(); for ($pts_n = 0 ; !feof($fp) ; $pts_n++) {