Commit a291ec24 authored by Franco Fichtner's avatar Franco Fichtner

src: some baby steps with phpstorm inspection

parent 32f78562
...@@ -239,6 +239,8 @@ function index_users() ...@@ -239,6 +239,8 @@ function index_users()
{ {
global $config; global $config;
$userindex = array();
if (is_array($config['system']['user'])) { if (is_array($config['system']['user'])) {
$i = 0; $i = 0;
foreach($config['system']['user'] as $userent) { foreach($config['system']['user'] as $userent) {
...@@ -247,7 +249,7 @@ function index_users() ...@@ -247,7 +249,7 @@ function index_users()
} }
} }
return ($userindex); return $userindex;
} }
function &getUserEntry($name) function &getUserEntry($name)
...@@ -283,6 +285,8 @@ function &getGroupEntry($name) ...@@ -283,6 +285,8 @@ function &getGroupEntry($name)
if (isset($groupindex[$name])) { if (isset($groupindex[$name])) {
return $config['system']['group'][$groupindex[$name]]; return $config['system']['group'][$groupindex[$name]];
} }
return array();
} }
function &getGroupEntryByGID($gid) function &getGroupEntryByGID($gid)
...@@ -360,7 +364,6 @@ function local_sync_accounts() ...@@ -360,7 +364,6 @@ function local_sync_accounts()
} }
/* remove local groups to avoid gid conflicts */ /* remove local groups to avoid gid conflicts */
$gids = array();
$fd = popen('/usr/sbin/pw groupshow -a', 'r'); $fd = popen('/usr/sbin/pw groupshow -a', 'r');
if ($fd) { if ($fd) {
while (!feof($fd)) { while (!feof($fd)) {
...@@ -606,9 +609,9 @@ function local_group_del_user($user) ...@@ -606,9 +609,9 @@ function local_group_del_user($user)
function local_group_set($group, $reset = false) function local_group_set($group, $reset = false)
{ {
if (!isset($group['name']) || !isset($group['gid'])) { if (!isset($group['name']) || !isset($group['gid'])) {
// input data invalid return;
return false;
} }
$group_name = $group['name']; $group_name = $group['name'];
$group_gid = $group['gid']; $group_gid = $group['gid'];
$group_members = ''; $group_members = '';
...@@ -721,6 +724,8 @@ function auth_get_authserver($name) ...@@ -721,6 +724,8 @@ function auth_get_authserver($name)
} }
} }
} }
return false;
} }
function auth_get_authserver_list() function auth_get_authserver_list()
......
...@@ -279,7 +279,6 @@ function security_checks_disabled() ...@@ -279,7 +279,6 @@ function security_checks_disabled()
function cleanup_backups() function cleanup_backups()
{ {
global $config; global $config;
$i = false;
if (isset($config['system']['backupcount']) && is_numeric($config['system']['backupcount']) && ($config['system']['backupcount'] >= 0)) { if (isset($config['system']['backupcount']) && is_numeric($config['system']['backupcount']) && ($config['system']['backupcount'] >= 0)) {
$revisions = intval($config['system']['backupcount']); $revisions = intval($config['system']['backupcount']);
...@@ -301,8 +300,6 @@ function cleanup_backups() ...@@ -301,8 +300,6 @@ function cleanup_backups()
function make_config_revision_entry($desc = '') function make_config_revision_entry($desc = '')
{ {
global $config;
if (!empty($_SESSION['Username'])) { if (!empty($_SESSION['Username'])) {
$username = $_SESSION['Username']; $username = $_SESSION['Username'];
} else { } else {
......
...@@ -196,7 +196,6 @@ function legacy_interface_stats($ifs=null) ...@@ -196,7 +196,6 @@ function legacy_interface_stats($ifs=null)
/** /**
* detect interface capabilities using ifconfig -m * detect interface capabilities using ifconfig -m
* @param $intf filter on interface name (empty for all)
* @return array list of interface specifics indexed by physical interface name * @return array list of interface specifics indexed by physical interface name
*/ */
function legacy_interfaces_details($intf = null) function legacy_interfaces_details($intf = null)
...@@ -276,7 +275,7 @@ function legacy_interfaces_details($intf = null) ...@@ -276,7 +275,7 @@ function legacy_interfaces_details($intf = null)
/** /**
* fetch interface details for one interface * fetch interface details for one interface
* @param $intf interface name * @param $intf string interface name
* @return array list of interface specifics * @return array list of interface specifics
*/ */
function legacy_interface_details($intf) function legacy_interface_details($intf)
......
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