Rev 16821 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
23 | reyssat | 1 | |
2 | badfield= |
||
3 | !read adm/class/authchars |
||
4 | !for n in institution,description,supervisor,email,level |
||
12413 | bpr | 5 | u_=!translate internal !$$<" to $ $ in $(up_$n) |
6 | !if $n!=supervisor |
||
7 | u_=!replace , by , in $u_ |
||
23 | reyssat | 8 | !endif |
12413 | bpr | 9 | u_=!singlespace $u_ |
10 | u_=!trim $u_ |
||
11 | !if $n iswordof email level homepage |
||
12 | u_=!word 1 of $u_ |
||
23 | reyssat | 13 | !endif |
12413 | bpr | 14 | !if $n=homepage |
15 | !if / notin $u_ or .. isin $u_ |
||
16 | u_= |
||
17 | !else |
||
18 | t_=!defof titb in wimshome/log/classes/$wims_class/doc/$u_.def |
||
19 | !if $t_=$empty |
||
20 | u_= |
||
21 | !endif |
||
22 | !endif |
||
23 | !endif |
||
24 | c=!charcnt $u_ |
||
25 | !if $c<$(min_$n) or $c>$(max_$n) |
||
26 | u_=$(class_$n) |
||
27 | !if $c>0 |
||
28 | badfield=$badfield $n |
||
29 | !endif |
||
30 | !endif |
||
31 | up_$n=$u_ |
||
23 | reyssat | 32 | !next n |
33 | |||
34 | up_email=!word 1 of $up_email |
||
35 | et=!translate @ to $ $ in $up_email |
||
36 | n=!wordcnt $et |
||
37 | !if $n!=2 |
||
12413 | bpr | 38 | up_email= |
23 | reyssat | 39 | !endif |
40 | !default up_email=$class_email |
||
41 | !bound up_limit between integer 1 and $wims_class_user_limit default $class_limit |
||
1317 | reyssat | 42 | !bound up_topscores between integer 0 and $wims_class_user_limit default $class_topscores |
4808 | guerimand | 43 | !bound up_anonymtopscores within yes,no default yes |
44 | !bound up_authscoresuspend within yes,no default yes |
||
5352 | guerimand | 45 | !bound up_supconnectshowed within yes,no default no |
4890 | guerimand | 46 | !bound up_exotitleform within -1,0,1,2,3 default 0 |
23 | reyssat | 47 | !bound up_exolog between integer 0 and $wims_exolog_limit |
48 | !bound up_examlog between integer 0 and $wims_examlog_limit |
||
9460 | guerimand | 49 | !bound up_allowcloning within yes,no default no |
9692 | bpr | 50 | !bound up_examscore_withoutip within yes,no default no |
16805 | guerimand | 51 | !bound up_hideaverage within yes,no default no |
16821 | guerimand | 52 | !bound up_mexolog within yes,no default no |
16903 | guerimand | 53 | !bound up_utime between 1 and 100 default 15 |
9460 | guerimand | 54 | !if $up_allowcloning=yes |
12413 | bpr | 55 | !read adm/class/authchars |
56 | up_cloningpwd=!text select $char_passwd in $up_cloningpwd |
||
57 | l=!charcnt $up_cloningpwd |
||
58 | !if $l<$passwd_min or $l>$passwd_max |
||
59 | !reset up_cloningpwd |
||
15360 | bpr | 60 | error=emptycloningpwd |
12413 | bpr | 61 | up_allowcloning=no |
62 | !endif |
||
9460 | guerimand | 63 | !else |
12413 | bpr | 64 | !reset up_cloningpwd |
9460 | guerimand | 65 | !endif |
603 | bpr | 66 | !default up_examshow=yes |
23 | reyssat | 67 | ll=!words2items $wims_site_languages |
68 | !bound up_lang within $ll default $class_lang |
||
69 | today=!char 1 to 8 of $wims_now |
||
70 | !if $class_type isin 13 |
||
12413 | bpr | 71 | up_expiration=$class_expiration |
23 | reyssat | 72 | !else |
14343 | guerimand | 73 | limit_expiration=!sh date --date '1 years 3 months' +%Y%m%d |
74 | !bound up_expiration between integer $today and $limit_expiration default $class_expiration |
||
23 | reyssat | 75 | !endif |
76 | up_level=!upper $up_level |
||
77 | up_level=!trim $up_level |
||
78 | up_level=!char 1,2 of $up_level |
||
5193 | guerimand | 79 | !bound up_level within $wims_listlevel default $class_level |
23 | reyssat | 80 | up_secure=!lower $up_secure |
81 | up_secure=!singlespace $up_secure |
||
82 | up_secure=!text select $char_lower $char_digit.-_ in $up_secure |
||
83 | up_secure=!char 1 to 1024 of $up_secure |
||
84 | !if $up_secure!=$empty |
||
12413 | bpr | 85 | test=!checkhost $up_secure |
86 | !if $test<1 |
||
87 | error=$error checkhost |
||
88 | up_secure=$class_secure |
||
89 | !endif |
||
23 | reyssat | 90 | !endif |
91 | |||
15795 | guerimand | 92 | !if $class_type isin 024 |
93 | !! --- check geoloc |
||
15808 | guerimand | 94 | up_geoloc=!text select -0123456789., in $up_geoloc |
15795 | guerimand | 95 | X=!item 1 of $up_geoloc |
96 | X=$[$X * 1] |
||
97 | Y=!item 2 of $up_geoloc |
||
98 | Y=$[$Y * 1] |
||
99 | N=!itemcnt $up_geoloc |
||
100 | !if $N!=2 or NAN isin $X$Y |
||
101 | up_geoloc=$empty |
||
102 | !endif |
||
103 | !! --- end check geoloc |
||
104 | !! --- check location |
||
105 | up_location=!translate ,!$$"< to $ $ in $up_location |
||
106 | up_location=!singlespace $up_location |
||
107 | up_location=!trim $up_location |
||
108 | !! --- end check location |
||
109 | !else |
||
110 | !reset up_location up_geoloc |
||
111 | !endif |
||
112 | |||
10491 | guerimand | 113 | !! remarks don't forget to add variable name to adm/class/regclass/proc/cloning.proc to keep it when cloning class (if necessary) |
114 | |||
23 | reyssat | 115 | !setdef !set class_password=$class_password\ |
116 | !set class_supervisor=$up_supervisor\ |
||
117 | !set class_description=$up_description\ |
||
118 | !set class_institution=$up_institution\ |
||
119 | !set class_email=$up_email\ |
||
120 | !set class_lang=$up_lang\ |
||
121 | !set class_creation=$class_creation\ |
||
122 | !set class_expiration=$up_expiration\ |
||
123 | !set class_limit=$up_limit\ |
||
1317 | reyssat | 124 | !set class_topscores=$up_topscores\ |
2581 | reyssat | 125 | !set class_anonymtopscores=$up_anonymtopscores\ |
23 | reyssat | 126 | !set class_level=$up_level\ |
127 | !set class_secure=$up_secure\ |
||
128 | !set class_connections=$class_connections\ |
||
15524 | bpr | 129 | !set class_option=$up_option $up_optionex\ |
23 | reyssat | 130 | !set class_lock=$up_lock\ |
131 | !set class_homepage=$class_homepage\ |
||
132 | !set class_bgcolor=$class_bgcolor\ |
||
133 | !set class_refcolor=$class_refcolor\ |
||
2069 | bpr | 134 | !set class_ref_menucolor=$class_ref_menucolor\ |
3064 | bpr | 135 | !set class_ref_button_help_bgcolor=$class_ref_button_help_bgcolor\ |
136 | !set class_ref_button_help_color=$class_ref_button_help_color\ |
||
137 | !set class_ref_button_bgcolor=$class_ref_button_bgcolor\ |
||
138 | !set class_ref_button_color=$class_ref_button_color\ |
||
23 | reyssat | 139 | !set class_bgimg=$class_bgimg\ |
140 | !set class_theme=$class_theme\ |
||
1364 | bpr | 141 | !set class_theme_icon=$class_theme_icon\ |
23 | reyssat | 142 | !set class_css=$class_css\ |
143 | !set class_exolog=$up_exolog\ |
||
144 | !set class_examlog=$up_examlog\ |
||
603 | bpr | 145 | !set class_examshow=$up_examshow\ |
1288 | bpr | 146 | !set class_ent=$up_ent\ |
2756 | bpr | 147 | !set class_external_auth=$up_external_auth\ |
148 | !set class_mixed_external_auth=$up_mixed_external_auth\ |
||
5069 | bpr | 149 | !set class_authidp=$class_authidp\ |
5015 | bpr | 150 | !set class_cas_auth=$class_cas_auth\ |
151 | !set class_ldap_auth=$class_ldap_auth\ |
||
5038 | bpr | 152 | !set class_php_auth=$class_php_auth\ |
732 | bpr | 153 | !set class_ldap_port=$class_ldap_port\ |
154 | !set class_ldap_version=$class_ldap_version\ |
||
155 | !set class_ldap_base=$class_ldap_base\ |
||
156 | !set class_ldap_branch=$class_ldap_branch\ |
||
157 | !set class_ldap_uid=$class_ldap_uid\ |
||
158 | !set class_ldap_login=$class_ldap_login\ |
||
5024 | bpr | 159 | !set class_ldap_email=$class_ldap_email\ |
160 | !set class_ldap_regnum=$class_ldap_regnum\ |
||
161 | !set class_ldap_photourl=$class_ldap_photourl\ |
||
4808 | guerimand | 162 | !set class_authscoresuspend=$up_authscoresuspend\ |
4884 | guerimand | 163 | !set class_exotitleform=$up_exotitleform\ |
5352 | guerimand | 164 | !set class_supconnectshowed=$up_supconnectshowed\ |
9692 | bpr | 165 | !set class_defined=yes\ |
166 | !set class_examscore_withoutip=$up_examscore_withoutip\ |
||
13052 | bpr | 167 | !set class_sendmailteacher=$up_sendmailteacher\ |
15795 | guerimand | 168 | !set class_location=$up_location\ |
169 | !set class_geoloc=$up_geoloc\ |
||
16805 | guerimand | 170 | !set class_hideaverage=$up_hideaverage\ |
16821 | guerimand | 171 | !set class_mexolog=$up_mexolog\ |
16903 | guerimand | 172 | !set class_utime=$up_utime\ |
9692 | bpr | 173 | in wimshome/log/classes/$wims_class/.def |
23 | reyssat | 174 | |
13181 | guerimand | 175 | !! change class_expiration in all subclasses .def file |
176 | !if $class_typename isitemof portal,group |
||
177 | listdef=!sh cd $wims_home/log/classes/$wims_superclass;\ |
||
178 | grep -r class_expiration * | awk -F: '{print $$1}' |
||
179 | listdef=!lines2items $listdef |
||
180 | !for file in $listdef |
||
181 | !setdef !set class_expiration=$up_expiration in wimshome/log/classes/$wims_superclass/$file |
||
182 | !next file |
||
183 | !endif |
||
184 | |||
9683 | guerimand | 185 | !if $class_type=0 or ($class_type=1 and $wims_typename=class) |
12413 | bpr | 186 | !setdef !set class_allowcloning=$up_allowcloning\ |
9475 | bpr | 187 | !set class_cloningpwd=$up_cloningpwd\ |
10825 | bpr | 188 | in wimshome/log/classes/$wims_class/.def |
9460 | guerimand | 189 | !endif |
12937 | guerimand | 190 | |
12942 | guerimand | 191 | !if $class_type isin 024 |
12937 | guerimand | 192 | up_regvars=!item 1 to $limit_regvars of $up_regvars |
14015 | bpr | 193 | up_regvars=!singlespace $up_regvars |
13052 | bpr | 194 | !! MAYBE WE SHOULD TEST LENGTH OF EACH regvar name (not be too long or too short) ? |
12413 | bpr | 195 | !setdef !set class_regvars=$up_regvars in wimshome/log/classes/$wims_class/.def |
10825 | bpr | 196 | !endif |
9460 | guerimand | 197 | |
23 | reyssat | 198 | lastname=!word -1 of $up_supervisor |
199 | firstname=!word 1 to -2 of $up_supervisor |
||
200 | lastname=!char 1 to 30 of $lastname |
||
201 | firstname=!char 1 to 50 of $firstname |
||
202 | !setdef !set user_email=$up_email\ |
||
203 | !set user_lastname=$lastname\ |
||
204 | !set user_firstname=$firstname in wimshome/log/classes/$wims_class/supervisor |
||
205 | |||
849 | bpr | 206 | sesdir=!translate internal _ to $ $ in $wims_sesdir |
207 | sesdir=!word 1 of $sesdir |
||
208 | !if $modtoolchg=0 |
||
209 | !setdef !set wims_developer=$empty in wimshome/log/classes/$wims_class/supervisor |
||
210 | !setdef wims_developer=$empty in wimshome/$sesdir/var.stat |
||
211 | !endif |
||
10776 | bpr | 212 | !if $wims_superclass!=$empty |
213 | !sh cd $wims_home/log/classes; ./.build-index $wims_superclass |
||
214 | !else |
||
215 | !sh cd $wims_home/log/classes; ./.build-index $wims_class |
||
216 | !endif |