1 #include "otsdaq-core/WizardSupervisor/WizardSupervisor.h"
3 #include "otsdaq-core/GatewaySupervisor/GatewaySupervisor.h"
5 #include "otsdaq-core/Macros/CoutMacros.h"
6 #include "otsdaq-core/MessageFacility/MessageFacility.h"
8 #include <xdaq/NamespaceURI.h>
9 #include "otsdaq-core/CgiDataUtilities/CgiDataUtilities.h"
10 #include "otsdaq-core/SOAPUtilities/SOAPCommand.h"
11 #include "otsdaq-core/SOAPUtilities/SOAPUtilities.h"
12 #include "otsdaq-core/WebUsersUtilities/WebUsers.h"
13 #include "otsdaq-core/XmlUtilities/HttpXmlDocument.h"
25 #define SECURITY_FILE_NAME \
26 std::string(__ENV__("SERVICE_DATA_PATH")) + "/OtsWizardData/security.dat"
27 #define SEQUENCE_FILE_NAME \
28 std::string(__ENV__("SERVICE_DATA_PATH")) + "/OtsWizardData/sequence.dat"
29 #define SEQUENCE_OUT_FILE_NAME \
30 std::string(__ENV__("SERVICE_DATA_PATH")) + "/OtsWizardData/sequence.out"
31 #define USER_DATA_PATH std::string(__ENV__("SERVICE_DATA_PATH")) + std::string("/")
34 #define XML_STATUS "editUserData_status"
36 #define XML_ADMIN_STATUS "logbook_admin_status"
37 #define XML_MOST_RECENT_DAY "most_recent_day"
38 #define XML_EXPERIMENTS_ROOT "experiments"
39 #define XML_EXPERIMENT "experiment"
40 #define XML_ACTIVE_EXPERIMENT "active_experiment"
41 #define XML_EXPERIMENT_CREATE "create_time"
42 #define XML_EXPERIMENT_CREATOR "creator"
44 #define XML_LOGBOOK_ENTRY "logbook_entry"
45 #define XML_LOGBOOK_ENTRY_SUBJECT "logbook_entry_subject"
46 #define XML_LOGBOOK_ENTRY_TEXT "logbook_entry_text"
47 #define XML_LOGBOOK_ENTRY_FILE "logbook_entry_file"
48 #define XML_LOGBOOK_ENTRY_TIME "logbook_entry_time"
49 #define XML_LOGBOOK_ENTRY_CREATOR "logbook_entry_creator"
50 #define XML_LOGBOOK_ENTRY_HIDDEN "logbook_entry_hidden"
51 #define XML_LOGBOOK_ENTRY_HIDER "logbook_entry_hider"
52 #define XML_LOGBOOK_ENTRY_HIDDEN_TIME "logbook_entry_hidden_time"
54 #define XML_PREVIEW_INDEX "preview_index"
55 #define LOGBOOK_PREVIEW_FILE "preview.xml"
60 #define __MF_SUBJECT__ "Wizard"
63 WizardSupervisor::WizardSupervisor(xdaq::ApplicationStub* s)
64 : xdaq::Application(s)
66 , supervisorClass_(getApplicationDescriptor()->getClassName())
67 , supervisorClassNoNamespace_(supervisorClass_.substr(
68 supervisorClass_.find_last_of(
":") + 1,
69 supervisorClass_.length() - supervisorClass_.find_last_of(
":")))
71 __COUT__ <<
"Constructor started." << __E__;
73 INIT_MF(
"OtsConfigurationWizard");
76 mkdir((std::string(__ENV__(
"SERVICE_DATA_PATH"))).c_str(), 0755);
77 mkdir((std::string(__ENV__(
"SERVICE_DATA_PATH")) +
"/OtsWizardData").c_str(), 0755);
79 GatewaySupervisor::indicateOtsAlive();
82 xgi::bind(
this, &WizardSupervisor::Default,
"Default");
83 xgi::bind(
this, &WizardSupervisor::verification,
"Verify");
84 xgi::bind(
this, &WizardSupervisor::request,
"Request");
85 xgi::bind(
this, &WizardSupervisor::requestIcons,
"requestIcons");
86 xgi::bind(
this, &WizardSupervisor::editSecurity,
"editSecurity");
87 xgi::bind(
this, &WizardSupervisor::UserSettings,
"UserSettings");
88 xgi::bind(
this, &WizardSupervisor::tooltipRequest,
"TooltipRequest");
90 &WizardSupervisor::toggleSecurityCodeGeneration,
91 "ToggleSecurityCodeGeneration");
93 &WizardSupervisor::supervisorSequenceCheck,
94 "SupervisorSequenceCheck",
97 &WizardSupervisor::supervisorLastConfigGroupRequest,
98 "SupervisorLastConfigGroupRequest",
102 __COUT__ <<
"Constructor complete." << __E__;
106 WizardSupervisor::~WizardSupervisor(
void) { destroy(); }
109 void WizardSupervisor::init(
void)
114 allowedFileUploadTypes_.push_back(
"image/png");
115 matchingFileUploadTypes_.push_back(
"png");
116 allowedFileUploadTypes_.push_back(
"image/jpeg");
117 matchingFileUploadTypes_.push_back(
"jpeg");
118 allowedFileUploadTypes_.push_back(
"image/gif");
119 matchingFileUploadTypes_.push_back(
"gif");
120 allowedFileUploadTypes_.push_back(
"image/bmp");
121 matchingFileUploadTypes_.push_back(
"bmp");
122 allowedFileUploadTypes_.push_back(
"application/pdf");
123 matchingFileUploadTypes_.push_back(
"pdf");
124 allowedFileUploadTypes_.push_back(
"application/zip");
125 matchingFileUploadTypes_.push_back(
"zip");
126 allowedFileUploadTypes_.push_back(
"text/plain");
127 matchingFileUploadTypes_.push_back(
"txt");
131 void WizardSupervisor::requestIcons(xgi::Input* in,
134 cgicc::Cgicc cgi(in);
136 std::string submittedSequence = CgiDataUtilities::postData(cgi,
"sequence");
139 if(securityCode_.compare(submittedSequence) != 0)
141 __COUT__ <<
"Unauthorized Request made, security sequence doesn't match! "
142 << time(0) << std::endl;
147 __COUT__ <<
"***Successfully authenticated security sequence. " << time(0)
160 *out <<
"Configure,CFG,0,1,icon-Configure.png,/urn:xdaq-application:lid=280/,/"
162 "Editor,TBL,0,1,icon-IconEditor.png,/urn:xdaq-application:lid=280/"
163 "?configWindowName=tableEditor,/"
165 "Settings,SEC,1,1,icon-SecuritySettings.png,/WebPath/html/"
166 "SecuritySettings.html,/User Settings"
168 "Data,USER,1,1,icon-EditUserData.png,/WebPath/html/EditUserData.html,/User "
172 ",Console,C,1,1,icon-Console.png,/urn:xdaq-application:lid=260/,/" <<
183 "Wizard,CFG,0,1,icon-Configure.png,/WebPath/html/"
184 "RecordWiz_ConfigurationGUI.html?urn=280&recordAlias=Front%2Dend,Config Wizards"
186 "Wizard,CFG,0,1,icon-Configure.png,/WebPath/html/"
187 "RecordWiz_ConfigurationGUI.html?urn=280&recordAlias=Processor,Config Wizards"
189 "Diagram,CFG,0,1,icon-Configure.png,/WebPath/html/"
190 "ConfigurationSubsetBlockDiagram.html?urn=280,Config Wizards"
198 ",Code Editor,CODE,0,1,icon-CodeEditor.png,/urn:xdaq-application:lid=240/,/"
205 void WizardSupervisor::verification(xgi::Input* in,
208 cgicc::Cgicc cgi(in);
209 std::string submittedSequence = CgiDataUtilities::getData(cgi,
"code");
210 __COUT__ <<
"submittedSequence=" << submittedSequence <<
" " << time(0) << std::endl;
212 std::string securityWarning =
"";
214 if(securityCode_.compare(submittedSequence) != 0)
216 __COUT__ <<
"Unauthorized Request made, security sequence doesn't match!"
218 *out <<
"Invalid code.";
224 __COUT__ <<
"*** Successfully authenticated security sequence "
225 <<
"@ " << time(0) << std::endl;
230 securityWarning =
"&secure=False";
234 *out <<
"<!DOCTYPE HTML><html lang='en'><head><title>ots wiz</title>" <<
237 "<link rel='apple-touch-icon' sizes='57x57' href='/WebPath/images/otsdaqIcons/apple-icon-57x57.png'>\
238 <link rel='apple-touch-icon' sizes='60x60' href='/WebPath/images/otsdaqIcons/apple-icon-60x60.png'>\
239 <link rel='apple-touch-icon' sizes='72x72' href='/WebPath/images/otsdaqIcons/apple-icon-72x72.png'>\
240 <link rel='apple-touch-icon' sizes='76x76' href='/WebPath/images/otsdaqIcons/apple-icon-76x76.png'>\
241 <link rel='apple-touch-icon' sizes='114x114' href='/WebPath/images/otsdaqIcons/apple-icon-114x114.png'>\
242 <link rel='apple-touch-icon' sizes='120x120' href='/WebPath/images/otsdaqIcons/apple-icon-120x120.png'>\
243 <link rel='apple-touch-icon' sizes='144x144' href='/WebPath/images/otsdaqIcons/apple-icon-144x144.png'>\
244 <link rel='apple-touch-icon' sizes='152x152' href='/WebPath/images/otsdaqIcons/apple-icon-152x152.png'>\
245 <link rel='apple-touch-icon' sizes='180x180' href='/WebPath/images/otsdaqIcons/apple-icon-180x180.png'>\
246 <link rel='icon' type='image/png' sizes='192x192' href='/WebPath/images/otsdaqIcons/android-icon-192x192.png'>\
247 <link rel='icon' type='image/png' sizes='32x32' href='/WebPath/images/otsdaqIcons/favicon-32x32.png'>\
248 <link rel='icon' type='image/png' sizes='96x96' href='/WebPath/images/otsdaqIcons/favicon-96x96.png'>\
249 <link rel='icon' type='image/png' sizes='16x16' href='/WebPath/images/otsdaqIcons/favicon-16x16.png'>\
250 <link rel='manifest' href='/WebPath/images/otsdaqIcons/manifest.json'>\
251 <meta name='msapplication-TileColor' content='#ffffff'>\
252 <meta name='msapplication-TileImage' content='/ms-icon-144x144.png'>\
253 <meta name='theme-color' content='#ffffff'>"
257 <<
"<frameset col='100%' row='100%'><frame src='/WebPath/html/Wizard.html?urn="
258 << this->getApplicationDescriptor()->getLocalId() << securityWarning
259 <<
"'></frameset></html>";
263 void WizardSupervisor::generateURL()
265 defaultSequence_ =
true;
268 FILE* fp = fopen((SEQUENCE_FILE_NAME).c_str(),
"r");
271 __COUT_INFO__ <<
"Sequence length file found: " << SEQUENCE_FILE_NAME
274 fgets(line, 100, fp);
275 sscanf(line,
"%d", &length);
280 defaultSequence_ =
false;
286 <<
"(Reverting to default wiz security) Sequence length file NOT found: "
287 << SEQUENCE_FILE_NAME << std::endl;
291 __COUT__ <<
"Sequence length = " << length << std::endl;
295 const char alphanum[] =
297 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
298 "abcdefghijklmnopqrstuvwxyz";
300 for(
int i = 0; i < length; ++i)
302 securityCode_ += alphanum[rand() % (
sizeof(alphanum) - 1)];
305 __COUT__ << __ENV__(
"OTS_CONFIGURATION_WIZARD_SUPERVISOR_SERVER") <<
":"
306 << __ENV__(
"PORT") <<
"/urn:xdaq-application:lid="
307 << this->getApplicationDescriptor()->getLocalId()
308 <<
"/Verify?code=" << securityCode_ << std::endl;
314 fp = fopen((SEQUENCE_OUT_FILE_NAME).c_str(),
"w");
317 fprintf(fp,
"%s", securityCode_.c_str());
321 __COUT_ERR__ <<
"Sequence output file NOT found: " << SEQUENCE_OUT_FILE_NAME
327 void WizardSupervisor::printURL(
WizardSupervisor* ptr, std::string securityCode)
329 INIT_MF(
"ConfigurationWizard");
334 std::this_thread::sleep_for(std::chrono::seconds(2));
335 __COUT__ << __ENV__(
"OTS_CONFIGURATION_WIZARD_SUPERVISOR_SERVER") <<
":"
336 << __ENV__(
"PORT") <<
"/urn:xdaq-application:lid="
337 << ptr->getApplicationDescriptor()->getLocalId()
338 <<
"/Verify?code=" << securityCode << std::endl;
343 void WizardSupervisor::destroy(
void)
349 void WizardSupervisor::tooltipRequest(xgi::Input* in,
352 cgicc::Cgicc cgi(in);
354 std::string Command = CgiDataUtilities::getData(cgi,
"RequestType");
357 std::string submittedSequence = CgiDataUtilities::postData(cgi,
"sequence");
360 if(securityCode_.compare(submittedSequence) != 0)
362 __COUT__ <<
"Unauthorized Request made, security sequence doesn't match!"
374 if(Command ==
"check")
376 WebUsers::tooltipCheckForUsername(WebUsers::DEFAULT_ADMIN_USERNAME,
378 CgiDataUtilities::getData(cgi,
"srcFile"),
379 CgiDataUtilities::getData(cgi,
"srcFunc"),
380 CgiDataUtilities::getData(cgi,
"srcId"));
382 else if(Command ==
"setNeverShow")
384 WebUsers::tooltipSetNeverShowForUsername(
385 WebUsers::DEFAULT_ADMIN_USERNAME,
387 CgiDataUtilities::getData(cgi,
"srcFile"),
388 CgiDataUtilities::getData(cgi,
"srcFunc"),
389 CgiDataUtilities::getData(cgi,
"srcId"),
390 CgiDataUtilities::getData(cgi,
"doNeverShow") ==
"1" ?
true :
false,
391 CgiDataUtilities::getData(cgi,
"temporarySilence") ==
"1" ?
true :
false);
394 __COUT__ <<
"Command Request, " << Command <<
", not recognized." << std::endl;
396 xmldoc.outputXmlDocument((std::ostringstream*)out,
false,
true);
400 void WizardSupervisor::toggleSecurityCodeGeneration(
401 xgi::Input* in, xgi::Output* out)
403 cgicc::Cgicc cgi(in);
405 std::string Command = CgiDataUtilities::getData(cgi,
"RequestType");
406 __COUT__ <<
"Got to Command = " << Command << std::endl;
408 std::string submittedSequence = CgiDataUtilities::postData(cgi,
"sequence");
411 if(securityCode_.compare(submittedSequence) != 0)
413 __COUT__ <<
"Unauthorized Request made, security sequence doesn't match!"
419 __COUT__ <<
"***Successfully authenticated security sequence." << std::endl;
425 if(Command ==
"TurnGenerationOn")
427 __COUT__ <<
"Turning automatic URL Generation on with a sequence depth of 16!"
429 std::ofstream outfile((SEQUENCE_FILE_NAME).c_str());
430 outfile <<
"16" << std::endl;
442 std::string securityCode) { printURL(ptr, securityCode); },
447 xmldoc.addTextElementToData(
"Status",
"Generation_Success");
450 __COUT__ <<
"Command Request, " << Command <<
", not recognized." << std::endl;
452 xmldoc.outputXmlDocument((std::ostringstream*)out,
false,
true);
458 xoap::MessageReference WizardSupervisor::supervisorSequenceCheck(
459 xoap::MessageReference message)
463 parameters.addParameter(
"sequence");
464 SOAPUtilities::receive(message, parameters);
466 std::string submittedSequence = parameters.getValue(
"sequence");
470 std::map<std::string , WebUsers::permissionLevel_t> permissionMap;
472 if(securityCode_ == submittedSequence)
473 permissionMap.emplace(
474 std::pair<std::string /*groupName*/, WebUsers::permissionLevel_t>(
475 WebUsers::DEFAULT_USER_GROUP, WebUsers::PERMISSION_LEVEL_ADMIN));
478 __COUT__ <<
"Unauthorized Request made, security sequence doesn't match!"
481 permissionMap.emplace(
482 std::pair<std::string /*groupName*/, WebUsers::permissionLevel_t>(
483 WebUsers::DEFAULT_USER_GROUP, WebUsers::PERMISSION_LEVEL_INACTIVE));
488 retParameters.addParameter(
"Permissions", StringMacros::mapToString(permissionMap));
490 return SOAPUtilities::makeSOAPMessageReference(
"SequenceResponse", retParameters);
498 xoap::MessageReference WizardSupervisor::supervisorLastConfigGroupRequest(
499 xoap::MessageReference message)
502 parameters.addParameter(
"ActionOfLastGroup");
503 SOAPUtilities::receive(message, parameters);
505 return GatewaySupervisor::lastConfigGroupRequestHandler(parameters);
509 void WizardSupervisor::Default(xgi::Input* in,
512 __COUT__ <<
"Unauthorized Request made, security sequence doesn't match!"
514 *out <<
"Unauthorized Request.";
518 void WizardSupervisor::request(xgi::Input* in,
521 cgicc::Cgicc cgiIn(in);
523 std::string submittedSequence = CgiDataUtilities::postData(cgiIn,
"sequence");
526 if(securityCode_.compare(submittedSequence) != 0)
528 __COUT__ <<
"Unauthorized Request made, security sequence doesn't match! "
529 << time(0) << std::endl;
534 __COUT__ <<
"***Successfully authenticated security sequence. " << time(0)
539 std::string requestType = CgiDataUtilities::getData(cgiIn,
"RequestType");
540 __COUTV__(requestType);
546 if(requestType ==
"gatewayLaunchOTS" || requestType ==
"gatewayLaunchWiz")
550 __COUT_WARN__ << requestType <<
" requestType received! " << __E__;
551 __MOUT_WARN__ << requestType <<
" requestType received! " << __E__;
555 if(requestType ==
"gatewayLaunchOTS")
556 GatewaySupervisor::launchStartOTSCommand(
"LAUNCH_OTS", &cfgMgr);
557 else if(requestType ==
"gatewayLaunchWiz")
558 GatewaySupervisor::launchStartOTSCommand(
"LAUNCH_WIZ", &cfgMgr);
562 __SS__ <<
"requestType Request, " << requestType <<
", not recognized."
567 catch(
const std::runtime_error& e)
569 __SS__ <<
"An error was encountered handling requestType '" << requestType
570 <<
"':" << e.what() << __E__;
571 __COUT__ <<
"\n" << ss.str();
572 xmlOut.addTextElementToData(
"Error", ss.str());
576 __SS__ <<
"An unknown error was encountered handling requestType '" << requestType
578 <<
"Please check the printouts to debug." << __E__;
579 __COUT__ <<
"\n" << ss.str();
580 xmlOut.addTextElementToData(
"Error", ss.str());
584 xmlOut.outputXmlDocument(
585 (std::ostringstream*)out,
592 void WizardSupervisor::editSecurity(xgi::Input* in,
596 cgicc::Cgicc cgi(in);
597 std::string submittedSequence = CgiDataUtilities::postData(cgi,
"sequence");
598 std::string submittedSecurity = CgiDataUtilities::postData(cgi,
"selection");
599 std::string securityFileName = SECURITY_FILE_NAME;
602 if(securityCode_.compare(submittedSequence) != 0)
604 __COUT__ <<
"Unauthorized Request made, security sequence doesn't match!"
610 __COUT__ <<
"***Successfully authenticated security sequence." << std::endl;
614 if(submittedSecurity !=
"")
616 __COUT__ <<
"Selection exists!" << std::endl;
617 __COUT__ << submittedSecurity << std::endl;
619 if(submittedSecurity ==
"ResetAllUserData")
621 WebUsers::deleteUserData();
622 __COUT__ <<
"Turning URL Generation back to default!" << std::endl;
625 std::ofstream newFile((SEQUENCE_FILE_NAME).c_str());
626 newFile <<
"4" << std::endl;
631 std::string securityCode) { printURL(ptr, securityCode); },
635 *out <<
"Default_URL_Generation";
637 else if(submittedSecurity ==
"ResetAllUserTooltips")
639 WebUsers::resetAllUserTooltips();
640 *out << submittedSecurity;
643 else if(submittedSecurity ==
"DigestAccessAuthentication" ||
644 submittedSecurity ==
"NoSecurity")
646 std::ofstream writeSecurityFile;
648 writeSecurityFile.open(securityFileName.c_str());
649 if(writeSecurityFile.is_open())
650 writeSecurityFile << submittedSecurity;
652 __COUT__ <<
"Error writing file!" << std::endl;
654 writeSecurityFile.close();
658 __COUT_ERR__ <<
"Invalid submittedSecurity string: " << submittedSecurity
666 std::ifstream securityFile;
668 std::string security =
"";
671 securityFile.open(securityFileName.c_str());
680 security =
"DigestAccessAuthentication";
682 if(securityFile.is_open())
685 while(std::getline(securityFile, line))
693 securityFile.close();
699 void WizardSupervisor::UserSettings(xgi::Input* in,
703 cgicc::Cgicc cgi(in);
704 std::string submittedSequence = CgiDataUtilities::postData(cgi,
"sequence");
705 std::string securityFileName = SECURITY_FILE_NAME;
707 if((Command = CgiDataUtilities::postData(cgi,
"RequestType")) ==
"")
708 Command = cgi(
"RequestType");
710 __COUT__ << Command << std::endl;
711 __COUT__ <<
"We are vewing Users' Settings!" << std::endl;
714 if(securityCode_.compare(submittedSequence) != 0)
716 __COUT__ <<
"Unauthorized Request made, security sequence doesn't match!"
718 __COUT__ << submittedSequence << std::endl;
723 __COUT__ <<
"***Successfully authenticated security sequence." << std::endl;
728 uint64_t activeSessionIndex;
730 uint8_t userPermissions;
734 __COUT__ <<
"Action exists!" << std::endl;
735 __COUT__ << Command << std::endl;
737 if(Command ==
"Import")
756 __COUT__ << cgi(
"Entry") << std::endl;
757 __COUT__ << cgi(
"Filename") << std::endl;
758 __COUT__ << cgi(
"Imported_File") << std::endl;
760 const std::vector<cgicc::FormFile> files = cgi.getFiles();
761 __COUT__ <<
"FormFiles: " <<
sizeof(files) << std::endl;
762 __COUT__ <<
"Number of files: " << files.size() << std::endl;
764 for(
unsigned int i = 0; i < files.size(); ++i)
766 std::string filename = USER_DATA_PATH + files[i].getFilename();
767 __COUT__ << filename << std::endl;
768 std::ofstream myFile;
769 myFile.open(filename.c_str());
770 files[0].writeToStream(myFile);
773 __COUT__ << files[0].getFilename() << std::endl;
774 __COUT__ <<
"********************Files Begin********************"
776 for(
unsigned int i = 0; i < files.size(); ++i)
778 __COUT__ << files[i].getDataType() << std::endl;
780 __COUT__ <<
"*********************Files End*********************"
787 else if(Command ==
"Export")
789 __SS__ <<
"This has been commented out due to problems compiling. Contact "
833 __COUT__ <<
"Command request not recognized: " << Command << std::endl;
845 std::string WizardSupervisor::validateUploadFileType(
const std::string fileType)
847 for(
unsigned int i = 0; i < allowedFileUploadTypes_.size(); ++i)
848 if(allowedFileUploadTypes_[i] == fileType)
849 return matchingFileUploadTypes_[i];
857 void WizardSupervisor::cleanUpPreviews()
859 std::string userData = (std::string)USER_DATA_PATH;
861 DIR* dir = opendir(userData.c_str());
864 __COUT__ <<
"Error - User Data directory missing: " << userData << std::endl;
868 struct dirent* entry;
869 time_t dirCreateTime;
876 if(strcmp(entry->d_name,
".") != 0 && strcmp(entry->d_name,
"..") != 0 &&
877 strcmp(entry->d_name,
".svn") != 0)
880 for(i = 0; i < strlen(entry->d_name); ++i)
881 if(entry->d_name[i] ==
'_')
883 entry->d_name[i] =
' ';
886 sscanf(entry->d_name,
"%li", &dirCreateTime);
888 if((time(0) - dirCreateTime) > USER_DATA_EXPIRATION_TIME)
890 __COUT__ <<
"Expired" << std::endl;
892 entry->d_name[i] =
'_';
894 __COUT__ <<
"rm -rf " << USER_DATA_PATH + (std::string)entry->d_name
897 system(((std::string)(
"rm -rf " + userData + (std::string)entry->d_name))
909 void WizardSupervisor::savePostPreview(std::string& subject,
911 const std::vector<cgicc::FormFile>& files,
926 std::string userDataPath = (std::string)USER_DATA_PATH + (std::string)fileIndex;
928 __COUT__ <<
"userDataPath " << userDataPath << std::endl;
929 if(-1 == mkdir(userDataPath.c_str(), 0755))
932 xmldoc->addTextElementToData(XML_STATUS,
933 "Failed - directory could not be generated.");