} #------------------------------------------------------------------------------- $DOM->AddText('Title', 'Настройка уведомлений'); #------------------------------------------------------------------------------- $Script = new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/Pages/UserNotifiesSet.js}')); #------------------------------------------------------------------------------- $DOM->AddChild('Head', $Script); #------------------------------------------------------------------------------- $Config = Config(); #------------------------------------------------------------------------------- $Notifies = $Config['Notifies']; #------------------------------------------------------------------------------- $Methods = $Notifies['Methods']; #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $ServerSettings = SelectServerSettingsByTemplate('SMS'); #------------------------------------------------------------------------------- switch (ValueOf($ServerSettings)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': #------------------------------------------------------------------------------- if ($Methods['SMS']['IsActive']) { return $ServerSettings; } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- case 'array': break; default: return ERROR | @Trigger_Error(101);
/******************************************************************************/ /******************************************************************************/ #if(!$Theme) $Theme = 'message theme is empty'; #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- Debug(SPrintF('[comp/Tasks/Jabber]: отправка Jabber сообщения для (%s)', $JabberID)); #------------------------------------------------------------------------------- $GLOBALS['TaskReturnInfo'] = $JabberID; #------------------------------------------------------------------------------- if (Is_Error(System_Load('classes/JabberClient.class.php', 'libs/Server.php'))) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Settings = SelectServerSettingsByTemplate('Jabber'); #------------------------------------------------------------------------------- switch (ValueOf($Settings)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': #------------------------------------------------------------------------------- $GLOBALS['TaskReturnInfo'] = 'server with template: Jabber, params: IsActive, IsDefault not found'; #------------------------------------------------------------------------------- if (isset($GLOBALS['IsCron'])) { return 3600; } #------------------------------------------------------------------------------- return $Settings; #------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Tasks/Email]: обработка вложения (%s), размер (%s), тип (%s)', $Attachment['Name'], $Attachment['Size'], $Attachment['Mime'])); #------------------------------------------------------------------------------- $Message = SPrintF("%s%s\r\nContent-Disposition: attachment;\r\n\tfilename=\"%s\"\r\nContent-Transfer-Encoding: base64\r\nContent-Type: %s;\r\n\tname=\"%s\"\r\n\r\n%s", $Message, $Boundary, Mb_Encode_MimeHeader($Attachment['Name']), $Attachment['Mime'], Mb_Encode_MimeHeader($Attachment['Name']), $Attachment['Data']); #Debug(SPrintF('[comp/Tasks/Email]: %s',$Attachment['Data'])); #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- # закрываем сообщение $Message = SPrintF("%s\r\n\r\n%s--", $Message, $Boundary); #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Settings = SelectServerSettingsByTemplate('Email'); #------------------------------------------------------------------------------- switch (ValueOf($Settings)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': #------------------------------------------------------------------------------- Debug(SPrintF('[comp/Tasks/Email]: не найден сервер для отправки почты, используется функция mail()')); #------------------------------------------------------------------------------- break; #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- case 'array': break; default: return ERROR | @Trigger_Error(101);
if ($__USER['Params']['NotificationMethods'][$Method]['Confirmed'] > Time() - 24 * 60 * 60) { #------------------------------------------------------------------------------- if ($Confirm) { return new gException('ALREADY_CONFIRMED', 'Уже подтверждено'); } #------------------------------------------------------------------------------- Header(SPrintF('Location: /Home')); #------------------------------------------------------------------------------- return NULL; #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $ServerSettings = SelectServerSettingsByTemplate($Method); #------------------------------------------------------------------------------- switch (ValueOf($ServerSettings)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': #------------------------------------------------------------------------------- if ($Method != 'Email') { return $ServerSettings; } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- case 'array': break; default: return ERROR | @Trigger_Error(101);
#------------------------------------------------------------------------------- Debug(SPrintF('[comp/Tasks/WhatsApp]: уведомления через WhatsApp отключены')); #------------------------------------------------------------------------------- return TRUE; #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $GLOBALS['TaskReturnInfo'] = $Mobile; #------------------------------------------------------------------------------- if (Is_Error(System_Load('classes/WhatsApp/whatsprot.class.php', 'libs/Server.php'))) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Settings = SelectServerSettingsByTemplate('WhatsApp'); #------------------------------------------------------------------------------- switch (ValueOf($Settings)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': #------------------------------------------------------------------------------- $GLOBALS['TaskReturnInfo'] = 'server with template: WhatsApp, params: IsActive, IsDefault not found'; #------------------------------------------------------------------------------- if (isset($GLOBALS['IsCron'])) { return 3600; } #------------------------------------------------------------------------------- return $Settings; #------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#------------------------------------------------------------------------------- Debug(SPrintF('[comp/Tasks/ICQ]: уведомления через ICQ отключены')); #------------------------------------------------------------------------------- return TRUE; #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $GLOBALS['TaskReturnInfo'] = $UIN; #------------------------------------------------------------------------------- if (Is_Error(System_Load('classes/WebIcqLite.class.php', 'libs/Server.php'))) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Settings = SelectServerSettingsByTemplate('ICQ'); #------------------------------------------------------------------------------- switch (ValueOf($Settings)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception': #------------------------------------------------------------------------------- $GLOBALS['TaskReturnInfo'] = 'server with template: ICQ, params: IsActive, IsDefault not found'; #------------------------------------------------------------------------------- if (isset($GLOBALS['IsCron'])) { return 3600; } #------------------------------------------------------------------------------- return $Settings; #------------------------------------------------------------------------------- #-------------------------------------------------------------------------------