#!/usr/local/bin/tclsh8.6

#
# Display administration operations
#
# Parameters (form or url): none
#
# History
#   2001/03/22 : pda      : design
#   2001/10/20 : pda      : use output procedure
#   2002/05/03 : pda/jean : re-use in netmagis
#   2002/07/09 : pda      : add nologin
#   2003/05/13 : pda/jean : use auth base
#   2010/12/06 : pda      : i18n
#   2010/12/26 : pda      : use cgi-dispatch
#

#
# Template pages used by this script
#

set conf(page)		admindex.html

#
# Netmagis general library
#

source /usr/local/lib/netmagis/libnetmagis.tcl

# ::webapp::cgidebug ; exit

##############################################################################
# Main procedure
##############################################################################

d cgi-register {} {} {
    global conf

    #
    # URL and substitution list building
    #

    foreach script {admlmx statuser statorg lnet lusers who search
			admmrel admmx admgrp admzgen admpar topotop} {
	set up [string toupper $script]
	d urlset "%URL$up%" "$script" {}
    }
    foreach ref {org comm hinfo net domain view
    			zone zone4 zone6 dhcpprof
			vlan eq eqtype confcmd dotattr} {
	set up [string toupper $ref]
	set args [list [list "type" $ref]]
	d urlset "%URLREF$up%" "admref" $args
    }

    #
    # End of script: output page and close database
    #

    d result $conf(page) {}
}

##############################################################################
# Main procedure
##############################################################################

d cgi-dispatch "admin" "admin"
