#include <stdio.h>

#include <string.h>
#include <dirent.h>		/* Directory information. */

#include <sys/stat.h>		/* for stat()            */
#include <unistd.h>		/* for unlink */

#include "global.h"
#include "custom.h"		/* for date FORMAT strings */


#include "manhat-lib/shared_util.h"
#include "manhat-lib/shared_super_util.h"
#include "manhat-lib/shared_authenticate.h"
#include "manhat-lib/shared_cs_util.h"
#include "manhat-lib/shared_super_menu.h"



static void
set_form(  const char *key)
{
   char url[MAX_PATH +1];
    snprintf (url, MAX_PATH +1, "%s?id=%s", "super_admin_page",  key);
    cs_set_value("back_url", url);
    cs_set_int_value("maxpass", MAX_PASSWORD);
    cs_set_int_value("maxusername", MAX_USERNAME);

}



int main()
{
    char key[MAX_KEY +1];
    SESSION user;
     
    cs_cgi_init();
    read_param(key);                 /* shared_super_util.c */
    validate_super_key(key, &user);  /* shared_super_util.c */
    set_admin_page(&user, key, 0, "super_add_admin_form");  /* shared_super_menu.c */

    set_form( key);
    cs_cgi_display("super_add_admin_form", 1);
    cs_cgi_destroy();
    return 0;
}
