X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fadmin.php;h=55674ba709e078b750a2af842997e7f820d693b3;hb=cacb96363fc214b83debe7967cc61b75882b1ee1;hp=7c87e1d6e7d5551ccd94ecc983aba42cbf4a208a;hpb=a3111de89c89bb1a3a81e748592d26d85e4fd79d;p=brisk.git
diff --git a/web/admin.php b/web/admin.php
index 7c87e1d..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;
}
@@ -102,8 +99,10 @@ function main()
break;
}
- // FIXME: now create can return FALSE
- $newdb = BriskDB::create();
+ 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");
@@ -125,8 +124,11 @@ function main()
break;
}
- // FIXME: now create can return FALSE
- $newdb = BriskDB::create();
+ 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++) {
@@ -266,4 +268,4 @@ echo "$cont";