Commit 2f26ec12ad73bc2e80d0e419175eebf43cc01da7

Authored by Etienne Pallier
1 parent ccfdef5f
Exists in master and in 2 other branches dev, dev-IRAP

ldap test

Showing 1 changed file with 224 additions and 2 deletions   Show diff stats
src/Model/Table/LdapConnectionsTable.php
... ... @@ -523,7 +523,229 @@ class LdapConnectionsTable extends AppTable
523 523 //$binddn .= ','.$this->baseDn;
524 524 $user_fetched = $this->searchLdap($filter, $just_these, $user_login, $user_password);
525 525 $this->mydebugmsg("(1) user found in LDAP is:");
526   - $this->mydebugmsg($user_fetched);
  526 + //$this->mydebugmsg($user_fetched);
  527 + $this->mydebugmsg($user_fetched[0]);
  528 + /* Voici un exemple de ce qui est dans $user_fetched (structure LDAP IRAP) :
  529 +
  530 + 'sn' => [
  531 + 'count' => (int) 1,
  532 + (int) 0 => 'Pallier'
  533 + ],
  534 + (int) 14 => 'sn',
  535 + 'givenname' => [
  536 + 'count' => (int) 1,
  537 + (int) 0 => 'Etienne'
  538 + ],
  539 +
  540 +
  541 + [
  542 + 'sn' => [
  543 + (int) 0 => 'Pallier'
  544 + ],
  545 + 'mail' => [
  546 + (int) 0 => 'Etienne.Pallier@irap.omp.eu'
  547 + ],
  548 + 'givenname' => [
  549 + (int) 0 => 'Etienne'
  550 + ],
  551 + 'uid' => [
  552 + (int) 0 => 'epallier'
  553 + ],
  554 + 'userpassword' => [
  555 + (int) 0 => '<mot de passe crypté>'
  556 + ]
  557 + ]
  558 +
  559 + [
  560 + 'count' => (int) 1,
  561 + (int) 0 => [
  562 + 'cn' => [
  563 + 'count' => (int) 1,
  564 + (int) 0 => 'Etienne Pallier'
  565 + ],
  566 + (int) 0 => 'cn',
  567 + 'homedirectory' => [
  568 + 'count' => (int) 1,
  569 + (int) 0 => '/home/epallier'
  570 + ],
  571 + (int) 1 => 'homedirectory',
  572 + 'uidnumber' => [
  573 + 'count' => (int) 1,
  574 + (int) 0 => '20172'
  575 + ],
  576 + (int) 2 => 'uidnumber',
  577 + 'objectclass' => [
  578 + 'count' => (int) 9,
  579 + (int) 0 => 'top',
  580 + (int) 1 => 'person',
  581 + (int) 2 => 'organizationalPerson',
  582 + (int) 3 => 'inetOrgPerson',
  583 + (int) 4 => 'posixAccount',
  584 + (int) 5 => 'shadowAccount',
  585 + (int) 6 => 'irap',
  586 + (int) 7 => 'hostObject',
  587 + (int) 8 => 'sambaSamAccount'
  588 + ],
  589 + (int) 3 => 'objectclass',
  590 + 'sambasid' => [
  591 + 'count' => (int) 1,
  592 + (int) 0 => 'S-1-5-21-3149873848-2002230563-1027543705-41344'
  593 + ],
  594 + (int) 4 => 'sambasid',
  595 + 'mail' => [
  596 + 'count' => (int) 1,
  597 + (int) 0 => 'Etienne.Pallier@irap.omp.eu'
  598 + ],
  599 + (int) 5 => 'mail',
  600 + 'olddn' => [
  601 + 'count' => (int) 1,
  602 + (int) 0 => 'uid=pallier,ou=users,ou=laboratoire,dc=cesr,dc=fr'
  603 + ],
  604 + (int) 6 => 'olddn',
  605 + 'userpassword' => [
  606 + 'count' => (int) 1,
  607 + (int) 0 => '{SASL}epallier@IRAP.OMP.EU'
  608 + ],
  609 + (int) 7 => 'userpassword',
  610 + 'sambantpassword' => [
  611 + 'count' => (int) 1,
  612 + (int) 0 => 'ED9A0ECE0C6C7560A8DDF6A23B2C7C36'
  613 + ],
  614 + (int) 8 => 'sambantpassword',
  615 + 'sambapwdlastset' => [
  616 + 'count' => (int) 1,
  617 + (int) 0 => '1317291687'
  618 + ],
  619 + (int) 9 => 'sambapwdlastset',
  620 + 'loginshell' => [
  621 + 'count' => (int) 1,
  622 + (int) 0 => '/bin/bash'
  623 + ],
  624 + (int) 10 => 'loginshell',
  625 + 'shadowexpire' => [
  626 + 'count' => (int) 1,
  627 + (int) 0 => '-1'
  628 + ],
  629 + (int) 11 => 'shadowexpire',
  630 + 'host' => [
  631 + 'count' => (int) 3,
  632 + (int) 0 => 'gitlab1.irap.omp.eu',
  633 + (int) 1 => 'gw.irap.omp.eu',
  634 + (int) 2 => 'version2.irap.omp.eu'
  635 + ],
  636 + (int) 12 => 'host',
  637 + 'uid' => [
  638 + 'count' => (int) 1,
  639 + (int) 0 => 'epallier'
  640 + ],
  641 + (int) 13 => 'uid',
  642 + 'sn' => [
  643 + 'count' => (int) 1,
  644 + (int) 0 => 'Pallier'
  645 + ],
  646 + (int) 14 => 'sn',
  647 + 'givenname' => [
  648 + 'count' => (int) 1,
  649 + (int) 0 => 'Etienne'
  650 + ],
  651 + (int) 15 => 'givenname',
  652 + 'gecos' => [
  653 + 'count' => (int) 1,
  654 + (int) 0 => 'Etienne.Pallier'
  655 + ],
  656 + (int) 16 => 'gecos',
  657 + 'gidnumber' => [
  658 + 'count' => (int) 1,
  659 + (int) 0 => '2001'
  660 + ],
  661 + (int) 17 => 'gidnumber',
  662 + 'tagmail' => [
  663 + 'count' => (int) 1,
  664 + (int) 0 => 'Oui'
  665 + ],
  666 + (int) 18 => 'tagmail',
  667 + 'compteinfo' => [
  668 + 'count' => (int) 1,
  669 + (int) 0 => 'Oui'
  670 + ],
  671 + (int) 19 => 'compteinfo',
  672 + 'arrivaldate' => [
  673 + 'count' => (int) 1,
  674 + (int) 0 => '01/01/1933'
  675 + ],
  676 + (int) 20 => 'arrivaldate',
  677 + 'birthday' => [
  678 + 'count' => (int) 1,
  679 + (int) 0 => '07/08/1968'
  680 + ],
  681 + (int) 21 => 'birthday',
  682 + 'telephonenumber' => [
  683 + 'count' => (int) 1,
  684 + (int) 0 => '0561556648'
  685 + ],
  686 + (int) 22 => 'telephonenumber',
  687 + 'roomnumber' => [
  688 + 'count' => (int) 1,
  689 + (int) 0 => 'J039'
  690 + ],
  691 + (int) 23 => 'roomnumber',
  692 + 'mailperso' => [
  693 + 'count' => (int) 1,
  694 + (int) 0 => 'N/A'
  695 + ],
  696 + (int) 24 => 'mailperso',
  697 + 'title' => [
  698 + 'count' => (int) 1,
  699 + (int) 0 => 'M'
  700 + ],
  701 + (int) 25 => 'title',
  702 + 'site' => [
  703 + 'count' => (int) 1,
  704 + (int) 0 => 'Roche'
  705 + ],
  706 + (int) 26 => 'site',
  707 + 'manager' => [
  708 + 'count' => (int) 1,
  709 + (int) 0 => 'uid=mgiard,ou=users,dc=irap,dc=omp,dc=eu'
  710 + ],
  711 + (int) 27 => 'manager',
  712 + 'statut1' => [
  713 + 'count' => (int) 1,
  714 + (int) 0 => 'ITA'
  715 + ],
  716 + (int) 28 => 'statut1',
  717 + 'o' => [
  718 + 'count' => (int) 1,
  719 + (int) 0 => 'UPS'
  720 + ],
  721 + (int) 29 => 'o',
  722 + 'gt1' => [
  723 + 'count' => (int) 1,
  724 + (int) 0 => 'PEPS'
  725 + ],
  726 + (int) 30 => 'gt1',
  727 + 'gt2' => [
  728 + 'count' => (int) 1,
  729 + (int) 0 => 'GAHEC'
  730 + ],
  731 + (int) 31 => 'gt2',
  732 + 'statut2' => [
  733 + 'count' => (int) 1,
  734 + (int) 0 => 'GT2I'
  735 + ],
  736 + (int) 32 => 'statut2',
  737 + 'affichageannuaire' => [
  738 + 'count' => (int) 1,
  739 + (int) 0 => 'Oui'
  740 + ],
  741 + (int) 33 => 'affichageannuaire',
  742 + 'count' => (int) 34,
  743 + 'dn' => 'uid=epallier,ou=users,dc=irap,dc=omp,dc=eu'
  744 + ]
  745 + ]
  746 +
  747 +
  748 + */
527 749 // CACHE the new user in DB for next time
528 750 if ($user_fetched !== FALSE) {
529 751 $this->saveNewUserInDB($user_fetched[0]);
... ... @@ -544,7 +766,7 @@ class LdapConnectionsTable extends AppTable
544 766 $user_fetched = $this->getFakeLdapUser($user_login);
545 767 $this->mydebugmsg("(1) user found in FAKE LDAP is:");
546 768 $this->mydebugmsg($user_fetched);
547   - /* Voici un exemple de ce qui est dans $user_fetched
  769 + /* Voici un exemple de ce qui est dans $user_fetched (fake ldap) :
548 770 [
549 771 'sn' => [
550 772 (int) 0 => 'Pallier'
... ...