#19192 [NEW]: Array consists of only one value

From: Date: Fri, 30 Aug 2002 08:10:00 +0000
Subject: #19192 [NEW]: Array consists of only one value
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18223@lists.php.net to get a copy of this message
From: mario.schmidt@mediavillage.de Operating system: NT, 2000, XP PHP version: 4.2.2 PHP Bug Type: COM related Bug description: Array consists of only one value Following code "should" list all NT-Usergroups of the given machinename or nt-domain. This works with ASP but not PHP :(... Array $objComputer is created but it only consists of one recordset (the first one, the machine itself). But there should be more in it! (Groups, Users, Services) <?php $objComputer = new COM("WinNT://machinename"); echo $objComputer->Name." is a ".$objComputer->Class." and has following NT-Groups:<p>"; $objComputer->filter = array("Group"); foreach($objComputer as $group) { print $group->name."<br>\n"; } echo "Group listing complete."; ?> And here the WORKING Code using ASP: <% Set GroupObj = GetObject("WinNT://machinename") strFilter = Array("Group") BaseObj.Filter= strFilter Response.write "---- Select a Group ----<p>" For Each Member in BaseObj Response.write Member.Name & "<br>" Next %> BTW: "WinNT://" is a VALID COM-Data Provider!!! -- Edit bug report at http://bugs.php.net/?id=19192&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=19192&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=19192&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=19192&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=19192&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=19192&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=19192&r=support Expected behavior: http://bugs.php.net/fix.php?id=19192&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=19192&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=19192&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=19192&r=globals

« previous php.bugs (#18223) next »