Subversion Repositories wimsdev

Rev

Rev 15360 | Rev 15795 | 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
 
10491 guerimand 89
!! remarks don't forget to add variable name to adm/class/regclass/proc/cloning.proc to keep it when cloning class (if necessary)
90
 
23 reyssat 91
!setdef !set class_password=$class_password\
92
!set class_supervisor=$up_supervisor\
93
!set class_description=$up_description\
94
!set class_institution=$up_institution\
95
!set class_email=$up_email\
96
!set class_lang=$up_lang\
97
!set class_creation=$class_creation\
98
!set class_expiration=$up_expiration\
99
!set class_limit=$up_limit\
1317 reyssat 100
!set class_topscores=$up_topscores\
2581 reyssat 101
!set class_anonymtopscores=$up_anonymtopscores\
23 reyssat 102
!set class_level=$up_level\
103
!set class_secure=$up_secure\
104
!set class_connections=$class_connections\
15524 bpr 105
!set class_option=$up_option $up_optionex\
23 reyssat 106
!set class_lock=$up_lock\
107
!set class_homepage=$class_homepage\
108
!set class_bgcolor=$class_bgcolor\
109
!set class_refcolor=$class_refcolor\
2069 bpr 110
!set class_ref_menucolor=$class_ref_menucolor\
3064 bpr 111
!set class_ref_button_help_bgcolor=$class_ref_button_help_bgcolor\
112
!set class_ref_button_help_color=$class_ref_button_help_color\
113
!set class_ref_button_bgcolor=$class_ref_button_bgcolor\
114
!set class_ref_button_color=$class_ref_button_color\
23 reyssat 115
!set class_bgimg=$class_bgimg\
116
!set class_theme=$class_theme\
1364 bpr 117
!set class_theme_icon=$class_theme_icon\
23 reyssat 118
!set class_css=$class_css\
119
!set class_exolog=$up_exolog\
120
!set class_examlog=$up_examlog\
603 bpr 121
!set class_examshow=$up_examshow\
1288 bpr 122
!set class_ent=$up_ent\
2756 bpr 123
!set class_external_auth=$up_external_auth\
124
!set class_mixed_external_auth=$up_mixed_external_auth\
5069 bpr 125
!set class_authidp=$class_authidp\
5015 bpr 126
!set class_cas_auth=$class_cas_auth\
127
!set class_ldap_auth=$class_ldap_auth\
5038 bpr 128
!set class_php_auth=$class_php_auth\
732 bpr 129
!set class_ldap_port=$class_ldap_port\
130
!set class_ldap_version=$class_ldap_version\
131
!set class_ldap_base=$class_ldap_base\
132
!set class_ldap_branch=$class_ldap_branch\
133
!set class_ldap_uid=$class_ldap_uid\
134
!set class_ldap_login=$class_ldap_login\
5024 bpr 135
!set class_ldap_email=$class_ldap_email\
136
!set class_ldap_regnum=$class_ldap_regnum\
137
!set class_ldap_photourl=$class_ldap_photourl\
4808 guerimand 138
!set class_authscoresuspend=$up_authscoresuspend\
4884 guerimand 139
!set class_exotitleform=$up_exotitleform\
5352 guerimand 140
!set class_supconnectshowed=$up_supconnectshowed\
9692 bpr 141
!set class_defined=yes\
142
!set class_examscore_withoutip=$up_examscore_withoutip\
13052 bpr 143
!set class_sendmailteacher=$up_sendmailteacher\
9692 bpr 144
in wimshome/log/classes/$wims_class/.def
23 reyssat 145
 
13181 guerimand 146
!! change class_expiration in all subclasses .def file
147
!if $class_typename isitemof portal,group
148
  listdef=!sh cd $wims_home/log/classes/$wims_superclass;\
149
grep -r class_expiration * | awk -F: '{print $$1}'
150
  listdef=!lines2items $listdef
151
  !for file in $listdef
152
    !setdef !set class_expiration=$up_expiration in wimshome/log/classes/$wims_superclass/$file
153
  !next file
154
!endif
155
 
9683 guerimand 156
!if $class_type=0 or ($class_type=1 and $wims_typename=class)
12413 bpr 157
  !setdef !set class_allowcloning=$up_allowcloning\
9475 bpr 158
!set class_cloningpwd=$up_cloningpwd\
10825 bpr 159
in wimshome/log/classes/$wims_class/.def
9460 guerimand 160
!endif
12937 guerimand 161
 
12942 guerimand 162
!if $class_type isin 024
12937 guerimand 163
  up_regvars=!item 1 to $limit_regvars of $up_regvars
14015 bpr 164
  up_regvars=!singlespace $up_regvars
13052 bpr 165
  !! MAYBE WE SHOULD TEST LENGTH OF EACH regvar name (not be too long or too short) ?
12413 bpr 166
  !setdef !set class_regvars=$up_regvars in wimshome/log/classes/$wims_class/.def
10825 bpr 167
!endif
9460 guerimand 168
 
23 reyssat 169
lastname=!word -1 of $up_supervisor
170
firstname=!word 1 to -2 of $up_supervisor
171
lastname=!char 1 to 30 of $lastname
172
firstname=!char 1 to 50 of $firstname
173
!setdef !set user_email=$up_email\
174
!set user_lastname=$lastname\
175
!set user_firstname=$firstname in wimshome/log/classes/$wims_class/supervisor
176
 
849 bpr 177
sesdir=!translate internal _ to $ $ in $wims_sesdir
178
sesdir=!word 1 of $sesdir
179
!if $modtoolchg=0
180
  !setdef !set wims_developer=$empty in wimshome/log/classes/$wims_class/supervisor
181
  !setdef wims_developer=$empty in wimshome/$sesdir/var.stat
182
!endif
10776 bpr 183
!if $wims_superclass!=$empty
184
  !sh cd $wims_home/log/classes; ./.build-index $wims_superclass
185
!else
186
  !sh cd $wims_home/log/classes; ./.build-index $wims_class
187
!endif