mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 16:44:39 +00:00
Backend functions: worked in some CR recommendations
This commit is contained in:
parent
3f04c0a7e2
commit
b6484af7a9
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user