Subversion Repositories wimsdev

Rev

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