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