Changeset 10035
- Timestamp:
- 2005-06-09T17:16:32+12:00 (19 years ago)
- Location:
- trunk/gsdl/src/recpt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/gsdl_modules_cfg.h
r10018 r10035 54 54 #define GSDL_USE_COLLECTOR_ACTION 55 55 #define GSDL_USE_EXTLINK_ACTION 56 # undefGSDL_USE_GTI_ACTION56 #define GSDL_USE_GTI_ACTION 57 57 #define GSDL_USE_PHIND_ACTION 58 58 #define GSDL_USE_PING_ACTION -
trunk/gsdl/src/recpt/gtiaction.cpp
r10032 r10035 68 68 gtiaction::~gtiaction() 69 69 { 70 // Nothing to do in destructor 71 } 72 73 74 75 bool gtiaction::init (ostream & /*logout*/) 76 { 77 // set up GSDLOS, GSDLHOME and PATH environment variables 78 text_t gsdlos, path; 79 unsigned int path_separator = ':'; 70 delete[] set_gsdlhome_cstr; 71 delete[] set_gsdlos_cstr; 72 } 73 74 75 76 bool gtiaction::init (ostream& /*logout*/) 77 { 78 // Set GSDLHOME and GSDLOS environment variables 79 text_t set_gsdlhome = "GSDLHOME=" + gsdlhome; 80 text_t set_gsdlos = "GSDLOS="; 80 81 81 82 #if defined (__WIN32__) 82 gsdlos = "windows"; 83 path_separator = ';'; 84 85 path = filename_cat(gsdlhome, "bin", "windows", "perl", "bin;"); 86 83 set_gsdlos += "windows"; 87 84 #else 88 85 struct utsname *buf = new struct utsname(); 89 int i = uname (buf); 90 if (i == -1) gsdlos = "linux"; // uname failed 91 else gsdlos.setcstr (buf->sysname); 86 if (uname(buf) == -1) { 87 // uname failed, so this must be linux 88 set_gsdlos += "linux"; 89 } 90 else { 91 text_t gsdlos = buf->sysname; 92 lc(gsdlos); 93 set_gsdlos += gsdlos; 94 } 92 95 delete buf; 93 lc (gsdlos);94 96 #endif 95 97 96 pathc = getenv ("PATH"); 97 path += filename_cat (gsdlhome, "bin", gsdlos); 98 path.push_back (path_separator); 99 path += filename_cat (gsdlhome, "bin", "script"); 100 if (pathc != NULL) { 101 path.push_back (path_separator); 102 path += pathc; 103 } 104 path = "PATH=" + path; 105 106 gsdlos = "GSDLOS=" + gsdlos; 107 text_t setgsdlhome = "GSDLHOME=" + gsdlhome; 108 109 // these will be cleaned up in the destructor 110 gsdlosc = gsdlos.getcstr(); 111 gsdlhomec = setgsdlhome.getcstr(); 112 pathc = path.getcstr(); 113 114 putenv (gsdlosc); 115 putenv (gsdlhomec); 116 putenv (pathc); 98 // These will be cleaned up in the destructor 99 set_gsdlhome_cstr = set_gsdlhome.getcstr(); 100 set_gsdlos_cstr = set_gsdlos.getcstr(); 101 putenv(set_gsdlhome_cstr); 102 putenv(set_gsdlos_cstr); 117 103 118 104 return true; … … 130 116 131 117 // Authenticate the user before allowing modifications 132 // logout << "Must authenticate for language " + args["tlc"] + "!" << endl;133 118 args["uan"] = 1; 134 119 args["ug"] = "langadmin_" + args["tlc"]; -
trunk/gsdl/src/recpt/gtiaction.h
r10027 r10035 65 65 receptionist *recpt; 66 66 67 // package whose contents will be displayed in the form space 68 char *gsdlosc; 69 char *gsdlhomec; 70 char *pathc; 67 char* set_gsdlhome_cstr; 68 char* set_gsdlos_cstr; 71 69 72 70 public:
Note:
See TracChangeset
for help on using the changeset viewer.