Subversion Repositories wimsdev

Rev

Rev 4118 | Rev 4640 | 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
6
!if $job=help
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
25
	!read var.check	
26
!endif
27
 
23 reyssat 28
!if $error=$empty
29
 !read jobs/$job.proc
30
!endif
31
 
3996 obado 32
notplaintext = xmlformat json
33
 
391 obado 34
#Lorsque l'on sort de la procedure "job", il ne doit tjs pas y avoir d'erreur.
23 reyssat 35
!if $error!=$empty
36
 !changeto error.proc $error
37
!endif
38
 
3666 obado 39
 
40
 
3996 obado 41
 
23 reyssat 42
!if $code=$empty
3666 obado 43
  !if $ident_type notwordof $notplaintext
3261 obado 44
	ok=OK
45
  !else
3666 obado 46
  	!if $ident_type=xmlformat
47
  	  	ok=<params><param><value><string>OK</string></value></param>
48
  	!endif
49
  	!if $ident_type=json
4118 obado 50
  	  	ok={"status" : "OK"
3666 obado 51
  	!endif
3261 obado 52
  !endif
23 reyssat 53
!else
3666 obado 54
  !if $ident_type notwordof $notplaintext
4365 obado 55
	ok=OK $code
3261 obado 56
  !else
3666 obado 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
 
3666 obado 64
	!endif
65
	!if $ident_type=json
4118 obado 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
72
 !if job=getclasstgz
73
 	!shortout Content-type: application/gzip\
74
Content-disposition: attachment; filename="getclass.tgz"\
3666 obado 75
 
3996 obado 76
 !else
77
 	!shortout $header\
3666 obado 78
 
3996 obado 79
 !endif
80
 
81
 !sh cat $wims_home/$fname
82
 
83
 !exit
84
!endif
85
 
86
 
3666 obado 87
!if $ident_type notwordof $notplaintext
3261 obado 88
	!shortout $header\
23 reyssat 89
 
3261 obado 90
!else
3666 obado 91
 !if $ident_type iswordof xmlformat
3261 obado 92
	!shortout $header_xml\
3666 obado 93
<?xml version="1.0" encoding="$encoding"?>\
94
<!DOCTYPE methodResponse PUBLIC "XML9-RPC" "http://ticewims.unice.fr/xml-rpc/xml-rpc.dtd">\
95
<methodResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ticewims.unice.fr/xml-rpc/xml-rpc.xsd">\
391 obado 96
 
3666 obado 97
 !endif
98
 !if $ident_type=json
99
 	!shortout $header_json\
100
 
101
 !endif
102
 
3261 obado 103
!endif
104
 
105
 
106
 
391 obado 107
!if $job isitemof $allowed_actions_jobs
108
 !shortout $ok\
109
 
23 reyssat 110
 !read types/$ident_type
111
!endif
112
 
113
 
114
!if $job notwordof authuser
115
 wims_mode=popup
116
!endif
117
 
3261 obado 118
wims_module_log=$job $ident -> $qclass $quser