| Новости | FAQ | Авторы | Документация | В действии | Библиотека |
| Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
BeaVe 11.02.2006 09:04
@getDomain[]
$result[$env:SERVER_NAME^if($env:SERVER_PORT != 80){:$env:SERVER_PORT}]
#end @getDomain[]
@refresh[string]
^if(def $string){
$string[^if(^request:uri.pos[?]>=0){&}{?}$string]
}
^location[http://^taint[as-is][^getDomain[]$request:uri]^untaint[uri]{$string}]
#end @refresh[]
@test_cookie[]
^if(!def $form:sid){
$sid[^math:uid64[]]
$cookie:$sid[$sid]
^refresh[sid=$sid]
}{
$formname[$form:sid]
^if(def $cookie:$formname){
$cookie_sid[$cookie:$formname]
$cookie:sid[$cookie_sid]
$cookie:$formname[]
$result(1)
}{
$result(0)
}
}
#end @test_cookie[]
@getSID[]
^if(^cookie:sid.length[] == 16){
^if(!def $form:sid){
^refresh[sid=$cookie:sid]
}
$result[$cookie:sid]
}{
^test_cookie[]
$result[$form:sid]
}
#end @getSID[]