Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 15678 | Rev 15680 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
15670 anderson 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace LeadersLinked\Controller;
6
 
7
use Laminas\Mvc\Controller\AbstractActionController;
8
use Laminas\View\Model\ViewModel;
15673 anderson 9
use Laminas\View\Model\JsonModel;
15670 anderson 10
 
11
// Create an action controller.
12
class DiscoveryContactProgressController extends AbstractActionController
13
{
14
    // Define an action "world".
15
    public function indexAction()
16
    {
15674 anderson 17
        $currentUserPlugin = $this->plugin('currentUserPlugin');
18
        $currentUser = $currentUserPlugin->getUser();
19
        $currentCompany = $currentUserPlugin->getCompany();
15670 anderson 20
 
15674 anderson 21
        $request = $this->getRequest();
22
        if ($request->isGet()) {
15677 anderson 23
            $headers  = $request->getHeaders();
24
            $isJson = false;
15678 anderson 25
 
15679 anderson 26
            $prioritized = $accept->getPrioritized();
27
 
28
            foreach ($prioritized as $key => $value) {
29
                $raw = trim($value->getRaw());
30
 
31
                if (!$isJson) {
32
                    $isJson = strpos($raw, 'json');
33
                }
34
            }
35
 
36
 
15677 anderson 37
            return new JsonModel([
38
                'success' => true,
15678 anderson 39
                'message' => $headers
15677 anderson 40
            ]);
15675 anderson 41
        }
15673 anderson 42
        return new JsonModel([
43
            'success' => true,
15676 anderson 44
            'message' => $currentUser
15673 anderson 45
        ]);
15670 anderson 46
    }
47
}