<commit_before><?php
class LoginModule extends SmartyModule {
	
	public function build($runData){
		
		$site = $runData->getTemp('site');
		// check the connection type
		if(!$_SERVER['HTTPS'] && $site->getSettings()->getSslMode()){
			// not enabled, redirect to http:
			$site = $runData->getTemp("site");
			header("HTTP/1.1 301 Moved Permanently");
			header("Location: ".'https://'.$site->getDomain().$_SERVER['REQUEST_URI']);
			exit();		
		}
		
		// check if not already logged in...
		
		
		$user = $runData->getUser();
		if($user){
			throw new ProcessException(_("You already are logged in."), "already_logged");	
		}	
		
		
		
		// check if reset remebered user
		$pl = $runData->getParameterList();
		if($pl->getParameterValue("reset")){
			setcookie('welcome', 'dummy', time() - 10000000, "/", GlobalProperties::$SESSION_COOKIE_DOMAIN);
		}else{
			// check if a recognized user
			
			$userId = $_COOKIE['welcome'];
			if($userId && is_numeric($userId) && $userId >0){
				$user = DB_OzoneUserPeer::instance()->selectByPrimaryKey($userId);
			}
			if($user == null){
				setcookie('welcome', 'dummy', time() - 10000000, "/", GlobalProperties::$SESSION_COOKIE_DOMAIN);
			}
		}
		
		$originalUrl = $pl->getParameterValue('origUrl');
		if($originalUrl){
			$originalUrlForce = $pl->getParameterValue('origUrlForce');
			if($originalUrlForce){
				$runData->sessionAdd('loginOriginalUrlForce', true);
			}
			$runData->sessionAdd('loginOriginalUrl', $originalUrl);
		}
		
		$runData->contextAdd("user", $user);
		
	}
	
}
?>
<commit_msg>* disableSSL parameter added to the LoginModule.<commit_after><?php
class LoginModule extends SmartyModule {
	
	public function build($runData){
		
		$site = $runData->getTemp('site');
		// check the connection type
		if(!$_SERVER['HTTPS'] && $site->getSettings()->getSslMode() && !$runData->getParameterList()->getParameterValue('disableSSL')){
			// not enabled, redirect to http:
			$site = $runData->getTemp("site");
			header("HTTP/1.1 301 Moved Permanently");
			header("Location: ".'https://'.$site->getDomain().$_SERVER['REQUEST_URI']);
			exit();		
		}
		
		// check if not already logged in...
		
		
		$user = $runData->getUser();
		if($user){
			throw new ProcessException(_("You already are logged in."), "already_logged");	
		}	
		
		
		
		// check if reset remebered user
		$pl = $runData->getParameterList();
		if($pl->getParameterValue("reset")){
			setcookie('welcome', 'dummy', time() - 10000000, "/", GlobalProperties::$SESSION_COOKIE_DOMAIN);
		}else{
			// check if a recognized user
			
			$userId = $_COOKIE['welcome'];
			if($userId && is_numeric($userId) && $userId >0){
				$user = DB_OzoneUserPeer::instance()->selectByPrimaryKey($userId);
			}
			if($user == null){
				setcookie('welcome', 'dummy', time() - 10000000, "/", GlobalProperties::$SESSION_COOKIE_DOMAIN);
			}
		}
		
		$originalUrl = $pl->getParameterValue('origUrl');
		if($originalUrl){
			$originalUrlForce = $pl->getParameterValue('origUrlForce');
			if($originalUrlForce){
				$runData->sessionAdd('loginOriginalUrlForce', true);
			}
			$runData->sessionAdd('loginOriginalUrl', $originalUrl);
		}
		
		$runData->contextAdd("user", $user);
		
	}
	
}
?>

{'fraction_non_alphanumeric': 0.18591549295774648, 'fraction_numerical': 0.01377151799687011, 'mean_word_length': 4.138263665594855, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5810933', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1027, 'n_words': 193}