svg
This commit is contained in:
@ -11,8 +11,27 @@ class HomeController extends AbstractController
|
||||
{
|
||||
public function home()
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$items=null;
|
||||
if($this->getParameter("appNinegateactivate")) {
|
||||
// Entete
|
||||
$headers = ['Accept' => 'application/json', 'key' => $this->getParameter("appNinegatesecret"), 'only'=>'items'];
|
||||
$query = [];
|
||||
$url=$this->getParameter("appNinegateurl");
|
||||
// Paramétrage unirest
|
||||
|
||||
\Unirest\Request::verifyPeer(false);
|
||||
\Unirest\Request::verifyHost(false);
|
||||
\Unirest\Request::timeout(5);
|
||||
try {
|
||||
$response = \Unirest\Request::get($url.'/rest/user/'.($this->getUser()?$this->getUser()->getUsername():"nononononouser"),$headers);
|
||||
$items=$response->body->items;
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
dump($items);
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$users = $em->getRepository("App:User")->findBy([],["pseudo"=>"ASC"]);
|
||||
$illustrations = $em->getRepository("App:Illustration")->findBy([],["submittime"=>"DESC"]);
|
||||
$links = $em->getRepository("App:Link")->findBy(["user"=>null]);
|
||||
@ -25,7 +44,8 @@ class HomeController extends AbstractController
|
||||
"users" => $users,
|
||||
"illustrations" => $illustrations,
|
||||
"links" => $links,
|
||||
"webzines" => $webzines
|
||||
"webzines" => $webzines,
|
||||
"items" => $items,
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -168,7 +168,7 @@ class SecurityController extends AbstractController
|
||||
private function updateNinegate($user) {
|
||||
if($this->getParameter("appNinegateactivate") && $this->getParameter("appNinegatemasteridentity")=="SQL") {
|
||||
// Entete
|
||||
$headers = ['Accept' => 'application/json', 'key' => $this->getParameter("appNinegatesecret")];
|
||||
$headers = ['Accept' => 'application/json', 'key' => $this->getParameter("appNinegatesecret"), 'only' => 'user'];
|
||||
$query = [];
|
||||
$url=$this->getParameter("appNinegateurl");
|
||||
// Paramétrage unirest
|
||||
@ -177,7 +177,7 @@ class SecurityController extends AbstractController
|
||||
\Unirest\Request::verifyHost(false);
|
||||
\Unirest\Request::timeout(5);
|
||||
try {
|
||||
$response = \Unirest\Request::get($url.'/rest/user/'.$user->getUsername(),$headers,["only"=>"user"]);
|
||||
$response = \Unirest\Request::get($url.'/rest/user/'.$user->getUsername(),$headers);
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
|
@ -259,14 +259,14 @@ class UserController extends AbstractController
|
||||
private function updateNinegate($user) {
|
||||
if($this->getParameter("appNinegateactivate") && $this->getParameter("appNinegatemasteridentity")=="SQL") {
|
||||
// Entete
|
||||
$headers = ['Accept' => 'application/json', 'key' => $this->getParameter("appNinegatesecret")];
|
||||
$headers = ['Accept' => 'application/json', 'key' => $this->getParameter("appNinegatesecret"), 'only' => 'user'];
|
||||
$query = [];
|
||||
$url=$this->getParameter("appNinegateurl");
|
||||
\Unirest\Request::verifyPeer(false);
|
||||
\Unirest\Request::verifyHost(false);
|
||||
\Unirest\Request::timeout(5);
|
||||
try {
|
||||
$response = \Unirest\Request::get($url.'/rest/user/'.$user->getUsername(),$headers,["only"=>"user"]);
|
||||
$response = \Unirest\Request::get($url.'/rest/user/'.$user->getUsername(),$headers);
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
if(property_exists($response->body->user,'lastname')) $user->setLastname($response->body->user->lastname);
|
||||
|
Reference in New Issue
Block a user