Subversion Repositories wimsdev

Rev

Rev 12076 | Rev 12934 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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