Ejemplo n.º 1
0
 public static function onBeforeAdd(Entity\Event $event)
 {
     $result = new Entity\EventResult();
     $data = $event->getParameter("fields");
     if (isset($data["USER_ID"]) && isset($data['PASSWORD'])) {
         $salt = md5(\CMain::GetServerUniqID() . uniqid());
         $password = $salt . md5($salt . $data['PASSWORD']);
         $modified = array('PASSWORD' => $password);
         $user = Main\UserTable::getRowById($data["USER_ID"]);
         if ($user !== null) {
             $realm = defined('BX_HTTP_AUTH_REALM') ? BX_HTTP_AUTH_REALM : "Bitrix Site Manager";
             $digest = md5($user["LOGIN"] . ':' . $realm . ':' . $data['PASSWORD']);
             $modified['DIGEST_PASSWORD'] = $digest;
         }
         $result->modifyFields($modified);
     }
     return $result;
 }
Ejemplo n.º 2
0
                    $lAdmin->AddGroupError(GetMessage("sender_mailing_chain_adm_del_error"), $ID);
                }
                $DB->Commit();
                break;
        }
    }
}
$groupListDb = \Bitrix\Sender\MailingChainTable::getList(array('select' => array('ID', 'MAILING_ID', 'POSTING_ID', 'CREATED_BY', 'STATUS', 'REITERATE', 'LAST_EXECUTED', 'EMAIL_FROM', 'AUTO_SEND_TIME', 'DAYS_OF_MONTH', 'DAYS_OF_WEEK', 'TIMES_OF_DAY', 'NAME' => 'SUBJECT'), 'filter' => $arFilter, 'order' => array($by => $order)));
$rsData = new CAdminResult($groupListDb, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("sender_mailing_chain_adm_nav")));
$lAdmin->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "ID", "align" => "right", "default" => true), array("id" => "NAME", "content" => GetMessage("sender_mailing_chain_adm_field_name"), "sort" => "NAME", "default" => true), array("id" => "CREATED_BY", "content" => GetMessage("sender_mailing_chain_adm_field_created_by"), "sort" => "CREATED_BY", "default" => true), array("id" => "STATUS", "content" => GetMessage("sender_mailing_chain_adm_field_status"), "sort" => "STATUS", "default" => true), array("id" => "EMAIL_FROM", "content" => GetMessage("sender_mailing_chain_adm_field_email_from"), "sort" => "EMAIL_FROM", "default" => false), array("id" => "REITERATE", "content" => GetMessage("sender_mailing_chain_adm_field_reiterate"), "sort" => "REITERATE", "default" => false), array("id" => "AUTO_SEND_TIME", "content" => GetMessage("sender_mailing_chain_adm_field_auto_send_time"), "sort" => "AUTO_SEND_TIME", "default" => false)));
while ($arRes = $rsData->NavNext(true, "f_")) {
    $row =& $lAdmin->AddRow($f_ID, $arRes);
    $row->AddViewField("NAME", '<a href="/bitrix/admin/sender_mailing_chain_edit.php?MAILING_ID=' . $MAILING_ID . '&ID=' . $f_ID . '&amp;lang=' . LANG . '">' . $f_NAME . '</a>');
    $arUser = \Bitrix\Main\UserTable::getRowById(intval($f_CREATED_BY));
    $row->AddViewField("CREATED_BY", '<a href="/bitrix/admin/user_edit.php?lang=' . LANGUAGE_ID . '&ID=' . $f_CREATED_BY . '">' . htmlspecialcharsbx($arUser['NAME'] . " " . $arUser['LAST_NAME']) . "</a>");
    $arStatus = MailingChainTable::getStatusList();
    $row->AddViewField("STATUS", $arStatus[$f_STATUS]);
    $row->AddViewField("REITERATE", $f_REITERATE == 'Y' ? GetMessage("MAIN_YES") : GetMessage("MAIN_NO"));
    $arActions = array();
    $arActions[] = array("ICON" => "edit", "DEFAULT" => true, "TEXT" => GetMessage("sender_mailing_chain_adm_action_edit"), "ACTION" => $lAdmin->ActionRedirect("sender_mailing_chain_edit.php?MAILING_ID=" . $MAILING_ID . "&ID=" . $f_ID));
    if ($POST_RIGHT >= "W") {
        $arActions[] = array("ICON" => "delete", "TEXT" => GetMessage("sender_mailing_chain_adm_action_delete"), "ACTION" => "if(confirm('" . GetMessage('sender_mailing_chain_adm_action_delete_confirm') . "')) " . $lAdmin->ActionDoGroup($f_ID, "delete", "MAILING_ID=" . $MAILING_ID));
    }
    $arActions[] = array("SEPARATOR" => true);
    switch ($f_STATUS) {
        case MailingChainTable::STATUS_NEW:
            if ($POST_RIGHT >= "W") {
                $arActions[] = array("ICON" => "", "DEFAULT" => false, "TEXT" => GetMessage("sender_mailing_chain_adm_action_send"), "ACTION" => $lAdmin->ActionRedirect("/bitrix/admin/sender_mailing_chain_admin.php?MAILING_ID=" . $MAILING_ID . "&ID=" . $f_ID . "&action=send&lang=" . LANGUAGE_ID));
            }
Ejemplo n.º 3
0
							echo GetMessage("sender_chain_edit_field_status_def");
						}
						?>
					</span>
					<?if(!empty($str_DATE_SENT) && in_array($str_STATUS, array(\Bitrix\Sender\MailingChainTable::STATUS_END))):?>
						<span class="sender-mailing-status-text-date"><?php 
echo $str_DATE_SENT;
?>
</span>
					<?endif;?>
					<?if(!empty($str_CREATED_BY)):?>
						<span class="sender-mailing-status-creator">
							<?php 
echo GetMessage("sender_chain_edit_field_author");
?>
 <?$arUser = \Bitrix\Main\UserTable::getRowById($str_CREATED_BY);echo htmlspecialcharsbx($arUser['NAME'].' '.$arUser['LAST_NAME']);?>
						</span>
					<?endif;?>
				</span>
				<span>
					<?if($ID>0 && $POST_RIGHT>="W" && \Bitrix\Sender\MailingChainTable::isReadyToSend($ID)):?>
						<input style="margin-left: 80px;" type="button"
							value="<?echo GetMessage("sender_chain_edit_btn_send")?>"
							onclick="window.location='/bitrix/admin/sender_mailing_chain_admin.php?MAILING_ID=<?php 
echo $MAILING_ID;
?>
&ID=<?php 
echo $ID;
?>
&action=send&lang=<?php 
echo LANGUAGE_ID;
Ejemplo n.º 4
0
						<span class="sender-mailing-status-text-date"><?php 
    echo $str_DATE_SENT;
    ?>
</span>
					<?php 
}
?>
					<?php 
if (!empty($str_CREATED_BY)) {
    ?>
						<span class="sender-mailing-status-creator">
							<?php 
    echo GetMessage("sender_chain_edit_field_author");
    ?>
 <?php 
    $arUser = \Bitrix\Main\UserTable::getRowById($str_CREATED_BY);
    echo htmlspecialcharsbx($arUser['NAME'] . ' ' . $arUser['LAST_NAME']);
    ?>
						</span>
					<?php 
}
?>
				</span>
				<span>
					<?php 
if ($ID > 0 && $POST_RIGHT >= "W" && \Bitrix\Sender\MailingChainTable::isReadyToSend($ID)) {
    ?>
						<input style="margin-left: 80px;" type="button"
							value="<?php 
    echo GetMessage("sender_chain_edit_btn_send");
    ?>
Ejemplo n.º 5
0
						{
							$arStatus = \Bitrix\Sender\MailingChainTable::getStatusList();
							echo $arStatus[$str_STATUS];
						}
						else
						{
							echo GetMessage("sender_chain_edit_field_status_def");
						}
						?>
					</span>
					<?if(!empty($str_DATE_SENT) && in_array($str_STATUS, array(\Bitrix\Sender\MailingChainTable::STATUS_END))):?>
						<span class="sender-mailing-status-text-date"><?=$str_DATE_SENT?></span>
					<?endif;?>
					<?if(!empty($str_CREATED_BY)):?>
						<span class="sender-mailing-status-creator">
							<?=GetMessage("sender_chain_edit_field_author")?> <?$arUser = \Bitrix\Main\UserTable::getRowById($str_CREATED_BY);echo htmlspecialcharsbx($arUser['NAME'].' '.$arUser['LAST_NAME']);?>
						</span>
					<?endif;?>
				</span>
				<span>
					<?if($ID>0 && $POST_RIGHT>="W" && \Bitrix\Sender\MailingChainTable::isReadyToSend($ID)):?>
						<input style="margin-left: 80px;" type="button"
							value="<?echo GetMessage("sender_chain_edit_btn_send")?>"
							onclick="window.location='/bitrix/admin/sender_mailing_chain_admin.php?MAILING_ID=<?=$MAILING_ID?>&ID=<?=$ID?>&action=send&lang=<?=LANGUAGE_ID?>'"
							title="<?echo GetMessage("sender_chain_edit_btn_send_desc")?>" />
					<?endif;?>
					<?if($ID>0 && $POST_RIGHT>="W" && \Bitrix\Sender\MailingChainTable::isManualSentPartly($ID)):?>
						<input style="margin-left: 80px;" type="button"
							value="<?echo GetMessage("sender_chain_edit_btn_send2")?>"
							onclick="window.location='/bitrix/admin/sender_mailing_chain_admin.php?MAILING_ID=<?=$MAILING_ID?>&ID=<?=$ID?>&action=send&lang=<?=LANGUAGE_ID?>'"
							title="<?echo GetMessage("sender_chain_edit_btn_send2_desc")?>" />