class.user.php

Gesponsorde koppelingen

PHP script bestanden

  1. index.php
  2. class.user.php
  3. login.php
  4. phphulp.sql
  5. class.userMapper.php
  6. class.bruteForce.php
  7. class.bruteForceMapper.php
  8. class.database.php
  9. class.dataMapper.php
  10. class.hash.php

« Lees de omschrijving en reacties

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php

/**
 *
 * @date 15 Aug 2012,
 * @package Login System
 *
 */

Class User {

    /**
     * @param int $user_id,
     * @param string $username,
     * @param string $password
     */

    private
        $user_id,
        $username,
        $password;
        
    /**
     * @param int $user_id,
     * @return void
     */

    public function setUserId($user_id) {
        $this->user_id    = (int) $user_id;
    }

    
    /**
     * @param string $username,
     * @return void
     */

    public function setUsername($username) {
        $this->username    = (string) $username;
    }

    
    /**
     * @param string $password,
     * @return void
     */

    public function setPassword($password) {
        $this->password    = (string) $password;
    }

    
    /**
     * @return int $user_id
     */

    public function getUserId() {
        return (int) $this->user_id;
    }

    
    /**
     * @return string $username
     */

    public function getUsername() {
        return (string) preg_replace('/[^0-9\p{L}]$/u', '', $this->username);
    }

    
    /**
     * @return string $password
     */

    public function getHashedPassword() {
        $hash            = new Hash($this->password, strtolower($this->username));
        return $hash->getHashedPassword();
    }
    
}


?>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.