Project

General

Profile

« Previous | Next » 

Revision 596

Added by thorn almost 17 years ago

added new CAPTCHA and ASP (Advanced Spam Protection)

View differences:

initialize.php
51 51
	$string_dir_mode = STRING_DIR_MODE;
52 52
	define('OCTAL_DIR_MODE',(int) octdec($string_dir_mode));
53 53
	
54
	// get CAPTCHA and ASP settings
55
	$table = TABLE_PREFIX.'mod_captcha_control';
56
	if($get_settings = $database->query("SELECT * FROM $table LIMIT 1")) {
57
		if($get_settings->numRows() == 0) { die("CAPTCHA-Settings not found"); }
58
		$setting = $get_settings->fetchRow();
59
		if($setting['enabled_captcha'] == '1') define('ENABLED_CAPTCHA', true);
60
		else define('ENABLED_CAPTCHA', false);
61
		if($setting['enabled_asp'] == '1') define('ENABLED_ASP', true);
62
		else define('ENABLED_ASP', false);
63
		define('CAPTCHA_TYPE', $setting['captcha_type']);
64
		define('ASP_SESSION_MIN_AGE', (int)$setting['asp_session_min_age']);
65
		define('ASP_VIEW_MIN_AGE', (int)$setting['asp_view_min_age']);
66
		define('ASP_INPUT_MIN_AGE', (int)$setting['asp_input_min_age']);
67
	}
68

  
54 69
	// set error-reporting
55 70
	if(is_numeric(ER_LEVEL)) {
56 71
		error_reporting(ER_LEVEL);
......
62 77
		session_start();
63 78
		define('SESSION_STARTED', true);
64 79
	}
65
	
80
	if(ENABLED_ASP && !isset($_SESSION['session_started']))
81
		$_SESSION['session_started'] = time();
82

  
83

  
66 84
	// Get users language
67 85
	if(isset($_GET['lang']) AND $_GET['lang'] != '' AND !is_numeric($_GET['lang']) AND strlen($_GET['lang']) == 2) {
68 86
	  	define('LANGUAGE', strtoupper($_GET['lang']));
......
105 123
		
106 124
}
107 125

  
108
?>
126
?>

Also available in: Unified diff