<commit_before><?php

// User model
class User{

	// adds a user
	public static function Add($email, $password, $firstName, $lastName, $role, $language, $isActive, $siteId){
		
        try{
            
    		$db = DB::get();
    
        	$userId = uniqid();
    		
    		$token = null;
    	
    		$timestamp = gmdate("Y-m-d H:i:s", time());
    		
    		// create a more secure password (http://www.openwall.com/articles/PHP-Users-Passwords)
    		$hash_cost_log2 = 8; // Base-2 logarithm of the iteration count used for password stretching
    		$hash_portable = FALSE; // Not portable
    		
    		$hasher = new PasswordHash($hash_cost_log2, $hash_portable);
    		$s_password = $<PASSWORD>Password($password);
    		unset($hasher);
        
            $q = "INSERT INTO Users (UserId, Email, Password, FirstName, LastName, Role, Language, IsActive, SiteId, Created) 
        		 	VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
     
            $s = $db->prepare($q);
            $s->bindParam(1, $userId);
            $s->bindParam(2, $email);
            $s->bindParam(3, $s_password);
            $s->bindParam(4, $firstName);
            $s->bindParam(5, $lastName);
            $s->bindParam(6, $role);
            $s->bindParam(7, $language);
            $s->bindParam(8, $isActive);
            $s->bindParam(9, $siteId);
            $s->bindParam(10, $timestamp);
            
            $s->execute();
            
            return array(
                'UserId' => $userId,
                'Email' => $email,
                'FirstName' => $firstName,
                'LastName' => $lastName,
                'Role' => $role,
                'Language' => $language,
                'IsActive' => $isActive,
                'Token' => $token,
                'Created' => $timestamp
                );
                
        } catch(PDOException $e){
            die('[User::Add] PDO Error: '.$e->getMessage());
        }
	}<commit_msg>Add siteId to the user/add for webhook access<commit_after><?php

// User model
class User{

	// adds a user
	public static function Add($email, $password, $firstName, $lastName, $role, $language, $isActive, $siteId){
		
        try{
            
    		$db = DB::get();
    
        	$userId = uniqid();
    		
    		$token = null;
    	
    		$timestamp = gmdate("Y-m-d H:i:s", time());
    		
    		// create a more secure password (http://www.openwall.com/articles/PHP-Users-Passwords)
    		$hash_cost_log2 = 8; // Base-2 logarithm of the iteration count used for password stretching
    		$hash_portable = FALSE; // Not portable
    		
    		$hasher = new PasswordHash($hash_cost_log2, $hash_portable);
    		$s_password = $hasher->HashPassword($password);
    		unset($hasher);
        
            $q = "INSERT INTO Users (UserId, Email, Password, FirstName, LastName, Role, Language, IsActive, SiteId, Created) 
        		 	VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
     
            $s = $db->prepare($q);
            $s->bindParam(1, $userId);
            $s->bindParam(2, $email);
            $s->bindParam(3, $s_password);
            $s->bindParam(4, $firstName);
            $s->bindParam(5, $lastName);
            $s->bindParam(6, $role);
            $s->bindParam(7, $language);
            $s->bindParam(8, $isActive);
            $s->bindParam(9, $siteId);
            $s->bindParam(10, $timestamp);
            
            $s->execute();
            
            return array(
                'UserId' => $userId,
                'Email' => $email,
                'FirstName' => $firstName,
                'LastName' => $lastName,
                'Role' => $role,
                'Language' => $language,
                'IsActive' => $isActive,
                'Token' => $token,
                'SiteId' => $siteId,
                'Created' => $timestamp
                );
                
        } catch(PDOException $e){
            die('[User::Add] PDO Error: '.$e->getMessage());
        }
	}
{'fraction_non_alphanumeric': 0.15982884470173672, 'fraction_numerical': 0.007550969041026932, 'mean_word_length': 1.6127547666009205, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 50, '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': '4499683', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1262, 'n_words': 255}