Subversion Repositories wimsdev

Rev

Rev 12070 | Rev 12076 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5374 bpr 1
!default wims_superclass=$wims_class
2
!read adm/class/userisinclass $wims_superclass,$getuser
3
!set class_Supervisor=!defof class_Supervisor in wimshome/log/classes/$wims_class/.def
862 guerimand 4
!if yes notin $script_reply
5
 error=bad_usercls
6
 !reset job,getuser
7
 !exit
8
!endif
23 reyssat 9
!read adm/class/userdef classes,$wims_class,$getuser
10
!defread $userdef
12072 guerimand 11
!read adm/class/initclass $wims_class
23 reyssat 12
 
13
!if $user_exists!=yes or $abandon!=$empty
5124 bpr 14
 !reset up_lastname,up_firstname,up_email,up_regnum,up_photourl,up_comments,up_vars,up_external_auth,up_supervise
23 reyssat 15
 !if $wims_user=supervisor
12072 guerimand 16
  !bound oldjob within userlist,teacher default userlist
17
  job=$oldjob
9527 guerimand 18
  !changeto $job.proc
23 reyssat 19
  !exit
20
 !else
21
  job=getuser
22
  lastname=$user_lastname
23
  firstname=$user_firstname
9985 guerimand 24
!! BUGTOFIX : this file don't exists (20160409)
23 reyssat 25
  !changeto var.proc.getuser
26
 !endif
27
!endif
28
 
29
!if $wims_user=supervisor and $getuser!=supervisor
30
 user_vars=!sh grep -E '^!set user__' $Userdef | sed 's/^!set user__//g'
31
!endif
32
 
12070 guerimand 33
!if $reg!=$empty or $job2=photoerase
34
 class_pass=!defof class_password in wimshome/log/classes/$wims_class/.def
35
 !if $wims_user!=supervisor and $passcheck!=$class_pass
36
  error=bad_classpass
37
  !exit
38
 !endif
39
!endif
40
 
12018 guerimand 41
!if photoerase=$job2
42
    up_photofile=no
43
    up_photourl= 
44
    !sh rm -f $wims_home/log/classes/$photodir/photoboard/$getuser
45
    !reset reg
46
    replacelist=photofile,photourl
47
!endif
48
 
12056 guerimand 49
!! make list of name of classes,program etc...
12057 guerimand 50
!readproc mksubclslist.proc
12056 guerimand 51
 
23 reyssat 52
!if $reg!=$empty
53
 up_password=
12065 guerimand 54
 replacelist=regnum,comments,photourl,email,external_auth,photofile
12002 guerimand 55
 !for r in $replacelist
5374 bpr 56
    !default up_$r=$(user_$r)
12002 guerimand 57
 !next r
12065 guerimand 58
 replacelist=$replacelist,supervise
59
 
12072 guerimand 60
!! ------------- manage modification of user_supervise for teacher account
12020 guerimand 61
 !if $wims_user=supervisor or ($wims_realuser!=supervisor and $wims_realuser!=$empty)
7795 bpr 62
   !if $superv=no
63
    !set up_supervise=!listcomplement $wims_class in $up_supervise
64
   !else
12056 guerimand 65
    !if $wims_user=supervisor and $wims_realuser!=supervisor
7795 bpr 66
!!not administrator of the portail
67
       !set up_supervise=!listuniq $wims_class, $(user_supervise)
12056 guerimand 68
    !else
7795 bpr 69
       !set up_supervise=!listuniq $(up_supervise)
12056 guerimand 70
    !endif
7795 bpr 71
   !endif
72
   !if $up_supervise=$empty
7329 bpr 73
     up_supervise=noclass
7795 bpr 74
   !endif
5374 bpr 75
 !endif
5480 bpr 76
 
12072 guerimand 77
!! ------------- manage modification of user_participate for teacher account
78
  !if ($wims_realuser=supervise or $wims_realuser=$class_Supervisor) and $type_class=1
79
   replacelist=$replacelist,participate
80
   !if $superp=no
81
    !set up_participate=!listcomplement $wims_class in $user_participate
82
   !else
83
    !set up_participate=!listuniq $wims_class,$user_participate
84
   !endif
85
   !if $up_participate=$empty
86
     up_participate=noclass
87
   !endif
88
 !endif
89
 
5777 bpr 90
 !set up_external_auth=!lowercase $up_external_auth
12018 guerimand 91
!!-------------------- photo file process management
12066 guerimand 92
 !if noname.file notin $wims_deposit and $wims_deposit!=$empty
12002 guerimand 93
    type=!sh file --mime-type $wims_home/$wims_sesdir/user-deposit | awk '{print $$2}'
94
    !if image/ notin $type
95
	error=badimgformat
96
    !else
97
	size=!sh mkdir -p $wims_home/log/classes/$photodir/photoboard\
98
convert $wims_home/$wims_sesdir/user-deposit -resize 132x170 $wims_home/$wims_sesdir/user-deposit\
99
ls -s $wims_home/$wims_sesdir/user-deposit | awk '{print $$1}'
100
	!if $size>100
101
	    error=filetoobig
102
	!else
103
	    !read adm/du $wims_home/log/classes/$wims_class
104
	    !if $[$wims_class_quota-$du-$size]<0
105
		error=quota_file
106
	    !else
107
		!sh rm -f $wims_home/log/classes/$photodir/photoboard/$getuser\
108
mv $wims_home/$wims_sesdir/user-deposit $wims_home/log/classes/$photodir/photoboard/$getuser
109
		up_photofile=yes
110
		up_photourl= 
111
	    !endif
112
	!endif
113
    !endif
12020 guerimand 114
 !else
115
    !if $up_photourl!=$user_photourl
116
	up_photofile=no
117
	!sh rm -f $wims_home/log/classes/$photodir/photoboard/$getuser
118
    !endif
12002 guerimand 119
 !endif
120
 !!----------------------   end photo file
12018 guerimand 121
!endif
122
 
123
!if $reg!=$empty or $job2=photoerase
23 reyssat 124
 !read adm/class/adduser $getuser
125
 !read adm/class/mkuserlist
4840 bpr 126
 !if $class_type isin 1234
23 reyssat 127
  !read adm/gateway/mkteacherlist
128
 !endif
10134 bpr 129
 !read adm/class/stat
937 bpr 130
 !reset user_lastname, user_firstname, user_email, user_regnum, user_photourl, user_comments,\
12002 guerimand 131
    user_supervisable, user_supervise, user_participate, user_external_auth, user_photofile,wims_deposit
23 reyssat 132
 !defread $userdef
133
 !if $wims_user=supervisor and $getuser!=supervisor
134
  user_vars=!sh grep -E '^!set user__' $Userdef | sed 's/^!set user__//g'
135
 !endif
136
!endif
137
 
8992 guerimand 138
!reset up_lastname,up_firstname,up_email,up_regnum,up_comments_$(wims_class),up_photourl,up_vars,up_external_auth,\
12018 guerimand 139
  up_supervise,up_photofile,job2,reg
23 reyssat 140