Example #1
0
function __AdmSettingsSaveOptions($module_id, $arOptions)
{
	foreach($arOptions as $arOption)
	{
		__AdmSettingsSaveOption($module_id, $arOption);
	}
}
Example #2
0
			CAgent::RemoveAgent("CSocServAuthManager::GetTwitMessages($siteId);", "socialservices");
			if($_POST["allow_socserv_authorization".$suffix] == 'Y')
				$allowAuthorization = 'Y';
			COption::SetOptionString("socialservices", "allow_socserv_authorization".$suffix, $allowAuthorization);
			if($_POST["send_message_to_twitter".$suffix] == 'Y')
			{
				$sendTwit = 'Y';
				CAgent::AddAgent("CSocServAuthManager::GetTwitMessages($site);", "socialservices", "N", 60, "", "Y", "");
			}

			COption::SetOptionString("socialservices", "send_message_to_twitter".$suffix, $sendTwit);
			foreach($arOptions as $option)
			{
				if(is_array($option))
					$option[0] .= $suffix;
				__AdmSettingsSaveOption($module_id, $option);
			}
		}
	}

	if(strlen($_REQUEST["back_url_settings"]) > 0)
	{
		if($_POST["Apply"] <> '' || $_POST["RestoreDefaults"] <> '')
			LocalRedirect($APPLICATION->GetCurPage()."?mid=".urlencode($module_id)."&lang=".urlencode(LANGUAGE_ID)."&back_url_settings=".urlencode($_REQUEST["back_url_settings"])."&".$tabControl->ActiveTabParam().($_REQUEST["siteTabControl_active_tab"] <> ''? "&siteTabControl_active_tab=".urlencode($_REQUEST["siteTabControl_active_tab"]):''));
		else
			LocalRedirect($_REQUEST["back_url_settings"]);
	}
	else
	{
		LocalRedirect($APPLICATION->GetCurPage()."?mid=".urlencode($module_id)."&lang=".urlencode(LANGUAGE_ID)."&".$tabControl->ActiveTabParam().($_REQUEST["siteTabControl_active_tab"] <> ''? "&siteTabControl_active_tab=".urlencode($_REQUEST["siteTabControl_active_tab"]):''));
	}
Example #3
0
{
	if(LICENSE_KEY !== $_POST["SET_LICENSE_KEY"])
	{
		$SET_LICENSE_KEY = preg_replace("/[^A-Za-z0-9_.-]/", "", $_POST["SET_LICENSE_KEY"]);

		file_put_contents(
			$_SERVER["DOCUMENT_ROOT"].FX_ROOT."/license_key.php",
			"<"."? $"."LICENSE_KEY = \"".EscapePHPString($SET_LICENSE_KEY)."\"; ?".">"
		);
	}

	foreach($arAllOptions as $aOptGroup)
	{
		foreach($aOptGroup as $option)
		{
			__AdmSettingsSaveOption("main", $option);
		}
	}
	COption::SetOptionString("main", "admin_lid", $_POST["admin_lid"]);
	COption::SetOptionString("main", "show_panel_for_users", serialize($_POST["show_panel_for_users"]));

	$cleanup_days = COption::GetOptionInt("main", "new_user_registration_cleanup_days", 7);
	if($cleanup_days > 0 && COption::GetOptionString("main", "new_user_registration_email_confirmation", "N") === "Y")
	{
		CAgent::AddAgent("CUser::CleanUpAgent();", "main", "N", 24*60*60);
	}
	else
	{
		CAgent::RemoveAgent("CUser::CleanUpAgent();", "main");
	}
                 __AdmSettingsDrawRow($settings_id, $Option);
}

//Save options
if($REQUEST_METHOD == "POST" && $MODULE_RIGHT >= "W" && strlen($Update.$Apply.$RestoreDefaults) > 0 && check_bitrix_sessid())
{
        if(strlen($RestoreDefaults) > 0)
        {
                COption::RemoveOption($settings_id);
        }
        else
        {
        	foreach($arOptionGroups as $arOptionGroup)
        	{
        		foreach($arOptionGroup[1] as $option)
        			__AdmSettingsSaveOption($settings_id, $option);
        	}
	}
}
?>
<script type="text/javascript">
<!--
	function RestoreDefaults()
	{
	        if(confirm('<? echo GetMessageJS("MAIN_HINT_RESTORE_DEFAULTS_WARNING"); ?>'))
	                window.location = "<?echo $APPLICATION->GetCurPage()?>?RestoreDefaults=Y&lang=<?echo LANG?>&mid=<?echo urlencode($mid)?>&<?php 
echo bitrix_sessid_get();
?>
";
	}
//-->