+sub action_ask_del
+{
+ my $cn = param_utf8 ('cn');
+ $cn or die;
+
+ my $person = LiCoM::Person->load ($cn);
+ $person or die;
+
+ my $cn_uri = uri_escape_utf8 ($cn);
+ my $cn_html = encode_entities ($cn);
+
+ print <<EOF;
+ <h2>Really delete $cn_html?</h2>
+
+ <div>
+ You are about to delete <strong>$cn_html</strong>.
+ Are you totally, absolutely sure you want to do this?
+ </div>
+
+ <div class="menu">
+ [<a href="$MySelf?action=expunge&cn=$cn_uri">Yes, delete</a>]
+ [<a href="$MySelf?action=detail&cn=$cn_uri">No, keep</a>]
+ </div>
+
+EOF
+}
+
+sub action_do_del
+{
+ my $cn = param_utf8 ('cn');
+ $cn or die;
+
+ my $cn_html = encode_entities ($cn);
+
+ my $person = LiCoM::Person->load ($cn);
+ $person or die;
+
+ $person->delete ();
+
+ print <<EOF;
+ <div>$cn_html has been deleted.</div>
+
+EOF
+ action_browse ();
+}
+
+sub action_edit_group
+{
+ my $group_name = param_utf8 ('group') or die;
+
+ my $group_name_html = encode_entities ($group_name);
+
+ my $group_obj = LiCoM::Group->load ($group_name);
+
+ if (!$group_obj)
+ {
+ print qq(\t<div class="error">Group "$group_name_html" does not exist or could not be loaded.</div>\n);
+ return;
+ }
+
+ $group_name_html = encode_entities ($group_obj->name ());
+
+ my $desc_html = encode_entities ($group_obj->description () || '');
+
+ print <<HTML;
+ <h2>Edit contact group "$group_name_html"</h2>
+ <form action="$MySelf" method="post" accept-charset="UTF-8">
+ <input type="hidden" name="action" value="save_group" />
+ <input type="hidden" name="group" value="$group_name_html" />
+ <table>
+ <tr>
+ <th>Group Name</th>
+ <td>$group_name_html</td>
+ </tr>
+ <tr>
+ <th>Description</th>
+ <td><input type="text" name="description" value="$desc_html" /></td>
+ </tr>
+ <tr>
+ <th colspan="2"><input type="submit" name="button" value="Save" /></th>
+ </tr>
+ </table>
+ </form>
+HTML
+}
+
+sub action_save_group
+{
+ my $group_name = param_utf8 ('group') or die;
+
+ my $group_name_html = encode_entities ($group_name);
+
+ my $group_obj = LiCoM::Group->load ($group_name);
+
+ if (!$group_obj)
+ {
+ print qq(\t<div class="error">Group "$group_name_html" does not exist or could not be loaded.</div>\n);
+ return;
+ }
+
+ my $desc = param_utf8 ('description');
+ $group_obj->description ($desc);
+
+ action_browse ();
+ return;
+}
+