Skip to content

Commit

Permalink
Cleanup for medals, because it does mater :-)
Browse files Browse the repository at this point in the history
  • Loading branch information
ztec committed Apr 10, 2016
1 parent d69f5bc commit 87b919c
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 63 deletions.
30 changes: 0 additions & 30 deletions DependencyInjection/Configuration.php

This file was deleted.

2 changes: 1 addition & 1 deletion Exception/ADConnexionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
class ADConnexionException extends \Exception
{

}
}
2 changes: 1 addition & 1 deletion Exception/WrongTokenException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
class WrongTokenException extends \Exception
{

}
}
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ Riper/Security/ActiveDirectory
This package is a bundle for Symfony 2. It uses the standard form_login security model to authenticate user from an Active Directory domain.
It uses LDAP as communication layer, so you need the LDAP extension installed on your server to make it work.


[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/RiperFr/Security-ActiveDirectoryBundle/badges/quality-score.png?b=v2.x)](https://scrutinizer-ci.com/g/RiperFr/Security-ActiveDirectoryBundle/?branch=v2.x)
![License CC-BY-4](https://img.shields.io/badge/licence-CC--BY--4.0-blue.svg)
![php version](https://img.shields.io/badge/php->=5.3.0,%205.4,%205.5,%205.6,%207-blue.svg)
![symfony version](https://img.shields.io/badge/symfony-2.6,%202.7,%202.8,%203-blue.svg)

[![SensioLabsInsight](https://insight.sensiolabs.com/projects/3628b49a-0ab1-4412-94cf-328809040af1/big.png)](https://insight.sensiolabs.com/projects/3628b49a-0ab1-4412-94cf-328809040af1)



Requirements
----------------
php 5.3.0
Expand Down
2 changes: 1 addition & 1 deletion Resources/translations/messages.de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ riper.security.active_directory.invalid_user: "Der Benutzername ist ungültig :
riper.security.active_directory.wrong_credential: "Benutzername oder Passwort falsch"
riper.security.active_directory.username_not_matching_rules: "Der Benutzername \"%username%\" entspricht nicht der Benutzernamenrichtlinie"
riper.security.active_directory.ad.bad_response: "Unerwartete Antwort vom Active Directory Server : %connection_status% - %is_AD%"
riper.security.active_directory.bad_instance: "Instanz von \"%class_name%\" nicht unterstützt"
riper.security.active_directory.bad_instance: "Instanz von \"%class_name%\" nicht unterstützt"
2 changes: 1 addition & 1 deletion Resources/translations/messages.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ riper.security.active_directory.invalid_user: "The username is invalid : \"%reas
riper.security.active_directory.wrong_credential: "Bad credentials"
riper.security.active_directory.username_not_matching_rules: "The username \"%username%\" does not match the username policy"
riper.security.active_directory.ad.bad_response: "Bad response from the Active Directory server : %connection_status% - %is_AD%"
riper.security.active_directory.bad_instance: "Instance of \"%class_name%\" is not suported."
riper.security.active_directory.bad_instance: "Instance of \"%class_name%\" is not suported."
2 changes: 1 addition & 1 deletion Resources/translations/messages.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ riper.security.active_directory.invalid_user: "Le login est invalid : \"%reason%
riper.security.active_directory.wrong_credential: "Identifiants erronés"
riper.security.active_directory.username_not_matching_rules: "Le login \"%username%\" ne correspond à aucune règle"
riper.security.active_directory.ad.bad_response: "L'Active Directory ne repond pas : %connection_status% - %is_AD%"
riper.security.active_directory.bad_instance: "Les instance \"%class_name%\" ne sont pas suportées"
riper.security.active_directory.bad_instance: "Les instance \"%class_name%\" ne sont pas suportées"
3 changes: 0 additions & 3 deletions Security/Factory/AdAuthFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@

namespace Riper\Security\ActiveDirectoryBundle\Security\Factory;

use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FormLoginFactory;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;

class AdAuthFactory extends FormLoginFactory
{
Expand Down
2 changes: 1 addition & 1 deletion Security/Factory/AdldapFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ public function getAuthenticatedAdLdap()
$adldap->authenticate($token->getUsername(), $token->getCredentials());
}

}
}
2 changes: 1 addition & 1 deletion Security/Token/FaultyToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public function eraseCredentials()
{

}
}
}
6 changes: 1 addition & 5 deletions Security/User/AdUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ class AdUser implements UserInterface
/** @var string */
private $password;

/** @var string */
private $salt;

/** @var string */
/** @var array */
private $roles;

/** @var string */
Expand All @@ -28,7 +25,6 @@ public function __construct($username, $password, array $roles)
{
$this->username = $username;
$this->password = $password;
$this->salt = '';
$this->roles = $roles;
}

Expand Down
18 changes: 0 additions & 18 deletions Security/User/AdUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,27 +180,9 @@ public function fetchData(AdUser $adUser, TokenInterface $token, adLDAP $adLdap)
}
/** @var adLDAPUserCollection $user */
$user = $adLdap->user()->infoCollection($adUser->getUsername());
//$userInfo = $adLdap->user_info($this->username);

if ($user) {
$groups = array();
//$allGroups = $adLdap->search_groups(ADLDAP_SECURITY_GLOBAL_GROUP,true);
$groups = $adLdap->user()->groups($adUser->getUsername(), $this->recursiveGrouproles);
/*if ($this->recursiveGrouproles == true) {
// get recursive groups via adLdap
$groups = $adLdap->user()->groups($adUser->getUsername(), true);
} else {
foreach ($user->memberOf as $k => $group) {
if ($k !== 'count' && $group) {
$reg = '#CN=([^,]*)#';
preg_match_all($reg, $group, $out);
$groups[] = $out[1][0];
/*if(array_key_exists($out[1][0],$allGroups)){
$groups[$out[1][0]] = $allGroups[$out[1][0]];
}*/
/*}
}
}*/
/** End Fetching */
$sfRoles = array();
$sfRolesTemp = array();
Expand Down

0 comments on commit 87b919c

Please sign in to comment.