modUserServer for Antville

4 views
Skip to first unread message

Michael Platzer

unread,
Jul 11, 2005, 12:32:31 PM7/11/05
to so...@googlegroups.com
The Helma code-snippets provided here
http://www.sorua.net/stories/776023/ are just intented for demonstration
purpose, and are not expected to work out-of-the-box. I attached the
adapted UserServer, which hopefully works for Antville-installations.

So you probably need the following steps to enable UserServer for Antville:
* download the commons-httpclient-3.0-rc2.jar from
http://jakarta.apache.org/site/downloads/downloads_commons-httpclient.cgi
and put it into your code-repository (or to [HelmaDir]/lib/ext)
* put the attacht file modSoruaUserServer.js into [AntvilleDir]/MemberMgr
* Adapt function Root.modSoruaUserServerGetArrayOfKnownAuthServers to
define your list of known AuthServers.
* Include the following lines somewhere into the MemberMgr/login Skin:
----------------------
<tr>
<td valign="top"><% input id="isusersorua" type="radio" name="isuser"
value="sorua" %></td>
<td>
I am registered at another Service with
<b>SORUA</b>-Authentification.<br />
<% MemberMgr.modSoruaUserServerKnownAuthServers width="100"
as="dropdown"
onChange="document.getElementById('isusersorua').checked='checked'" %>
</td>
</tr>
----------------------
* And include the following lines into the MemberMgr/login_action:
--------------------
function login_action() {
...
if (req.data.login && req.data.isuser == "sorua") {
var redUrl = this.href("modSoruaUserServer") + "?submit=1";
if (req.data.name) redUrl += "&name=" + req.data.name;
redUrl += "&authuri=" + escape(req.data.modSoruaAuthServerAuthUri);
if (req.data.remember || req.data.remembersorua) redUrl +=
"&remember=1";
res.redirect(redUrl);
}else if (req.data.login) {
...
--------------------

hope this works, but cant tell for sure.

greets,
michi


--

DI Michael Platzer
technical director
--------------------------------------
knallgrau new media solutions gmbh
pezzlgasse 7|1, A-1170 wien
phone: +43 - 1 - 522 76 37
fax: +43 - 1 - 522 76 38
http://www.knallgrau.at

weitere News im Knallgrau Weblog:
http://www.knallgrau.at/company/weblog

modSoruaUserServer.js

Michael Platzer

unread,
Jul 12, 2005, 1:43:16 AM7/12/05
to so...@googlegroups.com
i forgot to mention that a recent commons-codec-library is also
necessary. you can download that from
http://jakarta.apache.org/site/downloads/downloads_commons-codec.cgi

greets,
michi


Michael Platzer schrieb:

night

unread,
Jul 12, 2005, 4:30:00 AM7/12/05
to so...@googlegroups.com
ok i placed the jar in the lib/ext/ directory aswell and now i'm
getting the following error:

Exception in Transactor[null]: helma.scripting.ScriptingException:
[object Object]

:(

Michael Platzer

unread,
Jul 12, 2005, 5:09:09 AM7/12/05
to so...@googlegroups.com
* Did you restart Helma? Which Helma-version are you using?
* Can you set debug=true in app.properties and send the full error trace
* Can you trace down the line that particular bug occurs by inserting res.debug-statements into the action/functions. That is necessary for me to be able to tell you what is going wrong.

  michi



night schrieb:

night

unread,
Jul 12, 2005, 5:38:12 AM7/12/05
to so...@googlegroups.com
>> * Did you restart Helma? Which Helma-version are you using?

yes, i did restart it and helma is using both commons extensions. the
helmaversion is 1.4.3 on java 1.5.0_02.

>> * Can you set debug=true in app.properties and send the full error trace

yes. here (prefixed with > to prevent linewraps by google groups):

>Error in Script: [object Object]
>org.mozilla.javascript.JavaScriptException: anmeldung fehlgeschlagen! hast du dich vertippt? (antville:MemberMgr/objectFunctions.js#12)
> at org.mozilla.javascript.gen.c98._c1(antville:MemberMgr/objectFunctions.js:12)
> at org.mozilla.javascript.gen.c98.call(antville:MemberMgr/objectFunctions.js)
> at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1442)
> at org.mozilla.javascript.gen.c101._c1(antville:MemberMgr/modSoruaUserServer.js:49)
> at org.mozilla.javascript.gen.c101.call(antville:MemberMgr/modSoruaUserServer.js)
> at helma.scripting.rhino.RhinoEngine.invoke(RhinoEngine.java:283)
> at helma.framework.core.RequestEvaluator.run(RequestEvaluator.java:346)
> at java.lang.Thread.run(Thread.java:595)

i would assume that the error occurs in line 49 of
modSoruaUserServer.js which is the following:

> var msg = this.evalLogin(newUser.name, newUser.password);

>> * Can you trace down the line that particular bug occurs by inserting res.debug-statements into the action/functions. That is necessary for me to be able to tell you what is going wrong.

just like "res.debug('1');" or something like that? where would those
debug messages appear? in the console output? or in the eventlog?

Michael Platzer

unread,
Jul 12, 2005, 6:49:30 AM7/12/05
to so...@googlegroups.com
night schrieb:
i would assume that the error occurs in line 49 of
modSoruaUserServer.js which is the following:
  
attached you will find a new version of MemberMgr/modSoruaUserServer.js which is hopefully less dependent on the existence/logic of other functions. hopefully it will work out now.

* Can you trace down the line that particular bug occurs by inserting res.debug-statements into the action/functions. That is necessary for me to be able to tell you what is going wrong.
    
just like "res.debug('1');" or something like that? where would those
debug messages appear? in the console output? or in the eventlog?
  
yes, shtg like that. a yellow message would then appear at the end of the response itself. but this is not necessary, since the error trace had all the necessary information.

  michi

modSoruaUserServer.js

night

unread,
Jul 12, 2005, 9:23:22 AM7/12/05
to so...@googlegroups.com
> attached you will find a new version of MemberMgr/modSoruaUserServer.js
> which is hopefully less dependent on the existence/logic of other
> functions. hopefully it will work out now.

yes! i just tested it and it works fine! thanks!

> yes, shtg like that. a yellow message would then appear at the end of
> the response itself. but this is not necessary, since the error trace
> had all the necessary information.

ah.. that would have been kinda not helpful then, since the response
was not really shown to the user.. the client got just redirected to
another page.

Reply all
Reply to author
Forward
0 new messages