Subversion Repositories wimsdev

Rev

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