Example #1
0
		}

		$arTemplates = CFileman::GetFileTemplates(LANGUAGE_ID, array($site_template));
		if(strlen($template)>0)
		{
			for ($i=0; $i<count($arTemplates); $i++)
			{
				if($arTemplates[$i]["file"] == $template)
				{
					$filesrc_tmp = CFileman::GetTemplateContent($arTemplates[$i]["file"], LANGUAGE_ID, array($site_template));
					break;
				}
			}
		}
		else
			$filesrc_tmp = CFileman::GetTemplateContent($arTemplates[0]["file"], LANGUAGE_ID, array($site_template));
	}

	if($REQUEST_METHOD=="POST" && strlen($save)>0)
	{
		if(!check_freetrix_sessid())
		{
			$strWarning = GetMessage("FILEMAN_SESSION_EXPIRED");
			$bVarsFromForm = true;
		}

		// lpa was denied earlier, so use file src as is
		$filesrc_for_save = $_POST['filesrc'];

		if(strlen($strWarning) <= 0)
		{
Example #2
0
         }
         if (strlen($sectionname) > 0) {
             if (COption::GetOptionString($module_id, "log_page", "Y") == "Y") {
                 $res_log['path'] = substr($pathto, 1);
                 CEventLog::Log("content", "SECTION_ADD", "fileman", "", serialize($res_log));
             }
             $APPLICATION->SaveFileContent($DOC_ROOT . $pathto . "/.section.php", "<?\n\$sSectionName=\"" . CFileMan::EscapePHPString($sectionname) . "\";\n?>");
         }
         if ($e = $APPLICATION->GetException()) {
             $strNotice = $e->msg;
         } else {
             if ($USER->CanDoFileOperation('fm_create_new_file', $arPath) && $USER->CanDoOperation('fileman_admin_files') && $mkindex == "Y") {
                 if ($toedit == "Y") {
                     LocalRedirect("/bitrix/admin/fileman_html_edit.php?" . $addUrl . "&site=" . $site . "&template=" . Urlencode($template) . "&path=" . UrlEncode($pathto) . "&filename=index.php&new=Y" . (strlen($back_url) <= 0 ? "" : "&back_url=" . UrlEncode($back_url)) . (strlen($gotonewpage) <= 0 ? "" : "&gotonewpage=" . UrlEncode($gotonewpage)) . (strlen($backnewurl) <= 0 ? "" : "&backnewurl=" . UrlEncode($backnewurl)));
                 } else {
                     $APPLICATION->SaveFileContent($DOC_ROOT . $pathto . "/index.php", CFileman::GetTemplateContent($template));
                 }
             }
         }
         if ($e = $APPLICATION->GetException()) {
             $strNotice = $e->msg;
         } elseif (strlen($apply) <= 0 && $strNotice == '') {
             if (strlen($back_url) > 0) {
                 LocalRedirect("/" . ltrim($back_url, "/"));
             } else {
                 $arPathtoParsed = CFileMan::ParsePath(array($site, $pathto), false, false, "", $logical == "Y");
                 LocalRedirect("/bitrix/admin/fileman_admin.php?" . $addUrl . "&site=" . $site . "&path=" . UrlEncode($arPathtoParsed["PREV"]));
             }
         }
     }
 }