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