fixed error messages when getgid() is called for nonexisting group

This commit is contained in:
Roland Gruber 2005-06-11 11:20:45 +00:00
parent d58048c975
commit a2a3fb9bde
1 changed files with 6 additions and 4 deletions

View File

@ -265,10 +265,12 @@ class cache {
*/
function getgid($groupname) {
$dn_groups = $_SESSION['cache']->get_cache(array('gidNumber', 'cn'), 'posixGroup', 'group');
$DNs = array_keys($dn_groups);
foreach ($DNs as $DN) {
if ($dn_groups[$DN]['cn'][0] == $groupname) {
return $dn_groups[$DN]['gidNumber'][0];
if (is_array($dn_groups)) {
$DNs = array_keys($dn_groups);
foreach ($DNs as $DN) {
if ($dn_groups[$DN]['cn'][0] == $groupname) {
return $dn_groups[$DN]['gidNumber'][0];
}
}
}
}