Subversion Repositories wimsdev

Rev

Rev 10469 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 reyssat 1
# Add a subclass under the current superclass.
2
# Calling parameter: subclass address under the superclass.
3
 
4
!if $wims_superclass=$empty or $wims_user!=supervisor or $wims_read_parm=$empty
5
 !exit
6
!endif
7
 
8
classdir=wimshome/log/classes/$wims_superclass
9
userdir=$classdir/.users
10
s_=$sup
11
 
12
!if $pass!=$empty
13
 pass=!text select $char_passwd in $pass
14
 passlen=!charcnt $pass
15
 !if $passlen<$passwd_min or $passlen>$passwd_max or $pass != $pass2
16
  error=bad_password
17
  !exit
18
 !endif
19
!else
20
 pass=!defof class_password in $classdir/$wims_read_parm/.def
21
!endif
22
 
23
!if $passs!=$empty
24
 passs=!text select $char_passwd in $passs
25
 passlen=!charcnt $passs
26
 !if $passlen<$passwd_min or $passlen>$passwd_max or $passs != $passs2
27
  error=bad_password
28
  !exit
29
 !endif
30
!else
31
 passs=!defof user_password in $classdir/$wims_read_parm/supervisor
32
!endif
33
 
34
1=!defof user_exists in $userdir/$s_
35
2=!defof class_defined in $classdir/$wims_read_parm/.def
36
!if $2!=yes
37
 error=mod_not_exist
38
 !exit
39
!endif
40
!if $1!=yes
41
 s_=supervisor
42
!else
43
 1=!defof user_supervisable in $userdir/$s_
44
 !if $1!=yes
45
  name=$s_
46
  error=not_supervisable
47
  !exit
48
 !endif
49
!endif
50
!read adm/class/userdef classes,$wims_superclass,$s_
51
cadd_Supervisor=$s_
52
sadd_firstname=!defof user_firstname in $userdef
53
sadd_lastname=!defof user_lastname in $userdef
54
sadd_email=!defof user_email in $userdef
55
cadd_email=$sadd_email
56
cadd_password=$pass
57
sadd_password=$passs
58
modclass_slist=!listunion firstname,lastname,email and $modclass_slist
59
 
60
!read adm/gateway/delsup $wims_read_parm
61
!if $s_!=supervisor
62
 suplist=!defof user_supervise in $userdir/$s_
63
 suplist=!listunion $suplist and $wims_superclass/$wims_read_parm
64
 !setdef !set user_supervise=$suplist in $userdir/$s_
65
!endif
66
 
67
!read adm/class/modclass $wims_superclass/$wims_read_parm
68
 
69
!if $error!=$empty
70
 !exit
71
!endif
72