#include "stdafx.h" #include "globals.h" #include "fstream.h" #include "direct.h" #include #include #include "comp.h" #include "ib.h" extern CString rootPath;// = GetGlobal("Root"); extern CString configName;// = GetGlobal("CustomizationList"); extern CString configPath;// = rootPath + "Configs\\" + configName; extern CString cdPath ;// = configPath + "\\CD"; extern CString workspacePath;// = configPath + "\\Workspace"; extern CString cdshellPath; //CString CDout="CD_output"; void CreateHelpMenu (void) { CString root = GetGlobal("Root"); CString config = GetGlobal("CustomizationList"); CString file1 = root + "\\help1.txt"; CString file2 = root + "\\help2.txt"; CString HelpPath = root + "\\Configs\\" + config + "\\Temp\\"; _mkdir (HelpPath); CString HelpMenuFile = HelpPath +"helpMenu.rdf"; CString HelpMenuName = GetGlobal("HelpMenuCommandName"); CString HelpMenuUrl = GetGlobal("HelpMenuCommandURL"); if ( !(HelpMenuName.IsEmpty()) && !(HelpMenuUrl.IsEmpty()) ) { ifstream help1(file1); ifstream help2(file2); ofstream Hlp(HelpMenuFile); char jsprefname[200]; if(!help1) { cout << "cannot open the file \n"; } while (!help1.eof()) { help1.getline(jsprefname,200); Hlp <\n"; // Hlp <<" \n\t"; // Hlp <<" \n"; if(!help2) { cout << "cannot open the file \n"; } while (!help2.eof()) { help2.getline(jsprefname,200); Hlp <\n"; Isp <<"\n\n"; Isp <<"\n"; Isp <<" \n"; Isp <<" \n\n"; Isp <<" \n"; Isp <<" \n"; Isp <<" \n"; Isp <<" " << ispPrettyName << "\n"; Isp <<" " << ispInServer << "\n"; Isp <<" " << serverType << "\n"; Isp <<" " << ispPortNumber << "\n"; Isp <<" false\n"; if (serverType == "pop3") { Isp <<" \n"; Isp <<" \n"; Isp <<" " << popMessage << "\n"; Isp <<" false\n"; Isp <<" \n"; Isp <<" \n"; } Isp <<" \n"; Isp <<" \n\n"; Isp <<" \n"; Isp <<" \n"; Isp <<" \n"; Isp <<" false\n"; Isp <<" false\n"; Isp <<" \n"; Isp <<" \n\n"; Isp <<" \n"; Isp <<" \n"; Isp <<" " << ispOutServer << "\n"; Isp <<" \n"; Isp <<" \n\n"; Isp <<" true\n"; Isp <<" ture\n"; Isp <<" true\n\n"; Isp <<" true\n"; Isp <<" " << shortname << "\n"; Isp <<" " << ispLongName << "\n"; Isp <<" true\n"; Isp <<" true\n"; Isp <<" " << ispDomainName << "\n"; Isp <<" username@" << ispDomainName << "\n"; Isp <<" username\n"; Isp <<" user name\n"; Isp <<" User name:\n"; Isp <<" false\n"; Isp <<" \n"; Isp <<" \n"; Isp <<"\n\n"; Isp <<"\n"; } Isp.close(); } } // This function creates the file "newsaccount.rdf" to customize the News account void CreateNewsMenu(void) { CString root = GetGlobal("Root"); CString config = GetGlobal("CustomizationList"); CString NewsPath = root + "\\Configs\\" + config + "\\Temp\\";//NewsPath=CCKTool\Configs\configname\Temp _mkdir (NewsPath); CString newsDomainName = GetGlobal("nDomainName"); CString newsPrettyName = GetGlobal("nPrettyName"); CString newsLongName = GetGlobal("nLongName"); CString newsServer = GetGlobal("nServer"); CString newsPortNumber = GetGlobal("nPortNumber"); // newsaccount.rdf file is created only if values are entered for all the fields in the CCK News UI if (!( (newsDomainName.IsEmpty()) || (newsPrettyName.IsEmpty()) || (newsLongName.IsEmpty()) || (newsServer.IsEmpty()) || (newsPortNumber.IsEmpty()) )) { CString NewsFile = NewsPath +"newsaccount.rdf"; ofstream News(NewsFile); char *shortname; char tempdomain[25]; strcpy(tempdomain,newsDomainName); shortname = strtok(tempdomain,"."); if (!News) { cout << "The file cannot be opened \n"; } else { News <<"<\?xml version=\"1.0\"\?>\n"; News <<"\n\n"; News <<"\n"; News <<" \n"; News <<" \n\n"; News <<" \n"; News <<" \n"; News <<" \n"; News <<" " << newsPrettyName << "\n"; News <<" " << newsServer << "\n"; News <<" nntp\n"; News <<" " << newsPortNumber << "\n"; News <<" false\n"; News <<" \n"; News <<" \n\n"; News <<" \n"; News <<" \n"; News <<" \n"; News <<" false\n"; News <<" false\n"; News <<" \n"; News <<" \n\n"; News <<" true\n"; News <<" " << shortname << "\n"; News <<" " << newsLongName << "\n"; News <<" true\n"; News <<" true\n"; News <<" " << newsDomainName << "\n"; News <<" username@" << newsDomainName << "\n"; News <<" username\n"; News <<" user name\n"; News <<" User name:\n"; News <<" false\n"; News <<" \n"; News <<" \n"; News <<"\n\n"; News <<"\n"; } News.close(); } }