Commit 3ada8564 authored by Robert Ricci's avatar Robert Ricci
Browse files

Add a check for a serial line before presenting the 'Connect to

Serial Line' option.
parent e2b8e98f
......@@ -1152,6 +1152,15 @@ function TBCvswebAllowed($uid) {
return mysql_num_rows($query_result);
}
#
# Returns > 0 if a node has a serial console, 0 if it does not
#
function TBHasSerialConsole($node_id) {
$query_result =
DBQueryFatal("select tipname from tiplines WHERE node_id='$node_id'");
return mysql_num_rows($query_result);
}
#
# DB Interface.
#
......
......@@ -50,8 +50,8 @@ SUBMENUSTART("Node Options");
#
# Tip to node option
#
if ($isadmin ||
TBNodeAccessCheck($uid, $node_id, $TB_NODEACCESS_MODIFYINFO)) {
if (TBHasSerialConsole($node_id) && ($isadmin ||
TBNodeAccessCheck($uid, $node_id, $TB_NODEACCESS_MODIFYINFO))) {
WRITESUBMENUBUTTON("Connect to Serial Line</a> " .
"<a href=\"faq.php3#UTT-TUNNEL\">(howto)",
"nodetipacl.php3?node_id=$node_id");
......@@ -76,8 +76,6 @@ if ($isadmin) {
}
SUBMENUEND();
# echo "<h4>(<a href=\"faq.php3#UTT-TUNNEL\">Help on 'connect to serial line'</a>)</h4>";
#
# Dump record.
#
......
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