Subversion Repositories wimsdev

Rev

Rev 12981 | Details | Compare with Previous | 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
12981 bpr 5
  !exit
20 reyssat 6
!endif
7
 
8
classdir=wimshome/log/classes/$wims_superclass
9
userdir=$classdir/.users
10
s_=$sup
11
 
12
!if $pass!=$empty
12981 bpr 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
20 reyssat 19
!else
12981 bpr 20
  pass=!defof class_password in $classdir/$wims_read_parm/.def
20 reyssat 21
!endif
22
 
23
!if $passs!=$empty
12981 bpr 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
20 reyssat 30
!else
12981 bpr 31
  passs=!defof user_password in $classdir/$wims_read_parm/supervisor
20 reyssat 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
14336 bpr 37
  error=mod_not_exist
38
  !exit
20 reyssat 39
!endif
40
!if $1!=yes
14336 bpr 41
  s_=supervisor
20 reyssat 42
!else
14336 bpr 43
  1=!defof user_supervisable in $userdir/$s_
44
  !if $1!=yes
45
    name=$s_
46
    error=not_supervisable
47
    !exit
48
  !endif
20 reyssat 49
!endif
50
!read adm/class/userdef classes,$wims_superclass,$s_
51
cadd_Supervisor=$s_
10677 bpr 52
tmp=!defof user_firstname,user_lastname,user_email in $userdef
10469 guerimand 53
!distribute item $tmp into sadd_firstname,sadd_lastname,sadd_email,sadd_password
20 reyssat 54
cadd_email=$sadd_email
55
cadd_password=$pass
10677 bpr 56
sadd_password=$passs
20 reyssat 57
modclass_slist=!listunion firstname,lastname,email and $modclass_slist
58
 
59
!read adm/gateway/delsup $wims_read_parm
60
!if $s_!=supervisor
14336 bpr 61
  suplist=!defof user_supervise in $userdir/$s_
62
  suplist=!listunion $suplist and $wims_superclass/$wims_read_parm
63
  !setdef !set user_supervise=$suplist in $userdir/$s_
20 reyssat 64
!endif
65
 
66
!read adm/class/modclass $wims_superclass/$wims_read_parm
67
 
68
!if $error!=$empty
14336 bpr 69
  !exit
20 reyssat 70
!endif