Creating of new groups works.
authorocto <octo>
Sat, 7 May 2005 09:32:23 +0000 (09:32 +0000)
committerocto <octo>
Sat, 7 May 2005 09:32:23 +0000 (09:32 +0000)
lib/LiCoM/Group.pm
licom.cgi

index 79530f1..7bdc500 100644 (file)
@@ -118,7 +118,7 @@ sub create ($$$@)
        $entry->add (ou => $ou);
        $entry->add (cn => $name);
        $entry->add (member => [map { _cn_to_dn ($_) } (@members)]);
-       $entry->add (description => $desc);
+       $entry->add (description => $desc) if ($desc);
        $entry->dn ($dn);
 
        $entry->changetype ('add');
index 015c34b..2e46d19 100755 (executable)
--- a/licom.cgi
+++ b/licom.cgi
@@ -123,7 +123,7 @@ sub action_browse
                        my $group_esc  = uri_escape ($group_name);
                        my $desc = $group->description ();
 
-                       print qq#\t\t\t<li><a href="$MySelf?action=browse&group=$group_esc">$group_name</a> ($members Members)#;
+                       print qq#\t\t\t<li><a href="$MySelf?action=browse&group=$group_esc">$group_name</a> ($members Member#, ($members == 1 ? ')' : 's)');
                        print qq(<br />\n\t\t\t\t<span class="description">$desc</span>) if ($desc);
                        print "</li>\n";
                }
@@ -296,6 +296,25 @@ EOF
                        "\t\t\t</tr>\n";
                }
        }
+
+       my @groups = LiCoM::Group->load_by_member ($cn);
+       if (@groups)
+       {
+               my $num = scalar (@groups);
+               print "\t\t\t<tr>\n",
+               "\t\t\t\t<th", ($num == 1 ? '' : qq( rowspan="$num")), ">Group", ($num == 1 ? '' : 's'), "</th>\n";
+               for (my $i = 0; $i < $num; $i++)
+               {
+                       my $group = $groups[$i];
+                       my $group_name = $group->name ();
+                       my $group_esc = uri_escape ($group_name);
+
+                       print "\t\t\t<tr>\n" if ($i != 0);
+                       print qq(\t\t\t\t<td><a href="$MySelf?action=browse&group=$group_esc">$group_name</a></td>\n),
+                       "\t\t\t</tr>\n";
+               }
+       }
+       
        print <<EOF;
                </table>