diff --git a/lam/lib/listusers.php b/lam/lib/listusers.php index b0968b4b..1811fdfb 100644 --- a/lam/lib/listusers.php +++ b/lam/lib/listusers.php @@ -13,7 +13,7 @@ $Id$ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + GNU General Public License for more detaexils. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software @@ -25,31 +25,45 @@ $Id$ include_once ('../config/config.php'); include_once("ldap.php"); -$ldapconnection = new Ldap(new Config()); -$userlist = $ldapconnection->getUsers(); +// class representing local user entry with attributes of ldap user entry +include_once("userentry.php"); -//$bla = array (attr1, attr2); -//$userlist = array ($bla, $bla, $bla, $bla); +echo ""; -echo "\n"; +// config object should be in session!!! +$config = new Config(); +$ldap = new Ldap($config); + +// username/password should also be in session!!! +$username = "cn=admin,o=test,c=de"; +$passwd = "secret"; +$result = $ldap->connect ($username, $passwd); + +$user_dn_list = $ldap->getUsers ($config->get_UserSuffix()); + +echo "
\n"; // print attribute headers -echo "\n"; -foreach ($userlist[0] as $attributes) { - echo (""); -} -echo "\n"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; -// print user list -foreach ($userlist as $user_attributes) { +foreach ($user_dn_list as $user_dn) { echo "\n"; - foreach ($user_attributes as $attribute) { - echo "\n"; - } + + $userentry = $ldap->getUser ($user_dn); + echo (""); + echo (""); + echo (""); + echo (""); echo "\n"; } -echo "
" . $attributes["dn"] . "
VornameNachnameUidHome Verzeichnis
$attribute" . $userentry->getGivenName() . "" . $userentry->getSn() . "" . $userentry->getUid() . "" . $userentry->gethomeDirectory() . "
\n"; +echo ""; +$ldap->close(); ?>