From ff1d3d0680c7c7553eeca033bc868ba02917f462 Mon Sep 17 00:00:00 2001 From: allo Date: Fri, 30 Sep 2005 13:48:26 +0000 Subject: [PATCH] Init of userDB Pagelayout of User_p.html git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@822 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/User_p.html | 79 ++++++++++++++++++ htroot/User_p.java | 82 +++++++++++++++++++ .../de/anomic/plasma/plasmaSwitchboard.java | 3 + 3 files changed, 164 insertions(+) create mode 100644 htroot/User_p.html create mode 100644 htroot/User_p.java diff --git a/htroot/User_p.html b/htroot/User_p.html new file mode 100644 index 000000000..85b4abc7f --- /dev/null +++ b/htroot/User_p.html @@ -0,0 +1,79 @@ + + + +YaCy '#[clientname]#': User Administration +#[metas]# + + +#[header]# +

+

User Administration


+ + + + + + + + + +
+
+
+ +
+
+
+Current User: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Username:
Password:
Password(repeat):
First Name:
Last Name:
Address:
Timelimit:
Time used:
Time range:
+ + +

+
+ +#[footer]# + + diff --git a/htroot/User_p.java b/htroot/User_p.java new file mode 100644 index 000000000..a4282e7ae --- /dev/null +++ b/htroot/User_p.java @@ -0,0 +1,82 @@ +//User_p.java +//----------------------- +//part of the AnomicHTTPD caching proxy +//(C) by Michael Peter Christen; mc@anomic.de +//first published on http://www.anomic.de +//Frankfurt, Germany, 2004 +// +//This File is contributed by Alexander Schier +//last major change: 30.09.2005 +// +//This program is free software; you can redistribute it and/or modify +//it under the terms of the GNU General Public License as published by +//the Free Software Foundation; either version 2 of the License, or +//(at your option) any later version. +// +//This program is distributed in the hope that it will be useful, +//but WITHOUT ANY WARRANTY; without even the implied warranty of +//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//GNU General Public License for more details. +// +//You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +//Using this software in any meaning (reading, learning, copying, compiling, +//running) means that you agree that the Author(s) is (are) not responsible +//for cost, loss of data or any harm that may be caused directly or indirectly +//by usage of this softare or this documentation. The usage of this software +//is on your own risk. The installation and usage (starting/running) of this +//software may allow other people or application to access your computer and +//any attached devices and is highly dependent on the configuration of the +//software which must be done by the user of the software; the author(s) is +//(are) also not responsible for proper configuration and usage of the +//software, even if provoked by documentation provided together with +//the software. +// +//Any changes to this file according to the GPL as documented in the file +//gpl.txt aside this file in the shipment you received can be done to the +//lines that follows this copyright notice here, but changes must not be +//done inside the copyright notive above. A re-distribution must contain +//the intact and unchanged copyright notice. +//Contributions and changes to the program code must be marked as such. + + +//You must compile this file with +//javac -classpath .:../Classes Message.java +//if the shell's current path is HTROOT + +import java.util.logging.Handler; +import java.util.logging.Logger; + +import de.anomic.plasma.plasmaSwitchboard; +import de.anomic.http.httpHeader; +import de.anomic.server.serverObjects; +import de.anomic.server.serverSwitch; +import de.anomic.data.userDB; + +public class User_p { + + + public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) { + serverObjects prop = new serverObjects(); + plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard(); + + //default values + prop.put("current_user", "nouser"); + prop.put("username", ""); + prop.put("firstname", ""); + prop.put("lastname", ""); + prop.put("address", ""); + prop.put("timelimit", ""); + prop.put("timeused", ""); + prop.put("timerange", ""); + + if(sb.userDB == null) + return prop; + + // return rewrite properties + return prop; + } + +} diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java index 6e7c53d69..8fa147622 100644 --- a/source/de/anomic/plasma/plasmaSwitchboard.java +++ b/source/de/anomic/plasma/plasmaSwitchboard.java @@ -124,6 +124,7 @@ import java.util.logging.Level; import de.anomic.data.messageBoard; import de.anomic.data.robotsParser; import de.anomic.data.wikiBoard; +import de.anomic.data.userDB; import de.anomic.htmlFilter.htmlFilterContentScraper; import de.anomic.http.httpHeader; import de.anomic.http.httpc; @@ -184,6 +185,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser public long proxyLastAccess; public yacyCore yc; public HashMap indexingTasksInProcess; + public userDB userDB; private static final String STR_PROXYPROFILE = "defaultProxyProfile"; private static final String STR_REMOTEPROFILE = "defaultRemoteProfile"; @@ -359,6 +361,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser log.logConfig("Starting Wiki Board"); wikiDB = new wikiBoard(new File(getRootPath(), "DATA/SETTINGS/wiki.db"), new File(getRootPath(), "DATA/SETTINGS/wiki-bkp.db"), ramWiki); + userDB = new userDB(new File(getRootPath(), "DATA/SETTINGS/user.db"), 512); // init cookie-Monitor log.logConfig("Starting Cookie Monitor");