OX6:Adding a pre defined UWA widget for a User: Difference between revisions

From Open-Xchange
(New page: Here is an example bash script which can be used to add a new UWA widget for a user. This should only be used bevore the first login, else it will reset the GUI settings to the defaults. ...)
 
No edit summary
Line 1: Line 1:
Here is an example bash script which can be used to add a new UWA widget for a user. This should only be used bevore the first login, else it will reset the GUI settings to the defaults.
Here is an example bash script which can be used to add a new UWA widget for a user. This should only be used before the first login, else it will reset the GUI settings to the defaults.


  #!/bin/bash
  #!/bin/bash

Revision as of 12:28, 23 April 2008

Here is an example bash script which can be used to add a new UWA widget for a user. This should only be used before the first login, else it will reset the GUI settings to the defaults.

#!/bin/bash

SERVER=http://localhost
USER=user@context
PASSWORD=password

CURL='curl -b cookies -c cookies -H Expect: -s'

SESSION=`$CURL "$SERVER/ajax/login?action=login&name=$USER&password=$PASSWORD" \
        |sed 's/^.*session\":\"\([0-9A-Fa-f]*\)\".*$/\1/'`

EXTERNAL='{"portal": {"externalcontents": [{ "autorefresh":true,  "id":"Heise001", "title":"Heise", "visible":true, "adj":{"hw":0,"ww":0,"y":0,"x":0}, "url":"http://www.netvibes.com/api/uwa/examples/rssreader.html", "parameter": { "feedUrl":"http://www.heise.de/newsticker/heise-atom.xml" } }] } }'

$CURL -X PUT -H "Content-Type: text/javascript" -d "$EXTERNAL"  "$SERVER/ajax/config/gui?session=$SESSION"