当前位置: 首页>>代码示例>>PHP>>正文


PHP Ldap::deleteGroup方法代码示例

本文整理汇总了PHP中Ldap::deleteGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP Ldap::deleteGroup方法的具体用法?PHP Ldap::deleteGroup怎么用?PHP Ldap::deleteGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ldap的用法示例。


在下文中一共展示了Ldap::deleteGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

$host = "phpuc.ez.no";
$connection = Ldap::connect("ldap://{$host}", "cn=%s,{$dc}", 'admin', 'wee123');
Ldap::delete($connection, 'yoda', "ou=StarWars,{$dc}");
Ldap::delete($connection, 'boba.fett', "ou=StarWars,{$dc}");
Ldap::delete($connection, 'obi.wan', "ou=StarWars,{$dc}");
Ldap::delete($connection, 'jabba.thehutt', "ou=StarWars,{$dc}");
Ldap::delete($connection, 'darth.vader', "ou=StarWars,{$dc}");
Ldap::delete($connection, 'leia', "ou=StarWars,{$dc}");
Ldap::delete($connection, 'han.solo', "ou=StarWars,{$dc}");
Ldap::delete($connection, 'chewbacca', "ou=StarWars,{$dc}");
Ldap::deleteGroup($connection, 'Jedi', "ou=RebelAlliance,ou=StarWars,{$dc}");
Ldap::deleteGroup($connection, 'RebelAlliance', "ou=StarWars,{$dc}");
Ldap::deleteGroup($connection, 'Sith', "ou=GalacticEmpire,ou=StarWars,{$dc}");
Ldap::deleteGroup($connection, 'GalacticEmpire', "ou=StarWars,{$dc}");
Ldap::deleteGroup($connection, 'Rogues', "ou=StarWars,{$dc}");
Ldap::deleteGroup($connection, 'StarWars', $dc);
Ldap::addGroup($connection, 'StarWars', $dc);
$chewbaccaDN = Ldap::add($connection, 'chewbacca', '{MD5}' . base64_encode(pack('H*', md5('aaawwwwrrrkk'))), "ou=StarWars,{$dc}", 'Chewbacca', 'Chewbacca', array('givenName' => 'Chewbacca', 'displayName' => 'Chewbacca the Wokiee', 'ou' => array('StarWars', 'Rogues', 'RebelAlliance'), 'mail' => array('chewbacca@millenniumfalcon.net')));
$hanSoloDN = Ldap::add($connection, 'han.solo', '{MD5}' . base64_encode(pack('H*', md5('leiaishot'))), "ou=StarWars,{$dc}", 'Solo', 'Han Solo', array('givenName' => 'Han', 'displayName' => 'He who shot first', 'ou' => array('StarWars', 'Rogues', 'RebelAlliance'), 'mail' => array('han.solo@millenniumfalcon.net')));
$princessLeiaDN = Ldap::add($connection, 'leia', '{MD5}' . base64_encode(pack('H*', md5('bunhead'))), "ou=StarWars,{$dc}", 'Organa', 'Leia Organa', array('givenName' => 'Leia', 'displayName' => 'Princess Leia', 'ou' => array('StarWars', 'RebelAlliance'), 'mail' => array('leia@rebelalliance.org')));
$darthVaderDN = Ldap::add($connection, 'darth.vader', '{MD5}' . base64_encode(pack('H*', md5('whosyourdaddy'))), "ou=StarWars,{$dc}", 'Skywalker', 'Anakin Skywalker', array('givenName' => 'Anakin', 'displayName' => 'Darth Vader', 'ou' => array('StarWars', 'GalacticEmpire', 'Sith'), 'mail' => array('vader@empire.com')));
$jabbaTheHuttDN = Ldap::add($connection, 'jabba.thehutt', '{MD5}' . base64_encode(pack('H*', md5('wishihadlegs'))), "ou=StarWars,{$dc}", 'Hutt', 'Jabba Hutt', array('givenName' => 'Jabba', 'displayName' => 'Jabba the Hutt', 'ou' => array('Hutts'), 'mail' => array('jabba@hutt.com')));
$obiWanDN = Ldap::add($connection, 'obi.wan', '{MD5}' . base64_encode(pack('H*', md5('thesearenotthedroids'))), "ou=StarWars,{$dc}", 'Kenobi', 'Obi Wan Kenobi', array('givenName' => 'Obi Wan', 'displayName' => 'Obi Wan Kenobi', 'ou' => array('StarWars', 'RebelAlliance', 'Jedi'), 'seeAlso' => array("ou=StarWars,{$dc}", "ou=RebelAlliance,ou=StarWars,{$dc}", "ou=Jedi,ou=RebelAlliance,ou=StarWars,{$dc}"), 'mail' => array('obi.wan@jedi.org')));
$bobaFettDN = Ldap::add($connection, 'boba.fett', '{MD5}' . base64_encode(pack('H*', md5('ihatesarlacs'))), "ou=StarWars,{$dc}", 'Fett', 'Boba Fett', array('givenName' => 'Boba', 'displayName' => 'Boba Fett', 'ou' => array('StarWars', 'Rogues'), 'seeAlso' => array("ou=StarWars,{$dc}", "ou=Rogues,ou=StarWars,{$dc}"), 'mail' => array('boba.fett@bountyhunter.com')));
$yodaDN = Ldap::add($connection, 'yoda', '{MD5}' . base64_encode(pack('H*', md5('dagobah4eva'))), "ou=StarWars,{$dc}", 'Yoda', 'Yoda', array('givenName' => 'Yoda', 'displayName' => 'Yoda', 'ou' => array('StarWars', 'RebelAlliance', 'Jedi'), 'seeAlso' => array("ou=StarWars,{$dc}", "ou=RebelAlliance,ou=StarWars,{$dc}", "ou=Jedi,ou=RebelAlliance,ou=StarWars,{$dc}"), 'mail' => array('yoda@jedi.org')));
Ldap::addGroup($connection, 'RebelAlliance', "ou=StarWars,{$dc}", array('seeAlso' => array($princessLeiaDN, $chewbaccaDN, $hanSoloDN, $obiWanDN, $yodaDN)));
Ldap::addGroup($connection, 'Rogues', "ou=StarWars,{$dc}", array('seeAlso' => array($chewbaccaDN, $hanSoloDN)));
Ldap::addGroup($connection, 'GalacticEmpire', "ou=StarWars,{$dc}", array('seeAlso' => array($darthVaderDN)));
Ldap::addGroup($connection, 'Sith', "ou=GalacticEmpire,ou=StarWars,{$dc}", array('seeAlso' => array($darthVaderDN)));
Ldap::addGroup($connection, 'Jedi', "ou=RebelAlliance,ou=StarWars,{$dc}", array('seeAlso' => array($obiWanDN, $yodaDN)));
// This dumps all the LDAP data
开发者ID:nfrp,项目名称:ezpublish,代码行数:31,代码来源:setup_accounts.php

示例2: crypt

/**
 * Setup the test accounts on the ldap server.
 *
 * Assumes the username entries are 'uid'.
 *
 */
$dc = "dc=ezctest,dc=ez,dc=no";
$host = "ezctest.ez.no";
$connection = Ldap::connect("ldap://{$host}", "cn=%s,{$dc}", 'admin', 'wee123');
Ldap::delete($connection, 'john.doe', $dc);
Ldap::delete($connection, 'jan.modaal', $dc);
Ldap::delete($connection, 'zhang.san', $dc);
Ldap::delete($connection, 'johnny.doe', "ou=Users,{$dc}");
Ldap::delete($connection, 'hans.mustermann', $dc);
Ldap::delete($connection, 'Ruşinică Piţigoi', $dc);
Ldap::deleteGroup($connection, 'Users', $dc);
Ldap::addGroup($connection, 'Users', $dc);
Ldap::add($connection, 'john.doe', '{CRYPT}' . crypt('foobar'), $dc);
Ldap::add($connection, 'jan.modaal', '{SHA}' . base64_encode(pack('H*', sha1('qwerty'))), $dc);
Ldap::add($connection, 'zhang.san', '{MD5}' . base64_encode(pack('H*', md5('asdfgh'))), $dc);
Ldap::add($connection, 'johnny.doe', '{MD5}' . base64_encode(pack('H*', md5('12345'))), "ou=Users,{$dc}", array('displayName' => 'Johnny Doe', 'ou' => array('Users')));
//Ldap::add( $connection, 'jan.modaal', '{SHA}' . base64_encode( sha1( 'qwerty' ) ), $dc );
//Ldap::add( $connection, 'zhang.san', '{MD5}' . base64_encode( md5( 'asdfgh' ) ), $dc );
Ldap::add($connection, 'hans.mustermann', 'abcdef', $dc);
Ldap::add($connection, 'Ruşinică Piţigoi', '12345', $dc);
Ldap::fetchAll($connection, $dc);
Ldap::close($connection);
/**
 * Support for LDAP functions connect, add, delete and get_entries.
 */
class Ldap
开发者ID:bmdevel,项目名称:ezc,代码行数:31,代码来源:setup_accounts.php


注:本文中的Ldap::deleteGroup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。