home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 December
/
PCWorld_2000-12_cd.bin
/
Komunikace
/
Comanche
/
plugins
/
apache
/
modules
/
access
/
specialCases.tcl
< prev
Wrap
Text File
|
2000-11-02
|
2KB
|
62 lines
namespace eval ::apache1.3:: {}
proc ::apache1.3::parseAccess {elements parser dirDef xmlConf currentContainer} {
set xuiObj [apacheparserutils::getOrCreateIfNotExists access \
$dirDef $xmlConf $currentContainer]
set name [string tolower [lindex $elements 0]]
if [regexp env [lindex $elements 2] ] {
set environment 1
set variable [lindex [split [lindex $elements 2] =] 1]
set newElement [ $xuiObj newChild ]
$xuiObj insertChild $newElement
$subject selectComponentByName env
$subject.env setValue $variable
} else {
foreach host [lrange $elements 2 end ] {
set newElement [ $xuiObj newChild ]
$xuiObj insertChild $newElement
$newElement.action selectItem $name
set subject $newElement.subject
$subject selectComponentByName host
set hostAlternate $subject.host
switch $host {
all {
$hostAlternate selectComponentByName all
} default {
$hostAlternate selectComponentByName ipDom
$hostAlternate.ipDom setValue $host
}
}
}
}
}
proc ::apache1.3::dumpAccess { xuiObj } {
set result {}
foreach child [ $xuiObj getChildren ] {
append result "[$child.action getSelected] from "
set subject $child.subject
switch [$subject getSelectedComponentName] {
env {
append result \
"env=[[$subject getSelectedComponent] getValue]\n"
} host {
switch [[$subject getSelectedComponent] \
getSelectedComponentName] {
all {
append result "all\n"
} default {
append result "[[[$subject getSelectedComponent] \
getSelectedComponent] getValue]\n"
}
}
} default {
error " [$subject getSelectedComponentName] "
}
}
}
return $result
}