Correction non fonctionelle
continuous-integration/drone/push Build is passing Details

issue_a
Paul LEVRAULT 1 year ago
parent ace879472c
commit 3e0d8f9def

@ -1,9 +1,9 @@
<?php <?php
use Dotenv\Dotenv; // use Dotenv\Dotenv;
$dotenv = Dotenv::createImmutable(__DIR__); // $dotenv = Dotenv::createImmutable(__DIR__);
$dotenv->load(); // $dotenv->load();
// const DB_HOST = $_ENV['DB_HOST'] ?? 'localhost'; // const DB_HOST = $_ENV['DB_HOST'] ?? 'localhost';
// const DB_DATABASE = $_ENV['DB_DATABASE'] ?? 'heartTrack'; // const DB_DATABASE = $_ENV['DB_DATABASE'] ?? 'heartTrack';

@ -137,7 +137,7 @@ function addFriend(DataManager $model){
$userList = searchUsersByName($name); $userList = searchUsersByName($name);
$i=1; $i=1;
foreach($u as $userList){ foreach($u as $userList){
echo $u->getNom()." ".$u->getPrenom()." : ".$i++."<br>"; echo $u->getNom()." ".$u->getPrenom()." : ".$i++."\n";
} }
echo "\nEntrez le numéro de la personne que vous voulez ajouter ou 0 pour annuler"; echo "\nEntrez le numéro de la personne que vous voulez ajouter ou 0 pour annuler";
$choice = trim(fgets(STDIN)); $choice = trim(fgets(STDIN));

@ -15,13 +15,13 @@ class UserManager
{ {
private IAuthService $authService; private IAuthService $authService;
private IFriendRequestService $friendService; // private IFriendRequestService $friendService;
private User $currentUser; private User $currentUser;
private UserRepository $userRepo; private UserRepository $userRepo;
public function __construct(IAuthService $authService,IFriendRequestService $friendService) public function __construct(IAuthService $authService)
{ {
$this->authService = $authService; $this->authService = $authService;
} }
@ -32,6 +32,7 @@ class UserManager
if (!Validation::val_string($passwordUser) || !Validation::val_string($loginUser)) if (!Validation::val_string($passwordUser) || !Validation::val_string($loginUser))
throw new \Exception(" some wrong with cred !!!!!"); throw new \Exception(" some wrong with cred !!!!!");
if ($this->authService->login($loginUser, $passwordUser)) { if ($this->authService->login($loginUser, $passwordUser)) {
$this->currentUser = $this->userRepo->GetItemByName($loginUser,0,1);
return true; return true;
} }
return false; return false;
@ -90,6 +91,7 @@ class UserManager
} }
if ($this->authService->register($loginUser, $passwordUser, $data)) { if ($this->authService->register($loginUser, $passwordUser, $data)) {
$this->currentUser = $this->userRepo->GetItemByName($loginUser,0,1);
return true; return true;
} }
return false; return false;
@ -104,8 +106,8 @@ class UserManager
} }
public function searchUsersByName(string $name) : array{ public function searchUsersByName(string $name) : array{
$list=array(); $list=array();
$friendsList=$this->currentUser->getFriendsList(); $usersList=$this->currentUser->getItems();
foreach($u as $friendsList){ foreach($u as $usersList){
if(strcasecmp($name,$u->getNom())==0 || strcasecmp($name,$u->getPrenom())==0){ if(strcasecmp($name,$u->getNom())==0 || strcasecmp($name,$u->getPrenom())==0){
array_push($list, $u); array_push($list, $u);
} }

@ -3,7 +3,7 @@
'name' => 'hearttrack/package', 'name' => 'hearttrack/package',
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'reference' => 'd4345678992503b9eb56ef4afd00ff13f5d7531a', 'reference' => 'ace879472ced43c6e67830f9e1f63dea3b313fec',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
@ -31,7 +31,7 @@
'hearttrack/package' => array( 'hearttrack/package' => array(
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'reference' => 'd4345678992503b9eb56ef4afd00ff13f5d7531a', 'reference' => 'ace879472ced43c6e67830f9e1f63dea3b313fec',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),

Loading…
Cancel
Save