Rev 11061 | Rev 13211 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 11061 | Rev 11062 | ||
---|---|---|---|
Line 66... | Line 66... | ||
66 | 66 | ||
67 | userlist_lastcnt=!itemcnt $(userlist_$start) |
67 | userlist_lastcnt=!itemcnt $(userlist_$start) |
68 | 68 | ||
69 | !while $userlist_lastcnt>$[$pack_size-1] |
69 | !while $userlist_lastcnt>$[$pack_size-1] |
70 | !advance start |
70 | !advance start |
71 | - | ||
72 | userlist_$start=!sh cd $mul_userdir2; ls 2>/dev/null | tail -n +$[$start*$pack_size+1] | head -$pack_size |
71 | userlist_$start=!sh cd $mul_userdir2; ls 2>/dev/null | tail -n +$[$start*$pack_size+1] | head -$pack_size |
73 | userlist_$start=!words2items $(userlist_$start) |
72 | userlist_$start=!words2items $(userlist_$start) |
74 | userlist_lastcnt=!itemcnt $(userlist_$start) |
73 | userlist_lastcnt=!itemcnt $(userlist_$start) |
75 | !endwhile |
74 | !endwhile |
76 | 75 | ||
77 | ## On supprime une eventuelle liste temporaire "userlist*.raw" dans chaque classe |
76 | ## On supprime une eventuelle liste temporaire "userlist*.raw" dans chaque classe |
78 | ## just junk |
77 | ## just junk |
79 | !for c in $clist |
78 | !for c in $clist |
80 | !sh rm -f $wims_home/log/classes/$c/.userlist.raw 2>/dev/null\ |
79 | !sh rm -f $wims_home/log/classes/$c/.userlist.raw 2>/dev/null\ |
81 | rm -f $wims_home/log/classes/$c/.userlist_external.raw 2>/dev/null |
80 | rm -f $wims_home/log/classes/$c/.userlist_external.raw 2>/dev/null |
82 | !next |
81 | !next |
83 | 82 | ||
84 | ## On parcourt nos paquets de $pack_size users |
83 | ## On parcourt nos paquets de $pack_size users |
85 | !for N=0 to $start |
84 | !for N=0 to $start |
86 | !for u in $(userlist_$N) |
85 | !for u in $(userlist_$N) |
87 | !reset user_firstname, user_lastname, user_supervisable,\ |
86 | !reset user_firstname, user_lastname, user_supervisable,\ |
Line 98... | Line 97... | ||
98 | !endif |
97 | !endif |
99 | !if $typename=course |
98 | !if $typename=course |
100 | !readdef wimshome/log/classes/$uclass/.users/$u |
99 | !readdef wimshome/log/classes/$uclass/.users/$u |
101 | !if $user_class!=$empty |
100 | !if $user_class!=$empty |
102 | !appendfile wimshome/log/classes/$uclass/.userlist.raw $userline,$user_class |
101 | !appendfile wimshome/log/classes/$uclass/.userlist.raw $userline,$user_class |
103 | !if $userline_external!=$empty |
102 | !if $userline_external!=$empty |
104 | !appendfile wimshome/log/classes/$uclass/.userlist_external.raw $userline_external |
103 | !appendfile wimshome/log/classes/$uclass/.userlist_external.raw $userline_external |
105 | !endif |
104 | !endif |
106 | !endif |
105 | !endif |
107 | !else |
106 | !else |
108 | !if $supclass=$uclass or $uclass isitemof $user_participate |
107 | !if $supclass=$uclass or $uclass isitemof $user_participate |
109 | !appendfile wimshome/log/classes/$uclass/.userlist.raw $userline |
108 | !appendfile wimshome/log/classes/$uclass/.userlist.raw $userline |
110 | !if $userline_external!=$empty |
109 | !if $userline_external!=$empty |
111 | !appendfile wimshome/log/classes/$uclass/.userlist_external.raw $userline_external |
110 | !appendfile wimshome/log/classes/$uclass/.userlist_external.raw $userline_external |
112 | !endif |
111 | !endif |
113 | !endif |
112 | !endif |
114 | ### do it for the $supclass ? could be done many times if not in a group ? |
113 | ### do it for the $supclass ? could be done many times if not in a group ? |
115 | !if $supclass!=$uclass |
114 | !if $supclass!=$uclass |
116 | !appendfile wimshome/log/classes/$supclass/.userlist.raw $userline |
115 | !appendfile wimshome/log/classes/$supclass/.userlist.raw $userline |
117 | !if $userline_external!=$empty |
116 | !if $userline_external!=$empty |
118 | !appendfile wimshome/log/classes/$supclass/.userlist_external.raw $userline_external |
117 | !appendfile wimshome/log/classes/$supclass/.userlist_external.raw $userline_external |
Line 140... | Line 139... | ||
140 | rm -f $basedir/$c/.userlist_external.raw 2>/dev/null |
139 | rm -f $basedir/$c/.userlist_external.raw 2>/dev/null |
141 | !next |
140 | !next |
142 | ## Now the files .userlist and .userlist_external are created in the classes of $clist, |
141 | ## Now the files .userlist and .userlist_external are created in the classes of $clist, |
143 | ## so in the sup classes of $uclass. Do we need to do that (it is done many times for |
142 | ## so in the sup classes of $uclass. Do we need to do that (it is done many times for |
144 | ## the portal ... |
143 | ## the portal ... |
145 | 144 | ||
146 | ## do now the .usernextlist and .userprevlist only in the class $uclass |
145 | ## do now the .usernextlist and .userprevlist only in the class $uclass |
147 | ## in fact, there is only one class in $uclass. Leave the loop for the moment |
146 | ## in fact, there is only one class in $uclass. Leave the loop for the moment |
148 | !for c in $uclass |
147 | !for c in $uclass |
149 | rm -f $basedir/$c/.usernextlist.raw 2>/dev/null\ |
148 | !sh rm -f $basedir/$c/.usernextlist.raw 2>/dev/null\ |
150 | rm -f $basedir/$c/.userprevlist.raw 2>/dev/null |
149 | rm -f $basedir/$c/.userprevlist.raw 2>/dev/null |
151 | !set nbuser_=!recordcnt $basedir2/$c/.userlist |
150 | !set nbuser_=!recordcnt $basedir2/$c/.userlist |
152 | !if $nbuser_=0 |
151 | !if $nbuser_=0 |
153 | !break |
152 | !break |
154 | !endif |
153 | !endif |
- | 154 | ||
- | 155 | record_start = 1 |
|
- | 156 | remaining = $nbuser_ - 1 |
|
- | 157 | ## On parcourt nos users par paquets de $pack_size |
|
- | 158 | !while $remaining > 0 |
|
- | 159 | nb_processing = $[min($remaining, $pack_size)] |
|
- | 160 | record_end = $[$record_start+$nb_processing] |
|
155 |
|
161 | list_n=!record $record_start to $record_end of $basedir2/$c/.userlist |
156 |
|
162 | list_n=!column 3 of $list_n |
157 |
|
163 | nextuser=!makelist $$(list_n[x]), $$(list_n[x+1]); for x=1 to $nb_processing |
158 |
|
164 | nextuser=!nospace $nextuser |
159 |
|
165 | nextuser=!replace internal ;, by ; in $nextuser |
- | 166 | ||
160 |
|
167 | prevuser=!nospace $(nextuser[;2,1]) |
- | 168 | ||
161 |
|
169 | prevuser=!rows2lines $prevuser |
162 |
|
170 | prevuser=!replace internal , by : in $prevuser |
163 |
|
171 | nextuser=!rows2lines $nextuser |
164 |
|
172 | nextuser=!replace internal , by : in $nextuser |
- | 173 | ||
165 |
|
174 | !appendfile $basedir2/$c/.usernextlist.raw $nextuser |
166 |
|
175 | !appendfile $basedir2/$c/.userprevlist.raw $prevuser |
- | 176 | record_start = $record_start + $nb_processing |
|
- | 177 | remaining = $remaining - $nb_processing |
|
- | 178 | !endwhile |
|
- | 179 | first_user = !record 1 of $basedir2/$c/.userlist |
|
- | 180 | first_user = !item 3 of $first_user |
|
- | 181 | last_user = !record -1 of $basedir2/$c/.userlist |
|
- | 182 | last_user = !item 3 of $last_user |
|
- | 183 | !appendfile $basedir2/$c/.usernextlist.raw $last_user:$first_user |
|
- | 184 | !appendfile $basedir2/$c/.userprevlist.raw $first_user:$last_user |
|
167 | !sh mv $basedir/$c/.usernextlist.raw $basedir/$c/.usernextlist\ |
185 | !sh mv $basedir/$c/.usernextlist.raw $basedir/$c/.usernextlist\ |
168 | mv $basedir/$c/.userprevlist.raw $basedir/$c/.userprevlist |
186 | mv $basedir/$c/.userprevlist.raw $basedir/$c/.userprevlist |
169 | !next c |
187 | !next c |
170 | - | ||
171 | !exit |
- | |
172 | !read adm/class/stat |
- |