Commit aaefc41d authored by Leigh Stoller's avatar Leigh Stoller

Add hidden flag to node_attributes so we can hide (in the classic

interface) node_attributes. I set the snmpit user/paswd to hidden.
parent 62030ba2
......@@ -3365,6 +3365,7 @@ CREATE TABLE `node_attributes` (
`node_id` varchar(32) NOT NULL default '',
`attrkey` varchar(32) NOT NULL default '',
`attrvalue` tinytext NOT NULL,
`hidden` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`node_id`,`attrkey`),
KEY `node_id` (`node_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
......
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("node_attributes", "hidden")) {
DBQueryFatal("alter table node_attributes add ".
" `hidden` tinyint(1) NOT NULL default '0'");
}
DBQueryFatal("update node_attributes set hidden=1 ".
"where attrkey like 'snmpit%'");
return 0;
}
# Local Variables:
# mode:perl
# End:
<?php
#
# Copyright (c) 2006-2017 University of Utah and the Flux Group.
# Copyright (c) 2006-2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -1187,6 +1187,7 @@ class Node
$query_result =
DBQueryFatal("select attrkey,attrvalue from node_attributes ".
"where node_id='$node_id' ".
(!ISADMIN() ? "and hidden=0 " : " ").
($noroot ? "and attrkey!='root_password'" : ""));
if (!$short && mysql_num_rows($query_result)) {
......
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