<commit_before><?php defined('SYSPATH') or die('No direct script access.');
/**
 * User model
 *
 * @package    Anqh
 * @author     <NAME>
 * @copyright  (c) 2010-2011 <NAME>
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
class Anqh_Model_User extends AutoModeler_ORM implements Permission_Interface {

	/**
	 * Permission to post comments
	 */
	const PERMISSION_COMMENT = 'comment';

	/**
	 * Permission to read comments
	 */
	const PERMISSION_COMMENTS = 'comments';

	/**
	 * Permission to add/remove friend
	 */
	const PERMISSION_FRIEND = 'friend';

	/**
	 * Permission to (un)ignore
	 */
	const PERMISSION_IGNORE = 'ignore';

	protected $_table_name = 'users';

	protected $_data = array(
		'id'                 => null,
		'username'           => null,
		'username_clean'     => null,
		'password'           => <PASSWORD>,
		'email'              => null,

		// Personal information
		'name'               => null,
		'dob'                => null,
		'gender'             => null,
		'title'              => null,
		'signature'          => null,
		'description'        => null,
		'homepage'           => null,
		'avatar'             => null,
		'picture'            => null,
		'default_image_id'   => null,

		// Location
		'address_street'     => null,
		'address_zip'        => null,
		'address_city'       => null,
		'geo_city_id'        => null,
		'latitude'           => null,
		'longitude'          => null,

		// Stats
		'login_count'        => null,
		'last_login'         => null,
		'old_login'          => null,
		'post_count'         => 0,
		'new_comment_count'  => 0,
		'comment_count'      => 0,
		'left_comment_count' => 0,
		'created'            => null,
		'modified'           => null,
		'ip'                 => null,
		'hostname'           => null,

	);

	protected $_rules = array(
		'username'           => array(
			'not_empty',
			'length'              => array(':value', 1, 30),
			'regex'               => array(':value', '/^[a-zåäöA-ZÅÄÖ0-9_\.\-& ^]+$/ui'),
			'AutoModeler::unique' => array(':model', ':value', ':field')
		),
		'username_clean'     => array('not_empty', 'AutoModeler::unique' => array(':model', ':value', ':field')),
		'password'           => array('<PASSWORD>'),
		'email'              => array('not_empty', 'email', 'AutoModeler::unique' => array(':model', ':value', ':field')),

		'name'               => array('max_length' => array(':value', 50)),
		'dob'                => array('date'),
		'gender'             => array('in_array' => array(':value', array('f', 'm'))),
		'homepage'           => array('url'),
		'default_image_id'   => array('digit'),

		'address_street'     => array('max_length' => array(':value', 50)),
		'address_zip'        => array('digit', 'length' => array(':value', 4, 5)),
		'address_city'       => array('max_length' => array(':value', 50)),
		'city_id'            => array('digit'),
		'latitude'           => array('numeric'),
		'longitude'          => array('numeric'),

		'login_count'        => array('digit'),<commit_msg>Add deprecated values for old version auto login<commit_after><?php defined('SYSPATH') or die('No direct script access.');
/**
 * User model
 *
 * @package    Anqh
 * @author     <NAME>
 * @copyright  (c) 2010-2011 <NAME>
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
class Anqh_Model_User extends AutoModeler_ORM implements Permission_Interface {

	/**
	 * Permission to post comments
	 */
	const PERMISSION_COMMENT = 'comment';

	/**
	 * Permission to read comments
	 */
	const PERMISSION_COMMENTS = 'comments';

	/**
	 * Permission to add/remove friend
	 */
	const PERMISSION_FRIEND = 'friend';

	/**
	 * Permission to (un)ignore
	 */
	const PERMISSION_IGNORE = 'ignore';

	protected $_table_name = 'users';

	protected $_data = array(
		'id'                 => null,
		'username'           => null,
		'username_clean'     => null,
		'password'           => <PASSWORD>,
		'email'              => null,

		// Personal information
		'name'               => null,
		'dob'                => null,
		'gender'             => null,
		'title'              => null,
		'signature'          => null,
		'description'        => null,
		'homepage'           => null,
		'avatar'             => null,
		'picture'            => null,
		'default_image_id'   => null,

		// Location
		'address_street'     => null,
		'address_zip'        => null,
		'address_city'       => null,
		'geo_city_id'        => null,
		'latitude'           => null,
		'longitude'          => null,

		// Stats
		'login_count'        => null,
		'last_login'         => null,
		'old_login'          => null,
		'post_count'         => 0,
		'new_comment_count'  => 0,
		'comment_count'      => 0,
		'left_comment_count' => 0,
		'created'            => null,
		'modified'           => null,
		'ip'                 => null,
		'hostname'           => null,

		// Deprecated
		'level'              => null,
		'hash'               => null,

	);

	protected $_rules = array(
		'username'           => array(
			'not_empty',
			'length'              => array(':value', 1, 30),
			'regex'               => array(':value', '/^[a-zåäöA-ZÅÄÖ0-9_\.\-& ^]+$/ui'),
			'AutoModeler::unique' => array(':model', ':value', ':field')
		),
		'username_clean'     => array('not_empty', 'AutoModeler::unique' => array(':model', ':value', ':field')),
		'password'           => array('<PASSWORD>'),
		'email'              => array('not_empty', 'email', 'AutoModeler::unique' => array(':model', ':value', ':field')),

		'name'               => array('max_length' => array(':value', 50)),
		'dob'                => array('date'),
		'gender'             => array('in_array' => array(':value', array('f', 'm'))),
		'homepage'           => array('url'),
		'default_image_id'   => array('digit'),

		'address_street'     => array('max_length' => array(':value', 50)),
		'address_zip'        => array('digit', 'length' => array(':value', 4, 5)),
		'address_city'       => array('max_length' => array(':value', 50)),
		'city_id'            => array('digit'),
		'latitude'           => array('numeric'),
		'longitude'          => array('numeric'),

		'login_count'        => array('digit'),
{'fraction_non_alphanumeric': 0.1869340232858991, 'fraction_numerical': 0.008085381630012937, 'mean_word_length': 2.1459816887080367, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 129, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '939296', 'n_tokens_mistral': 2222, 'n_tokens_neox': 1972, 'n_words': 407}