%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/bitrix/www/local/components/p4/user.subscribe/
Upload File :
Create Path :
Current File : /home/bitrix/www/local/components/p4/user.subscribe/component.php

<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?> 
<?

CModule::IncludeModule("subscribe");

$arResult[] = array();
$arResult['APP_RESULT'] = array('OK' => true, 'ERROR_MESSAGE' => '');

if (isset($_REQUEST['email']) && check_email($_REQUEST['email']))
{
    $arFields = Array(
	    'RUB_ID' => array(3),
			'SEND_CONFIRM' => 'N',
			"USER_ID" => false,
			"FORMAT" => "html",
			"EMAIL" => $_REQUEST['email'],
			"ACTIVE" => "Y",
    );
    $subscr = new CSubscription;
    if ($subscr->Add($arFields) > 0) ;
    else
    {
			$arResult['APP_RESULT']['OK'] = false;
			$arResult['APP_RESULT']['ERROR_MESSAGE'] = $subscr->LAST_ERROR;
    }
}
else
{
	$arResult['APP_RESULT']['OK'] = false;
	$arResult['APP_RESULT']['ERROR_MESSAGE'] = GetMessage('EMAIL_NOT_VALID');
}

$this->IncludeComponentTemplate(); 
?>

Zerion Mini Shell 1.0