Rev 16804 | Blame | Compare with Previous | Last modification | View Log | RSS feed
l_=0
!if $nei isitemof $n_sup
!advance l_
!endif
!if $nei isitemof $n_part
l_=$[$l_+2]
!endif
!bound nlevel between integer 0 and 3 default $l_
!ifval $nlevel!=$l_
!ifval $nlevel%2=0
!if $nsharing!=$empty
error=remote_sharing
!advance nlevel
!else
n_sup=!listcomplement $nei in $n_sup
!endif
!else
n_sup=!append item $nei to $n_sup
n_sup=!listuniq $n_sup
!endif
!ifval $nlevel<2
n_part=!listcomplement $nei in $n_part
!else
n_part=!append item $nei to $n_part
n_part=!listuniq $n_part
!endif
!setdef n_sup=$n_sup\
n_part=$n_part in wimshome/log/classes/$wims_class/neighbors
wims_class_log=Neighbor level $nlevel with $nei by $wims_realuser
!endif
sharablelist=!listcomplement $sharing in $sharelist
!if $changeshare!=$empty
changed=0
classexp=!defof class_expiration in wimshome/log/classes/$wims_class/.def
neiexp=!defof class_expiration in wimshome/log/classes/$nei/.def
!if $classexp<$neiexp
error=sharable_expdate $neiexp
!goto end
!endif
detail_share=open
wims_class_log=Allow $nei share $mksharable by $wims_realuser
!for r in $sharablelist
!if $r isitemof $mksharable and $nei notitemof $(sharable_$r)
sharable_$r=!append item $nei to $(sharable_$r)
changed=1
!endif
!if $r notitemof $mksharable and $nei isitemof $(sharable_$r)
!if $r isitemof $nsharing
error=$error remote_sharing
!else
sharable_$r=!listcomplement $nei in $(sharable_$r)
changed=1
!endif
!endif
!next r
!if $changed>0
shlist=
!for sh in $sharablelist
shlist=!append item $(sharable_$sh) to $shlist
!next sh
sharable_all=!listuniq $shlist
!read neighbor/writeneighbor.proc
!endif
!endif
:end
!reset mksharable,changeshare
!for r in $sharablelist
!if $nei isitemof $(sharable_$r)
mksharable=!append item $r to $mksharable
!endif
!next r