<commit_before><?php

/**
 * Description of Member
 *
 * @author Kaj
 */
class Member {
    private $_id;
    private $_username;
    private $_email;
    private $_password;
    private $_avatar;
    private $_signature;
    private $_posts;
    private $_registerdate;
    private $_lastlogin;
    private $_lastip;
    private $_usergroup;
    private $_verificationcode;
    
    private $_db;
    
    public function __construct(PDO $db) {
        $this->_db = $db;
        $this->_avatar = "";
        $this->_signature = "";
        $this->_posts = "0";
        $this->_usergroup = "1";
    }
    
    public function getId() {
        return $this->_id;
    }
    public function getUsername() {
        return $this->_username;
    }
    public function setUsername($username) {
        $this->_username = $username;
    }
    public function getEmail() {
        return $this->_email;
    }
    public function setEmail($email) {
        $this->_email = $email;
    }
    public function getPassword() {
        return $this->_password;
    }
    public function setPassword($password) {
        $this->_password = $password;
    }
    public function getAvatar() {
        return $this->_avatar;
    }
    public function setAvatar($avatar) {
        $this->_avatar = $avatar;
    }
    public function getSignature() {
        return $this->_signature;
    }
    public function setSignature($signature) {
        $this->_signature = $signature;
    }
    public function getPosts() {
        return $this->_posts;
    }
    public function setPosts($posts) {
        $this->_posts = $posts;
    }
    public function getRegisterdate() {
        return $this->_registerdate;
    }
    public function getLastlogin() {
        return $this->_lastlogin;
    }
    public function getLastip() {
        return $this->_lastip;
    }
    public function getUsergroup() {
        return $this->_usergroup;
    }
    public function setUsergroup($usergroup) {
        $this->_usergroup = $usergroup;
    }
    public function getVerificationcode() {
        return $this->_verificationcode;
    }
    public function setVerificationcode($verificationcode) {
        $this->_verificationcode = $verificationcode;
    }
    public function getPermissions() {
        $usergroup = new Usergroup($this->_db);
        $usergroup->getById($this->_id);
        return $usergroup;
    }
    
    //Controle of deze (nieuwe) gebruiker aangemaakt mag worden
    public function available() {
        
        $qry = $this->_db->prepare("SELECT * FROM `users` WHERE `username` = ? OR email = ?;");
        $qry->execute(array($this->_username,$this->_email));
  
        
        if ($qry->rowCount() > "0") {<commit_msg>Bugfix: Usergroup getById function op basis van usergroup én niet user ID<commit_after><?php

/**
 * Description of Member
 *
 * @author Kaj
 */
class Member {
    private $_id;
    private $_username;
    private $_email;
    private $_password;
    private $_avatar;
    private $_signature;
    private $_posts;
    private $_registerdate;
    private $_lastlogin;
    private $_lastip;
    private $_usergroup;
    private $_verificationcode;
    
    private $_db;
    
    public function __construct(PDO $db) {
        $this->_db = $db;
        $this->_avatar = "";
        $this->_signature = "";
        $this->_posts = "0";
        $this->_usergroup = "1";
    }
    
    public function getId() {
        return $this->_id;
    }
    public function getUsername() {
        return $this->_username;
    }
    public function setUsername($username) {
        $this->_username = $username;
    }
    public function getEmail() {
        return $this->_email;
    }
    public function setEmail($email) {
        $this->_email = $email;
    }
    public function getPassword() {
        return $this->_password;
    }
    public function setPassword($password) {
        $this->_password = $password;
    }
    public function getAvatar() {
        return $this->_avatar;
    }
    public function setAvatar($avatar) {
        $this->_avatar = $avatar;
    }
    public function getSignature() {
        return $this->_signature;
    }
    public function setSignature($signature) {
        $this->_signature = $signature;
    }
    public function getPosts() {
        return $this->_posts;
    }
    public function setPosts($posts) {
        $this->_posts = $posts;
    }
    public function getRegisterdate() {
        return $this->_registerdate;
    }
    public function getLastlogin() {
        return $this->_lastlogin;
    }
    public function getLastip() {
        return $this->_lastip;
    }
    public function getUsergroup() {
        return $this->_usergroup;
    }
    public function setUsergroup($usergroup) {
        $this->_usergroup = $usergroup;
    }
    public function getVerificationcode() {
        return $this->_verificationcode;
    }
    public function setVerificationcode($verificationcode) {
        $this->_verificationcode = $verificationcode;
    }
    public function getPermissions() {
        $usergroup = new Usergroup($this->_db);
        $usergroup->getById($this->_usergroup);
        return $usergroup;
    }
    
    //Controle of deze (nieuwe) gebruiker aangemaakt mag worden
    public function available() {
        
        $qry = $this->_db->prepare("SELECT * FROM `users` WHERE `username` = ? OR email = ?;");
        $qry->execute(array($this->_username,$this->_email));
  
        
        if ($qry->rowCount() > "0") {
{'fraction_non_alphanumeric': 0.12456810329150755, 'fraction_numerical': 0.0010911074740861974, 'mean_word_length': 2.3292978208232444, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 73, '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': '4508722', 'n_tokens_mistral': 1568, 'n_tokens_neox': 1568, 'n_words': 367}