X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fadmin.php;h=efeb744b536e19f2a95b78fd0a8e2e6b5db9f788;hb=254c175a7e331947c69794aa7a0248caa47e32f5;hp=58686fd5da17ea73a531e7d7d203b9dbe8ca6255;hpb=fd0382ef2ff8216bc3880fc61cf0178d9f0f75e9;p=brisk.git
diff --git a/web/admin.php b/web/admin.php
index 58686fd..efeb744 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
@@ -51,7 +51,7 @@ class ImpPoints
// error_log("TTOK: ".count($arr), 0);
if (count($arr) != 20) {
- error_log("COUNT: ".count($arr));
+ // error_log("COUNT: ".count($arr));
return FALSE;
}
@@ -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++) {
@@ -263,4 +271,4 @@ echo "$cont";