5 * Copyright (C) 2006-2011 Matteo Nastasi
6 * mailto: nastasi@alternativeoutput.it
7 * matteo.nastasi@milug.org
8 * web: http://www.alternativeoutput.it
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details. You should have received a
19 * copy of the GNU General Public License along with this program; if
20 * not, write to the Free Software Foundation, Inc, 59 Temple Place -
21 * Suite 330, Boston, MA 02111-1307, USA.
25 require_once("Obj/brisk.phh");
26 require_once("Obj/dbase_pgsql.phh");
32 GLOBAL $cont, $G_alarm_passwd, $F_pass_private, $F_ACT, $F_filename;
34 if ($F_ACT == "append") {
36 if ($F_pass_private != $G_alarm_passwd) {
37 $cont .= sprintf("Wrong password, operation aborted.<br>\n");
40 $cont .= sprintf("FILENAME: %s<br>\n", $F_filename);
41 if (($olddb = new LoginDBOld($F_filename)) == FALSE) {
42 $cont .= sprintf("Loading failed.<br>\n");
45 $newdb = new LoginDB();
46 if ($newdb->addusers_from_olddb($olddb, $cont) == FALSE) {
47 $cont .= sprintf("Insert failed.<br>\n");
49 $cont .= sprintf("Item number: %d<br>\n", $olddb->count());
62 <b>Append users from a file</b><br>
63 <form accept-charset="utf-8" method="post" action="<?php echo $PHP_SELF;?>" onsubmit="return j_login_manager(this);">
64 <input type="hidden" name="F_ACT" value="append">
65 <table><tr><td>Admin Password:</td>
66 <td><input name="F_pass_private" type="password" value=""></td></tr>
67 <tr><td>Filename:</td>
68 <td><input type="text" name="F_filename"></td></tr>
69 <tr><td colspan=2><input type="submit" value="append users"></td></tr>