Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

menus.cc

Go to the documentation of this file.
00001 #include "ldapconf_defs.h" 
00002 
00003 /* 
00004     LDAPCONF Main Menu
00005     This is all the available submenus
00006     They will be linked into various places in the Linuxconf menutree,
00007     but will also be available in one main menu.
00008     Create a symlink from linuxconf to ldapconf and this main menu will show up.
00009 */
00010 
00011 void ldap_mainmenu()
00012 {
00013     const char *key_ldapmain_server = MSG_U(M_LDAP_MAINMENU_SERVER,"Server");
00014     const char *key_ldapmain_directory = MSG_U(M_LDAP_MAINMENU_DIRECTORY,"Directory");
00015     const char *key_ldapmain_client = MSG_U(M_LDAP_MAINMENU_CLIENT,"Client");
00016     const char *key_ldapmain_system = MSG_U(M_LDAP_MAINMENU_SYSTEM,"Auth");
00017     const char *key_ldapmain_profile = MSG_U(M_LDAP_MAINMENU_PROFILE,"Profile");
00018     const char *key_ldapmain_setup = MSG_U(M_LDAP_MAINMENU_SETUP,"Module setup");
00019 
00020     DIALOG_MENU dia;
00021     if (mode_ldap_client) {dia.new_menuitem("ldapconf","",key_ldapmain_client);}
00022     if (mode_ldap_system) {dia.new_menuitem("ldapconf","",key_ldapmain_system);}
00023     if (mode_ldap_profile) {dia.new_menuitem("ldapconf","",key_ldapmain_profile);}
00024     if (mode_ldap_directory) {dia.new_menuitem("ldapconf","",key_ldapmain_directory);}
00025     if (mode_ldap_server) {dia.new_menuitem("ldapconf","",key_ldapmain_server);}    
00026 
00027     dia.new_menuitem("ldapconf","",key_ldapmain_setup);
00028     int nof = 0;
00029     while (1){
00030         MENU_STATUS code = dia.editmenu (MSG_U(T_LDAP_MENU,"LDAP")
00031                                          ,MSG_U(I_LDAP_MENU
00032                                                 ,"LDAPconf submodules")
00033                                          ,help_index
00034                                          ,nof,0);
00035         if (code == MENU_ESCAPE || code == MENU_QUIT){
00036             break;
00037         }else{
00038             const char *key = dia.getmenustr(nof);
00039             if (key == key_ldapmain_server){
00040                 ldap_mainmenu_server(); 
00041             }else if (key == key_ldapmain_directory){
00042 //              ldap_mainmenu_directory();
00043                 ldap_db_select();
00044             }else if (key == key_ldapmain_client){
00045                 ldap_mainmenu_client();
00046             }else if (key == key_ldapmain_system){
00047                 ldap_mainmenu_system();     
00048             }else if (key == key_ldapmain_profile){
00049                 ldap_mainmenu_profile();        
00050             }else if (key == key_ldapmain_setup){
00051                 ldapconf_setup();
00052             }
00053         }
00054     }
00055 }
00056 
00057 /* 
00058     LDAP mainmenu - client
00059 */
00060 void ldap_mainmenu_client()
00061 {  
00062     const char *key_useredit_tool = MSG_U(M_USERINFO_TOOL,"Userinfo");
00063 //  const char *key_ldapclient_user = MSG_U(M_LDAP_USER_TOOLS,"Tools");
00064     const char *key_ldapclient_config = MSG_U(M_LDAP_MAIN_CLIENT_CONFIG,"Config");
00065     
00066     DIALOG_MENU dia;
00067     
00068     dia.new_menuitem("ldapconf","",key_useredit_tool);
00069 //  dia.new_menuitem("ldapconf","",key_ldapclient_user);
00070     dia.new_menuitem("ldapconf","",key_ldapclient_config);
00071     
00072     int nof = 0;
00073     while (1){
00074         MENU_STATUS code = dia.editmenu (MSG_U(T_MAINMENU_CLIENT,"Client")
00075                                          ,MSG_U(I_MAINMENU_CLIENT,"LDAP client")
00076                                          ,help_ldap
00077                                          ,nof,0);
00078         if (code == MENU_ESCAPE || code == MENU_QUIT){
00079             break;
00080         }else{
00081             const char *key = dia.getmenustr(nof);
00082 
00083             if (key == key_useredit_tool){
00084                 profile_select();
00085             }else if (key == key_ldapclient_config){
00086                 ldap_client_config();
00087 //          }else if (key == key_ldapclient_user){
00088 //              ldap_user_menu();
00089             }
00090         }
00091     }
00092 }
00093 
00094 /* 
00095     LDAP mainmenu - server
00096 */
00097 void ldap_mainmenu_server()
00098 {  
00099     const char *key_ldapserver_control = MSG_U(M_LDAP_MAIN_SERVER_CONTROL,"Control Server");
00100     const char *key_ldapserver_config = MSG_U(M_LDAP_MAIN_SERVER_CONFIG,"Config Server");
00101 
00102     DIALOG_MENU dia;
00103     dia.new_menuitem("ldapconf","",key_ldapserver_control);
00104     dia.new_menuitem("ldapconf","",key_ldapserver_config);
00105     
00106     int nof = 0;
00107     while (1){
00108         MENU_STATUS code = dia.editmenu (MSG_U(T_MAINMENU_SERVER,"Server menu")
00109                                          ,MSG_U(I_MAINMENU_SERVER,"Server menu")
00110                                          ,help_ldap
00111                                          ,nof,0);
00112         if (code == MENU_ESCAPE || code == MENU_QUIT){
00113             break;
00114         }else{
00115             const char *key = dia.getmenustr(nof);
00116             if (key == key_ldapserver_config){
00117                 ldap_server_config();
00118             }else if (key == key_ldapserver_control){
00119                 ldap_server_control();          
00120             }
00121         }
00122     }
00123 }
00124 
00125 /* 
00126     LDAP mainmenu - directory
00127 */
00128 void ldap_mainmenu_directory()
00129 {  
00130     const char *key_ldapdb_config = MSG_U(M_LDAP_DB_CONFIG,"Directory config");
00131 
00132     DIALOG_MENU dia;
00133     dia.new_menuitem("ldapconf","",key_ldapdb_config);
00134 
00135     int nof = 0;
00136     while (1){
00137         MENU_STATUS code = dia.editmenu (MSG_U(T_MAINMENU_DIRECTORY,"Directory menu")
00138                                          ,MSG_U(I_MAINMENU_DIRECTORY,"Directory mode")
00139                                          ,help_ldap
00140                                          ,nof,0);
00141         if (code == MENU_ESCAPE || code == MENU_QUIT){
00142             break;
00143         }else{
00144             const char *key = dia.getmenustr(nof);
00145             if (key == key_ldapdb_config){
00146                 ldap_db_select();
00147             }
00148         }
00149     }
00150 }
00151 
00152 /* 
00153     LDAP mainmenu - system
00154 */
00155 void ldap_mainmenu_system()
00156 {   
00157     const char *key_ldapsystem_config = MSG_U(M_LDAP_MAIN_SYSTEM_CONFIG,"LDAP Auth");
00158     const char *key_nss_config = MSG_U(M_NSS_CONFIG,"Config NSS");
00159 
00160     DIALOG_MENU dia;
00161     dia.new_menuitem("ldapconf","",key_ldapsystem_config);
00162     if (mode_ldap_devel) {dia.new_menuitem("ldapconf","",key_nss_config);}
00163     int nof = 0;
00164     while (1){
00165         MENU_STATUS code = dia.editmenu (MSG_U(T_MAINMENU_SYSTEM,"LDAP Auth")
00166                                          ,MSG_U(I_MAINMENU_SYSTEM,"Configuratin of LDAP NSS and PAM, used for system authentication.")
00167                                          ,help_ldap
00168                                          ,nof,0);
00169         if (code == MENU_ESCAPE || code == MENU_QUIT){
00170             break;
00171         }else{
00172             const char *key = dia.getmenustr(nof);
00173 
00174             if (key == key_ldapsystem_config){
00175                 ldap_system_config();
00176             }else if (key == key_nss_config){
00177                 nss_config();
00178             }
00179         }
00180     }
00181 }
00182 
00183 /* 
00184 
00185    User Clients menu 
00186 
00187 */
00188 /*
00189 void ldap_user_menu()
00190 {   
00191     const char *key_formclient = MSG_U(M_FORMCLIENT_TOOL,"Useradmin");
00192     const char *key_search_tool = MSG_U(M_SEARCH_TOOL,"Search tool");
00193     const char *key_edit_tool = MSG_U(M_EDIT_TOOL,"Edit tool");
00194     const char *key_passwd_tool = MSG_U(M_PASSWD_TOOL,"Password");
00195     
00196     DIALOG_MENU dia;
00197     if (mode_ldap_formclient) { dia.new_menuitem("",key_formclient); }
00198     if (mode_ldap_devel) { dia.new_menuitem("",key_search_tool); }
00199     if (mode_ldap_devel) { dia.new_menuitem("",key_edit_tool); }
00200     if (mode_ldap_devel) { dia.new_menuitem("",key_passwd_tool); }
00201 
00202     int nof = 0;
00203     while (1){
00204         MENU_STATUS code = dia.editmenu (MSG_U(T_USERCLIENT_MENU,"LDAP clients")
00205                                          ,MSG_U(I_USERCLIENT_MENU
00206                                                 ,"Select a client")
00207                                          ,help_formclient
00208                                          ,nof,0);
00209         const char *key = dia.getmenustr(nof);
00210 
00211         if (code == MENU_ESCAPE || code == MENU_QUIT){
00212             break;
00213         }else{          
00214             if (key == key_useredit_tool){
00215                 ldap_useredit();
00216             }else if (key == key_formclient ) { 
00217                 profile_select();
00218             }else if (key == key_search_tool){
00219                 ldapsearch();
00220             }else if (key == key_edit_tool){
00221                 ldapedit();
00222             }else if (key == key_passwd_tool){
00223                 ldap_passwd_tool();
00224             }
00225         }
00226     }
00227 }
00228 */
00229 
00230 /* 
00231     LDAP mainmenu - profiles
00232 */
00233 
00234 void ldap_mainmenu_profile()
00235 {  
00236     const char *key_client_profiles = MSG_U(M_LDAP_PROFILE_CONFIG,"Directory profiles");
00237     const char *key_dbform_config = MSG_U(M_LDAP_DBFORM_CONFIG,"Form profiles");
00238     const char *key_bind_config = MSG_U(M_LDAP_BIND_CONFIG,"Binding profiles");
00239 //  const char *key_userinfo_config = MSG_U(M_USERINFO_CONFIG,"Userinfo config");   
00240 
00241     DIALOG_MENU dia;
00242     int nof = 0;
00243     const char *key;
00244     
00245     dia.new_menuitem("ldapconf","",key_client_profiles);
00246     dia.new_menuitem("ldapconf","",key_dbform_config);
00247     dia.new_menuitem("ldapconf","",key_bind_config);
00248 //  if (mode_ldap_userinfo) {dia.new_menuitem("ldapconf","",key_userinfo_config);}
00249 
00250     while (1){ 
00251         MENU_STATUS code = dia.editmenu (MSG_U(T_MAINMENU_PROFILE,"Profile menu")
00252                                          ,MSG_U(I_MAINMENU_PROFILE,"Manage directory profiles")
00253                                          ,help_formclient
00254                                          ,nof,0);
00255         key = dia.getmenustr(nof);
00256 
00257         if (code == MENU_ESCAPE || code == MENU_QUIT){
00258             break;
00259         }else if (key == key_dbform_config){
00260             formprofile_edit();
00261         }else if (key == key_bind_config){
00262             bindprofile_edit();
00263         }else if (key == key_client_profiles){
00264             profile_edit("test");
00265 //      }else if (key == key_userinfo_config){
00266 //          profile_edit("userinfo");
00267         }
00268     }
00269 }
00270 
00271 /* 
00272     LDAP SERVER menu 
00273 */
00274 void ldap_server_menu()
00275 {
00276     const char *master_global = MSG_U(M_MASTER_GLOBAL,"Server");
00277     const char *master_database  = MSG_U(M_MASTER_DATABASE,"Directory");
00278 
00279     DIALOG_MENU dia;
00280     dia.new_menuitem("ldapconf","",master_global);
00281     dia.new_menuitem("ldapconf","",master_database);
00282     
00283     int nof = 0;
00284     while (1){
00285         MENU_STATUS code = dia.editmenu (MSG_U(T_MASTER_MENU,"LDAP server config")
00286                                          ,MSG_U(I_MASTER_MENU
00287                                                 ,"Select server or directory settings")
00288                                          ,help_ldap
00289                                          ,nof,0);
00290         if (code == MENU_ESCAPE || code == MENU_QUIT){
00291             break;
00292         }else{
00293             const char *key = dia.getmenustr(nof);
00294             if (key == master_global){
00295                 ldap_server_config();
00296             }else if (key == master_database){
00297                 ldap_db_select();
00298             }
00299         }
00300     }
00301 }
00302 
00303 
00304 
00305 
00306 
00307 
00308 
00309 
00310 
00311 
00312 
00313 
00314 
00315 
00316 
00317 
00318 
00319 
00320 

Generated at Mon Jan 22 08:35:12 2001 for ldapconf by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000