Subversion Repositories wimsdev

Rev

Rev 4365 | Rev 5601 | 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
 
39
!if $code=$empty
3666 obado 40
  !if $ident_type notwordof $notplaintext
3261 obado 41
	ok=OK
42
  !else
3666 obado 43
  	!if $ident_type=xmlformat
44
  	  	ok=<params><param><value><string>OK</string></value></param>
45
  	!endif
46
  	!if $ident_type=json
4118 obado 47
  	  	ok={"status" : "OK"
3666 obado 48
  	!endif
3261 obado 49
  !endif
23 reyssat 50
!else
3666 obado 51
  !if $ident_type notwordof $notplaintext
4365 obado 52
	ok=OK $code
3261 obado 53
  !else
3666 obado 54
  	!if $ident_type=xmlformat
55
  	 ok=<params><param><value><struct>\
56
  	 <member>\
57
	 	<name>code</name>\
58
	 	<value><string>$code</string></value>\
59
	 </member>\
3261 obado 60
 
3666 obado 61
	!endif
62
	!if $ident_type=json
4118 obado 63
  	  	ok={"status" : "OK","code":"$code"
3666 obado 64
  	!endif
3261 obado 65
  !endif
23 reyssat 66
!endif
67
 
3996 obado 68
!if $job isitemof $allowed_file_jobs
69
 !if job=getclasstgz
70
 	!shortout Content-type: application/gzip\
71
Content-disposition: attachment; filename="getclass.tgz"\
3666 obado 72
 
3996 obado 73
 !else
74
 	!shortout $header\
3666 obado 75
 
3996 obado 76
 !endif
77
 
78
 !sh cat $wims_home/$fname
79
 
80
 !exit
81
!endif
82
 
83
 
3666 obado 84
!if $ident_type notwordof $notplaintext
3261 obado 85
	!shortout $header\
23 reyssat 86
 
3261 obado 87
!else
3666 obado 88
 !if $ident_type iswordof xmlformat
3261 obado 89
	!shortout $header_xml\
3666 obado 90
<?xml version="1.0" encoding="$encoding"?>\
91
<!DOCTYPE methodResponse PUBLIC "XML9-RPC" "http://ticewims.unice.fr/xml-rpc/xml-rpc.dtd">\
92
<methodResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ticewims.unice.fr/xml-rpc/xml-rpc.xsd">\
391 obado 93
 
3666 obado 94
 !endif
95
 !if $ident_type=json
96
 	!shortout $header_json\
97
 
98
 !endif
99
 
3261 obado 100
!endif
101
 
102
 
103
 
391 obado 104
!if $job isitemof $allowed_actions_jobs
105
 !shortout $ok\
106
 
23 reyssat 107
 !read types/$ident_type
108
!endif
109
 
110
 
111
!if $job notwordof authuser
112
 wims_mode=popup
113
!endif
114
 
3261 obado 115
wims_module_log=$job $ident -> $qclass $quser