Commit b6484af7 authored by Manuel Faux's avatar Manuel Faux Committed by Franco Fichtner

Backend functions: worked in some CR recommendations

parent 3f04c0a7
......@@ -138,3 +138,25 @@ function legacy_move_config_list_items($source, $id, $items) {
return $new_config;
}
}
/**
* Retrieve description text of firewall alias by specifying the alias name.
* @param string $name alias name to retrieve the description from
* @return description of alias, or null if no description was set or alias
* does not exist.
*/
function get_alias_description($name)
{
global $config;
if (isset($config['aliases']['alias'])) {
foreach ($config['aliases']['alias'] as $alias) {
if ($alias['name'] == $name) {
return (isset($alias['descr'])) ? $alias['descr'] : "";
}
}
}
return null;
}
......@@ -1004,28 +1004,6 @@ function alias_expand($name) {
}
}
/* get description of alias */
function get_alias_description($name)
{
global $config;
if (is_alias($name))
{
if (isset($config['aliases']['alias']))
{
foreach ($config['aliases']['alias'] as $alias)
{
if ($alias['name'] == $name)
{
return (isset($alias['descr'])) ? $alias['descr'] : "";
}
}
return null;
}
}
}
function subnet_size($subnet) {
if (is_subnetv4($subnet)) {
list ($ip, $bits) = explode("/", $subnet);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment