Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
Init of userDB Pagelayout of User_p.html
alloff1d3d0680c7
diff --git a/htroot/User_p.html b/htroot/User_p.htmlnew file mode 100644index 000000000..85b4abc7f--- /dev/null+++ b/htroot/User_p.html@@ -0,0 +1,79 @@+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">+<html>+<head>+<title>YaCy '#[clientname]#': User Administration</title>+#[metas]#+</head>+<body>+#[header]#+<br><br>+<h2>User Administration</h2><br>+<table>+<tr>++<td valign="top">+<form action="User_p.html">+<select name="users">+<option value="newuser">new User</option>+#{users}#+<option>#[user]#</option>+#{/users}#+</select><br />+<input type="submit" value="Edit User">+</form>+</td>++<td width="100%">+<form action="User_p.html">+Current User: <input type="text" name="current_user" value="#[current_user]#" readonly>+<p />+<table border="1">+ <tr>+ <td>Username: </td>+ <td><input type="text" value="#[username]#"></td>+ </tr>+ <tr>+ <td>Password: </td>+ <td><input type="password" name="password"></td>+ </tr>+ <tr>+ <td>Password(repeat): </td>+ <td><input type="password" name="password2"></td>+ </tr>+ <tr>+ <td>First Name: </td>+ <td><input type="text" name="firstname" value="#[firstname]#"></td>+ </tr>+ <tr>+ <td>Last Name: </td>+ <td><input type="text" name="lastname" value="#[lastname]#"></td>+ </tr>+ <tr>+ <td>Address: </td>+ <td><input type="text" name="address" value="#[address]#"></td>+ </tr>+ <tr>+ <td>Timelimit: </td>+ <td><input type="text" name="timelimit" value="#[timelimit]#"></td>+ </tr>+ <tr>+ <td>Time used: </td>+ <td><input type="text" name="timeused" value="#[timeused]#"></td>+ </tr>+ <tr>+ <td>Time range: </td>+ <td><input type="text" name="timerange" value="#[timerange]#"></td>+ </tr>+</table>+<input type="submit" name="change" value="Save User">++</form>+</td>+++</tr>+</table>++#[footer]#+</body>+</html>diff --git a/htroot/User_p.java b/htroot/User_p.javanew file mode 100644index 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; [email protected]+//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.javaindex 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 serpublic 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 serlog.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-Monitorlog.logConfig("Starting Cookie Monitor");