Subversion Repositories wimsdev

Rev

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