Changeset 7842 for trunk/MagicSoft/Mars/msql
- Timestamp:
- 08/04/06 08:48:43 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/msql/MSQLServer.cc
r7404 r7842 540 540 void MSQLServer::InitEnv(TEnv &env, const char *prefix) 541 541 { 542 TString url; 543 TString user; 544 TString pass; 545 TString db; 542 TString url = env.GetValue("URL", ""); 543 TString db = env.GetValue("Database", ""); 544 TString user = env.GetValue("User", ""); 545 TString pass = env.GetValue("Password", ""); 546 547 user = env.GetValue(Form("%s.User", db.Data()), user); 548 549 pass = env.GetValue(Form("%s.Password", user.Data()), pass); 550 pass = env.GetValue(Form("%s.%s.Password", db.Data(), user.Data()), pass); 546 551 547 552 if (prefix) 548 553 { 549 url = env.GetValue(Form("%s.URL", prefix), ""); 550 user = env.GetValue(Form("%s.User", prefix), ""); 551 pass = env.GetValue(Form("%s.Password", prefix), ""); 552 db = env.GetValue(Form("%s.Database", prefix), ""); 553 } 554 if (url.IsNull()) 555 url = env.GetValue("URL", ""); 556 if (user.IsNull()) 557 user = env.GetValue("User", ""); 558 if (pass.IsNull()) 559 pass = env.GetValue("Password", ""); 560 if (db.IsNull()) 561 db = env.GetValue("Database", ""); 554 url = env.GetValue(Form("%s.URL", prefix), url); 555 db = env.GetValue(Form("%s.Database", prefix), db); 556 557 user = env.GetValue(Form("%s.User", prefix), user); 558 user = env.GetValue(Form("%s.%s.User", prefix, db.Data()), user); 559 560 pass = env.GetValue(Form("%s.Password", prefix), pass); 561 pass = env.GetValue(Form("%s.%s.Password", prefix, user.Data()), pass); 562 pass = env.GetValue(Form("%s.%s.%s.Password", prefix, db.Data(), user.Data()), pass); 563 } 562 564 563 565 if (user.IsNull() && pass.IsNull())
Note:
See TracChangeset
for help on using the changeset viewer.