Subversion Repositories wimsdev

Rev

Rev 13460 | Rev 15818 | 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
14335 bpr 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
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
14335 bpr 45
  ok=OK
3261 obado 46
  !else
14335 bpr 47
    !if $ident_type=xmlformat
48
      ok=<params><param><value><string>OK</string></value></param>
49
    !endif
50
    !if $ident_type=json
51
      ok={"status" : "OK"
52
    !endif
3261 obado 53
  !endif
23 reyssat 54
!else
3666 obado 55
  !if $ident_type notwordof $notplaintext
14335 bpr 56
  ok=OK $code
3261 obado 57
  !else
14335 bpr 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
 
14335 bpr 65
    !endif
66
    !if $ident_type=json
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
14335 bpr 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
 
14335 bpr 79
  !else
80
    !shortout $header\
3666 obado 81
 
3996 obado 82
 !endif
83
 
14335 bpr 84
  !sh cat $wims_home/$fname
5601 obado 85
 
14335 bpr 86
  !exit
3996 obado 87
!endif
88
 
3666 obado 89
!if $ident_type notwordof $notplaintext
3261 obado 90
	!shortout $header\
23 reyssat 91
 
3261 obado 92
!else
14335 bpr 93
  !if $ident_type iswordof xmlformat
94
	  !shortout $header_xml\
3666 obado 95
<?xml version="1.0" encoding="$encoding"?>\
96
<!DOCTYPE methodResponse PUBLIC "XML9-RPC" "http://ticewims.unice.fr/xml-rpc/xml-rpc.dtd">\
97
<methodResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ticewims.unice.fr/xml-rpc/xml-rpc.xsd">\
391 obado 98
 
14335 bpr 99
  !endif
100
  !if $ident_type=json
101
 	  !shortout $header_json\
9909 obado 102
 
14335 bpr 103
  !endif
3666 obado 104
 
3261 obado 105
!endif
106
 
391 obado 107
!if $job isitemof $allowed_actions_jobs
14335 bpr 108
  !shortout $ok\
391 obado 109
 
14335 bpr 110
  !read types/$ident_type
23 reyssat 111
!endif
112
 
11095 obado 113
!if $job notwordof authuser getsession
14335 bpr 114
   wims_mode=popup
23 reyssat 115
!endif
116
 
11095 obado 117
wims_module_log=$job $ident -> $qclass $quser