r2603 - trigger_ipv4(): show otherwisely hidden tab, until there's at least one...
authorDenis Ovsienko <infrastation@yandex.ru>
Fri, 3 Apr 2009 17:45:20 +0000 (17:45 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Fri, 3 Apr 2009 17:45:20 +0000 (17:45 +0000)
inc/triggers.php

index 0e17e3ed3e2183db14c2e0b0197e353059e836c5..c035ec02e2ec7632a4decf2f4235079e634ea5d8 100644 (file)
@@ -68,6 +68,9 @@ function trigger_isloadbalancer ()
 function trigger_ipv4 ()
 {
        assertUIntArg ('object_id', __FUNCTION__);
+       if (count (getObjectIPv4Allocations ($_REQUEST['object_id'])))
+               return TRUE;
+       // Only hide the tab, if there are no addresses allocated.
        return considerConfiguredConstraint ('object', $_REQUEST['object_id'], 'IPV4OBJ_LISTSRC');
 }