Viewing file: radacct_maint.php (44.91 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//Include Common Files @1-5C0B5B87
define("RelativePath", ".");
define("PathToCurrentPage", "/");
define("FileName", "radacct_maint.php");
include(RelativePath . "/Common.php");
include(RelativePath . "/Template.php");
include(RelativePath . "/Sorter.php");
include(RelativePath . "/Navigator.php");
//End Include Common Files
//Include Page implementation @32-3DD2EFDC
include_once(RelativePath . "/Header.php");
//End Include Page implementation
class clsRecordradacct { //radacct Class @2-3DE54B17
//Variables @2-F607D3A5
// Public variables
var $ComponentType = "Record";
var $ComponentName;
var $Parent;
var $HTMLFormAction;
var $PressedButton;
var $Errors;
var $ErrorBlock;
var $FormSubmitted;
var $FormEnctype;
var $Visible;
var $Recordset;
var $CCSEvents = "";
var $CCSEventResult;
var $RelativePath = "";
var $InsertAllowed = false;
var $UpdateAllowed = false;
var $DeleteAllowed = false;
var $ReadAllowed = false;
var $EditMode = false;
var $ds;
var $DataSource;
var $ValidatingControls;
var $Controls;
// Class variables
//End Variables
//Class_Initialize Event @2-2A10DD6B
function clsRecordradacct($RelativePath, & $Parent)
{
global $FileName;
global $CCSLocales;
global $DefaultDateFormat;
$this->Visible = true;
$this->Parent = & $Parent;
$this->RelativePath = $RelativePath;
$this->Errors = new clsErrors();
$this->ErrorBlock = "Record radacct/Error";
$this->DataSource = new clsradacctDataSource($this);
$this->ds = & $this->DataSource;
$this->InsertAllowed = true;
$this->UpdateAllowed = true;
$this->DeleteAllowed = true;
$this->ReadAllowed = true;
if($this->Visible)
{
$this->ComponentName = "radacct";
$CCSForm = split(":", CCGetFromGet("ccsForm", ""), 2);
if(sizeof($CCSForm) == 1)
$CCSForm[1] = "";
list($FormName, $FormMethod) = $CCSForm;
$this->EditMode = ($FormMethod == "Edit");
$this->FormEnctype = "application/x-www-form-urlencoded";
$this->FormSubmitted = ($FormName == $this->ComponentName);
$Method = $this->FormSubmitted ? ccsPost : ccsGet;
$this->AcctSessionId = & new clsControl(ccsTextBox, "AcctSessionId", "Acct Session Id", ccsText, "", CCGetRequestParam("AcctSessionId", $Method), $this);
$this->AcctSessionId->Required = true;
$this->AcctUniqueId = & new clsControl(ccsTextBox, "AcctUniqueId", "Acct Unique Id", ccsText, "", CCGetRequestParam("AcctUniqueId", $Method), $this);
$this->AcctUniqueId->Required = true;
$this->UserName = & new clsControl(ccsTextBox, "UserName", "User Name", ccsText, "", CCGetRequestParam("UserName", $Method), $this);
$this->UserName->Required = true;
$this->Realm = & new clsControl(ccsTextBox, "Realm", "Realm", ccsText, "", CCGetRequestParam("Realm", $Method), $this);
$this->NASIPAddress = & new clsControl(ccsTextBox, "NASIPAddress", "NASIPAddress", ccsText, "", CCGetRequestParam("NASIPAddress", $Method), $this);
$this->NASIPAddress->Required = true;
$this->NASPortId = & new clsControl(ccsTextBox, "NASPortId", "NASPort Id", ccsInteger, "", CCGetRequestParam("NASPortId", $Method), $this);
$this->NASPortType = & new clsControl(ccsTextBox, "NASPortType", "NASPort Type", ccsText, "", CCGetRequestParam("NASPortType", $Method), $this);
$this->AcctStartTime = & new clsControl(ccsTextBox, "AcctStartTime", "Acct Start Time", ccsDate, $DefaultDateFormat, CCGetRequestParam("AcctStartTime", $Method), $this);
$this->AcctStartTime->Required = true;
$this->DatePicker_AcctStartTime = & new clsDatePicker("DatePicker_AcctStartTime", "radacct", "AcctStartTime", $this);
$this->AcctStopTime = & new clsControl(ccsTextBox, "AcctStopTime", "Acct Stop Time", ccsDate, $DefaultDateFormat, CCGetRequestParam("AcctStopTime", $Method), $this);
$this->AcctStopTime->Required = true;
$this->DatePicker_AcctStopTime = & new clsDatePicker("DatePicker_AcctStopTime", "radacct", "AcctStopTime", $this);
$this->AcctSessionTime = & new clsControl(ccsTextBox, "AcctSessionTime", "Acct Session Time", ccsInteger, "", CCGetRequestParam("AcctSessionTime", $Method), $this);
$this->AcctAuthentic = & new clsControl(ccsTextBox, "AcctAuthentic", "Acct Authentic", ccsText, "", CCGetRequestParam("AcctAuthentic", $Method), $this);
$this->ConnectInfo_start = & new clsControl(ccsTextBox, "ConnectInfo_start", "Connect Info Start", ccsText, "", CCGetRequestParam("ConnectInfo_start", $Method), $this);
$this->ConnectInfo_stop = & new clsControl(ccsTextBox, "ConnectInfo_stop", "Connect Info Stop", ccsText, "", CCGetRequestParam("ConnectInfo_stop", $Method), $this);
$this->AcctInputOctets = & new clsControl(ccsTextBox, "AcctInputOctets", "Acct Input Octets", ccsInteger, "", CCGetRequestParam("AcctInputOctets", $Method), $this);
$this->AcctOutputOctets = & new clsControl(ccsTextBox, "AcctOutputOctets", "Acct Output Octets", ccsInteger, "", CCGetRequestParam("AcctOutputOctets", $Method), $this);
$this->CalledStationId = & new clsControl(ccsTextBox, "CalledStationId", "Called Station Id", ccsText, "", CCGetRequestParam("CalledStationId", $Method), $this);
$this->CalledStationId->Required = true;
$this->CallingStationId = & new clsControl(ccsTextBox, "CallingStationId", "Calling Station Id", ccsText, "", CCGetRequestParam("CallingStationId", $Method), $this);
$this->CallingStationId->Required = true;
$this->AcctTerminateCause = & new clsControl(ccsTextBox, "AcctTerminateCause", "Acct Terminate Cause", ccsText, "", CCGetRequestParam("AcctTerminateCause", $Method), $this);
$this->AcctTerminateCause->Required = true;
$this->ServiceType = & new clsControl(ccsTextBox, "ServiceType", "Service Type", ccsText, "", CCGetRequestParam("ServiceType", $Method), $this);
$this->FramedProtocol = & new clsControl(ccsTextBox, "FramedProtocol", "Framed Protocol", ccsText, "", CCGetRequestParam("FramedProtocol", $Method), $this);
$this->FramedIPAddress = & new clsControl(ccsTextBox, "FramedIPAddress", "Framed IPAddress", ccsText, "", CCGetRequestParam("FramedIPAddress", $Method), $this);
$this->FramedIPAddress->Required = true;
$this->AcctStartDelay = & new clsControl(ccsTextBox, "AcctStartDelay", "Acct Start Delay", ccsInteger, "", CCGetRequestParam("AcctStartDelay", $Method), $this);
$this->AcctStopDelay = & new clsControl(ccsTextBox, "AcctStopDelay", "Acct Stop Delay", ccsInteger, "", CCGetRequestParam("AcctStopDelay", $Method), $this);
$this->Button_Insert = & new clsButton("Button_Insert", $Method, $this);
$this->Button_Update = & new clsButton("Button_Update", $Method, $this);
$this->Button_Delete = & new clsButton("Button_Delete", $Method, $this);
}
}
//End Class_Initialize Event
//Initialize Method @2-DE642AD5
function Initialize()
{
if(!$this->Visible)
return;
$this->DataSource->Parameters["urlRadAcctId"] = CCGetFromGet("RadAcctId", "");
}
//End Initialize Method
//Validate Method @2-8A3E5136
function Validate()
{
global $CCSLocales;
$Validation = true;
$Where = "";
$Validation = ($this->AcctSessionId->Validate() && $Validation);
$Validation = ($this->AcctUniqueId->Validate() && $Validation);
$Validation = ($this->UserName->Validate() && $Validation);
$Validation = ($this->Realm->Validate() && $Validation);
$Validation = ($this->NASIPAddress->Validate() && $Validation);
$Validation = ($this->NASPortId->Validate() && $Validation);
$Validation = ($this->NASPortType->Validate() && $Validation);
$Validation = ($this->AcctStartTime->Validate() && $Validation);
$Validation = ($this->AcctStopTime->Validate() && $Validation);
$Validation = ($this->AcctSessionTime->Validate() && $Validation);
$Validation = ($this->AcctAuthentic->Validate() && $Validation);
$Validation = ($this->ConnectInfo_start->Validate() && $Validation);
$Validation = ($this->ConnectInfo_stop->Validate() && $Validation);
$Validation = ($this->AcctInputOctets->Validate() && $Validation);
$Validation = ($this->AcctOutputOctets->Validate() && $Validation);
$Validation = ($this->CalledStationId->Validate() && $Validation);
$Validation = ($this->CallingStationId->Validate() && $Validation);
$Validation = ($this->AcctTerminateCause->Validate() && $Validation);
$Validation = ($this->ServiceType->Validate() && $Validation);
$Validation = ($this->FramedProtocol->Validate() && $Validation);
$Validation = ($this->FramedIPAddress->Validate() && $Validation);
$Validation = ($this->AcctStartDelay->Validate() && $Validation);
$Validation = ($this->AcctStopDelay->Validate() && $Validation);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "OnValidate", $this);
$Validation = $Validation && ($this->AcctSessionId->Errors->Count() == 0);
$Validation = $Validation && ($this->AcctUniqueId->Errors->Count() == 0);
$Validation = $Validation && ($this->UserName->Errors->Count() == 0);
$Validation = $Validation && ($this->Realm->Errors->Count() == 0);
$Validation = $Validation && ($this->NASIPAddress->Errors->Count() == 0);
$Validation = $Validation && ($this->NASPortId->Errors->Count() == 0);
$Validation = $Validation && ($this->NASPortType->Errors->Count() == 0);
$Validation = $Validation && ($this->AcctStartTime->Errors->Count() == 0);
$Validation = $Validation && ($this->AcctStopTime->Errors->Count() == 0);
$Validation = $Validation && ($this->AcctSessionTime->Errors->Count() == 0);
$Validation = $Validation && ($this->AcctAuthentic->Errors->Count() == 0);
$Validation = $Validation && ($this->ConnectInfo_start->Errors->Count() == 0);
$Validation = $Validation && ($this->ConnectInfo_stop->Errors->Count() == 0);
$Validation = $Validation && ($this->AcctInputOctets->Errors->Count() == 0);
$Validation = $Validation && ($this->AcctOutputOctets->Errors->Count() == 0);
$Validation = $Validation && ($this->CalledStationId->Errors->Count() == 0);
$Validation = $Validation && ($this->CallingStationId->Errors->Count() == 0);
$Validation = $Validation && ($this->AcctTerminateCause->Errors->Count() == 0);
$Validation = $Validation && ($this->ServiceType->Errors->Count() == 0);
$Validation = $Validation && ($this->FramedProtocol->Errors->Count() == 0);
$Validation = $Validation && ($this->FramedIPAddress->Errors->Count() == 0);
$Validation = $Validation && ($this->AcctStartDelay->Errors->Count() == 0);
$Validation = $Validation && ($this->AcctStopDelay->Errors->Count() == 0);
return (($this->Errors->Count() == 0) && $Validation);
}
//End Validate Method
//CheckErrors Method @2-7749588F
function CheckErrors()
{
$errors = false;
$errors = ($errors || $this->AcctSessionId->Errors->Count());
$errors = ($errors || $this->AcctUniqueId->Errors->Count());
$errors = ($errors || $this->UserName->Errors->Count());
$errors = ($errors || $this->Realm->Errors->Count());
$errors = ($errors || $this->NASIPAddress->Errors->Count());
$errors = ($errors || $this->NASPortId->Errors->Count());
$errors = ($errors || $this->NASPortType->Errors->Count());
$errors = ($errors || $this->AcctStartTime->Errors->Count());
$errors = ($errors || $this->DatePicker_AcctStartTime->Errors->Count());
$errors = ($errors || $this->AcctStopTime->Errors->Count());
$errors = ($errors || $this->DatePicker_AcctStopTime->Errors->Count());
$errors = ($errors || $this->AcctSessionTime->Errors->Count());
$errors = ($errors || $this->AcctAuthentic->Errors->Count());
$errors = ($errors || $this->ConnectInfo_start->Errors->Count());
$errors = ($errors || $this->ConnectInfo_stop->Errors->Count());
$errors = ($errors || $this->AcctInputOctets->Errors->Count());
$errors = ($errors || $this->AcctOutputOctets->Errors->Count());
$errors = ($errors || $this->CalledStationId->Errors->Count());
$errors = ($errors || $this->CallingStationId->Errors->Count());
$errors = ($errors || $this->AcctTerminateCause->Errors->Count());
$errors = ($errors || $this->ServiceType->Errors->Count());
$errors = ($errors || $this->FramedProtocol->Errors->Count());
$errors = ($errors || $this->FramedIPAddress->Errors->Count());
$errors = ($errors || $this->AcctStartDelay->Errors->Count());
$errors = ($errors || $this->AcctStopDelay->Errors->Count());
$errors = ($errors || $this->Errors->Count());
$errors = ($errors || $this->DataSource->Errors->Count());
return $errors;
}
//End CheckErrors Method
//Operation Method @2-BF3F3A02
function Operation()
{
if(!$this->Visible)
return;
global $Redirect;
global $FileName;
$this->DataSource->Prepare();
if(!$this->FormSubmitted) {
$this->EditMode = $this->DataSource->AllParametersSet;
return;
}
if($this->FormSubmitted) {
$this->PressedButton = $this->EditMode ? "Button_Update" : "Button_Insert";
if($this->Button_Insert->Pressed) {
$this->PressedButton = "Button_Insert";
} else if($this->Button_Update->Pressed) {
$this->PressedButton = "Button_Update";
} else if($this->Button_Delete->Pressed) {
$this->PressedButton = "Button_Delete";
}
}
$Redirect = "radacct_list.php" . "?" . CCGetQueryString("QueryString", array("ccsForm"));
if($this->PressedButton == "Button_Delete") {
if(!CCGetEvent($this->Button_Delete->CCSEvents, "OnClick", $this->Button_Delete) || !$this->DeleteRow()) {
$Redirect = "";
}
} else if($this->Validate()) {
if($this->PressedButton == "Button_Insert") {
if(!CCGetEvent($this->Button_Insert->CCSEvents, "OnClick", $this->Button_Insert) || !$this->InsertRow()) {
$Redirect = "";
}
} else if($this->PressedButton == "Button_Update") {
if(!CCGetEvent($this->Button_Update->CCSEvents, "OnClick", $this->Button_Update) || !$this->UpdateRow()) {
$Redirect = "";
}
}
} else {
$Redirect = "";
}
if ($Redirect)
$this->DataSource->close();
}
//End Operation Method
//InsertRow Method @2-DA84932A
function InsertRow()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeInsert", $this);
if(!$this->InsertAllowed) return false;
$this->DataSource->AcctSessionId->SetValue($this->AcctSessionId->GetValue());
$this->DataSource->AcctUniqueId->SetValue($this->AcctUniqueId->GetValue());
$this->DataSource->UserName->SetValue($this->UserName->GetValue());
$this->DataSource->Realm->SetValue($this->Realm->GetValue());
$this->DataSource->NASIPAddress->SetValue($this->NASIPAddress->GetValue());
$this->DataSource->NASPortId->SetValue($this->NASPortId->GetValue());
$this->DataSource->NASPortType->SetValue($this->NASPortType->GetValue());
$this->DataSource->AcctStartTime->SetValue($this->AcctStartTime->GetValue());
$this->DataSource->AcctStopTime->SetValue($this->AcctStopTime->GetValue());
$this->DataSource->AcctSessionTime->SetValue($this->AcctSessionTime->GetValue());
$this->DataSource->AcctAuthentic->SetValue($this->AcctAuthentic->GetValue());
$this->DataSource->ConnectInfo_start->SetValue($this->ConnectInfo_start->GetValue());
$this->DataSource->ConnectInfo_stop->SetValue($this->ConnectInfo_stop->GetValue());
$this->DataSource->AcctInputOctets->SetValue($this->AcctInputOctets->GetValue());
$this->DataSource->AcctOutputOctets->SetValue($this->AcctOutputOctets->GetValue());
$this->DataSource->CalledStationId->SetValue($this->CalledStationId->GetValue());
$this->DataSource->CallingStationId->SetValue($this->CallingStationId->GetValue());
$this->DataSource->AcctTerminateCause->SetValue($this->AcctTerminateCause->GetValue());
$this->DataSource->ServiceType->SetValue($this->ServiceType->GetValue());
$this->DataSource->FramedProtocol->SetValue($this->FramedProtocol->GetValue());
$this->DataSource->FramedIPAddress->SetValue($this->FramedIPAddress->GetValue());
$this->DataSource->AcctStartDelay->SetValue($this->AcctStartDelay->GetValue());
$this->DataSource->AcctStopDelay->SetValue($this->AcctStopDelay->GetValue());
$this->DataSource->Insert();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterInsert", $this);
return (!$this->CheckErrors());
}
//End InsertRow Method
//UpdateRow Method @2-854EB998
function UpdateRow()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate", $this);
if(!$this->UpdateAllowed) return false;
$this->DataSource->AcctSessionId->SetValue($this->AcctSessionId->GetValue());
$this->DataSource->AcctUniqueId->SetValue($this->AcctUniqueId->GetValue());
$this->DataSource->UserName->SetValue($this->UserName->GetValue());
$this->DataSource->Realm->SetValue($this->Realm->GetValue());
$this->DataSource->NASIPAddress->SetValue($this->NASIPAddress->GetValue());
$this->DataSource->NASPortId->SetValue($this->NASPortId->GetValue());
$this->DataSource->NASPortType->SetValue($this->NASPortType->GetValue());
$this->DataSource->AcctStartTime->SetValue($this->AcctStartTime->GetValue());
$this->DataSource->AcctStopTime->SetValue($this->AcctStopTime->GetValue());
$this->DataSource->AcctSessionTime->SetValue($this->AcctSessionTime->GetValue());
$this->DataSource->AcctAuthentic->SetValue($this->AcctAuthentic->GetValue());
$this->DataSource->ConnectInfo_start->SetValue($this->ConnectInfo_start->GetValue());
$this->DataSource->ConnectInfo_stop->SetValue($this->ConnectInfo_stop->GetValue());
$this->DataSource->AcctInputOctets->SetValue($this->AcctInputOctets->GetValue());
$this->DataSource->AcctOutputOctets->SetValue($this->AcctOutputOctets->GetValue());
$this->DataSource->CalledStationId->SetValue($this->CalledStationId->GetValue());
$this->DataSource->CallingStationId->SetValue($this->CallingStationId->GetValue());
$this->DataSource->AcctTerminateCause->SetValue($this->AcctTerminateCause->GetValue());
$this->DataSource->ServiceType->SetValue($this->ServiceType->GetValue());
$this->DataSource->FramedProtocol->SetValue($this->FramedProtocol->GetValue());
$this->DataSource->FramedIPAddress->SetValue($this->FramedIPAddress->GetValue());
$this->DataSource->AcctStartDelay->SetValue($this->AcctStartDelay->GetValue());
$this->DataSource->AcctStopDelay->SetValue($this->AcctStopDelay->GetValue());
$this->DataSource->Update();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterUpdate", $this);
return (!$this->CheckErrors());
}
//End UpdateRow Method
//DeleteRow Method @2-299D98C3
function DeleteRow()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeDelete", $this);
if(!$this->DeleteAllowed) return false;
$this->DataSource->Delete();
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterDelete", $this);
return (!$this->CheckErrors());
}
//End DeleteRow Method
//Show Method @2-DA972432
function Show()
{
global $Tpl;
global $FileName;
global $CCSLocales;
$Error = "";
if(!$this->Visible)
return;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
$RecordBlock = "Record " . $this->ComponentName;
$ParentPath = $Tpl->block_path;
$Tpl->block_path = $ParentPath . "/" . $RecordBlock;
$this->EditMode = $this->EditMode && $this->ReadAllowed;
if($this->EditMode) {
if($this->DataSource->Errors->Count()){
$this->Errors->AddErrors($this->DataSource->Errors);
$this->DataSource->Errors->clear();
}
$this->DataSource->Open();
if($this->DataSource->Errors->Count() == 0 && $this->DataSource->next_record()) {
$this->DataSource->SetValues();
if(!$this->FormSubmitted){
$this->AcctSessionId->SetValue($this->DataSource->AcctSessionId->GetValue());
$this->AcctUniqueId->SetValue($this->DataSource->AcctUniqueId->GetValue());
$this->UserName->SetValue($this->DataSource->UserName->GetValue());
$this->Realm->SetValue($this->DataSource->Realm->GetValue());
$this->NASIPAddress->SetValue($this->DataSource->NASIPAddress->GetValue());
$this->NASPortId->SetValue($this->DataSource->NASPortId->GetValue());
$this->NASPortType->SetValue($this->DataSource->NASPortType->GetValue());
$this->AcctStartTime->SetValue($this->DataSource->AcctStartTime->GetValue());
$this->AcctStopTime->SetValue($this->DataSource->AcctStopTime->GetValue());
$this->AcctSessionTime->SetValue($this->DataSource->AcctSessionTime->GetValue());
$this->AcctAuthentic->SetValue($this->DataSource->AcctAuthentic->GetValue());
$this->ConnectInfo_start->SetValue($this->DataSource->ConnectInfo_start->GetValue());
$this->ConnectInfo_stop->SetValue($this->DataSource->ConnectInfo_stop->GetValue());
$this->AcctInputOctets->SetValue($this->DataSource->AcctInputOctets->GetValue());
$this->AcctOutputOctets->SetValue($this->DataSource->AcctOutputOctets->GetValue());
$this->CalledStationId->SetValue($this->DataSource->CalledStationId->GetValue());
$this->CallingStationId->SetValue($this->DataSource->CallingStationId->GetValue());
$this->AcctTerminateCause->SetValue($this->DataSource->AcctTerminateCause->GetValue());
$this->ServiceType->SetValue($this->DataSource->ServiceType->GetValue());
$this->FramedProtocol->SetValue($this->DataSource->FramedProtocol->GetValue());
$this->FramedIPAddress->SetValue($this->DataSource->FramedIPAddress->GetValue());
$this->AcctStartDelay->SetValue($this->DataSource->AcctStartDelay->GetValue());
$this->AcctStopDelay->SetValue($this->DataSource->AcctStopDelay->GetValue());
}
} else {
$this->EditMode = false;
}
}
if($this->FormSubmitted || $this->CheckErrors()) {
$Error = "";
$Error = ComposeStrings($Error, $this->AcctSessionId->Errors->ToString());
$Error = ComposeStrings($Error, $this->AcctUniqueId->Errors->ToString());
$Error = ComposeStrings($Error, $this->UserName->Errors->ToString());
$Error = ComposeStrings($Error, $this->Realm->Errors->ToString());
$Error = ComposeStrings($Error, $this->NASIPAddress->Errors->ToString());
$Error = ComposeStrings($Error, $this->NASPortId->Errors->ToString());
$Error = ComposeStrings($Error, $this->NASPortType->Errors->ToString());
$Error = ComposeStrings($Error, $this->AcctStartTime->Errors->ToString());
$Error = ComposeStrings($Error, $this->DatePicker_AcctStartTime->Errors->ToString());
$Error = ComposeStrings($Error, $this->AcctStopTime->Errors->ToString());
$Error = ComposeStrings($Error, $this->DatePicker_AcctStopTime->Errors->ToString());
$Error = ComposeStrings($Error, $this->AcctSessionTime->Errors->ToString());
$Error = ComposeStrings($Error, $this->AcctAuthentic->Errors->ToString());
$Error = ComposeStrings($Error, $this->ConnectInfo_start->Errors->ToString());
$Error = ComposeStrings($Error, $this->ConnectInfo_stop->Errors->ToString());
$Error = ComposeStrings($Error, $this->AcctInputOctets->Errors->ToString());
$Error = ComposeStrings($Error, $this->AcctOutputOctets->Errors->ToString());
$Error = ComposeStrings($Error, $this->CalledStationId->Errors->ToString());
$Error = ComposeStrings($Error, $this->CallingStationId->Errors->ToString());
$Error = ComposeStrings($Error, $this->AcctTerminateCause->Errors->ToString());
$Error = ComposeStrings($Error, $this->ServiceType->Errors->ToString());
$Error = ComposeStrings($Error, $this->FramedProtocol->Errors->ToString());
$Error = ComposeStrings($Error, $this->FramedIPAddress->Errors->ToString());
$Error = ComposeStrings($Error, $this->AcctStartDelay->Errors->ToString());
$Error = ComposeStrings($Error, $this->AcctStopDelay->Errors->ToString());
$Error = ComposeStrings($Error, $this->Errors->ToString());
$Error = ComposeStrings($Error, $this->DataSource->Errors->ToString());
$Tpl->SetVar("Error", $Error);
$Tpl->Parse("Error", false);
}
$CCSForm = $this->EditMode ? $this->ComponentName . ":" . "Edit" : $this->ComponentName;
$this->HTMLFormAction = $FileName . "?" . CCAddParam(CCGetQueryString("QueryString", ""), "ccsForm", $CCSForm);
$Tpl->SetVar("Action", $this->HTMLFormAction);
$Tpl->SetVar("HTMLFormName", $this->ComponentName);
$Tpl->SetVar("HTMLFormEnctype", $this->FormEnctype);
$this->Button_Insert->Visible = !$this->EditMode && $this->InsertAllowed;
$this->Button_Update->Visible = $this->EditMode && $this->UpdateAllowed;
$this->Button_Delete->Visible = $this->EditMode && $this->DeleteAllowed;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
if(!$this->Visible) {
$Tpl->block_path = $ParentPath;
return;
}
$this->AcctSessionId->Show();
$this->AcctUniqueId->Show();
$this->UserName->Show();
$this->Realm->Show();
$this->NASIPAddress->Show();
$this->NASPortId->Show();
$this->NASPortType->Show();
$this->AcctStartTime->Show();
$this->DatePicker_AcctStartTime->Show();
$this->AcctStopTime->Show();
$this->DatePicker_AcctStopTime->Show();
$this->AcctSessionTime->Show();
$this->AcctAuthentic->Show();
$this->ConnectInfo_start->Show();
$this->ConnectInfo_stop->Show();
$this->AcctInputOctets->Show();
$this->AcctOutputOctets->Show();
$this->CalledStationId->Show();
$this->CallingStationId->Show();
$this->AcctTerminateCause->Show();
$this->ServiceType->Show();
$this->FramedProtocol->Show();
$this->FramedIPAddress->Show();
$this->AcctStartDelay->Show();
$this->AcctStopDelay->Show();
$this->Button_Insert->Show();
$this->Button_Update->Show();
$this->Button_Delete->Show();
$Tpl->parse();
$Tpl->block_path = $ParentPath;
$this->DataSource->close();
}
//End Show Method
} //End radacct Class @2-FCB6E20C
class clsradacctDataSource extends clsDBConnection1 { //radacctDataSource Class @2-477E1887
//DataSource Variables @2-87CB922D
var $Parent = "";
var $CCSEvents = "";
var $CCSEventResult;
var $ErrorBlock;
var $CmdExecution;
var $InsertParameters;
var $UpdateParameters;
var $DeleteParameters;
var $wp;
var $AllParametersSet;
// Datasource fields
var $AcctSessionId;
var $AcctUniqueId;
var $UserName;
var $Realm;
var $NASIPAddress;
var $NASPortId;
var $NASPortType;
var $AcctStartTime;
var $AcctStopTime;
var $AcctSessionTime;
var $AcctAuthentic;
var $ConnectInfo_start;
var $ConnectInfo_stop;
var $AcctInputOctets;
var $AcctOutputOctets;
var $CalledStationId;
var $CallingStationId;
var $AcctTerminateCause;
var $ServiceType;
var $FramedProtocol;
var $FramedIPAddress;
var $AcctStartDelay;
var $AcctStopDelay;
//End DataSource Variables
//DataSourceClass_Initialize Event @2-0C986E55
function clsradacctDataSource(& $Parent)
{
$this->Parent = & $Parent;
$this->ErrorBlock = "Record radacct/Error";
$this->Initialize();
$this->AcctSessionId = new clsField("AcctSessionId", ccsText, "");
$this->AcctUniqueId = new clsField("AcctUniqueId", ccsText, "");
$this->UserName = new clsField("UserName", ccsText, "");
$this->Realm = new clsField("Realm", ccsText, "");
$this->NASIPAddress = new clsField("NASIPAddress", ccsText, "");
$this->NASPortId = new clsField("NASPortId", ccsInteger, "");
$this->NASPortType = new clsField("NASPortType", ccsText, "");
$this->AcctStartTime = new clsField("AcctStartTime", ccsDate, array("mm", "/", "dd", "/", "yyyy", " ", "HH", ":", "nn", ":", "ss"));
$this->AcctStopTime = new clsField("AcctStopTime", ccsDate, array("mm", "/", "dd", "/", "yyyy", " ", "HH", ":", "nn", ":", "ss"));
$this->AcctSessionTime = new clsField("AcctSessionTime", ccsInteger, "");
$this->AcctAuthentic = new clsField("AcctAuthentic", ccsText, "");
$this->ConnectInfo_start = new clsField("ConnectInfo_start", ccsText, "");
$this->ConnectInfo_stop = new clsField("ConnectInfo_stop", ccsText, "");
$this->AcctInputOctets = new clsField("AcctInputOctets", ccsInteger, "");
$this->AcctOutputOctets = new clsField("AcctOutputOctets", ccsInteger, "");
$this->CalledStationId = new clsField("CalledStationId", ccsText, "");
$this->CallingStationId = new clsField("CallingStationId", ccsText, "");
$this->AcctTerminateCause = new clsField("AcctTerminateCause", ccsText, "");
$this->ServiceType = new clsField("ServiceType", ccsText, "");
$this->FramedProtocol = new clsField("FramedProtocol", ccsText, "");
$this->FramedIPAddress = new clsField("FramedIPAddress", ccsText, "");
$this->AcctStartDelay = new clsField("AcctStartDelay", ccsInteger, "");
$this->AcctStopDelay = new clsField("AcctStopDelay", ccsInteger, "");
}
//End DataSourceClass_Initialize Event
//Prepare Method @2-2B7E46F6
function Prepare()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->wp = new clsSQLParameters($this->ErrorBlock);
$this->wp->AddParameter("1", "urlRadAcctId", ccsInteger, "", "", $this->Parameters["urlRadAcctId"], "", false);
$this->AllParametersSet = $this->wp->AllParamsSet();
$this->wp->Criterion[1] = $this->wp->Operation(opEqual, "RadAcctId", $this->wp->GetDBValue("1"), $this->ToSQL($this->wp->GetDBValue("1"), ccsInteger),false);
$this->Where =
$this->wp->Criterion[1];
}
//End Prepare Method
//Open Method @2-6C758107
function Open()
{
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildSelect", $this->Parent);
$this->SQL = "SELECT * " .
"FROM radacct {SQL_Where} {SQL_OrderBy}";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteSelect", $this->Parent);
$this->PageSize = 1;
$this->query($this->OptimizeSQL(CCBuildSQL($this->SQL, $this->Where, $this->Order)));
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteSelect", $this->Parent);
}
//End Open Method
//SetValues Method @2-E504D4D9
function SetValues()
{
$this->AcctSessionId->SetDBValue($this->f("AcctSessionId"));
$this->AcctUniqueId->SetDBValue($this->f("AcctUniqueId"));
$this->UserName->SetDBValue($this->f("UserName"));
$this->Realm->SetDBValue($this->f("Realm"));
$this->NASIPAddress->SetDBValue($this->f("NASIPAddress"));
$this->NASPortId->SetDBValue(trim($this->f("NASPortId")));
$this->NASPortType->SetDBValue($this->f("NASPortType"));
$this->AcctStartTime->SetDBValue(trim($this->f("AcctStartTime")));
$this->AcctStopTime->SetDBValue(trim($this->f("AcctStopTime")));
$this->AcctSessionTime->SetDBValue(trim($this->f("AcctSessionTime")));
$this->AcctAuthentic->SetDBValue($this->f("AcctAuthentic"));
$this->ConnectInfo_start->SetDBValue($this->f("ConnectInfo_start"));
$this->ConnectInfo_stop->SetDBValue($this->f("ConnectInfo_stop"));
$this->AcctInputOctets->SetDBValue(trim($this->f("AcctInputOctets")));
$this->AcctOutputOctets->SetDBValue(trim($this->f("AcctOutputOctets")));
$this->CalledStationId->SetDBValue($this->f("CalledStationId"));
$this->CallingStationId->SetDBValue($this->f("CallingStationId"));
$this->AcctTerminateCause->SetDBValue($this->f("AcctTerminateCause"));
$this->ServiceType->SetDBValue($this->f("ServiceType"));
$this->FramedProtocol->SetDBValue($this->f("FramedProtocol"));
$this->FramedIPAddress->SetDBValue($this->f("FramedIPAddress"));
$this->AcctStartDelay->SetDBValue(trim($this->f("AcctStartDelay")));
$this->AcctStopDelay->SetDBValue(trim($this->f("AcctStopDelay")));
}
//End SetValues Method
//Insert Method @2-CA2AFAE3
function Insert()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent);
$this->SQL = "INSERT INTO radacct ("
. "AcctSessionId, "
. "AcctUniqueId, "
. "UserName, "
. "Realm, "
. "NASIPAddress, "
. "NASPortId, "
. "NASPortType, "
. "AcctStartTime, "
. "AcctStopTime, "
. "AcctSessionTime, "
. "AcctAuthentic, "
. "ConnectInfo_start, "
. "ConnectInfo_stop, "
. "AcctInputOctets, "
. "AcctOutputOctets, "
. "CalledStationId, "
. "CallingStationId, "
. "AcctTerminateCause, "
. "ServiceType, "
. "FramedProtocol, "
. "FramedIPAddress, "
. "AcctStartDelay, "
. "AcctStopDelay"
. ") VALUES ("
. $this->ToSQL($this->AcctSessionId->GetDBValue(), $this->AcctSessionId->DataType) . ", "
. $this->ToSQL($this->AcctUniqueId->GetDBValue(), $this->AcctUniqueId->DataType) . ", "
. $this->ToSQL($this->UserName->GetDBValue(), $this->UserName->DataType) . ", "
. $this->ToSQL($this->Realm->GetDBValue(), $this->Realm->DataType) . ", "
. $this->ToSQL($this->NASIPAddress->GetDBValue(), $this->NASIPAddress->DataType) . ", "
. $this->ToSQL($this->NASPortId->GetDBValue(), $this->NASPortId->DataType) . ", "
. $this->ToSQL($this->NASPortType->GetDBValue(), $this->NASPortType->DataType) . ", "
. $this->ToSQL($this->AcctStartTime->GetDBValue(), $this->AcctStartTime->DataType) . ", "
. $this->ToSQL($this->AcctStopTime->GetDBValue(), $this->AcctStopTime->DataType) . ", "
. $this->ToSQL($this->AcctSessionTime->GetDBValue(), $this->AcctSessionTime->DataType) . ", "
. $this->ToSQL($this->AcctAuthentic->GetDBValue(), $this->AcctAuthentic->DataType) . ", "
. $this->ToSQL($this->ConnectInfo_start->GetDBValue(), $this->ConnectInfo_start->DataType) . ", "
. $this->ToSQL($this->ConnectInfo_stop->GetDBValue(), $this->ConnectInfo_stop->DataType) . ", "
. $this->ToSQL($this->AcctInputOctets->GetDBValue(), $this->AcctInputOctets->DataType) . ", "
. $this->ToSQL($this->AcctOutputOctets->GetDBValue(), $this->AcctOutputOctets->DataType) . ", "
. $this->ToSQL($this->CalledStationId->GetDBValue(), $this->CalledStationId->DataType) . ", "
. $this->ToSQL($this->CallingStationId->GetDBValue(), $this->CallingStationId->DataType) . ", "
. $this->ToSQL($this->AcctTerminateCause->GetDBValue(), $this->AcctTerminateCause->DataType) . ", "
. $this->ToSQL($this->ServiceType->GetDBValue(), $this->ServiceType->DataType) . ", "
. $this->ToSQL($this->FramedProtocol->GetDBValue(), $this->FramedProtocol->DataType) . ", "
. $this->ToSQL($this->FramedIPAddress->GetDBValue(), $this->FramedIPAddress->DataType) . ", "
. $this->ToSQL($this->AcctStartDelay->GetDBValue(), $this->AcctStartDelay->DataType) . ", "
. $this->ToSQL($this->AcctStopDelay->GetDBValue(), $this->AcctStopDelay->DataType)
. ")";
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteInsert", $this->Parent);
if($this->Errors->Count() == 0 && $this->CmdExecution) {
$this->query($this->SQL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteInsert", $this->Parent);
}
}
//End Insert Method
//Update Method @2-0053D20B
function Update()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent);
$this->SQL = "UPDATE radacct SET "
. "AcctSessionId=" . $this->ToSQL($this->AcctSessionId->GetDBValue(), $this->AcctSessionId->DataType) . ", "
. "AcctUniqueId=" . $this->ToSQL($this->AcctUniqueId->GetDBValue(), $this->AcctUniqueId->DataType) . ", "
. "UserName=" . $this->ToSQL($this->UserName->GetDBValue(), $this->UserName->DataType) . ", "
. "Realm=" . $this->ToSQL($this->Realm->GetDBValue(), $this->Realm->DataType) . ", "
. "NASIPAddress=" . $this->ToSQL($this->NASIPAddress->GetDBValue(), $this->NASIPAddress->DataType) . ", "
. "NASPortId=" . $this->ToSQL($this->NASPortId->GetDBValue(), $this->NASPortId->DataType) . ", "
. "NASPortType=" . $this->ToSQL($this->NASPortType->GetDBValue(), $this->NASPortType->DataType) . ", "
. "AcctStartTime=" . $this->ToSQL($this->AcctStartTime->GetDBValue(), $this->AcctStartTime->DataType) . ", "
. "AcctStopTime=" . $this->ToSQL($this->AcctStopTime->GetDBValue(), $this->AcctStopTime->DataType) . ", "
. "AcctSessionTime=" . $this->ToSQL($this->AcctSessionTime->GetDBValue(), $this->AcctSessionTime->DataType) . ", "
. "AcctAuthentic=" . $this->ToSQL($this->AcctAuthentic->GetDBValue(), $this->AcctAuthentic->DataType) . ", "
. "ConnectInfo_start=" . $this->ToSQL($this->ConnectInfo_start->GetDBValue(), $this->ConnectInfo_start->DataType) . ", "
. "ConnectInfo_stop=" . $this->ToSQL($this->ConnectInfo_stop->GetDBValue(), $this->ConnectInfo_stop->DataType) . ", "
. "AcctInputOctets=" . $this->ToSQL($this->AcctInputOctets->GetDBValue(), $this->AcctInputOctets->DataType) . ", "
. "AcctOutputOctets=" . $this->ToSQL($this->AcctOutputOctets->GetDBValue(), $this->AcctOutputOctets->DataType) . ", "
. "CalledStationId=" . $this->ToSQL($this->CalledStationId->GetDBValue(), $this->CalledStationId->DataType) . ", "
. "CallingStationId=" . $this->ToSQL($this->CallingStationId->GetDBValue(), $this->CallingStationId->DataType) . ", "
. "AcctTerminateCause=" . $this->ToSQL($this->AcctTerminateCause->GetDBValue(), $this->AcctTerminateCause->DataType) . ", "
. "ServiceType=" . $this->ToSQL($this->ServiceType->GetDBValue(), $this->ServiceType->DataType) . ", "
. "FramedProtocol=" . $this->ToSQL($this->FramedProtocol->GetDBValue(), $this->FramedProtocol->DataType) . ", "
. "FramedIPAddress=" . $this->ToSQL($this->FramedIPAddress->GetDBValue(), $this->FramedIPAddress->DataType) . ", "
. "AcctStartDelay=" . $this->ToSQL($this->AcctStartDelay->GetDBValue(), $this->AcctStartDelay->DataType) . ", "
. "AcctStopDelay=" . $this->ToSQL($this->AcctStopDelay->GetDBValue(), $this->AcctStopDelay->DataType);
$this->SQL = CCBuildSQL($this->SQL, $this->Where, "");
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteUpdate", $this->Parent);
if($this->Errors->Count() == 0 && $this->CmdExecution) {
$this->query($this->SQL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteUpdate", $this->Parent);
}
}
//End Update Method
//Delete Method @2-BBA21429
function Delete()
{
global $CCSLocales;
global $DefaultDateFormat;
$this->CmdExecution = true;
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete", $this->Parent);
$this->SQL = "DELETE FROM radacct";
$this->SQL = CCBuildSQL($this->SQL, $this->Where, "");
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteDelete", $this->Parent);
if($this->Errors->Count() == 0 && $this->CmdExecution) {
$this->query($this->SQL);
$this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteDelete", $this->Parent);
}
}
//End Delete Method
} //End radacctDataSource Class @2-FCB6E20C
//Include Page implementation @33-58DBA1E3
include_once(RelativePath . "/Footer.php");
//End Include Page implementation
//Initialize Page @1-6FBD4A15
// Variables
$FileName = "";
$Redirect = "";
$Tpl = "";
$TemplateFileName = "";
$BlockToParse = "";
$ComponentName = "";
// Events;
$CCSEvents = "";
$CCSEventResult = "";
$FileName = FileName;
$Redirect = "";
$TemplateFileName = "radacct_maint.html";
$BlockToParse = "main";
$TemplateEncoding = "CP1252";
$PathToRoot = "./";
//End Initialize Page
//Initialize Objects @1-9932B9C4
$DBConnection1 = new clsDBConnection1();
$MainPage->Connections["Connection1"] = & $DBConnection1;
// Controls
$Header = & new clsHeader("", "Header", $MainPage);
$Header->Initialize();
$radacct = & new clsRecordradacct("", $MainPage);
$Footer = & new clsFooter("", "Footer", $MainPage);
$Footer->Initialize();
$MainPage->Header = & $Header;
$MainPage->radacct = & $radacct;
$MainPage->Footer = & $Footer;
$radacct->Initialize();
$CCSEventResult = CCGetEvent($CCSEvents, "AfterInitialize", $MainPage);
$Charset = $Charset ? $Charset : "windows-1252";
if ($Charset)
header("Content-Type: text/html; charset=" . $Charset);
//End Initialize Objects
//Initialize HTML Template @1-8F4531F3
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView", $MainPage);
$Tpl = new clsTemplate($FileEncoding, $TemplateEncoding);
$Tpl->LoadTemplate(PathToCurrentPage . $TemplateFileName, $BlockToParse, "CP1252");
$Tpl->block_path = "/$BlockToParse";
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow", $MainPage);
//End Initialize HTML Template
//Execute Components @1-47B4B4C7
$Header->Operations();
$radacct->Operation();
$Footer->Operations();
//End Execute Components
//Go to destination page @1-7522FE99
if($Redirect)
{
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBConnection1->close();
header("Location: " . $Redirect);
$Header->Class_Terminate();
unset($Header);
unset($radacct);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
exit;
}
//End Go to destination page
//Show Page @1-DFA6BC2C
$Header->Show();
$radacct->Show();
$Footer->Show();
$Tpl->block_path = "";
$Tpl->Parse($BlockToParse, false);
$main_block = $Tpl->GetVar($BlockToParse);
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeOutput", $MainPage);
if ($CCSEventResult) echo $main_block;
//End Show Page
//Unload Page @1-C9BA6218
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
$DBConnection1->close();
$Header->Class_Terminate();
unset($Header);
unset($radacct);
$Footer->Class_Terminate();
unset($Footer);
unset($Tpl);
//End Unload Page
?>
|