diff options
| author | orbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2006-03-01 22:27:20 +0000 |
|---|---|---|
| committer | orbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2006-03-01 22:27:20 +0000 |
| commit | 1b9b8922d9c377a4690486b175bbafebf7f7cd9a (patch) | |
| tree | 216c8a5572b111de295ba05aec24e4f6a2be56fc /htroot | |
| parent | c2f8318b4fecedd153350362d467bba6dcf65e98 (diff) | |
* fixed problems with new basic 1-2-3 configuration (now authentication required)
* fixed graphics problem
* fixed some other problems with default values
* 1-2-3 config now appears automatically on start-up if no password is set
* added new config menu
* moved profile to new config menu
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1792 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot')
| -rw-r--r-- | htroot/ConfigBasic.html | 4 | ||||
| -rw-r--r-- | htroot/ConfigBasic.java | 18 | ||||
| -rw-r--r-- | htroot/ConfigProfile_p.html (renamed from htroot/EditProfile_p.html) | 3 | ||||
| -rw-r--r-- | htroot/ConfigProfile_p.java (renamed from htroot/EditProfile_p.java) | 2 | ||||
| -rw-r--r-- | htroot/env/templates/header.template | 4 | ||||
| -rw-r--r-- | htroot/env/templates/submenuConfig.template | 11 |
6 files changed, 28 insertions, 14 deletions
diff --git a/htroot/ConfigBasic.html b/htroot/ConfigBasic.html index 493ffa909..d7fa245e6 100644 --- a/htroot/ConfigBasic.html +++ b/htroot/ConfigBasic.html @@ -28,8 +28,8 @@ Your YaCy Peer needs some basic information to operate properly <li>#(statusPassword)#<img src="/env/grafics/warning.png">Please set a password for your peer to protect your settings::<img src="/env/grafics/ok.png" height="32px" width="32px">Password is set#(/statusPassword)#<br> Peer User: <input type="text" name="adminuser" value="#[defaultUser]#" size="16" maxlength="32"><br> Peer Password: <input type="text" name="adminpw1" value="" size="16" maxlength="32"><br> - Peer Password: <input type="text" name="adminpw2" value="" size="16" maxlength="32"><br></li> - <li>#(statusPort)#<img src="/env/grafics/warning.png">Your peer cannot be reached from outside; please open your firewall for this port and/or set a virtual server option in your router to allow connections on this port::<img src="/env/grafics/check.png">Your peer can be reached by other peers#(/statusPort)#<br> + Peer Password: <input type="text" name="adminpw2" value="" size="16" maxlength="32">(repeat same password)<br></li> + <li>#(statusPort)#<img src="/env/grafics/warning.png">Your peer cannot be reached from outside; please open your firewall for this port and/or set a virtual server option in your router to allow connections on this port::<img src="/env/grafics/ok.png" height="32px" width="32px">Your peer can be reached by other peers#(/statusPort)#<br> Peer Port: <input type="text" name="port" value="#[defaultPort]#" size="5" maxlength="5"><br></li> </ol> <br> <input type="submit" name="set" value="Set Configuration"> diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.java index 1c504061b..81f524df4 100644 --- a/htroot/ConfigBasic.java +++ b/htroot/ConfigBasic.java @@ -49,8 +49,10 @@ import de.anomic.http.httpHeader; import de.anomic.kelondro.kelondroBase64Order; +import de.anomic.plasma.plasmaSwitchboard; import de.anomic.server.serverCodings; import de.anomic.server.serverCore; +import de.anomic.server.serverInstantThread; import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; import de.anomic.yacy.yacyCore; @@ -60,9 +62,17 @@ public class ConfigBasic { public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) { // return variable that accumulates replacements + plasmaSwitchboard sb = (plasmaSwitchboard) env; serverObjects prop = new serverObjects(); - //yacyCore.peerPing(); + int authentication = sb.adminAuthenticated(header); + if (authentication < 2) { + // must authenticate + prop.put("AUTHENTICATE", "admin log-in"); + return prop; + } + + serverInstantThread.oneTimeJob(sb.yc, "peerPing", null, 0); // password settings String user = (post == null) ? "" : (String) post.get("adminuser", ""); @@ -70,13 +80,13 @@ public class ConfigBasic { String pw2 = (post == null) ? "" : (String) post.get("adminpw2", ""); // peer name settings - String peerName = (post == null) ? "" : (String) post.get("peername", ""); + String peerName = (post == null) ? env.getConfig("peerName","") : (String) post.get("peername", ""); // port settings - String port = (post == null) ? "8080" : (String) post.get("port", "8080"); + String port = (post == null) ? env.getConfig("port", "8080") : (String) post.get("port", "8080"); // admin password - if ((user.length() > 0) && (!(pw1.equals(pw2)))) { + if ((user.length() > 0) && (pw1.equals(pw2))) { // check passed. set account: env.setConfig("adminAccountBase64MD5", serverCodings.encodeMD5Hex(kelondroBase64Order.standardCoder.encodeString(user + ":" + pw1))); env.setConfig("adminAccount", ""); diff --git a/htroot/EditProfile_p.html b/htroot/ConfigProfile_p.html index 1c5a6df9c..e3af9ca53 100644 --- a/htroot/EditProfile_p.html +++ b/htroot/ConfigProfile_p.html @@ -6,7 +6,8 @@ </head>
<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
#%env/templates/header.template%#
-<br><br>
+#%env/templates/submenuConfig.template%#
+<br>
<h2>Your Personal Profile</h2>
<p>
You can create a personal profile here. Other YaCy users can view these information using a link on the network page.<br>
diff --git a/htroot/EditProfile_p.java b/htroot/ConfigProfile_p.java index f7a0fb44c..2280f5d3d 100644 --- a/htroot/EditProfile_p.java +++ b/htroot/ConfigProfile_p.java @@ -59,7 +59,7 @@ import de.anomic.server.serverSwitch; import de.anomic.yacy.yacyNewsRecord;
import de.anomic.yacy.yacyCore;
-public class EditProfile_p {
+public class ConfigProfile_p {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
//listManager.switchboard = (plasmaSwitchboard) env;
diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template index ca756cacf..780ddbb40 100644 --- a/htroot/env/templates/header.template +++ b/htroot/env/templates/header.template @@ -51,15 +51,15 @@ <tr><td class="MenuItem"> <a href="/share/" class="MenuItemLink">File Share</a></td></tr>
<tr><td class="MenuItem"> <a href="/Wiki.html" class="MenuItemLink">Wiki</a></td></tr>
<tr><td class="MenuItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> <a href="/Messages_p.html" class="MenuItemLink">Messages</a> <img border="0" src="notifier.gif" align="center"></td></tr>
- <tr><td class="MenuItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> <a href="/EditProfile_p.html" class="MenuItemLink">Personal Profile</a></td></tr>
<tr><td class="MenuSpacer"></td></tr>
<tr><td class="MenuHeader"> Peer Control</td></tr>
+ <tr><td class="MenuItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> <a href="/ConfigBasic.html" class="MenuItemLink">Basic Configuration</a></td></tr>
+ <tr><td class="MenuItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> <a href="/Settings_p.html" class="MenuItemLink">Advanced Settings</a></td></tr>
<tr><td class="MenuItem"> <a href="/Status.html" accesskey="t" class="MenuItemLink">Status</a></td></tr>
<tr><td class="MenuItem"> <a href="/Network.html" accesskey="w" class="MenuItemLink">Network</a></td></tr>
<tr><td class="MenuItem"> <a href="/News.html" accesskey="n" class="MenuItemLink">News</a></td></tr>
<tr><td class="MenuItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> <a href="/ViewLog_p.html" class="MenuItemLink">Log</a></td></tr>
- <tr><td class="MenuItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> <a href="/Settings_p.html" class="MenuItemLink">Settings</a></td></tr>
<tr><td class="MenuItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> <a href="/PerformanceQueues_p.html" class="MenuItemLink">Performance</a></td></tr>
<tr><td class="MenuItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> <a href="/Connections_p.html" class="MenuItemLink">Connections</a></td></tr>
<tr><td class="MenuItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> <a href="/Language_p.html" class="MenuItemLink">Language</a></td></tr>
diff --git a/htroot/env/templates/submenuConfig.template b/htroot/env/templates/submenuConfig.template index c71057c25..162bae253 100644 --- a/htroot/env/templates/submenuConfig.template +++ b/htroot/env/templates/submenuConfig.template @@ -1,11 +1,14 @@ <table width="100%" border="0" cellpadding="0" cellspacing="0" class="SubMenu"> -<tr height="10"><td colspan="3" class="MenuHeader"> Peer Configuration Menu</td></tr> -<tr height="2"><td colspan="3"></td></tr> +<tr height="10"><td colspan="5" class="MenuHeader"> Peer Configuration Menu</td></tr> +<tr height="2"><td colspan="5"></td></tr> <tr class="TableHeader"> -<td width="50%" class="MenuSubItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> +<td width="40%" class="MenuSubItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> <a href="/ConfigBasic.html" class="MenuItemLink">Basic Configuraion</a> </td> <td class="MenuSubSpacer"></td> -<td width="50%" class="MenuSubItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> +<td width="40%" class="MenuSubItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> +<a href="/ConfigProfile_p.html" class="MenuItemLink">Profile Configuraion</a> </td> +<td class="MenuSubSpacer"></td> +<td width="20%" class="MenuSubItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> <a href="/ConfigAdvanced_p.html" class="MenuItemLink">Advanced Configuration</a> </td> </tr> </table>
\ No newline at end of file |
