|
Server : LiteSpeed System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : elvh3918 ( 1528) PHP Version : 8.2.31 Disable Function : mail Directory : /proc/thread-self/root/usr/local/lsws/admin/html/classes/ws/ |
<?php
class ConfValidation extends CValidation
{
protected function validatePostTbl($tbl, &$d)
{
$isValid = parent::validatePostTbl($tbl, $d);
if ($tbl->_id == 'VH_SECHL') {
$res = $this->chkPostTbl_VH_SECHL($d);
$this->setValid($isValid, $res);
}
return $isValid;
}
protected function chkPostTbl_VH_SECHL(&$d)
{
$isValid = 1;
if ( $d['enableHotlinkCtrl']->GetVal() == '0' ) {
if ( isset($d['suffixes']) && !$d['suffixes']->HasVal() ) {
$d['suffixes']->SetErr(null);
}
if ( isset($d['allowDirectAccess']) && !$d['allowDirectAccess']->HasVal() ) {
$d['allowDirectAccess']->SetErr(null);
}
if ( isset($d['onlySelf']) && !$d['onlySelf']->HasVal() ) {
$d['onlySelf']->SetErr(null);
}
$isValid = 2;
} else {
if ( $d['onlySelf']->GetVal() == '0'
&& !$d['allowedHosts']->HasVal() ) {
$d['allowedHosts']->SetErr('Must be specified if "Only Self Reference" is set to No');
$isValid = -1;
}
}
return $isValid;
}
}