<commit_before><?php
class User extends CPHPDatabaseRecordClass {

	public $table_name = "accounts";
	public $id_field = "id";
	public $fill_query = "SELECT * FROM accounts WHERE `id` = :Id";
	public $verify_query = "SELECT * FROM accounts WHERE `id` = :Id";
	public $query_cache = 1;
	
	public $prototype = array(
		'string' => array(
			'Username' => "username",
			'EmailAddress' => "email_address",
			'Password' => "password",
			'ActivationCode' => "activation_code",
			'Salt' => "salt",
			'Forgot' => "forgot",
		),
		'numeric' => array(
			'Permissions' => "permissions",
		),
	);
	
	public static function check_attempts($sType){
		global  $database;
		$sUserIP = $_SERVER['REMOTE_ADDR'];
		$sTimeAgo = (time() - 600);
		if($sCheckAttempts = $database->CachedQuery("SELECT * FROM attempts WHERE `ip_address` = :UserIP AND timestamp < :TimeAgo AND type = :Type", array('UserIP' => $sUserIP, 'TimeAgo' => $sTimeAgo, 'Type' => $sType))){
			$sAttempts = count($sCheckAttempts);
			if($sAttempts > 3){
				return $sError = array("content" => "You've made too many failed {$sType} requests in the last 10 minutes.");
			}
		}
		return true;
	}<commit_msg>Flip the less than around.<commit_after><?php
class User extends CPHPDatabaseRecordClass {

	public $table_name = "accounts";
	public $id_field = "id";
	public $fill_query = "SELECT * FROM accounts WHERE `id` = :Id";
	public $verify_query = "SELECT * FROM accounts WHERE `id` = :Id";
	public $query_cache = 1;
	
	public $prototype = array(
		'string' => array(
			'Username' => "username",
			'EmailAddress' => "email_address",
			'Password' => "password",
			'ActivationCode' => "activation_code",
			'Salt' => "salt",
			'Forgot' => "forgot",
		),
		'numeric' => array(
			'Permissions' => "permissions",
		),
	);
	
	public static function check_attempts($sType){
		global  $database;
		$sUserIP = $_SERVER['REMOTE_ADDR'];
		$sTimeAgo = (time() - 600);
		if($sCheckAttempts = $database->CachedQuery("SELECT * FROM attempts WHERE `ip_address` = :UserIP AND timestamp > :TimeAgo AND type = :Type", array('UserIP' => $sUserIP, 'TimeAgo' => $sTimeAgo, 'Type' => $sType))){
			$sAttempts = count($sCheckAttempts);
			if($sAttempts > 3){
				return $sError = array("content" => "You've made too many failed {$sType} requests in the last 10 minutes.");
			}
		}
		return true;
	}
{'fraction_non_alphanumeric': 0.17259100642398287, 'fraction_numerical': 0.0059957173447537475, 'mean_word_length': 4.382488479262673, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '5312754', 'n_tokens_mistral': 904, 'n_tokens_neox': 798, 'n_words': 208}