X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=lib%2Fhub.php;h=7a18d472d8024bbd64b04bcac1707b9089eccee7;hb=37d4290c9eae09546c22b257c589c7e66ad3a1f3;hp=51aec9a6682c3c4b373e9939714686249deceef6;hpb=0925aeead950582ca1136feeb597730086bec498;p=readifood.git diff --git a/lib/hub.php b/lib/hub.php index 51aec9a..7a18d47 100644 --- a/lib/hub.php +++ b/lib/hub.php @@ -342,6 +342,17 @@ return $hub->getId(); } + function confirm_delete_hub($name, $id = null) { + if (! check_admin(1, "delete a hub")) return; + + if (isset($id)) $hub = get_hub_by_id($id); + else $hub = get_hub_by_name($name); + if (! $hub) return false; + + echo "

Confirm deletion

\n"; + echo "

You must confirm deletion of hub " . $hub->getDisplayname() . ": " . $hub->getDeleteLink(true) . "

\n"; + } + function delete_hub($name, $id = null, &$city_id = null) { if (! check_admin(1, "delete a hub")) return; @@ -418,6 +429,10 @@ if (count($args)) { switch ($args[0]) { case "delete": + confirm_delete_hub($name, $id); + break; + + case "confirmdelete": delete_hub($name, $id); break; }