Subversion Repository Public Repository

Nextrek

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
<?php
	require('UserRepositoryInterface.php');

	class UserRepository implements UserRepositoryInterface {
		protected $db;

		public function __construct($db) {
			$this->db = $db;
		}

		public function registerUser($user, $password) {

			$hashedPwd = password_hash($password, PASSWORD_DEFAULT);

			$query = "INSERT INTO utente(username, password, nominativo, cell, email, img)
    				VALUES ('".$user->username."',
    						'".$hashedPwd."',
    						'".$user->nominativo."',
    						'".$user->cell."',
    						'".$user->email."',
    						'".$user->img."')";
			
			//echo "<br/>".$query."<br/>";	

			try {
				$this->db->exec($query);
				return $this->db->lastInsertId();

				//echo "New record created successfully";
			} catch (PDOException $e) {
				echo $e->getMessage();
			}

		}
	}

?>

Commits for Nextrek/Android/SmartCharging/endPoints/UserRepository.php

Diff revisions: vs.
Revision Author Commited Message
224 Diff Diff FSallustio picture FSallustio Wed 08 Jul, 2015 07:36:39 +0000

- Piccolo refactor (sia lato php che lato sql);
- set_position.php

222 FSallustio picture FSallustio Tue 07 Jul, 2015 15:51:51 +0000

- Prima versione di registrazione_utente.php e registrazione_locale.php
- Corretti i json degli stub (alcuni non erano corretti sintatticamente)