Make machines.cgi display the purpose attribute from LDAP
authorMarc 'HE' Brockschmidt <he@debian.org>
Fri, 14 Mar 2008 20:17:51 +0000 (21:17 +0100)
committerMarc 'HE' Brockschmidt <he@debian.org>
Fri, 14 Mar 2008 20:17:51 +0000 (21:17 +0100)
machines.cgi

index 383f7cd..8fe4bfa 100755 (executable)
@@ -36,6 +36,7 @@ my (%attrs, @attrorder, %summaryattrs, @summaryorder);
          'sshrsahostkey' => 'SSH host key',
          'sshrsahostfprint' => 'SSH host fingerprint',
          'description' => 'Description',
+         'purpose' => 'purposes of this server',
 #        'createtimestamp' => 'Entry created',
 #        'modifytimestamp' => 'Entry modified'
         );
@@ -44,7 +45,7 @@ my (%attrs, @attrorder, %summaryattrs, @summaryorder);
 @attrorder = qw(hostname admin architecture distribution access
                 sponsor sponsor-admin location machine memory
                disk bandwidth status notes sshrsahostkey sshrsahostfprint
-               description);
+               description purpose);
 
 # ditto for summary
 %summaryattrs = ('hostname' => 'Host name',
@@ -144,6 +145,9 @@ foreach $dn (sort {$entries->{$a}->{host}->[0] cmp $entries->{$b}->{host}->[0]}
         $output{sponsor} .= $sponsor;
       }
     }
+
+       #Reformat purposes to be pleasing for the human eye:
+       $output{purpose} = join(",", @{$data->{purpose}});
     
     $selected = " selected ";    
   }