Subversion Repositories wimsdev

Rev

Rev 3261 | Rev 3996 | 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
 
391 obado 32
#Lorsque l'on sort de la procedure "job", il ne doit tjs pas y avoir d'erreur.
23 reyssat 33
!if $error!=$empty
34
 !changeto error.proc $error
35
!endif
36
 
3666 obado 37
 
38
notplaintext = xmlformat json
39
 
23 reyssat 40
!if $code=$empty
3666 obado 41
  !if $ident_type notwordof $notplaintext
3261 obado 42
	ok=OK
43
  !else
3666 obado 44
  	!if $ident_type=xmlformat
45
  	  	ok=<params><param><value><string>OK</string></value></param>
46
  	!endif
47
  	!if $ident_type=json
48
  	  	ok=[{"status" : "OK"
49
  	!endif
3261 obado 50
  !endif
23 reyssat 51
!else
3666 obado 52
  !if $ident_type notwordof $notplaintext
3261 obado 53
	ok=OK $code$ident_type
54
  !else
3666 obado 55
  	!if $ident_type=xmlformat
56
  	 ok=<params><param><value><struct>\
57
  	 <member>\
58
	 	<name>code</name>\
59
	 	<value><string>$code</string></value>\
60
	 </member>\
3261 obado 61
 
3666 obado 62
	!endif
63
	!if $ident_type=json
64
  	  	ok=[{"status" : "OK","code":"$code",
65
  	!endif
3261 obado 66
  !endif
23 reyssat 67
!endif
68
 
3666 obado 69
 
70
 
71
!if $ident_type notwordof $notplaintext
3261 obado 72
	!shortout $header\
23 reyssat 73
 
3261 obado 74
!else
3666 obado 75
 !if $ident_type iswordof xmlformat
3261 obado 76
	!shortout $header_xml\
3666 obado 77
<?xml version="1.0" encoding="$encoding"?>\
78
<!DOCTYPE methodResponse PUBLIC "XML9-RPC" "http://ticewims.unice.fr/xml-rpc/xml-rpc.dtd">\
79
<methodResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ticewims.unice.fr/xml-rpc/xml-rpc.xsd">\
391 obado 80
 
3666 obado 81
 !endif
82
 !if $ident_type=json
83
 	!shortout $header_json\
84
 
85
 !endif
86
 
3261 obado 87
!endif
88
 
89
 
90
 
391 obado 91
!if $job isitemof $allowed_actions_jobs
92
 !shortout $ok\
93
 
23 reyssat 94
 !read types/$ident_type
95
!endif
96
 
391 obado 97
!if $job isitemof $allowed_file_jobs
23 reyssat 98
 !sh cat $wims_home/$fname
99
!endif
100
 
101
!if $job notwordof authuser
102
 wims_mode=popup
103
!endif
104
 
3261 obado 105
wims_module_log=$job $ident -> $qclass $quser