Пример #1
0
	function run()
	{
	//	echo date('h:i:s A')." - just entered run<br>";
		//echo microtime()."Main:run just entered run() <br>";
		//$output_function = "output_template";
		//$mss = new Main_SecuritySystem();
		//if (!$mss->passed_security_check($this->xml_string) && $_REQUEST['target_function'][0] != "register_user") //handles login page post
		if (false) //won't be using this for now
		{
			$output_function = $mss->output_function;
		}
		//if (SecurityOperationsFacade::passed_security_check($this->xml_string, $this->xslt_file))
		else
		{
			if (!isset($_REQUEST['target_component']))
			{ 
				if (isset($_REQUEST['ntctf']))
				{
					$this->setup_for_no_server_side_content();
				}
				else if (isset($_REQUEST['pl']))
				{
					$this->set_product_lookup_page();
				}
				else
				{
					$this->set_default_site_page();
				}
			}
		
			//echo microtime()."Main:run before new RequestProcessor() <br>";
			$rp = new RequestProcessor();
			//echo microtime()."Main:run after new RequestProcessor() <br>";
			$output_function = $rp->process_request($this->xml_string, $this->xslt_file);
			//echo microtime()."Main:run after RequestProcessor::process_request <br>";
		}
		//echo microtime()."Main:run before user_authorized_output_function_check <br>";
		//	echo date('h:i:s A')." - just got output function<br>";
		/*if (!$mss->user_authorized_output_function_check($output_function))
		{
			die ("Unauthorized Access Attempt!");
		}*/
		$oof = new ssc_OutputOperationsFacade;
		//echo microtime()."Main:run before output_function <br>";
		if ($_REQUEST['OF_passthru'])
		{ 
			$oof->output_function_passthru($this->xml_string, $_REQUEST['OF_passthru']); 
			//echo "<br>output function:".$_REQUEST['OF_passthru'];
		}
		else
		{
			$oof->$output_function($this->xml_string, $this->xslt_file);
		}
		//echo microtime()."Main:run after output_function <br>";
		//echo date('h:i:s A')." - just exec'd output function<br>";
	}
Пример #2
0
	function run()
	{
	//	echo date('h:i:s A')." - just entered run<br>";
		//echo microtime()."Main:run just entered run() <br>";
		//$output_function = "output_template";
		//echo "<br>Main,  searcresrowcount".$_SESSION['search_res_row_cnt'];
		if ($_REQUEST['er'])
		{
			$un_encrypted_request = myedb_decrypt($_REQUEST['er']);
			if (!strstr($un_encrypted_request,"check_activation_password")) die ("error: bad link");
			eval($un_encrypted_request); //echo $_REQUEST['id']." -yooo- ".$_REQUEST['activate'];
		}
		
		$mss = new Main_SecuritySystem();

		$bypass_auth = in_array($_REQUEST['target_function'][0],$this->non_auth_target_functions)
			|| in_array($_REQUEST['OF_passthru'],$this->non_auth_output_functions);
		
		if (!$mss->passed_security_check($this->xml_string) 
			&& !$bypass_auth) 
		{//echo "didn't pass";
			$output_function = $mss->output_function;
		}
		//if (SecurityOperationsFacade::passed_security_check($this->xml_string, $this->xslt_file))
		else
		{// echo "did pass";
			if (!isset($_REQUEST['target_component']))
			{ 
				if (isset($_REQUEST['ntctf']))
				{
					$this->setup_for_no_server_side_content();
				}
				else if (isset($_REQUEST['pl']))
				{
					$this->set_product_lookup_page();
				}
				else
				{
					$this->set_default_site_page();
				}
			}
		
			//echo microtime()."Main:run before new RequestProcessor() <br>"; flush();
			$rp = new RequestProcessor();
			//echo microtime()."Main:run after new RequestProcessor() <br>"; flush();
			$output_function = $rp->process_request($this->xml_string, $this->xslt_file);
			//echo microtime()."Main:run after RequestProcessor::process_request <br>"; flush();
		}

		//echo microtime()."Main:run before user_authorized_output_function_check <br>";
		//	echo date('h:i:s A')." - just got output function<br>";
		if (!$mss->user_authorized_output_function_check($output_function))
		{
			
			$cur_user_eid = Main_SecuritySystem::get_user_eid();
			$subject = "unauthorized access attempt";
			$message = "user with eid ".$cur_user_eid." attempted to access ".$output_function; 
			NotificationSys::email_developer($subject,$message);
			die ("Unauthorized Access Attempt!");
		}
		$oof = new OutputOperationsFacade;
		//echo microtime()."Main:run before output_function <br>";
		if ($_REQUEST['OF_passthru'] && 
			($mss->authenticated || $bypass_auth))
		{
			$oof->output_function_passthru($this->xml_string, $_REQUEST['OF_passthru']); 
			//echo "<br>output function:".$_REQUEST['OF_passthru'];
		}
		else
		{
			$oof->$output_function($this->xml_string, $this->xslt_file);
		}
		//echo microtime()."Main:run after output_function <br>";
		//echo date('h:i:s A')." - just exec'd output function<br>";
	}