use SL::Auth;
use File::Spec;
use SL::MoreCommon qw(uri_encode);
+use SL::InstanceState;
use SL::YAML;
our %menu_cache;
_merge($nodes, $nodes_by_id, $data);
}
+ my $instance_state = SL::InstanceState->new;
my $self = bless {
nodes => $nodes,
by_id => $nodes_by_id,
+ instance_state => $instance_state,
}, $package;
$self->build_tree;
} else {
if ($token =~ m{^ client / (.*) }x) {
push @{$cur_ary}, $self->parse_instance_conf_string($1);
+ } elsif ($token =~ m{^ state / (.*) }x) {
+ push @{$cur_ary}, $self->parse_instance_state_string($1);
} else {
push @{$cur_ary}, $::auth->check_right($::myconfig{login}, $token, 1);
}
return $::instance_conf->data->{$setting};
}
+sub parse_instance_state_string {
+ my ($self, $setting) = @_;
+ return $self->{instance_state}->$setting;
+}
+
sub clear_access {
my ($self) = @_;
for my $node ($self->tree_walk("all")) {