Rev 10714 | Rev 12414 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 10714 | Rev 12413 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | copy=!words2items $selw $dep |
34 | copy=!words2items $selw $dep |
35 | copy=!listuniq $copy |
35 | copy=!listuniq $copy |
36 | 36 | ||
37 | !! ----------------------------- restore of user when replace or merge |
37 | !! ----------------------------- restore of user when replace or merge |
38 | !if user isitemof $copy |
38 | !if user isitemof $copy |
39 | n=!recordcnt wimshome/$wims_sesdir/upload/class/.userlist |
39 | n=!recordcnt wimshome/$wims_sesdir/upload/class/.userlist |
40 | !read adm/class/userremain.proc |
40 | !read adm/class/userremain.proc |
41 | m=!recordcnt wimshome/log/classes/$wims_class/.userlist |
41 | m=!recordcnt wimshome/log/classes/$wims_class/.userlist |
42 | !if $restore=merge |
42 | !if $restore=merge |
43 | !if $n>$dispo |
43 | !if $n>$dispo |
44 | user_bad=refused |
44 | user_bad=refused |
45 | copy=!listcomplement user,score in $copy |
45 | copy=!listcomplement user,score in $copy |
46 | !endif |
46 | !endif |
47 | !else |
- | |
48 | !if ($n>$dispo and $class_superclass!=$empty) or ($class_superclass=$empty and $n>$dispo+$m) |
- | |
49 | user_bad=refused |
- | |
50 | copy=!listcomplement user,score in $copy |
- | |
51 | !else |
47 | !else |
52 | !if $m>0 |
- | |
53 | erase=user |
- | |
54 | !endif |
- | |
55 | !endif |
- | |
56 | !endif |
- | |
57 | !if |
48 | !if ($n>$dispo and $class_superclass!=$empty) or ($class_superclass=$empty and $n>$dispo+$m) |
58 | !if $class_typename=class |
- | |
59 |
|
49 | user_bad=refused |
60 | !for k=1 to $m |
- | |
61 | u=!record $k of wimshome/log/classes/$wims_class/.userlist |
- | |
62 | t=!defof user_participate in wimshome/log/classes/$wims_superclass/.users/$(u[3]) |
- | |
63 |
|
50 | copy=!listcomplement user,score in $copy |
64 | !setdef !set user_participate=$t in wimshome/log/classes/$wims_superclass/.users/$(u[3]) |
- | |
65 | !next k |
- | |
66 | !endif |
- | |
67 | !reset user_ok,user_loginused |
- | |
68 | !for k=1 to $n |
- | |
69 | u=!record $k of wimshome/$wims_sesdir/upload/class/.userlist |
- | |
70 | test=!defof user_exists in wimshome/log/classes/$wims_superclass/.users/$(u[3]) |
- | |
71 | !if $test!=$empty |
- | |
72 | user_loginused=!append item $(u[3]) to $(user_loginused) |
- | |
73 | !sh rm -f $wims_home/$wims_sesdir/upload/class/.users/$(u[3]) $wims_home/$wims_sesdir/upload/class/score/$(u[3]) $wims_home/$wims_sesdir/upload/class/noscore/$(u[3]); |
- | |
74 | !else |
51 | !else |
- | 52 | !if $m>0 |
|
- | 53 | erase=user |
|
- | 54 | !endif |
|
- | 55 | !endif |
|
- | 56 | !endif |
|
- | 57 | !if ($wims_supertype=4 or $wims_supertype=2) |
|
- | 58 | !if $class_typename=class |
|
- | 59 | !if user isin $erase |
|
- | 60 | !for k=1 to $m |
|
- | 61 | u=!record $k of wimshome/log/classes/$wims_class/.userlist |
|
- | 62 | t=!defof user_participate in wimshome/log/classes/$wims_superclass/.users/$(u[3]) |
|
- | 63 | t=!listcomplement $wims_class in $t |
|
- | 64 | !setdef !set user_participate=$t in wimshome/log/classes/$wims_superclass/.users/$(u[3]) |
|
- | 65 | !next k |
|
- | 66 | !endif |
|
- | 67 | !reset user_ok,user_loginused |
|
- | 68 | !for k=1 to $n |
|
- | 69 | u=!record $k of wimshome/$wims_sesdir/upload/class/.userlist |
|
- | 70 | test=!defof user_exists in wimshome/log/classes/$wims_superclass/.users/$(u[3]) |
|
- | 71 | !if $test!=$empty |
|
- | 72 | user_loginused=!append item $(u[3]) to $(user_loginused) |
|
- | 73 | !sh rm -f $wims_home/$wims_sesdir/upload/class/.users/$(u[3]) $wims_home/$wims_sesdir/upload/class/score/$(u[3]) $wims_home/$wims_sesdir/upload/class/noscore/$(u[3]); |
|
- | 74 | !else |
|
75 | user_ok=!append item $(u[3]) to $user_ok |
75 | user_ok=!append item $(u[3]) to $user_ok |
76 | !endif |
76 | !endif |
77 | !next k |
77 | !next k |
78 | !sh cd $wims_home/$wims_sesdir/upload/class/;\ |
78 | !sh cd $wims_home/$wims_sesdir/upload/class/;\ |
79 | cp -pR .users $wims_home/log/classes/$wims_superclass/; |
79 | cp -pR .users $wims_home/log/classes/$wims_superclass/; |
80 | !for u in $user_ok |
80 | !for u in $user_ok |
81 | !setdef !set user_participate=$wims_class in wimshome/log/classes/$wims_superclass/.users/$u |
81 | !setdef !set user_participate=$wims_class in wimshome/log/classes/$wims_superclass/.users/$u |
82 | !next k |
82 | !next k |
83 | !endif |
83 | !endif |
84 | copy=!listcomplement user in $copy |
84 | copy=!listcomplement user in $copy |
85 | !readproc adm/class/mkuserlist |
85 | !readproc adm/class/mkuserlist |
86 | !endif |
86 | !endif |
87 | !endif |
87 | !endif |
88 | 88 | ||
89 | !if $restore=replace |
89 | !if $restore=replace |
90 | erase=$copy |
90 | erase=$copy |
91 | !else |
91 | !else |
92 | erase=!listcomplement user,exo in $copy |
92 | erase=!listcomplement user,exo in $copy |
93 | !endif |
93 | !endif |
94 | copyw=!items2words $copy |
94 | copyw=!items2words $copy |
95 | erasew=!items2words $erase |
95 | erasew=!items2words $erase |
96 | dictionary=$module_dir/arch/recdir |
96 | dictionary=$module_dir/arch/recdir |
97 | copylist=!exec translator $copyw |
97 | copylist=!exec translator $copyw |
Line 99... | Line 99... | ||
99 | c=!replace , by , $ in $copy |
99 | c=!replace , by , $ in $copy |
100 | dictionary=$module_dir/lang/recnames.$moduclass_lang |
100 | dictionary=$module_dir/lang/recnames.$moduclass_lang |
101 | restored=!exec translator $c |
101 | restored=!exec translator $c |
102 | 102 | ||
103 | !distribute words y y y y y y y y y y y y y y y y y y y y y y y into $copy |
103 | !distribute words y y y y y y y y y y y y y y y y y y y y y y y into $copy |
104 | 104 | ||
105 | !if def isitemof $copy |
105 | !if def isitemof $copy |
106 | creat=!defof class_creation in wimshome/log/classes/$wims_class/.def |
106 | creat=!defof class_creation in wimshome/log/classes/$wims_class/.def |
107 | !endif |
107 | !endif |
108 | 108 | ||
109 | !mexec arch/restore.sh |
109 | !mexec arch/restore.sh |
110 | wims_class_log=Restore $copy from $wims_deposit by $wims_realuser |
110 | wims_class_log=Restore $copy from $wims_deposit by $wims_realuser |
111 | selection= |
111 | selection= |
112 | 112 | ||
113 | !if user isitemof $copy |
113 | !if user isitemof $copy |
114 | !read adm/class/mkuserlist |
114 | !read adm/class/mkuserlist |
115 | !endif |
115 | !endif |
116 | 116 | ||
117 | !if def isitemof $copy |
117 | !if def isitemof $copy |
118 | !setdef !set class_creation=$creat in wimshome/log/classes/$wims_class/.def |
118 | !setdef !set class_creation=$creat in wimshome/log/classes/$wims_class/.def |
119 | exp=!defof class_expiration in wimshome/log/classes/$wims_class/.def |
119 | exp=!defof class_expiration in wimshome/log/classes/$wims_class/.def |
120 | today=!char 1 to 8 of $wims_now |
120 | today=!char 1 to 8 of $wims_now |
121 | later=!date -d '2 months' '+%Y%m%d' |
121 | later=!date -d '2 months' '+%Y%m%d' |
122 | !if NaN isin $[$exp] |
122 | !if NaN isin $[$exp] |
123 | exp_bad=bad |
123 | exp_bad=bad |
124 | exp=$later |
124 | exp=$later |
125 | !endif |
125 | !endif |
126 | !if $exp<$later |
126 | !if $exp<$later |
127 | exp=$later |
127 | exp=$later |
128 | exp_bad=early |
128 | exp_bad=early |
129 | !endif |
129 | !endif |
130 | !if $exp>$today+10000 |
130 | !if $exp>$today+10000 |
131 | exp=$[$today+10000] |
131 | exp=$[$today+10000] |
132 | exp_bad=late |
132 | exp_bad=late |
133 | !endif |
133 | !endif |
134 | !if $exp_bad!=$empty |
134 | !if $exp_bad!=$empty |
135 | !setdef !set class_expiration=$exp in wimshome/log/classes/$wims_class/.def |
135 | !setdef !set class_expiration=$exp in wimshome/log/classes/$wims_class/.def |
136 | !endif |
136 | !endif |
137 | !mexec scripts/classlist.sh |
137 | !mexec scripts/classlist.sh |
138 | !endif |
138 | !endif |
139 | 139 | ||
140 | !read adm/class/stat |
140 | !read adm/class/stat |