dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16582
[Branch ~dhis2-documenters/dhis2/dhis2-docbook-docs] Rev 480: Quickly fixed
------------------------------------------------------------
revno: 480
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2-docbook-docs
timestamp: Wed 2012-03-21 16:04:43 +0100
message:
Quickly fixed
modified:
src/docbkx/en/dhis2_user_man_web_api.xml
--
lp:~dhis2-documenters/dhis2/dhis2-docbook-docs
https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs
Your team DHIS 2 developers is subscribed to branch lp:~dhis2-documenters/dhis2/dhis2-docbook-docs.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs/+edit-subscription
=== modified file 'src/docbkx/en/dhis2_user_man_web_api.xml'
--- src/docbkx/en/dhis2_user_man_web_api.xml 2012-03-21 13:59:25 +0000
+++ src/docbkx/en/dhis2_user_man_web_api.xml 2012-03-21 15:04:43 +0000
@@ -94,10 +94,9 @@
<para>There are many ways to authenticate over the Web and each method has its advantages and disadvantages. For this example we will use an approach where we emulate a login from the web-based login form. To help us we will use the <emphasis role="italic">jQuery</emphasis> javascript library. This javascript code should be embedded in the <emphasis role="italic">head</emphasis> section of the Web page:</para>
<screen>jQuery(document).ready(function() {
var base = "http://apps.dhis2.org/demo/";
- $.post( base + "dhis-web-commons-security/login.action",{
+ $.post( base + "dhis-web-commons-security/login.action", {
j_username: "admin", j_password: "district"
- },
- setLinks
+ }
);
});</screen>
<para>In this code block we ask jQuery to send a POST request to the standard authentication point with two name-value pairs containing the username and password information. We assume that the user has the necessary authorities to view reports in the DHIS 2 Web API. If authentication was successful the server will send a HTTP cookie in the response with a session identifier. This will make sure that the current user is authorized to view reports for up to 60 minutes.</para>