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