';
if ($exists_cacert)
{
$list .="exists_cacert=true;\n";
}
else
{
$list .="exists_cacert=false;\n";
}
if ($exists_server_cert)
{
$list .="exists_server_cert=true;\n";
}
else
{
$list .="exists_server_cert=false;\n";
}
if ($exists_server_key)
{
$list .="exists_server_key=true;\n";
}
else
{
$list .="exists_server_key=false;\n";
}
$list .='
';
return $list;
}
/* ------------------------------------------------------------------------ */
function make_auth_servers_panel ($auth_servers)
/* ------------------------------------------------------------------------ */
{
global $url_plugin;
global $paths;
$list = '
Virtual Auth Servers
';
foreach ($auth_servers as $avs_name => $avs_data)
{
$list .= '
';
$list .= make_auth_server_info_row($avs_name, $avs_data, $url_plugin);
$list .= '
';
}
$list .= '
';
$list .= make_auth_server_form_panel ();
$list .= '
';
return $list;
}
/* ------------------------------------------------------------------------ */
function make_auth_server_form_panel ()
/* ------------------------------------------------------------------------ */
{
$list = '
';
return $list;
}
/* ------------------------------------------------------------------------ */
function make_acct_servers_panel ($acct_servers)
/* ------------------------------------------------------------------------ */
{
global $paths;
$list = '
Virtual Acct Server
';
foreach ($acct_servers as $acvs_name => $acvs_data)
{
$list .= '
';
$list .= make_acct_server_info_row($acvs_name, $acvs_data);
$list .= '
';
}
$list .= '
';
$list .= '
';
return $list;
}
/* ------------------------------------------------------------------------ */
function make_clients_panel ($auth_servers)
/* ------------------------------------------------------------------------ */
{
global $paths;
$list = '
Clients
';
$list .= '
';
$clients = load_conf_file ($paths['clients']);
if ( empty($clients) )
{
$clients = array (
'localhost' => array ('addr' => '127.0.0.1',
'pass' => '123456',
'auth_servers' => array('vs0', 'vs1'))
);
save_conf_file ($paths['clients'], $clients);
}
$list .= ''."\n";
foreach ($clients as $client_name => $client_data)
{
$list .= '
';
$list .= make_client_info_row($client_name, $client_data);
$list .= '
';
$list .= "'."\n";
}
$list .= '
';
$list .= make_client_form_panel ($auth_servers);
$list .= '
';
return $list;
}
/* ------------------------------------------------------------------------ */
function make_client_form_panel ($auth_servers)
/* ------------------------------------------------------------------------ */
{
$list = '
';
return $list;
}
/* ------------------------------------------------------------------------ */
function create_login_time_data($username, $info)
/* ------------------------------------------------------------------------ */
{
$list = '';
$dweek_str = array (
'Al' => 'All', 'Wk' => 'Monday-Friday', 'Mo' => 'Monday',
'Tu' => 'Tuesday', 'We' => 'Wednesday', 'Th' => 'Thursday',
'Fr' => 'Friday', 'Sa' => 'Saturday', 'Su' => 'Sunday'
);
$login_time = $info;
$slot = strtok ($login_time, ",");
while ($slot !== false)
{
$dweek = substr($slot, 0, 2);
$hour_start = substr($slot, 2, 2);
$min_start = substr($slot, 4, 2);
$hour_end = substr($slot, 7, 2);
$min_end = substr($slot, 9, 2);
$logtime = '
'.$dweek_str[$dweek].', '.$hour_start.':'.
$min_start.'-'.$hour_end.':'.$min_end;
$list .= "user_logtime['".$username."'].push('$logtime');\n";
$slot = strtok (",");
}
return $list;
}
/* ------------------------------------------------------------------------ */
function make_users_panel ()
/* ------------------------------------------------------------------------ */
{
global $paths;
$list = '
Users
';
$list .= '
';
$users = load_conf_file ($paths['users']);
exec ('sudo radwho -r', $radwho);
$online = array();
foreach ($radwho as $line)
{
$online[] = strtok($line, ',');
}
$list .= ''."\n";
foreach ($users as $username => $user_data)
{
$list .= '
';
$list .= '
';
$list .= make_user_info_row($username, $user_data, in_array($username, $online));
$list .= '
';
$list .= "'."\n";
}
$list .= '
';
$list .= make_user_form_panel ();
$list .= '
';
return $list;
}
/* ------------------------------------------------------------------------ */
function make_user_form_panel ()
/* ------------------------------------------------------------------------ */
{
$list = '
';
return $list;
}
/* ------------------------------------------------------------------------ */
?>