Example #1
0
 protected function validatePostTbl($tbl, $extracted)
 {
     $isValid = 1;
     $tid = $tbl->Get(DTbl::FLD_ID);
     if (($index = $tbl->Get(DTbl::FLD_INDEX)) != NULL) {
         $keynode = $extracted->GetChildren($index);
         if ($keynode != NULL) {
             $holderval = $keynode->Get(CNode::FLD_VAL);
             $extracted->SetVal($holderval);
             if ($holderval != $this->_disp->GetLast(DInfo::FLD_REF)) {
                 // check conflict
                 $ref = $this->_disp->GetParentRef();
                 $location = DPageDef::GetPage($this->_disp)->GetTblMap()->FindTblLoc($tid);
                 if ($location[0] == '*') {
                     // allow multiple
                     $confdata = $this->_disp->Get(DInfo::FLD_ConfData);
                     $existingkeys = $confdata->GetChildrenValues($location, $ref);
                     if (in_array($holderval, $existingkeys)) {
                         $keynode->SetErr('This value has been used! Please choose a unique one.');
                         $isValid = -1;
                     }
                 }
             }
         }
     }
     if (($defaultExtract = $tbl->Get(DTbl::FLD_DEFAULTEXTRACT)) != NULL) {
         foreach ($defaultExtract as $k => $v) {
             $extracted->AddChild(new CNode($k, $v));
         }
     }
     $view = $this->_disp->Get(DInfo::FLD_View);
     if ($tid == 'L_GENERAL' || $tid == 'ADM_L_GENERAL') {
         $this->chkPostTbl_L_GENERAL($extracted);
     } elseif ($view == 'sl' || $view == 'al') {
         // will ignore vhlevel
         if ($tid == 'LVT_SSL') {
             $isValid = $this->chkPostTbl_L_SSL($extracted);
         } elseif ($tid == 'LVT_SSL_CERT') {
             $isValid = $this->chkPostTbl_L_SSL_CERT($extracted);
         }
     } elseif ($view == 'admin') {
         if ($tid == 'ADM_USR') {
             $isValid = $this->chkPostTbl_ADM_USR($extracted);
         } elseif ($tid == 'ADM_USR_NEW') {
             $isValid = $this->chkPostTbl_ADM_USR_NEW($extracted);
         }
     } elseif ($tid == 'V_UDB') {
         $isValid = $this->chkPostTbl_ADM_USR_NEW($extracted);
     }
     return $isValid;
 }
Example #2
0
<?php

require_once "inc/auth.php";
$disp = Service::ConfigDispData();
$page = DPageDef::GetPage($disp);
UI::PrintConfPage($disp, $page);
?>

<script type="text/javascript">

pageSetUp();

var pagefunction = function() {
	// clears memory even if nothing is in the function

<?php 
if (Service::HasChanged()) {
    ?>
	var span = $("#ribbon span");
	if (span.hasClass("hide"))
		span.removeClass("hide");
 <?php 
}
?>
};

// end pagefunction

// run pagefunction on load
pagefunction();
Example #3
0
 public function DeleteEntry($disp)
 {
     $tid = $disp->GetLast(DInfo::FLD_TID);
     if ($this->_type == DInfo::CT_EX) {
         $ref = $disp->GetLast(DInfo::FLD_REF);
     } else {
         $ref = $disp->Get(DInfo::FLD_REF);
     }
     $tblmap = DPageDef::GetPage($disp)->GetTblMap();
     $location = $tblmap->FindTblLoc($tid);
     $layer = $this->_root->GetChildrenByLoc($location, $ref);
     if ($layer != NULL) {
         $layer->RemoveFromParent();
         $this->check_integrity($tid, NULL, $disp);
         $this->SaveFile();
     } else {
         error_log("cannot find delete entry\n");
     }
 }