<commit_before><?php
class User {
	private $id = null;
	private $username = null;
	private $lastname = "";
	private $firstname = "";
	private $email = "";
	private $password = "";
	private $old_encryption = false;
	private $skype_id = "";
	private $about_me = "";
	public function __construct($id = null) {
		if ($id) {
			$this->loadById ( $id );
		}
	}
	public function loadById($id) {
		throw new NotImplementedException ();
	}
	public function loadByUsername($name) {
		throw new NotImplementedException ();
	}
	public function save() {
		if ($this->id) {
			$this->update ();
		} else {
			$this->insert ();
		}
	}
	protected function insert() {
		throw new NotImplementedException ();
	}
	protected function update() {
		throw new NotImplementedException ();
	}
	public function getId() {
		return $this->id;
	}
	public function setId($id) {
		$this->id = ! is_null ( $id ) ? intval ( $id ) : null;
	}
	public function getUsername() {
		return $this->username;
	}
	public function setUsername($username) {
		$this->username = ! is_null ( $username ) ? strval ( $username ) : null;
	}
	public function getLastname() {
		return $this->lastname;
	}
	public function setLastname($lastname) {
		$this->lastname = ! is_null ( $lastname ) ? strval ( $lastname ) : null;
	}
	public function getFirstname() {
		return $this->firstname;
	}
	public function setFirstname($firstname) {
		$this->firstname = ! is_null ( $firstname ) ? strval ( $firstname ) : null;
	}
	public function getEmail() {
		return $this->email;
	}
	public function setEmail($email) {
		$this->email = ! is_null ( $email ) ? strval ( $firstname ) : null;
	}
	public function delete() {
		throw new NotImplementedException ();
	}
	public function getPassword() {
		return $this->password;
	}
	public function setPassword($password) {
		$this->password = securityHelper::hash_password ( $password );
		$this->old_encryption = true;
	}
	public function getOldEncryption() {
		return $this->old_encryption;
	}
	public function setOldEncryption($value) {
		$this->old_encryption = boolval ( $value );
	}
	public function getSkypeId() {
		return $this->skype_id;
	}
	public function setSkypeId($skype_id) {
		$this->skype_id = ! is_null ( $skype_id ) ? strval ( $skype_id ) : null;
	}
	public function getAboutMe() {
		return $this->about_me;
	}
	public function setAboutMe($text) {
		$this->about_me = ! is_null ( $text ) ? strval ( $text ) : null;
	}
}<commit_msg>weitere felder hinzugefügt<commit_after><?php
class User {
	private $id = null;
	private $username = null;
	private $lastname = "";
	private $firstname = "";
	private $email = "";
	private $password = "";
	private $old_encryption = false;
	private $skype_id = "";
	private $about_me = "";
	private $group_id = null;
	private $notify_on_login = false;
	private $html_editor = "ckeditor";
	private $require_password_change = false;
	private $admin = false;
	private $password_changed = null;
	private $locked = false;
	private $last_login = null;
	public function __construct($id = null) {
		if ($id) {
			$this->loadById ( $id );
		}
	}
	public function loadById($id) {
		throw new NotImplementedException ();
	}
	public function loadByUsername($name) {
		throw new NotImplementedException ();
	}
	public function save() {
		if ($this->id) {
			$this->update ();
		} else {
			$this->insert ();
		}
	}
	protected function insert() {
		throw new NotImplementedException ();
	}
	protected function update() {
		throw new NotImplementedException ();
	}
	public function getId() {
		return $this->id;
	}
	public function setId($id) {
		$this->id = ! is_null ( $id ) ? intval ( $id ) : null;
	}
	public function getUsername() {
		return $this->username;
	}
	public function setUsername($username) {
		$this->username = ! is_null ( $username ) ? strval ( $username ) : null;
	}
	public function getLastname() {
		return $this->lastname;
	}
	public function setLastname($lastname) {
		$this->lastname = ! is_null ( $lastname ) ? strval ( $lastname ) : null;
	}
	public function getFirstname() {
		return $this->firstname;
	}
	public function setFirstname($firstname) {
		$this->firstname = ! is_null ( $firstname ) ? strval ( $firstname ) : null;
	}
	public function getEmail() {
		return $this->email;
	}
	public function setEmail($email) {
		$this->email = ! is_null ( $email ) ? strval ( $firstname ) : null;
	}
	public function delete() {
		throw new NotImplementedException ();
	}
	public function getPassword() {
		return $this->password;
	}
	public function setPassword($password) {
		$this->password = securityHelper::hash_password ( $password );
		$this->old_encryption = false;
		$this->password_changed = date ( "Y-m-d H:i:s" );
	}
	public function getOldEncryption() {
		return $this->old_encryption;
	}
	public function setOldEncryption($value) {
		$this->old_encryption = boolval ( $value );
	}
	public function getSkypeId() {
		return $this->skype_id;
	}
	public function setSkypeId($skype_id) {
		$this->skype_id = ! is_null ( $skype_id ) ? strval ( $skype_id ) : null;
	}
	public function getAboutMe() {
		return $this->about_me;
	}
	public function setAboutMe($text) {
		$this->about_me = ! is_null ( $text ) ? strval ( $text ) : null;
	}
	public function getLastAction() {
		$result = 0;
		if (! is_null ( $this->id )) {
			
			$sql = "select last_action from {prefix}users where id = ?";
			$args = array (
					$this->id 
			);
			$query = Database::pQuery ( $sql, $args, true );
			if (Database::any ( $query )) {
				$data = Database::fetchObject ( $query );
				$result = $data->last_action;
			}
		}
		return $result;
	}
	public function setLastAction($time) {
		if (is_null ( $this->id )) {
			return;
		}
		$time = intval ( $time );
		$sql = "update {prefix}users set last_action = ? where id = ?";
		$args = array (
				$time,
				$this->id 
		);
		Database::pQuery ( $sql, $args, true );
	}
	public function getGroupId() {
		return $this->group_id;
	}
	public function setGroupId($gid) {
		$this->group_id = ! is_null ( $gid ) ? $gid : null;
	}
	public function getNotifyOnLogin() {
		return boolval ( $this->notify_on_login );
	}
	public function setNotifyOnLogin($val) {
		$this->notify_on_login = boolval ( $val );
	}
	public function getHTMLEditor() {
		return $this->html_editor;
	}
	public function setHTMLEditor($editor) {
		$allowedEditors = array (
				"ckeditor",
				"codemirror" 
		);
		if (! in_array ( $editor, $allowedEditors )) {
			$editor = "ckeditor";
		}
		$this->html_editor = $editor;
	}
	public function getRequirePasswordChange() {
		return $this->require_password_change;
	}
	public function setRequirePasswordChange($val) {
		$this->require_password_change = boolval ( $val );
	}
	public function getAdmin() {
		return $this->admin;
	}
	public function setAdmin($val) {
		$this->admin = boolval ( $val );
	}
	public function getLocked() {
		return $this->locked;
	}
	public function setLocked($val) {
		$this->locked = boolval ( $val );
	}
	public function getLastLogin() {
		return $this->last_login;
	}
	public function setLastLogin($val) {
		$this->last_login = ! is_null ( $val ) ? intval ( $val ) : null;
	}
}
{'fraction_non_alphanumeric': 0.150938073070955, 'fraction_numerical': 0.0001410636196924813, 'mean_word_length': 3.8695054945054945, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 69, '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': '4213163', 'n_tokens_mistral': 2594, 'n_tokens_neox': 2449, 'n_words': 564}