here
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
4ea6f09766
commit
f7c8793301
@ -0,0 +1,177 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// namespace App\Controller;
|
||||||
|
|
||||||
|
// use App\Container;
|
||||||
|
// use App\Router\Request\IRequest;
|
||||||
|
// use App\Router\Response\Response;
|
||||||
|
// use Shared\Attributes\Route;
|
||||||
|
// use Twig\Environment;
|
||||||
|
// use Data\Core\Preferences;
|
||||||
|
// use Shared\Log;
|
||||||
|
|
||||||
|
// class AthleteController extends BaseController
|
||||||
|
// {
|
||||||
|
|
||||||
|
// #[Route(path: '/search-user', name: 'search-user', methods: ['GET'])]
|
||||||
|
// public function searchUser(string $username, IRequest $req): Response
|
||||||
|
// {
|
||||||
|
// $taberror = [];
|
||||||
|
// $utiliArray = [
|
||||||
|
// [
|
||||||
|
// 'nom' => 'John',
|
||||||
|
// 'prenom' => 'Doe',
|
||||||
|
// 'img' => 'john_doe',
|
||||||
|
// 'username' => 'johndoe',
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// 'nom' => 'Alice',
|
||||||
|
// 'prenom' => 'Smith',
|
||||||
|
// 'img' => 'alice_smith',
|
||||||
|
// 'username' => 'alicesmith',
|
||||||
|
// ],
|
||||||
|
// ];
|
||||||
|
// // if(!Validation::val_string($name)){
|
||||||
|
// try {
|
||||||
|
// //code...
|
||||||
|
// // $model->userMgr->getUser($name);
|
||||||
|
// return $this->render('./page/addfriend.html.twig',[
|
||||||
|
// 'css' => $this->preference->getCookie(),
|
||||||
|
// 'pp' => "test2",
|
||||||
|
// 'user' => "Doe",
|
||||||
|
// 'role' => "Athlète",
|
||||||
|
// 'friendship' => [],
|
||||||
|
// 'analyzes' => [],
|
||||||
|
// 'mails' => [],
|
||||||
|
// 'users' => $utiliArray,
|
||||||
|
// 'infoUser' => [],
|
||||||
|
// 'exos' => [],
|
||||||
|
// 'member' => [],
|
||||||
|
// 'responce' => "Notification d'ajout envoyée à $username"
|
||||||
|
// ]);
|
||||||
|
// } catch (\Throwable $th) {
|
||||||
|
// //throw $th;
|
||||||
|
// // return $this->render("addfriend.html.twig", ['tabError' => $taberror ]);
|
||||||
|
// }
|
||||||
|
// // }
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// #[Route(path: '/analyses', name: 'analyses', methods: ['GET'])]
|
||||||
|
// public function analyses(): Response
|
||||||
|
// {
|
||||||
|
// return $this->render('./page/analyze.html.twig',[
|
||||||
|
// 'css' => $this->preference->getCookie(),
|
||||||
|
// 'pp' => "test2",
|
||||||
|
// 'user' => "Doe",
|
||||||
|
// 'role' => "Athlète",
|
||||||
|
// 'friendship' => [],
|
||||||
|
// 'analyzes' => [],
|
||||||
|
// 'mails' => [],
|
||||||
|
// 'users' => [],
|
||||||
|
// 'infoUser' => [],
|
||||||
|
// 'exos' => [],
|
||||||
|
// 'member' => []
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// #[Route(path: '/exercice', name: 'exercice', methods: ['GET'])] // 8
|
||||||
|
// public function exercice(): Response
|
||||||
|
// {
|
||||||
|
// return $this->render('./page/exercice.html.twig',[
|
||||||
|
// 'css' => $this->preference->getCookie(),
|
||||||
|
// 'pp' => "test2",
|
||||||
|
// 'user' => "Doe",
|
||||||
|
// 'role' => "Athlète",
|
||||||
|
// 'friendship' => [],
|
||||||
|
// 'analyzes' => [],
|
||||||
|
// 'mails' => [],
|
||||||
|
// 'users' => [],
|
||||||
|
// 'infoUser' => [],
|
||||||
|
// 'exos' => [],
|
||||||
|
// 'member' => []
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// #[Route(path: '/add-friend', name: 'add-friend', methods: ['POST'])]
|
||||||
|
// public function addFriend(string $username, IRequest $req): Response
|
||||||
|
// {
|
||||||
|
// $taberror = [];
|
||||||
|
// $utiliArray = [
|
||||||
|
// [
|
||||||
|
// 'nom' => 'John',
|
||||||
|
// 'prenom' => 'Doe',
|
||||||
|
// 'img' => 'john_doe',
|
||||||
|
// 'username' => 'johndoe',
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// 'nom' => 'Alice',
|
||||||
|
// 'prenom' => 'Smith',
|
||||||
|
// 'img' => 'alice_smith',
|
||||||
|
// 'username' => 'alicesmith',
|
||||||
|
// ],
|
||||||
|
// ];
|
||||||
|
// // if(!Validation::val_string($name)){
|
||||||
|
// try {
|
||||||
|
// //code...
|
||||||
|
// // $model->userMgr->addFriend($name);
|
||||||
|
// return $this->render('./page/addfriend.html.twig',[
|
||||||
|
// 'css' => $this->preference->getCookie(),
|
||||||
|
// 'pp' => "test2",
|
||||||
|
// 'user' => "Doe",
|
||||||
|
// 'role' => "Athlète",
|
||||||
|
// 'friendship' => [],
|
||||||
|
// 'analyzes' => [],
|
||||||
|
// 'mails' => [],
|
||||||
|
// 'users' => $utiliArray,
|
||||||
|
// 'infoUser' => [],
|
||||||
|
// 'exos' => [],
|
||||||
|
// 'member' => [],
|
||||||
|
// 'responce' => "Notification d'ajout envoyée à $username"
|
||||||
|
// ]);
|
||||||
|
// } catch (\Throwable $th) {
|
||||||
|
// //throw $th;
|
||||||
|
// // return $this->render("addfriend.html.twig", ['tabError' => $taberror ]);
|
||||||
|
// }
|
||||||
|
// // }
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// #[Route(path: '/delete-friend', name: 'delete-friend', methods: ['POST'])]
|
||||||
|
|
||||||
|
|
||||||
|
// #[Route(path: '/friend', name: 'friend', methods: ['GET'])]
|
||||||
|
// public function friend(): Response
|
||||||
|
// {
|
||||||
|
// $utiliArray = [
|
||||||
|
// [
|
||||||
|
// 'nom' => 'John',
|
||||||
|
// 'prenom' => 'Doe',
|
||||||
|
// 'img' => 'john_doe',
|
||||||
|
// 'username' => 'johndoe',
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// 'nom' => 'Alice',
|
||||||
|
// 'prenom' => 'Smith',
|
||||||
|
// 'img' => 'alice_smith',
|
||||||
|
// 'username' => 'alicesmith',
|
||||||
|
// ],
|
||||||
|
// ];
|
||||||
|
// // $this->Auth->getUser->role->getFriends
|
||||||
|
// return $this->render('./page/addfriend.html.twig',[
|
||||||
|
// 'css' => $this->preference->getCookie(),
|
||||||
|
// 'pp' => "test2",
|
||||||
|
// 'user' => "Doe",
|
||||||
|
// 'role' => "Athlète",
|
||||||
|
// 'friendship' => [],
|
||||||
|
// 'analyzes' => [],
|
||||||
|
// 'mails' => [],
|
||||||
|
// 'users' => $utiliArray,
|
||||||
|
// 'infoUser' => [],
|
||||||
|
// 'exos' => [],
|
||||||
|
// 'member' => [],
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
@ -0,0 +1,80 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// namespace App\Controller;
|
||||||
|
|
||||||
|
// use App\Container;
|
||||||
|
// use App\Router\Request\IRequest;
|
||||||
|
// use App\Router\Response\Response;
|
||||||
|
// use Shared\Attributes\Route;
|
||||||
|
// use Twig\Environment;
|
||||||
|
// use Data\Core\Preferences;
|
||||||
|
// use Shared\Log;
|
||||||
|
|
||||||
|
// class AuthController extends BaseController
|
||||||
|
// {
|
||||||
|
// #[Route('/login', name: 'login')]
|
||||||
|
// public function login(?string $username, ?string $password ,IRequest $request): Response {
|
||||||
|
// // if user is already logged in, don't display the login page again
|
||||||
|
// if ($user) {
|
||||||
|
// return $this->redirectToRoute('blog_index');
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // this statement solves an edge-case: if you change the locale in the login
|
||||||
|
// // page, after a successful login you are redirected to a page in the previous
|
||||||
|
// // locale. This code regenerates the referrer URL whenever the login page is
|
||||||
|
// // browsed, to ensure that its locale is always the current one.
|
||||||
|
// $this->saveTargetPath($request->getSession(), 'main', $this->generateUrl('admin_index'));
|
||||||
|
|
||||||
|
// return $this->render('security/login.html.twig', [
|
||||||
|
// // last username entered by the user (if any)
|
||||||
|
// 'last_username' => $helper->getLastUsername(),
|
||||||
|
// // last authentication error (if any)
|
||||||
|
// 'error' => $helper->getLastAuthenticationError(),
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// #[Route('/login', name: 'login')]
|
||||||
|
// public function login(?string $username, ?string $password ,IRequest $request): Response {
|
||||||
|
// // if user is already logged in, don't display the login page again
|
||||||
|
// if ($user) {
|
||||||
|
// return $this->redirectToRoute('blog_index');
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // this statement solves an edge-case: if you change the locale in the login
|
||||||
|
// // page, after a successful login you are redirected to a page in the previous
|
||||||
|
// // locale. This code regenerates the referrer URL whenever the login page is
|
||||||
|
// // browsed, to ensure that its locale is always the current one.
|
||||||
|
// $this->saveTargetPath($request->getSession(), 'main', $this->generateUrl('admin_index'));
|
||||||
|
|
||||||
|
// return $this->render('security/login.html.twig', [
|
||||||
|
// // last username entered by the user (if any)
|
||||||
|
// 'last_username' => $helper->getLastUsername(),
|
||||||
|
// // last authentication error (if any)
|
||||||
|
// 'error' => $helper->getLastAuthenticationError(),
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// function inscription() {
|
||||||
|
// $model = new ModelVisitor();
|
||||||
|
// $log=Validation::clean_string($_POST['pseudo']);
|
||||||
|
// $mdp=Validation::clean_string($_POST['password']);
|
||||||
|
// if($model->createAUser($log,$mdp)){
|
||||||
|
// if(ModelUser::login($log, $mdp)){
|
||||||
|
// UserControler::displayView();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// function login() {
|
||||||
|
// $model = new ModelVisitor();
|
||||||
|
// if(!isset($_POST['pseudo']) || !isset($_POST['password'])) throw new Exception(" some wrong with credentials !!!!!");
|
||||||
|
// $log=Validation::clean_string($_POST['pseudo']);
|
||||||
|
// $mdp=Validation::clean_string($_POST['password']);
|
||||||
|
// if(ModelUser::login($log, $mdp)){
|
||||||
|
// UserControler::displayView();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// }
|
@ -0,0 +1,128 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// namespace App\Controller;
|
||||||
|
|
||||||
|
// use App\Container;
|
||||||
|
// use App\Router\Request\IRequest;
|
||||||
|
// use App\Router\Response\Response;
|
||||||
|
// use App\Router\Response\IResponse;
|
||||||
|
|
||||||
|
// use Shared\Attributes\Route;
|
||||||
|
// use Twig\Environment;
|
||||||
|
// use Data\Core\Preferences;
|
||||||
|
// use Shared\Log;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// #[Route(path: '/coach', name: 'coach')]
|
||||||
|
// class CoachController extends BaseController
|
||||||
|
// {
|
||||||
|
|
||||||
|
// private ICoachManager $coachManager;
|
||||||
|
// private $security;
|
||||||
|
|
||||||
|
// public function __construct(DataManager $dataManager, Security $security)
|
||||||
|
// {
|
||||||
|
// $this->coachManager = $dataManager->coachMgr;
|
||||||
|
// $this->security = $security;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// #[Route(path: '/', name: 'home', methods: ['GET'])]
|
||||||
|
// public function index(): Response
|
||||||
|
// {
|
||||||
|
// return $this->render('./page/home.html.twig',[
|
||||||
|
// 'css' => $this->preference->getCookie(),
|
||||||
|
// 'pp' => "test2",
|
||||||
|
// 'user' => "Doe",
|
||||||
|
// 'role' => "Athlète",
|
||||||
|
// 'friendship' => [],
|
||||||
|
// 'analyzes' => [],
|
||||||
|
// 'mails' => [],
|
||||||
|
// 'users' => [],
|
||||||
|
// 'infoUser' => [],
|
||||||
|
// 'exos' => [],
|
||||||
|
// 'member' => []
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// #[Route('/global-stats', name: 'coach_global_stats', methods: ['GET'])]
|
||||||
|
// public function globalStats(): Response
|
||||||
|
// {
|
||||||
|
// // Add logic to fetch and process global stats
|
||||||
|
// return $this->render('coach/global_stats.html.twig');
|
||||||
|
// }
|
||||||
|
|
||||||
|
// #[Route(path: '/exercice', name: 'exercice', methods: ['GET'])] // 8
|
||||||
|
// public function exercice(): Response
|
||||||
|
// {
|
||||||
|
// return $this->render('./page/exercice.html.twig',[
|
||||||
|
// 'css' => $this->preference->getCookie(),
|
||||||
|
// 'pp' => "test2",
|
||||||
|
// 'user' => "Doe",
|
||||||
|
// 'role' => "Athlète",
|
||||||
|
// 'friendship' => [],
|
||||||
|
// 'analyzes' => [],
|
||||||
|
// 'mails' => [],
|
||||||
|
// 'users' => [],
|
||||||
|
// 'infoUser' => [],
|
||||||
|
// 'exos' => [],
|
||||||
|
// 'member' => []
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// #[Route(path: '/coaching', name: 'coaching', methods: ['GET'])]
|
||||||
|
// public function coaching(): Response
|
||||||
|
// {
|
||||||
|
// return $this->render('./page/coaching.html.twig',[
|
||||||
|
// 'css' => $this->preference->getCookie(),
|
||||||
|
// 'pp' => "test2",
|
||||||
|
// 'user' => "Doe",
|
||||||
|
// 'role' => "Athlète",
|
||||||
|
// 'friendship' => [],
|
||||||
|
// 'analyzes' => [],
|
||||||
|
// 'mails' => [],
|
||||||
|
// 'users' => [],
|
||||||
|
// 'infoUser' => [],
|
||||||
|
// 'exos' => [],
|
||||||
|
// 'member' => []
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// #[Route('/list-athletes', name: 'coach_list_athletes')]
|
||||||
|
// public function listAthletes(): Response
|
||||||
|
// {
|
||||||
|
// $coach = $this->security->getUser();
|
||||||
|
// $athletes = $this->coachManager->getAthletesForCoach($coach);
|
||||||
|
|
||||||
|
// return $this->render('coach/list_athletes.html.twig', [
|
||||||
|
// 'athletes' => $athletes,
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
// #[Route('/athlete-analysis/{athleteId}', name: 'coach_athlete_analysis', methods: ['GET'])]
|
||||||
|
// public function athleteAnalysis($athleteId): Response
|
||||||
|
// {
|
||||||
|
// // Fetch and process data specific to the athlete
|
||||||
|
// return $this->render('coach/athlete_analysis.html.twig', [
|
||||||
|
// 'athleteId' => $athleteId,
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// #[Route('/add-athlete/{athleteId}', name: 'coach_add_athlete', methods: ['POST'])]
|
||||||
|
// public function addAthlete(IRequest $request, $athleteId): IResponse
|
||||||
|
// {
|
||||||
|
// // Implement logic to add athlete
|
||||||
|
// // ...
|
||||||
|
|
||||||
|
// return $this->redirectToRoute('coach_list_athletes');
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // #[Route('/remove-athlete', name: 'coach_remove_athlete', methods: ['POST'])]
|
||||||
|
// // public function removeAthlete(int $athleteId, IRequest $request): IResponse
|
||||||
|
// // {
|
||||||
|
|
||||||
|
// // return $this->redirectToRoute("/athletes");
|
||||||
|
// // }
|
||||||
|
|
||||||
|
|
||||||
|
// }
|
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// namespace App\Controller;
|
||||||
|
|
||||||
|
// use App\Container;
|
||||||
|
// use App\Router\Request\IRequest;
|
||||||
|
// use App\Router\Response\Response;
|
||||||
|
// use Shared\Attributes\Route;
|
||||||
|
// use Twig\Environment;
|
||||||
|
// use Data\Core\Preferences;
|
||||||
|
// use Shared\Log;
|
||||||
|
|
||||||
|
// class HeartRateController extends BaseController
|
||||||
|
// {
|
||||||
|
|
||||||
|
|
||||||
|
// #[Route(path: '/import', name: 'import', methods: ['GET'])]
|
||||||
|
// public function import(): Response
|
||||||
|
// {
|
||||||
|
// return $this->render('./page/import.html.twig',[
|
||||||
|
// 'css' => $this->preference->getCookie(),
|
||||||
|
// 'pp' => "test2",
|
||||||
|
// 'user' => "Doe",
|
||||||
|
// 'role' => "Athlète",
|
||||||
|
// 'friendship' => [],
|
||||||
|
// 'analyzes' => [],
|
||||||
|
// 'mails' => [],
|
||||||
|
// 'users' => [],
|
||||||
|
// 'infoUser' => [],
|
||||||
|
// 'exos' => [],
|
||||||
|
// 'member' => []
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// }
|
@ -0,0 +1,17 @@
|
|||||||
|
<!-- #[Route(path: '/mail', name: 'mail', methods: ['GET'])]
|
||||||
|
public function mail(): Response
|
||||||
|
{
|
||||||
|
return $this->render('./page/mail.html.twig',[
|
||||||
|
'css' => $this->preference->getCookie(),
|
||||||
|
'pp' => "test2",
|
||||||
|
'user' => "Doe",
|
||||||
|
'role' => "Athlète",
|
||||||
|
'friendship' => [],
|
||||||
|
'analyzes' => [],
|
||||||
|
'mails' => [],
|
||||||
|
'users' => [],
|
||||||
|
'infoUser' => [],
|
||||||
|
'exos' => [],
|
||||||
|
'member' => []
|
||||||
|
]);
|
||||||
|
} -->
|
@ -0,0 +1,80 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// namespace App\Controller;
|
||||||
|
|
||||||
|
// use App\Container;
|
||||||
|
// use App\Router\Request\IRequest;
|
||||||
|
// use App\Router\Response\Response;
|
||||||
|
// use Shared\Attributes\Route;
|
||||||
|
// use Twig\Environment;
|
||||||
|
// use Data\Core\Preferences;
|
||||||
|
// use Shared\Log;
|
||||||
|
|
||||||
|
// class UserController extends BaseController
|
||||||
|
// {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// #[Route(path: '/', name: 'home', methods: ['GET'])]
|
||||||
|
// public function index(): Response
|
||||||
|
// {
|
||||||
|
// return $this->render('./page/home.html.twig',[
|
||||||
|
// 'css' => $this->preference->getCookie(),
|
||||||
|
// 'pp' => "test2",
|
||||||
|
// 'user' => "Doe",
|
||||||
|
// 'role' => "Athlète",
|
||||||
|
// 'friendship' => [],
|
||||||
|
// 'analyzes' => [],
|
||||||
|
// 'mails' => [],
|
||||||
|
// 'users' => [],
|
||||||
|
// 'infoUser' => [],
|
||||||
|
// 'exos' => [],
|
||||||
|
// 'member' => []
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// #[Route(path: '/settings', name: 'settings', methods: ['GET'])]
|
||||||
|
// public function settings(IRequest $req): Response
|
||||||
|
// {
|
||||||
|
// return $this->render('./page/settings.html.twig',[
|
||||||
|
// 'css' => $this->preference->getCookie(),
|
||||||
|
// 'pp' => "test2",
|
||||||
|
// 'user' => "Doe",
|
||||||
|
// 'role' => "Athlète",
|
||||||
|
// 'friendship' => [],
|
||||||
|
// 'analyzes' => [],
|
||||||
|
// 'mails' => [],
|
||||||
|
// 'users' => [],
|
||||||
|
// 'infoUser' => [],
|
||||||
|
// 'exos' => [],
|
||||||
|
// 'member' => []
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// #[Route(path: '/preferences', name: 'preferences', methods: ['POST'])]
|
||||||
|
// public function preferences(string $theme, IRequest $req): Response
|
||||||
|
// {
|
||||||
|
// /*TODO*/
|
||||||
|
|
||||||
|
// // VALIDER LES DONNEES
|
||||||
|
// $this->preference->majCookie($theme);
|
||||||
|
|
||||||
|
// return $this->render('./page/settings.html.twig',[
|
||||||
|
// 'css' => $this->preference->getCookie(),
|
||||||
|
// 'pp' => "test2",
|
||||||
|
// 'user' => "Doe",
|
||||||
|
// 'role' => "Athlète",
|
||||||
|
// 'friendship' => [],
|
||||||
|
// 'analyzes' => [],
|
||||||
|
// 'mails' => [],
|
||||||
|
// 'users' => [],
|
||||||
|
// 'infoUser' => [],
|
||||||
|
// 'exos' => [],
|
||||||
|
// 'member' => []
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
Loading…
Reference in new issue