Rev 14335 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2732 | guerimand | 1 | !if $job=lightpopup |
2 | !changeto jobs/lightpopup.proc |
||
3 | !endif |
||
3261 | obado | 4 | |
23 | reyssat | 5 | wims_prefix=class user tmp n sharing sharable ident |
11853 | obado | 6 | !if $job=help or $job=$empty |
23 | reyssat | 7 | wims_module_log=help |
8 | !exit |
||
9 | !endif |
||
3261 | obado | 10 | |
391 | obado | 11 | !read defs |
23 | reyssat | 12 | |
13 | job=!lower $job |
||
3261 | obado | 14 | !bound job within $allowed_actions_jobs,$allowed_file_jobs,$allowed_jobs_without_auth default $ |
23 | reyssat | 15 | option=!items2words $option |
16 | option=!words2items $option |
||
17 | code=!word 1 of $code |
||
18 | |||
3261 | obado | 19 | !if $job notin $allowed_jobs_without_auth or $ident != $empty |
14335 | bpr | 20 | # le script autchars permet de definir les listes de caracteres alphanumeriques et de ponctuation |
21 | # il definit egalement la fourchette de longueur autorise des login/mdp |
||
22 | !read adm/class/authchars |
||
23 | # Le script var.check verifie l'authentification de l'utilisateur |
||
24 | !read var.check |
||
3261 | obado | 25 | !endif |
26 | |||
7549 | obado | 27 | !if $job isin $allowed_jobs_without_auth |
28 | !default ident_type=json |
||
29 | !endif |
||
30 | |||
23 | reyssat | 31 | !if $error=$empty |
32 | !read jobs/$job.proc |
||
33 | !endif |
||
34 | |||
3996 | obado | 35 | notplaintext = xmlformat json |
36 | |||
391 | obado | 37 | #Lorsque l'on sort de la procedure "job", il ne doit tjs pas y avoir d'erreur. |
23 | reyssat | 38 | !if $error!=$empty |
39 | !changeto error.proc $error |
||
40 | !endif |
||
41 | |||
42 | !if $code=$empty |
||
3666 | obado | 43 | !if $ident_type notwordof $notplaintext |
14335 | bpr | 44 | ok=OK |
3261 | obado | 45 | !else |
14335 | bpr | 46 | !if $ident_type=xmlformat |
47 | ok=<params><param><value><string>OK</string></value></param> |
||
48 | !endif |
||
49 | !if $ident_type=json |
||
50 | ok={"status" : "OK" |
||
51 | !endif |
||
3261 | obado | 52 | !endif |
23 | reyssat | 53 | !else |
3666 | obado | 54 | !if $ident_type notwordof $notplaintext |
14335 | bpr | 55 | ok=OK $code |
3261 | obado | 56 | !else |
14335 | bpr | 57 | !if $ident_type=xmlformat |
58 | ok=<params><param><value><struct>\ |
||
59 | <member>\ |
||
60 | <name>code</name>\ |
||
61 | <value><string>$code</string></value>\ |
||
62 | </member>\ |
||
3261 | obado | 63 | |
14335 | bpr | 64 | !endif |
65 | !if $ident_type=json |
||
66 | ok={"status" : "OK","code":"$code" |
||
3666 | obado | 67 | !endif |
3261 | obado | 68 | !endif |
23 | reyssat | 69 | !endif |
70 | |||
3996 | obado | 71 | !if $job isitemof $allowed_file_jobs |
14335 | bpr | 72 | !if $job isitemof getclasstgz,getibookwidget |
73 | !shortout $header_zip\ |
||
13460 | obado | 74 | Content-Disposition: attachment; filename=$given_fname;\ |
75 | \ |
||
3666 | obado | 76 | |
13460 | obado | 77 | |
14335 | bpr | 78 | !else |
79 | !shortout $header\ |
||
3666 | obado | 80 | |
3996 | obado | 81 | !endif |
82 | |||
14335 | bpr | 83 | !sh cat $wims_home/$fname |
5601 | obado | 84 | |
14335 | bpr | 85 | !exit |
3996 | obado | 86 | !endif |
87 | |||
3666 | obado | 88 | !if $ident_type notwordof $notplaintext |
3261 | obado | 89 | !shortout $header\ |
23 | reyssat | 90 | |
3261 | obado | 91 | !else |
14335 | bpr | 92 | !if $ident_type iswordof xmlformat |
93 | !shortout $header_xml\ |
||
3666 | obado | 94 | <?xml version="1.0" encoding="$encoding"?>\ |
95 | <!DOCTYPE methodResponse PUBLIC "XML9-RPC" "http://ticewims.unice.fr/xml-rpc/xml-rpc.dtd">\ |
||
96 | <methodResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ticewims.unice.fr/xml-rpc/xml-rpc.xsd">\ |
||
391 | obado | 97 | |
14335 | bpr | 98 | !endif |
99 | !if $ident_type=json |
||
100 | !shortout $header_json\ |
||
9909 | obado | 101 | |
14335 | bpr | 102 | !endif |
3666 | obado | 103 | |
3261 | obado | 104 | !endif |
105 | |||
391 | obado | 106 | !if $job isitemof $allowed_actions_jobs |
14335 | bpr | 107 | !shortout $ok\ |
391 | obado | 108 | |
14335 | bpr | 109 | !read types/$ident_type |
23 | reyssat | 110 | !endif |
111 | |||
11095 | obado | 112 | !if $job notwordof authuser getsession |
14335 | bpr | 113 | wims_mode=popup |
23 | reyssat | 114 | !endif |
115 | |||
11095 | obado | 116 | wims_module_log=$job $ident -> $qclass $quser |