function ValueOf($Value) { #------------------------------------------------------------------------------- $Type = GetType($Value); #------------------------------------------------------------------------------- switch ($Type) { case 'integer': #------------------------------------------------------------------------------- if (Is_Error($Value)) { $Type = 'error'; } #------------------------------------------------------------------------------- break; #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- case 'boolean': #------------------------------------------------------------------------------- $Type = $Value ? 'true' : 'false'; #------------------------------------------------------------------------------- break; #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- case 'object': #------------------------------------------------------------------------------- if (Get_Class($Value) == 'gException' || Get_Class($Value) == 'jException') { return 'exception'; } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- return $Type; #------------------------------------------------------------------------------- }
public function getParams() { #$Message = Preg_Replace("#\[hidden\](.+)\[/hidden\]#sU", ' ', $this->params['Message'], -1); $Message = Comp_Load('Edesks/Text', array('String' => $this->params['Message'], 'IsEmail' => TRUE)); if (Is_Error($Message)) { return ERROR | @Trigger_Error(500); } $this->params['Message'] = $Message; return $this->params; }
function Comp_Load($Element) { /****************************************************************************/ $__args_types = array('string', '*'); #----------------------------------------------------------------------------- $__args__ = Func_Get_Args(); eval(FUNCTION_INIT); /****************************************************************************/ $HostsIDs = System_HostsIDs(SPrintF('comp/%s.comp.php', $Element)); if (Is_Error($HostsIDs)) { return ERROR | @Trigger_Error('[Comp_Load]: не возможно найти компонент'); } #----------------------------------------------------------------------------- $IsCascade = In_Array(COMP_ALL_HOSTS, $__args__, TRUE); #----------------------------------------------------------------------------- if ($IsCascade) { $HostsIDs = Array_Reverse($HostsIDs); } #----------------------------------------------------------------------------- $Result = array(); #----------------------------------------------------------------------------- foreach ($HostsIDs as $HostID) { #--------------------------------------------------------------------------- $Path = SPrintF('%s/hosts/%s/comp/%s.comp.php', SYSTEM_PATH, $HostID, $Element); #--------------------------------------------------------------------------- if (Is_Dir($Path)) { return ERROR | @Trigger_Error('[Comp_Load]: объект не является компонентом'); } #--------------------------------------------------------------------------- $Args = $__args__; #--------------------------------------------------------------------------- Array_UnShift($Args, $Path); #--------------------------------------------------------------------------- $Comp = Call_User_Func_Array('LoadComp', $Args); if (Is_Error($Comp)) { return ERROR | @Trigger_Error('[Comp_Load]: не возможно загрузить компонент'); } #--------------------------------------------------------------------------- if ($IsCascade) { $Result[] = $Comp; } else { #------------------------------------------------------------------------- $Result = $Comp; #------------------------------------------------------------------------- break; } } #----------------------------------------------------------------------------- $Loaded =& Link_Get('Comp/Loaded', 'array'); #----------------------------------------------------------------------------- $Loaded[] = $Element; #----------------------------------------------------------------------------- return $Result; }
function &Messages() { #----------------------------------------------------------------------------- $Name = Md5('Messages'); #----------------------------------------------------------------------------- if (!isset($GLOBALS[$Name])) { #--------------------------------------------------------------------------- $GLOBALS[$Name] = System_XML('config/Messages.xml'); if (Is_Error($GLOBALS[$Name])) { return ERROR | Trigger_Error('[Messages]: не удалось загрузить файл сообщений'); } } #----------------------------------------------------------------------------- return $GLOBALS[$Name]; }
function &Regulars() { #----------------------------------------------------------------------------- $Name = Md5('Regulars'); #----------------------------------------------------------------------------- if (!isset($GLOBALS[$Name])) { #--------------------------------------------------------------------------- $GLOBALS[$Name] = System_XML('config/Regulars.xml'); if (Is_Error($GLOBALS[$Name])) { return ERROR | Trigger_Error('[Regulars]: не удалось загрузить файл регулярных выражений'); } } #----------------------------------------------------------------------------- return $GLOBALS[$Name]; }
function smarty_function_menu_left($params, $smarty) { $MenuPath = $params['MenuPath']; if (!$MenuPath) { return FALSE; } $XML = Styles_Menu($MenuPath); if (Is_Error($XML)) { return ERROR | @Trigger_Error(500); } $items = $XML['Items']; if (!Count($items)) { return FALSE; } //echo print_r($items); $smarty->assign('items', array_values($items)); $smarty->display('Menus/Left.tpl'); }
function &Config() { #------------------------------------------------------------------------------- $Name = Md5('Config'); #------------------------------------------------------------------------------- if (!isset($GLOBALS[$Name])) { #------------------------------------------------------------------------------- $GLOBALS[$Name] = System_XML('config/Config.xml'); if (Is_Error($GLOBALS[$Name])) { return ERROR | Trigger_Error('[Config]: не удалось загрузить основную конфигурацию'); } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- return $GLOBALS[$Name]; #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- }
function smarty_function_table($params, $smarty) { $tableName = $params['name']; if (!$tableName) { return ""; } $DOM = new DOM(); $Links =& Links(); # Коллекция ссылок $Links['DOM'] =& $DOM; $comp = Comp_Load('Tables/Super', $tableName); if (Is_Error($comp)) { return ERROR | @Trigger_Error(500); } $DOM->Object = $comp; $Out = $DOM->Build(); if (Is_Error($Out)) { return ERROR | @Trigger_Error(500); } return $Out; }
function TemplateReplace($Text, $Params = array(), $NoBody = TRUE) { #------------------------------------------------------------------------------- $Text = Trim($Text); #------------------------------------------------------------------------------- # проверяем что нам сунули - текст или файл if (!Preg_Match('/\\s/', $Text)) { #------------------------------------------------------------------------------- # достаём текст из файла $Path = System_Element(SPrintF('templates/modules/%s.html', $Text)); #------------------------------------------------------------------------------- if (Is_Error($Path)) { #------------------------------------------------------------------------------- $Text = SprintF('Отсутствует шаблон сообщения (templates/modules/%s.html)', $Text); #------------------------------------------------------------------------------- } else { #------------------------------------------------------------------------------- $Text = Trim(IO_Read($Path)); #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- if ($NoBody) { $Text = SPrintF('<NOBODY><SPAN>%s</SPAN></NOBODY>', $Text); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Replace = Array_ToLine($Params, '%'); #------------------------------------------------------------------------------- foreach (Array_Keys($Replace) as $Key) { $Text = Str_Replace($Key, $Replace[$Key], $Text); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- return $Text; #------------------------------------------------------------------------------- }
function smarty_function_top_panel($params, $smarty) { if (isset($GLOBALS['__USER'])) { $__USER = $GLOBALS['__USER']; if (Is_Null($__USER)) { return ERROR | @Trigger_Error(400); } $menuPath = SPrintF('%s/TopPanel', $__USER['InterfaceID']); $items = Styles_Menu($menuPath); if (Is_Error($items)) { return ERROR | @Trigger_Error(500); } $items =& $items['Items']; //return print_r(array_values($items)); $smarty->assign('items', array_values($items)); $__USER = $GLOBALS['__USER']; $smarty->assign('userName', $__USER['Name']); $smarty->display('TopPanel/User.tpl'); } else { $smarty->display('TopPanel/Logon.tpl'); } }
<?php #------------------------------------------------------------------------------- /** @author Великодный В.В. (Joonte Ltd.) */ #------------------------------------------------------------------------------- $Path = Styles_Element('Images/Icon.png'); if (Is_Error($Path)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $Icon = IO_Read($Path); if (Is_Error($Icon)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- Header('Content-Type: image/png'); #------------------------------------------------------------------------------- return $Icon; #-------------------------------------------------------------------------------
#------------------------------------------------------------------------------- $Params = Array_ToLine($Config); #------------------------------------------------------------------------------- foreach (Array_Keys($Params) as $Key) { if (!In_Array($Key, $ShareConfigsParams)) { $ShareConfigsParams[] = $Key; } } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Config = System_XML('config/Config.xml', array(HOST_ID)); if (Is_Error($Config)) { return new gException('ERROR_TEMPLATE_LOAD', 'Ошибка загрузки шаблона'); } #------------------------------------------------------------------------------- $Params = Array_ToLine($Config); #------------------------------------------------------------------------------- foreach (Array_Keys($Params) as $Key) { #------------------------------------------------------------------------------- if (!In_Array($Key, $ShareConfigsParams)) { #------------------------------------------------------------------------------- Debug(SPrintF('[comp/Tasks/GC/CheckConfigParams]: в конфигурационном файле обнаружен не используемый параметр: %s', $Key)); #------------------------------------------------------------------------------- if ($Settings['IsEvent']) { #------------------------------------------------------------------------------- $Event = array('IsReaded' => FALSE, 'PriorityID' => 'System', 'Text' => SPrintF('Обнаружен неиспользуемый параметр конфигурационного файла: %s, со значением (%s). Удалите его, или отключите задачу поиска неиспользуемых параметров. При удалении, будте аккуратны и внимательны, сохраняйте бэкап конфигурационного файла.', $Key, $Params[$Key])); $Event = Comp_Load('Events/EventInsert', $Event);
/******************************************************************************/ /******************************************************************************/ eval(COMP_INIT); /******************************************************************************/ /******************************************************************************/ $Tmp = System_Element('tmp'); if (Is_Error($Tmp)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $Folder = SPrintF('%s/files', $Tmp); #------------------------------------------------------------------------------- if (File_Exists($Folder)) { #----------------------------------------------------------------------------- $Files = IO_Scan($Folder); if (Is_Error($Files)) { return ERROR | @Trigger_Error(500); } #----------------------------------------------------------------------------- foreach ($Files as $File) { #--------------------------------------------------------------------------- $Path = SPrintF('%s/%s', $Folder, $File); #--------------------------------------------------------------------------- if (Time() - FileMTime($Path) > 86400) { #------------------------------------------------------------------------- if (!@UnLink($Path)) { return ERROR | @Trigger_Error(SPrintF('[comp/Tasks/Temp]: не удалось удалить файл (%s)', $Path)); } } } }
if (Is_Error(DB_Transaction($TransactionID = UniqID('comp/Tasks/GC/SetDeletedWaitingInvoice')))) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------- $Comp = Comp_Load('www/API/StatusSet', array('ModeID' => 'Invoices', 'StatusID' => 'Rejected', 'RowsIDs' => $Invoice['ID'], 'Comment' => SPrintF('Автоматическая отмена счёта, неоплачен более %d дней', $Params['Invoices']['DaysBeforeDeleted']))); #------------------------------------------------------------------------- switch (ValueOf($Comp)) { case 'array': $Event = array('UserID' => $Invoice['UserID'], 'PriorityID' => 'Billing', 'Text' => SPrintF('Автоматическая отмена счёта #%d, неоплачен более %d дней', $Invoice['ID'], $Params['Invoices']['DaysBeforeDeleted'])); $Event = Comp_Load('Events/EventInsert', $Event); if (!$Event) { return ERROR | @Trigger_Error(500); } break; default: return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------- if (Is_Error(DB_Commit($TransactionID))) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------- } $Count = DB_Count('Invoices', array('Where' => $Where)); if (Is_Error($Count)) { return ERROR | @Trigger_Error(500); } return $Count ? $Count : TRUE; default: return ERROR | @Trigger_Error(101); }
Debug(SPrintF('[comp/Invoices/PaymentSystems/Uniteller]: статус "%s", счёт #%u проигнорирован', $Args['Status'], $Args['Order_ID'])); return "OK\n"; #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Comp = Comp_Load('www/API/StatusSet', array('ModeID' => 'Invoices', 'StatusID' => $StatusID, 'RowsIDs' => $InvoiceID, 'Comment' => $Comment)); #------------------------------------------------------------------------------- switch (ValueOf($Comp)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': return ERROR | @Trigger_Error(400); case 'array': break; default: return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # если была транзакция - коммитим if (isset($TransactionID)) { if (Is_Error(DB_Commit($TransactionID))) { return ERROR | @Trigger_Error(500); } } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- return "OK\n"; #------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
case 'exception': return ERROR | @Trigger_Error(400); case 'array': break; default: return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- if (!$Settings['IsEvent']) { continue; } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Summ = Comp_Load('Formats/Currency', $Summ); if (Is_Error($Summ)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $Event = array('UserID' => $User['ID'], 'PriorityID' => 'Billing', 'IsReaded' => FALSE, 'Text' => SPrintF('Автоматическое списание средств (%s) у неактивного пользователя', $Summ)); $Event = Comp_Load('Events/EventInsert', $Event); if (!$Event) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- return TRUE; #------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
public function GetDiskUsage() { /****************************************************************************/ $__args__ = Func_Get_Args(); eval(FUNCTION_INIT); /****************************************************************************/ Array_UnShift($__args__, $this->Settings); #----------------------------------------------------------------------------- $Function = SPrintF('%s_Get_Disk_Usage', $this->SystemID); #----------------------------------------------------------------------------- if (!Function_Exists($Function)) { return new gException('FUNCTION_NOT_SUPPORTED', SPrintF('Функция (%s) не поддерживается API модулем', $Function)); } #----------------------------------------------------------------------------- $Result = Call_User_Func_Array($Function, $__args__); if (Is_Error($Result)) { return ERROR | @Trigger_Error('[HostingServer->GetDiskUsage]: не удалось вызвать целевую функцию'); } #----------------------------------------------------------------------------- return $Result; }
eval(COMP_INIT); /******************************************************************************/ /******************************************************************************/ $Args = isset($Args) ? $Args : Args(); #------------------------------------------------------------------------------- $id = (int) @$Args['id']; # elid лицензии $elid = (string) @$Args['elid']; # происходящее событие $module = (string) @$Args['module']; $IP = (string) @$_SERVER['REMOTE_ADDR']; #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- Debug(SPrintF('[comp/www/API/ISPswSettingURL]: id = "%s"; elid = "%s"; module = "%s"', $id, $elid, $module)); #------------------------------------------------------------------------------- if (Is_Error(System_Load('libs/XXTEA.php'))) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- if ($id < 1) { return new gException('ID_NOT_SET', 'Не задан идентификатор лицензии'); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- if ($elid != 'install') { return new gException('IS_NOT_INSTALL', 'Работает только при инсталляции'); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- if ($module != 'dns') {
<?php #------------------------------------------------------------------------------- /** @author Alex Keda, for www.host-food.ru */ /******************************************************************************/ /******************************************************************************/ $__args_list = array('Task', 'DNSmanagerOrderID'); /******************************************************************************/ eval(COMP_INIT); /******************************************************************************/ /******************************************************************************/ if (Is_Error(System_Load('classes/DNSmanagerServer.class.php'))) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $Columns = array('ID', 'UserID', 'Login', '(SELECT `ServerID` FROM `OrdersOwners` WHERE `OrdersOwners`.`ID` = `DNSmanagerOrdersOwners`.`OrderID`) AS `ServerID`', '(SELECT `IsReselling` FROM `DNSmanagerSchemes` WHERE `DNSmanagerSchemes`.`ID` = `DNSmanagerOrdersOwners`.`SchemeID`) as `IsReselling`', '(SELECT `Name` FROM `DNSmanagerSchemes` WHERE `DNSmanagerSchemes`.`ID` = `DNSmanagerOrdersOwners`.`SchemeID`) as `SchemeName`'); $DNSmanagerOrder = DB_Select('DNSmanagerOrdersOwners', $Columns, array('UNIQ', 'ID' => $DNSmanagerOrderID)); #------------------------------------------------------------------------------- switch (ValueOf($DNSmanagerOrder)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': return ERROR | @Trigger_Error(400); case 'array': #------------------------------------------------------------------------------- $ClassDNSmanagerServer = new DNSmanagerServer(); #------------------------------------------------------------------------------- $IsSelected = $ClassDNSmanagerServer->Select((int) $DNSmanagerOrder['ServerID']); #------------------------------------------------------------------------------- switch (ValueOf($IsSelected)) { case 'error':
$NewUserID = $MaxUserID['ID']; } #------------------------------------------------------------------------------- foreach ($OldUserIDs as $OldUserID) { $NewUserID++; # меняем ID юзера $IsUpdate = DB_Update('Users', array('ID' => $NewUserID), array('ID' => $OldUserID['ID'])); if (Is_Error($IsUpdate)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- # Events $IsUpdate = DB_Update('Events', array('UserID' => $NewUserID), array('Where' => SPrintF('`UserID` = %u', $OldUserID['ID']))); if (Is_Error($IsUpdate)) { return ERROR | @Trigger_Error(500); } # RequestLog $IsUpdate = DB_Update('RequestLog', array('UserID' => $NewUserID), array('Where' => SPrintF('`UserID` = %u', $OldUserID['ID']))); if (Is_Error($IsUpdate)) { return ERROR | @Trigger_Error(500); } } #------------------------------------------------------------------------------- $MaxID = DB_Query(SPrintF('ALTER TABLE `Users` AUTO_INCREMENT=%u;', $NewUserID + 2)); if (Is_Error($MaxID)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- return TRUE; #-------------------------------------------------------------------------------
} #------------------------------------------------------------------------------- $Comp = Comp_Load('Buttons/Panel', array('Comp' => $Comp, 'Name' => 'Новый тариф')); if (Is_Error($Comp)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $NoBody = new Tag('NOBODY', $Comp); #------------------------------------------------------------------------------- $Comp = Comp_Load('Tables/Super', 'VPSSchemes'); if (Is_Error($Comp)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $NoBody->AddChild($Comp); #------------------------------------------------------------------------------- $Comp = Comp_Load('Tab', 'Administrator/VPS', $NoBody); if (Is_Error($Comp)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $DOM->AddChild('Into', $Comp); #------------------------------------------------------------------------------- $Out = $DOM->Build(); #------------------------------------------------------------------------------- if (Is_Error($Out)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- return $Out; #-------------------------------------------------------------------------------
$Notice = DB_Select(SPrintF('%sOwners', $TableID), array('ID', 'UserNotice', 'UserID'), array('UNIQ', 'ID' => $RowID)); #------------------------------------------------------------------------------- switch (ValueOf($Notice)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': return ERROR | @Trigger_Error(400); case 'array': #------------------------------------------------------------------------------- if ($GLOBALS['__USER']['ID'] != $Notice['UserID']) { if (!$GLOBALS['__USER']['IsAdmin']) { return ERROR | @Trigger_Error(700); } } #------------------------------------------------------------------------------- break; default: return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $IsUpdate = DB_Update($TableID, array('UserNotice' => $UserNotice), array('ID' => $RowID)); #------------------------------------------------------------------------------- if (Is_Error($IsUpdate)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- return array('Status' => 'Ok'); #------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
$Server = array('TemplateID' => 'EmailClient', 'IsActive' => TRUE, 'IsDefault' => TRUE, 'Protocol' => isset($CheckEmail['UseSSL']) ? $CheckEmail['UseSSL'] ? 'ssl' : 'tcp' : 'ssl', 'Address' => isset($CheckEmail['CheckEmailServer']) ? $CheckEmail['CheckEmailServer'] : 'pop.yandex.ru', 'Port' => 110, 'Login' => isset($CheckEmail['CheckEmailLogin']) ? $CheckEmail['CheckEmailLogin'] : '', 'Password' => isset($CheckEmail['CheckEmailPassword']) ? $CheckEmail['CheckEmailPassword'] : '', 'Params' => array('Method' => isset($CheckEmail['CheckEmailProtocol']) ? $CheckEmail['CheckEmailProtocol'] : 'pop3'), 'AdminNotice' => 'Используется учётная запись от которой шлёт сообщения биллинг (пользователь с идентификатором 100)', 'SortID' => 100000, 'Monitoring' => "POP3=110\nPOP3S=995\nIMAP4=143\nIMAP4S=993"); #------------------------------------------------------------------------------- $IsInsert = DB_Insert('Servers', $Server); if (Is_Error($IsInsert)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- unset($Config['Tasks']['Types']['CheckEmail']['UseSSL']); unset($Config['Tasks']['Types']['CheckEmail']['CheckEmailServer']); unset($Config['Tasks']['Types']['CheckEmail']['CheckEmailLogin']); unset($Config['Tasks']['Types']['CheckEmail']['CheckEmailPassword']); unset($Config['Tasks']['Types']['CheckEmail']['CheckEmailProtocol']); #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $File = IO_Write($ConfigPath, To_XML_String($Config), TRUE); if (Is_Error($File)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $IsFlush = CacheManager::flush(); if (!$IsFlush) { @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- return TRUE; #------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
$Order = DB_Select(SPrintF('%sOrdersOwners', $OrdersTransfer['Code'] == 'Default' ? '' : $OrdersTransfer['Code']), array('*'), array('UNIQ', 'ID' => $OrdersTransfer['ServiceOrderID'])); #------------------------------------------------------------------------------- switch (ValueOf($Order)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': #------------------------------------------------------------------------------- return $Result; #return ERROR | @Trigger_Error(400); #------------------------------------------------------------------------------- #return ERROR | @Trigger_Error(400); #------------------------------------------------------------------------------- case 'array': #------------------------------------------------------------------------------- $OrderID = Comp_Load('Formats/Order/Number', isset($Order['OrderID']) ? $Order['OrderID'] : $Order['ID']); if (Is_Error($OrderID)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $Params = array('User' => $User, 'OrdersTransfer' => $OrdersTransfer, 'Order' => $Order, 'OrderID' => isset($Order['OrderID']) ? $Order['OrderID'] : $Order['ID']); #------------------------------------------------------------------------------- $NoBody = new Tag('NOBODY'); #------------------------------------------------------------------------------- # No more... break; #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- default: return ERROR | @Trigger_Error(101); } #-------------------------------------------------------------------------------
/** * Формирует объект * * Сформировывает объект класса DOM и подготавливает к выводу в браузер. После * вызова этой функции переменная, куда записывался результат выполнения функции * выводится с помощью оператора echo. * * @param boolean <необходимость преобразования в XML строку> */ public function Build($IsToXML = TRUE) { #----------------------------------------------------------------------------- if ($this->TemplateID) { #--------------------------------------------------------------------------- $Trigger = SPrintF('Triggers/DOM/After/%s', $this->TemplateID); #--------------------------------------------------------------------------- if (!Is_Error(System_Element(SPrintF('comp/%s.comp.php', $Trigger)))) { #------------------------------------------------------------------------- $LinkID = UniqID('DOM-'); #------------------------------------------------------------------------- $Links =& Links(); # Коллекция ссылок $Links[$LinkID] =& $this; #------------------------------------------------------------------------- if (Is_Error(Comp_Load($Trigger, $LinkID, COMP_ALL_HOSTS))) { return ERROR | @Trigger_Error('[DOM->Build]: ошибка загрузки предобработчика'); } #------------------------------------------------------------------------- unset($Links[$LinkID]); } } #----------------------------------------------------------------------------- # Номализация документа $this->Normalize(); #----------------------------------------------------------------------------- $this->Apply('Sources'); #----------------------------------------------------------------------------- if ($IsToXML) { #--------------------------------------------------------------------------- $Result = $this->Object->ToXMLString(); if (Is_Error($Result)) { return ERROR | Trigger_Error('[DOM->Build]: не удалось преобразовать DOM в строку'); } #--------------------------------------------------------------------------- return SPrintF("<!-- Joonte Billing System http://www.joonte.com -->\n%s", $Result); } #----------------------------------------------------------------------------- return TRUE; }
case 'string': #--------------------------------------------------- $Comp = Comp_Load('Formats/WorkComplite/Report/Number', $ContractID, $Month); if (Is_Error($Comp)) { return ERROR | @Trigger_Error(500); } #--------------------------------------------------- $Tmp = System_Element('tmp'); if (Is_Error($Tmp)) { return ERROR | @Trigger_Error(500); } #--------------------------------------------------- $File = SPrintF('Report%s.pdf', Md5($_SERVER['REMOTE_ADDR'])); #--------------------------------------------------- $IsWrite = IO_Write(SPrintF('%s/files/%s', $Tmp, $File), $PDF, TRUE); if (Is_Error($IsWrite)) { return ERROR | @Trigger_Error(500); } #--------------------------------------------------- $Location = SPrintF('/GetTemp?File=%s&Name=Report%s.pdf&Mime=application/pdf', $File, $Comp); #--------------------------------------------------- if (!XML_HTTP_REQUEST) { #------------------------------------------------- Header(SPrintF('Location: %s', $Location)); #------------------------------------------------- return TRUE; } #--------------------------------------------------- return array('Status' => 'Ok', 'Location' => $Location); default: return ERROR | @Trigger_Error(101);
#------------------------------------------------------------------------------- $Div->AddChild($Comp); #------------------------------------------------------------------------------- $Table[] = $Div; #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Comp = Comp_Load('Tables/Standard', $Table); if (Is_Error($Comp)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $Form = new Tag('FORM', array('name' => 'DSSchemeEditForm', 'onsubmit' => 'return false;'), $Comp); #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Comp = Comp_Load('Form/Input', array('name' => 'DSSchemeID', 'type' => 'hidden', 'value' => $DSSchemeID)); if (Is_Error($Comp)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $Form->AddChild($Comp); #------------------------------------------------------------------------------- $DOM->AddChild('Into', $Form); #------------------------------------------------------------------------------- if (Is_Error($DOM->Build(FALSE))) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- return array('Status' => 'Ok', 'DOM' => $DOM->Object); #------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#------------------------------------------------------------------------------- switch (ValueOf($IsAdd)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': return ERROR | @Trigger_Error(400); case 'array': break; default: return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # время срабатывания задачи на разблокировку $UnLockOverlimitsTime = Comp_Load('Formats/Task/ExecuteTime', array('ExecuteTime' => $Settings['UnLockOverlimitsTime'], 'DefaultTime' => MkTime(22, 0, 0, Date('n'), Date('j'), Date('Y')))); if (Is_Error($UnLockOverlimitsTime)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- # создаём задачу на разблокировку аккаунта $IsAdd = Comp_Load('www/Administrator/API/TaskEdit', array('UserID' => $HostingOrder['UserID'], 'TypeID' => 'HostingActive', 'ExecuteDate' => $UnLockOverlimitsTime, 'Params' => array($HostingOrder['ID']))); #------------------------------------------------------------------------------- switch (ValueOf($IsAdd)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': return ERROR | @Trigger_Error(400); case 'array': # No more... break; default:
} #------------------------------------------------------------------------------- $Comp = Comp_Load('Form/Input', array('type' => 'button', 'onclick' => 'form.submit();', 'value' => 'Сформировать')); if (Is_Error($Comp)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $Table[] = $Comp; #------------------------------------------------------------------------------- $Table[] = new Tag('IFRAME', array('height' => 120, 'width' => '100%', 'name' => 'Statistics'), 'Загрузка...'); #------------------------------------------------------------------------------- $Comp = Comp_Load('Tables/Standard', $Table); if (Is_Error($Comp)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $Form = new Tag('FORM', array('target' => 'Statistics', 'method' => 'POST', 'onsubmit' => 'return false;'), $Comp); #------------------------------------------------------------------------------- $Comp = Comp_Load('Form/Input', array('type' => 'hidden', 'name' => 'IsCreate', 'value' => 'yes')); if (Is_Error($Comp)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $Form->AddChild($Comp); #------------------------------------------------------------------------------- $DOM->AddChild('Into', $Form); #------------------------------------------------------------------------------- $Out = $DOM->Build(); #------------------------------------------------------------------------------- return $Out; #-------------------------------------------------------------------------------
<?php #------------------------------------------------------------------------------- /** @author Alex Keda, for www.host-food.ru */ /******************************************************************************/ /******************************************************************************/ $__args_list = array('Task', 'ExtraIPOrderID'); /******************************************************************************/ eval(COMP_INIT); /******************************************************************************/ /******************************************************************************/ if (Is_Error(System_Load('classes/ExtraIPServer.class.php'))) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $ExtraIPOrder = DB_Select('ExtraIPOrdersOwners', array('ID', 'UserID', 'Login', 'DependOrderID', 'SchemeID', 'ServerID', '(SELECT `Name` FROM `ExtraIPSchemes` WHERE `ExtraIPSchemes`.`ID` = `ExtraIPOrdersOwners`.`SchemeID`) as `SchemeName`'), array('UNIQ', 'ID' => $ExtraIPOrderID)); #------------------------------------------------------------------------------- switch (ValueOf($ExtraIPOrder)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': return ERROR | @Trigger_Error(400); case 'array': break; default: return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- #-------------------------------------------------------------------------------