403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/main/classes/general/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/main/classes/general/main_admin.php
<?php

class CMainAdmin
{
	public static function GetTemplateList($rel_dir)
	{
		$arrTemplate = array();
		$arrTemplateDir = array();
		$rel_dir = str_replace("\\", "/", $rel_dir);

		$path = BX_PERSONAL_ROOT."/templates/";
		$handle=@opendir($_SERVER["DOCUMENT_ROOT"].$path);
		if($handle)
		{
			while (false!==($dir_name = readdir($handle)))
			{
				if (is_dir($_SERVER["DOCUMENT_ROOT"].$path.$dir_name) && $dir_name!="." && $dir_name!="..")
					$arrTemplateDir[] = $path.$dir_name;
			}
			closedir($handle);
		}
		$arrS = explode("/", $rel_dir);
		if (is_array($arrS) && !empty($arrS))
		{
			$module_id = $arrS[0];
			$path = "/bitrix/modules/".$module_id."/install/templates/";
			if (is_dir($_SERVER["DOCUMENT_ROOT"].$path)) $arrTemplateDir[] = $path;
		}

		if (is_array($arrTemplateDir) && !empty($arrTemplateDir))
		{
			foreach($arrTemplateDir as $template_dir)
			{
				$path = $template_dir."/".$rel_dir;
				$path = str_replace("\\", "/", $path);
				$path = str_replace("//", "/", $path);
				$handle=@opendir($_SERVER["DOCUMENT_ROOT"].$path);
				if($handle)
				{
					while (false!==($file_name = readdir($handle)))
					{
						if (is_file($_SERVER["DOCUMENT_ROOT"].$path.$file_name) && $file_name!="." && $file_name!="..")
							$arrTemplate[$file_name] = $file_name;
					}
					closedir($handle);
				}
			}
		}
		$arrTemplate = array_values($arrTemplate);

		usort(
			$arrTemplate,
			function ($v1, $v2) {
				if ($v1 > $v2)
				{
					return 1;
				}
				elseif ($v1 < $v2)
				{
					return -1;
				}
				return 0;
			}
		);

		return $arrTemplate;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit