HEX
Server: Apache/2.4.58 (IUS)
System: Linux fromcolo1.linveo.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: u100898694 (7904)
PHP: 8.1.29
Disabled: symlink,shell_exec,exec,proc_close,proc_open,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,proc_get_status,proc_nice,proc_terminate,pclose,ini_alter,virtual,openlog,apache_child_terminate,apache_setenv,define_syslog_variables,highlight_file,ini_get_all,ini_restore,inject_code,openlog,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,posix_setuid,posix_uname,syslog,system,show_source,pcntl_exec,virtual,suexec,dbmopen,dl,disk_free_space,diskfreespace,leak,apache_get_modules,apache_get_version,apache_note,apache_setenv,highlight_file
Upload Files
File: /home/u100898694/samak-danesh.com/wp-content/plugins/gotmls/safe-load/session.php
<?php
/**
 * GOTMLS SESSION Start
 * @package GOTMLS
 * @since 4.23.77
*/

require_once(dirname(__FILE__)."/trace.php");

if (!defined("GOTMLS_SESSION_TIME")) {
	define("GOTMLS_SESSION_TIME", microtime(true));

	function GOTMLS_session_start($ID_sess = false) {
		GOTMLS_define("GOTMLS_SESSION_ID", session_id());
		if (!($GOTMLS_LOGIN_KEY = GOTMLS_SESSION_ID)) {
			GOTMLS_define("SESS_TEST", @session_start());
			if (!($GOTMLS_LOGIN_KEY = session_id()))
				GOTMLS_define("SESS_FILE", $GOTMLS_LOGIN_KEY = GOTMLS_session_file());
		}
		if (isset($_SESSION["GOTMLS_SESSION_TIME"]))
			$_SESSION["GOTMLS_SESSION_LAST"] = $_SESSION["GOTMLS_SESSION_TIME"];
		else
			$_SESSION["GOTMLS_SESSION_LAST"] = 0;
		$_SESSION["GOTMLS_SESSION_TIME"] = GOTMLS_SESSION_TIME;
		return md5($GOTMLS_LOGIN_KEY.GOTMLS_SESSION_TIME.serialize($_SERVER));
	}

	function GOTMLS_session_close() {
		if (defined("SESS_FILE"))
			GOTMLS_session_file($_SESSION["GOTMLS_server_time"]);
		if (session_id())
			session_write_close();
	}

	function GOTMLS_session_die($output, $header = "Content-type: text/javascript") {
		if ($header)
			@header($header);
		GOTMLS_session_close();
		die($output);
	}

	function GOTMLS_session_init($GOTMLS_server_times = array()) {
		if (!(isset($_SESSION["GOTMLS_server_time"]) && is_array($_SESSION["GOTMLS_server_time"])))
			$_SESSION["GOTMLS_server_time"] = array();
		if (defined("GOTMLS_SESSION_TIME") && !(isset($_SESSION["GOTMLS_server_time"]["time_START"]) && is_numeric($_SESSION["GOTMLS_server_time"]["time_START"])))
			$_SESSION["GOTMLS_server_time"]["time_START"] = GOTMLS_SESSION_TIME;
		if (defined("GOTMLS_LOGIN_PROTECTION") && !(isset($_SESSION["GOTMLS_server_time"]["sess_ID"]) && strlen($_SESSION["GOTMLS_server_time"]["sess_ID"]) == 32))
			$_SESSION["GOTMLS_server_time"]["sess_ID"] = GOTMLS_LOGIN_PROTECTION;
		if (is_array($GOTMLS_server_times) && count($GOTMLS_server_times))
			$_SESSION["GOTMLS_server_time"] = array_replace_recursive($_SESSION["GOTMLS_server_time"], $GOTMLS_server_times);
	}

	function GOTMLS_session_file($GOTMLS_server_times = array()) {
		if (defined("GOTMLS_INSTALL_TIME") && defined("GOTMLS_SESSION_FILE")) {
			GOTMLS_session_init();
			$GOTMLS_server_times["GOTMLS_LOGIN_ARRAY"] = array("ADDR" => GOTMLS_REMOTEADDR, "AGENT" => (isset($_SERVER["HTTP_USER_AGENT"])?$_SERVER["HTTP_USER_AGENT"]:"HTTP_USER_AGENT"), "TIME"=>GOTMLS_INSTALL_TIME);
			$GOTMLS_LOGIN_KEY = md5(serialize($GOTMLS_server_times["GOTMLS_LOGIN_ARRAY"]));
			$LAST_HOUR = GOTMLS_encode_njG(intval(GOTMLS_SESSION_TIME) - 3600);
			$THIS_HOUR = GOTMLS_encode_njG(intval(GOTMLS_SESSION_TIME));
			if (!defined("GOTMLS_LOG_FILE"))
				define("GOTMLS_LOG_FILE", dirname(GOTMLS_SESSION_FILE)."/gotmls_$THIS_HOUR.$GOTMLS_LOGIN_KEY.php");
			if (is_file(GOTMLS_LOG_FILE))
				include(GOTMLS_LOG_FILE);
			elseif (is_file($LOG_FILE = dirname(GOTMLS_SESSION_FILE)."/gotmls_$LAST_HOUR.$GOTMLS_LOGIN_KEY.php"))
				include($LOG_FILE);
			if (is_array($GOTMLS_server_times) && count($GOTMLS_server_times))
				$_SESSION["GOTMLS_server_time"] = array_replace_recursive($_SESSION["GOTMLS_server_time"], $GOTMLS_server_times);
			if (GOTMLS_save_contents(GOTMLS_LOG_FILE, '<?php $_SESSION["GOTMLS_server_time"] = array_replace_recursive($_SESSION["GOTMLS_server_time"], GOTMLS_uckserialize(GOTMLS_decode("'.GOTMLS_encode(serialize($_SESSION["GOTMLS_server_time"]), "D").'")));')) {
				if (is_array($sess_files = scandir(dirname(GOTMLS_SESSION_FILE))))
					foreach ($sess_files as $sess_file)
						if (is_file(dirname(GOTMLS_SESSION_FILE)."/$sess_file") && preg_match('/^gotmls_(?!'.$LAST_HOUR.')(?!'.$THIS_HOUR.')\w{3}\.[a-f\d]{32}\.php$/i', $sess_file))
							@unlink(dirname(GOTMLS_SESSION_FILE)."/$sess_file");
				return $GOTMLS_LOGIN_KEY;
			} else
				return 0;
		} else
			return false;
	}
}