X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fadmin.php;h=55674ba709e078b750a2af842997e7f820d693b3;hb=6304548260e74f35f8b7148ebc86c36f8a2faa87;hp=c36e47539d3bf69b2704bcca60616fceab23009b;hpb=920beeba1879c5b40e5527949d11536c6ec77f31;p=brisk.git diff --git a/web/admin.php b/web/admin.php index c36e475..55674ba 100644 --- a/web/admin.php +++ b/web/admin.php @@ -2,7 +2,7 @@ /* * brisk - admin.php * - * Copyright (C) 2011 Matteo Nastasi + * Copyright (C) 2011-2012 Matteo Nastasi * mailto: nastasi@alternativeoutput.it * matteo.nastasi@milug.org * web: http://www.alternativeoutput.it @@ -46,12 +46,9 @@ class ImpPoints function ImpPoints($s) { - // error_log($s, 0); $arr = explode('|', $s); - // error_log("TTOK: ".count($arr), 0); if (count($arr) != 20) { - error_log("COUNT: ".count($arr)); return FALSE; } @@ -101,7 +98,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 +124,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++) { @@ -263,4 +268,4 @@ echo "$cont"; - \ No newline at end of file +