multi user

This commit is contained in:
2024-10-26 12:08:33 +02:00
parent ecfb7d82d4
commit b85d03f78c
26 changed files with 1310 additions and 240 deletions

View File

@ -12,20 +12,47 @@ class HomeController extends AbstractController
public function home()
{
$em = $this->getDoctrine()->getManager();
$categorys = $em->getRepository("App:Category")->findAll();
$links = $em->getRepository("App:Link")->findAll();
$webzines = $em->getRepository("App:Webzine")->findBy([], ['set' => 'ASC', 'order' => 'ASC']);
$users = $em->getRepository("App:User")->findBy([],["pseudo"=>"ASC"]);
$categorys = $em->getRepository("App:Category")->findBy(["user"=>null]);
$links = $em->getRepository("App:Link")->findBy(["user"=>null]);
$webzines = $em->getRepository("App:Webzine")->findBy(["user"=>null], ['set' => 'ASC', 'order' => 'ASC']);
return $this->render('Home/home.html.twig',[
"useheader" => false,
"usesidebar" => false,
"usemonocolor" => true,
"users" => $users,
"categorys" => $categorys,
"links" => $links,
"webzines" => $webzines
]);
}
public function user($userpseudo)
{
$em = $this->getDoctrine()->getManager();
$user=$em->getRepository("App:User")->findOneBy(["slug"=>$userpseudo]);
if(!$user) return $this->redirectToRoute("app_home");
$categorys = $em->getRepository("App:Category")->findBy(["user"=>$user]);
$links = $em->getRepository("App:Link")->findBy(["user"=>$user]);
$webzines = $em->getRepository("App:Webzine")->findBy(["user"=>$user], ['set' => 'ASC', 'order' => 'ASC']);
$config = $em->getRepository("App:Config")->getUserConfig($user);
return $this->render('Home/user.html.twig',[
"useheader" => false,
"usesidebar" => false,
"usemonocolor" => true,
"user" => $user,
"config" => $config,
"categorys" => $categorys,
"links" => $links,
"webzines" => $webzines
]);
}
public function feed($nb)
{
$feeds=[];