From 5489f5dc8cad654f062ff0f40b6a47b5779877ed Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 23 Nov 2008 21:42:59 +0100 Subject: [PATCH] Ignore the * in [[*host]] links, and ignore [[- ]] in [[-hostname]] entries. --- debian/changelog | 8 ++++++++ machines.cgi | 21 +++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 20a5720..80182f4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +userdir-ldap-cgi (0.3.24) unstable; urgency=low + + * Ignore the * in [[*host]] links, and ignore [[- ]] in [[-hostname]] + entries. Both are special to the ssh_known_hosts generation. + [Thomas Viehmann] + + -- Peter Palfrader Sun, 23 Nov 2008 21:42:09 +0100 + userdir-ldap-cgi (0.3.23) unstable; urgency=low * New hmac scheme for sudo passwords. diff --git a/machines.cgi b/machines.cgi index 5cdbbcd..d67aa3f 100755 --- a/machines.cgi +++ b/machines.cgi @@ -86,20 +86,33 @@ sub sshfingerprint { sub wiki_link($) { my ($in) = @_; - $in =~ s#\[\[(.*?)\|(.*?)\]\]#$2#g; - $in =~ s#\[\[(.*?)\]\]#$1#g; + # [[hostname|text]] makes a link + # [[hostname]] makes a link too + # if you add a * after [[ it's still the same, only not used for ssh_known_hosts in ud-generate + # [[-hostname]] are not links, but get added to known_hosts. we should drop the [[- ]] tho + $in =~ s#\[\[\*?(.*?)\|(.*?)\]\]#$2#g; + $in =~ s#\[\[\*?(.*?)\]\]#$1#g; + $in =~ s#\[\[-(.*?)\]\]#$1#g; return $in; } +# in the purpose field [[host|some other text]] (where some other text is optional) +# makes a hyperlink on the web thing. we now also add these hosts to the ssh known_hosts +# file. But so that we don't have to add everything we link we can add an asterisk +# and say [[*... to ignore it. In order to be able to add stuff to ssh without +# http linking it we also support [[-hostname]] entries. +# +# sponsors are also wikified like purpose. maybe others as well sub item_uplist($) { my ($items) = @_; my $out = undef; + my(@tmp) = grep(!/\[\[-/, @$items); - if (scalar @$items >= 1) { + if (scalar @tmp>= 1) { $out = ""; } -- 2.20.1