Commit 8a17d8c8 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Adaptations pour ZF3.

parent 49fa65a9
Loading
Loading
Loading
Loading
+28 −29
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@
    "name": "unicaen/unicaen-oauth",
    "description": "Serveur OAuth2 authentifiant soit via LDAP, soit via CAS",
    "minimum-stability": "dev",
  "license": "proprietary",
    "authors": [
        {
            "name": "Bertrand GAUTHIER",
@@ -16,9 +15,9 @@
        }
    ],
    "require": {
    "zendframework/zend-authentication": "~2.4 || ^2.5 || ^7.0",
        "zendframework/zend-authentication": "^2.5",
        "zfcampus/zf-oauth2":                "^1.4.0",
    "unicaen/unicaen-ldap": "^2.0.0",
        "unicaen/unicaen-ldap":              "^3.0.0",
        "jasig/phpcas":                      "^1.3.4"
    },
    "autoload": {
+20 −20
Original line number Diff line number Diff line
@@ -4,8 +4,8 @@
        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
        "This file is @generated automatically"
    ],
    "hash": "6f06385f2f903fbbcda308b8d572b202",
    "content-hash": "ba5a487c93828a438d29a3984880f937",
    "hash": "5cc79788482906ab97429cf4c8df3da0",
    "content-hash": "15907b9134e28995154b4d04d10585bb",
    "packages": [
        {
            "name": "bshaffer/oauth2-server-php",
@@ -241,26 +241,26 @@
        },
        {
            "name": "unicaen/unicaen-ldap",
            "version": "2.0.0",
            "version": "3.0.0.x-dev",
            "source": {
                "type": "svn",
                "url": "https://svn.unicaen.fr/svn/UnicaenLdap",
                "reference": "/tags/2.0.0/@29"
                "reference": "/branches/3.0.0/@34"
            },
            "require": {
                "php": "^5.6 || ^7.0",
                "zendframework/zend-config": "~2.4 || ^2.7 || ^3.0",
                "zendframework/zend-i18n": "~2.4 || ^2.7 || ^3.0",
                "zendframework/zend-ldap": "~2.4 || ^2.7 || ^3.0",
                "zendframework/zend-log": "~2.4 || ^2.7 || ^3.0",
                "zendframework/zend-modulemanager": "~2.4 || ^2.7 || ^3.0",
                "zendframework/zend-serializer": "~2.4 || ^2.7 || ^3.0",
                "zendframework/zend-servicemanager": "~2.4 || ^2.7 || ^3.0",
                "zendframework/zend-stdlib": "~2.4 || ^2.7 || ^3.0"
                "zendframework/zend-config": "^2.6",
                "zendframework/zend-i18n": "^2.7",
                "zendframework/zend-ldap": "^2.7",
                "zendframework/zend-log": "^2.7",
                "zendframework/zend-modulemanager": "^2.7",
                "zendframework/zend-serializer": "^2.7",
                "zendframework/zend-servicemanager": "^3.0",
                "zendframework/zend-stdlib": "^3.0"
            },
            "require-dev": {
                "phpunit/phpunit": ">=3.7",
                "zendframework/zend-test": ">=2.2"
                "phpunit/phpunit": "^5.7",
                "zendframework/zend-test": "^3.0"
            },
            "type": "library",
            "autoload": {
@@ -274,7 +274,7 @@
                ]
            },
            "description": "Module Ldap de l'UCBN",
            "time": "2017-01-11 15:44:32"
            "time": "2017-01-13 11:38:26"
        },
        {
            "name": "zendframework/zend-authentication",
@@ -873,12 +873,12 @@
            "source": {
                "type": "git",
                "url": "https://github.com/zendframework/zend-log.git",
                "reference": "836497934c819015a4b78c49dc7225325ad164e8"
                "reference": "a4fbf3f9068671cd61b3d96c3a9c6080ca0c0568"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/zendframework/zend-log/zipball/836497934c819015a4b78c49dc7225325ad164e8",
                "reference": "836497934c819015a4b78c49dc7225325ad164e8",
                "url": "https://api.github.com/repos/zendframework/zend-log/zipball/a4fbf3f9068671cd61b3d96c3a9c6080ca0c0568",
                "reference": "a4fbf3f9068671cd61b3d96c3a9c6080ca0c0568",
                "shasum": ""
            },
            "require": {
@@ -893,7 +893,7 @@
            "require-dev": {
                "friendsofphp/php-cs-fixer": "~1.7.0",
                "mikey179/vfsstream": "^1.6",
                "phpunit/phpunit": "~4.0",
                "phpunit/phpunit": "^5.7",
                "zendframework/zend-db": "^2.6",
                "zendframework/zend-escaper": "^2.5",
                "zendframework/zend-filter": "^2.5",
@@ -936,7 +936,7 @@
                "logging",
                "zf2"
            ],
            "time": "2016-08-11 13:46:22"
            "time": "2017-01-12 15:38:22"
        },
        {
            "name": "zendframework/zend-math",
+3 −7
Original line number Diff line number Diff line
<?php

namespace UnicaenOauth\Cas;

use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorAwareTrait;
use phpCAS;

class CasService implements ServiceLocatorAwareInterface
class CasService
{
    use ServiceLocatorAwareTrait;

    private $config;

    public function __construct(array $config)
@@ -66,5 +63,4 @@ class CasService implements ServiceLocatorAwareInterface

        return $this;
    }

}
+10 −4
Original line number Diff line number Diff line
@@ -2,14 +2,20 @@

namespace UnicaenOauth\Cas;

use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\Factory\FactoryInterface;

class CasServiceFactory implements FactoryInterface
{
    public function createService(ServiceLocatorInterface $serviceLocator)
    /**
     * @param  ContainerInterface $container
     * @param  string             $requestedName
     * @param  null|array         $options
     * @return CasService
     */
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
        $config = $serviceLocator->get('config');
        $config = $container->get('config');

        return new CasService($config['unicaen-oauth']['cas']);
    }
+10 −4
Original line number Diff line number Diff line
@@ -2,14 +2,20 @@

namespace UnicaenOauth\Controller;

use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\Factory\FactoryInterface;

class CasControllerFactory implements FactoryInterface
{
    public function createService(ServiceLocatorInterface $serviceLocator)
    /**
     * @param  ContainerInterface $container
     * @param  string             $requestedName
     * @param  null|array         $options
     * @return CasController
     */
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
        $casService = $serviceLocator->getServiceLocator()->get('service.cas');
        $casService = $container/*->getServiceLocator()*/->get('service.cas');

        $controller = new CasController();
        $controller->setServiceCas($casService);
Loading