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