<commit_before><?php
class User extends AppModel {

	var $name = 'User';
	var $actsAs = array('Acl' => array('requester'), 'ExtendAssociations');
	
	const LOWEST_TRUST_GROUP_ID = 4;
	
	var $validate = array(
		'username' => array(
			'alphanumeric' => array(
				'rule' => '/^\\w*$/', 
				'message' => 'Username can only contain letters, numbers, or underscore'
			),
			'isUnique' => array(
				'rule' => 'isUnique',
				'message' => 'Username already taken.'
			),
			'min' => array(
				'rule' => array('minLength', 2), 
				'message' => 'Username must be at least two letters'
			)
		),
		'password' => array(
			array (
			        VALID_NOT_EMPTY,
                                'message' => 'Password can\'t be empty'
                              ), 
                        array(
				'rule' => array('minLength', 4), 
				'message' => 'Password must be at least two letters'
                             )
                ),
		'email' => array(
			'email' => array(
				'rule' => 'email', 
				'message' => 'Non valid email'),
			'isUnique' => array(
				'rule' => 'isUnique',
				'message' => 'Email already used.')
			),
		'lang' => array('alphanumeric'),
		'lastlogout' => array('numeric'),
		'status' => array('numeric'),
		'permissions' => array('numeric'),
		'level' => array('numeric'),
		'group_id' => array('numeric')
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $belongsTo = array(
		'Group' => array(
			'className' => 'Group',
			'foreignKey' => 'group_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
	
	var $hasMany = array(
		  'SentenceComments' => array('limit' => 10, 'order' => 'created DESC')
		, 'Contributions' => array('limit' => 10, 'order' => 'datetime DESC')
		, 'Sentences' => array('limit' => 10, 'order' => 'modified DESC')
	);
	
	var $hasAndBelongsToMany = array(
		'Follower' => array(
			'className' => 'User',
			'joinTable' => 'followers_users',
			'foreignKey' => 'user_id',<commit_msg>Took out the password rule in user model, it's not useful.<commit_after><?php
class User extends AppModel {

	var $name = 'User';
	var $actsAs = array('Acl' => array('requester'), 'ExtendAssociations');
	
	const LOWEST_TRUST_GROUP_ID = 4;
	
	var $validate = array(
		'username' => array(
			'alphanumeric' => array(
				'rule' => '/^\\w*$/', 
				'message' => 'Username can only contain letters, numbers, or underscore'
			),
			'isUnique' => array(
				'rule' => 'isUnique',
				'message' => 'Username already taken.'
			),
			'min' => array(
				'rule' => array('minLength', 2), 
				'message' => 'Username must be at least two letters'
			)
		),
		'email' => array(
			'email' => array(
				'rule' => 'email', 
				'message' => 'Non valid email'
			),
			'isUnique' => array(
				'rule' => 'isUnique',
				'message' => 'Email already used.'
			)
		),
		'lang' => array('alphanumeric'),
		'lastlogout' => array('numeric'),
		'status' => array('numeric'),
		'permissions' => array('numeric'),
		'level' => array('numeric'),
		'group_id' => array('numeric')
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $belongsTo = array(
		'Group' => array(
			'className' => 'Group',
			'foreignKey' => 'group_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
	
	var $hasMany = array(
		  'SentenceComments' => array('limit' => 10, 'order' => 'created DESC')
		, 'Contributions' => array('limit' => 10, 'order' => 'datetime DESC')
		, 'Sentences' => array('limit' => 10, 'order' => 'modified DESC')
	);
	
	var $hasAndBelongsToMany = array(
		'Follower' => array(
			'className' => 'User',
			'joinTable' => 'followers_users',
			'foreignKey' => 'user_id',
{'fraction_non_alphanumeric': 0.19543281996813594, 'fraction_numerical': 0.004514073287307488, 'mean_word_length': 3.0159914712153517, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 93, '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': '4582544', 'n_tokens_mistral': 1474, 'n_tokens_neox': 1252, 'n_words': 324}