-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDnn.Modules.ConfigurationManager_08.00.04.xml
494 lines (481 loc) · 18 KB
/
Dnn.Modules.ConfigurationManager_08.00.04.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<root file="Dnn.Modules.ConfigurationManager.dll" version="08.00.04" generated="2017-06-19 23:39:21Z" generationTime="2.0691282">
<namespace name="Dnn.Modules.ConfigurationManager.Components">
<class name="BusinessController">
<declaration><![CDATA[public class BusinessController : IUpgradeable]]></declaration>
<documentation>
<summary>
</summary>
</documentation>
<constructors>
<constructor name=".ctor">
<declaration><![CDATA[public BusinessController()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="2147483647" sc="0" el="0" ec="0">
</location>
<body hash="d41d8cd98f00b204e9800998ecf8427e"><![CDATA[]]></body>
</codeblock>
</constructor>
</constructors>
<methods>
<method name="UpgradeModule">
<declaration><![CDATA[public string UpgradeModule(string version)]]></declaration>
<documentation>
<summary>
</summary>
<param name="version"></param>
<returns></returns></documentation>
<codeblock>
<location sl="41" sc="9" el="55" ec="10">Components\BusinessController.cs</location>
<body hash="67abc96a144fec1e91cc1f2ff9dacb31"><![CDATA[{
try
{
switch (version)
{
case "08.00.00":
break;
}
return "Success";
}
catch (Exception)
{
return "Failed";
}
}]]></body>
</codeblock>
</method>
</methods>
<fields>
</fields>
<properties>
</properties>
<events>
</events>
</class>
</namespace>
<namespace name="Dnn.Modules.XmlMerge">
<class name="XmlMerge">
<declaration><![CDATA[public class XmlMerge : PortalModuleBase]]></declaration>
<documentation>
</documentation>
<constructors>
<constructor name=".ctor">
<declaration><![CDATA[public XmlMerge()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="2147483647" sc="0" el="0" ec="0">
</location>
<body hash="d41d8cd98f00b204e9800998ecf8427e"><![CDATA[]]></body>
</codeblock>
</constructor>
<constructor name=".cctor">
<declaration><![CDATA[static XmlMerge()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="49" sc="6" el="49" ec="95">XmlMerge.ascx.cs</location>
<body hash="df4f2b567304fafbb28b4d74d39eba90"><![CDATA[private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof (XmlMerge))]]></body>
</codeblock>
</constructor>
</constructors>
<methods>
<method name="BindConfigList">
<declaration><![CDATA[private void BindConfigList()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="89" sc="9" el="96" ec="10">XmlMerge.ascx.cs</location>
<body hash="6943a521fd8865f09bfb1a2dad9fbf49"><![CDATA[{
var files = Directory.GetFiles(Globals.ApplicationMapPath, "*.config");
IEnumerable<string> fileList = (from file in files select Path.GetFileName(file));
ddlConfig.DataSource = fileList;
ddlConfig.DataBind();
ddlConfig.InsertItem(0, Localization.GetString("SelectConfig", LocalResourceFile), "-1");
ddlConfig.SelectedIndex = 0;
}]]></body>
</codeblock>
</method>
<method name="IsValidDocType">
<declaration><![CDATA[private static bool IsValidDocType(string contentType)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="67" sc="9" el="76" ec="10">XmlMerge.ascx.cs</location>
<body hash="cc49e4f4507f4067a24002ec8b2ea1e1"><![CDATA[{
switch (contentType)
{
case "text/plain":
case "application/xml":
return true;
default:
return false;
}
}]]></body>
</codeblock>
</method>
<method name="IsValidXmlMergDocument">
<declaration><![CDATA[private bool IsValidXmlMergDocument(string mergeDocText)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="79" sc="9" el="86" ec="10">XmlMerge.ascx.cs</location>
<body hash="2dd5c7e9107756412664a070963d662a"><![CDATA[{
if (string.IsNullOrEmpty(mergeDocText.Trim()))
{
return false;
}
//TODO: Add more checks here
return true;
}]]></body>
</codeblock>
</method>
<method name="LoadConfig">
<declaration><![CDATA[private void LoadConfig(string configFile)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="108" sc="9" el="119" ec="10">XmlMerge.ascx.cs</location>
<body hash="46aeade66c18f23eb192da8140bd0fa6"><![CDATA[{
var configDoc = Config.Load(configFile);
using (var txtWriter = new StringWriter())
{
using (var writer = new XmlTextWriter(txtWriter))
{
writer.Formatting = Formatting.Indented;
configDoc.WriteTo(writer);
}
txtConfiguration.Text = txtWriter.ToString();
}
}]]></body>
</codeblock>
</method>
<method name="OnConfigFileIndexChanged">
<declaration><![CDATA[protected void OnConfigFileIndexChanged(object sender, EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="228" sc="9" el="233" ec="10">XmlMerge.ascx.cs</location>
<body hash="58c5e15542532db3c9821fac2882e9c0"><![CDATA[{
if (ddlConfig.SelectedIndex != 0)
{
LoadConfig(ddlConfig.SelectedValue.ToLowerInvariant());
}
}]]></body>
</codeblock>
</method>
<method name="OnExecuteClick">
<declaration><![CDATA[protected void OnExecuteClick(object sender, EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="171" sc="9" el="191" ec="10">XmlMerge.ascx.cs</location>
<body hash="b96df501f210b87258fb41042a42fca3"><![CDATA[{
ValidateSuperUser();
if (IsValidXmlMergDocument(txtScript.Text))
{
try
{
var doc = new XmlDocument();
doc.LoadXml(txtScript.Text);
var app = DotNetNukeContext.Current.Application;
var merge = new DotNetNuke.Services.Installer.XmlMerge(doc, Globals.FormatVersion(app.Version), app.Description);
merge.UpdateConfigs();
DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("Success", LocalResourceFile), ModuleMessage.ModuleMessageType.GreenSuccess);
}
catch (Exception ex)
{
DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ERROR_Merge", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError);
Exceptions.LogException(ex);
}
}
}]]></body>
</codeblock>
</method>
<method name="OnInit">
<declaration><![CDATA[protected override void OnInit(EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="126" sc="9" el="135" ec="10">XmlMerge.ascx.cs</location>
<body hash="80c6b78d77f7c9763b9aa91492ae4668"><![CDATA[{
base.OnInit(e);
cmdExecute.Click += OnExecuteClick;
cmdSave.Click += OnSaveClick;
cmdUpload.Click += OnUploadClick;
ddlConfig.SelectedIndexChanged += OnConfigFileIndexChanged;
JavaScript.RequestRegistration(CommonJs.DnnPlugins);
}]]></body>
</codeblock>
</method>
<method name="OnLoad">
<declaration><![CDATA[protected override void OnLoad(EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="138" sc="9" el="161" ec="10">XmlMerge.ascx.cs</location>
<body hash="cff6f4fdbfb3178dd260f37e23789c41"><![CDATA[{
base.OnLoad(e);
ValidateSuperUser();
if (!Page.IsPostBack)
{
BindConfigList();
}
else
{
if (ddlConfig.SelectedIndex != 0)
{
//ddlConfig.Attributes.Add("onClick", "javascript: alert('" + Localization.GetString("LoadConfigWarning", LocalResourceFile) + "');");
txtConfiguration.Enabled = true;
}
else
{
//ddlConfig.Attributes.Remove("onClick");
txtConfiguration.Text = string.Empty;
txtConfiguration.Enabled = true;
}
}
}]]></body>
</codeblock>
</method>
<method name="OnPreRender">
<declaration><![CDATA[protected override void OnPreRender(EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="164" sc="9" el="168" ec="10">XmlMerge.ascx.cs</location>
<body hash="4fd6d7403b9079ba2857ac0b9b636f64"><![CDATA[{
base.OnPreRender(e);
SetSaveButtonState();
}]]></body>
</codeblock>
</method>
<method name="OnSaveClick">
<declaration><![CDATA[protected void OnSaveClick(object sender, EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="194" sc="9" el="211" ec="10">XmlMerge.ascx.cs</location>
<body hash="8f55ae5417a68dd41db0a8f6b7a1f36f"><![CDATA[{
ValidateSuperUser();
var configDoc = new XmlDocument();
try
{
configDoc.LoadXml(txtConfiguration.Text);
Config.Save(configDoc, ddlConfig.SelectedValue);
LoadConfig(ddlConfig.SelectedValue);
DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("Success", LocalResourceFile), ModuleMessage.ModuleMessageType.GreenSuccess);
}
catch (Exception ex)
{
Logger.Error(ex);
DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, string.Format(Localization.GetString("ERROR_ConfigurationFormat", LocalResourceFile), ex.Message), ModuleMessage.ModuleMessageType.RedError);
return;
}
}]]></body>
</codeblock>
</method>
<method name="OnUploadClick">
<declaration><![CDATA[protected void OnUploadClick(object sender, EventArgs e)]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="214" sc="9" el="225" ec="10">XmlMerge.ascx.cs</location>
<body hash="71507f5469a7a8a52486f4d132bc7ab4"><![CDATA[{
ValidateSuperUser();
if (IsValidDocType(uplScript.PostedFile.ContentType))
{
var scriptFile = new StreamReader(uplScript.PostedFile.InputStream);
txtScript.Text = scriptFile.ReadToEnd();
}
else
{
DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, string.Format(Localization.GetString("ERROR_ConfigurationFormat", LocalResourceFile), ""), ModuleMessage.ModuleMessageType.RedError);
}
}]]></body>
</codeblock>
</method>
<method name="SetSaveButtonState">
<declaration><![CDATA[private void SetSaveButtonState()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="237" sc="9" el="258" ec="10">XmlMerge.ascx.cs</location>
<body hash="53080821dc6b4ce65f309ee8698c1a39"><![CDATA[{
if (ddlConfig.SelectedIndex <= 0)
{
cmdSave.Enabled = false;
cmdExecute.Enabled = false;
}
else
{
cmdSave.Enabled = true;
if (!String.IsNullOrEmpty(txtScript.Text.Trim()))
{
cmdExecute.Enabled = true;
}
else
{
cmdExecute.Enabled = false;
}
}
}]]></body>
</codeblock>
</method>
<method name="ValidateSuperUser">
<declaration><![CDATA[private void ValidateSuperUser()]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="99" sc="9" el="105" ec="10">XmlMerge.ascx.cs</location>
<body hash="f28b422b9e720e6be26a876433eb78e6"><![CDATA[{
//Verify that the current user has access to access this page
if (!UserInfo.IsSuperUser)
{
Response.Redirect(Globals.NavigateURL("Access Denied"), true);
}
}]]></body>
</codeblock>
</method>
</methods>
<fields>
<field name="cmdExecute">
<declaration><![CDATA[protected LinkButton cmdExecute;]]></declaration>
<documentation>
<summary>
cmdExecute control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
<field name="cmdSave">
<declaration><![CDATA[protected LinkButton cmdSave;]]></declaration>
<documentation>
<summary>
cmdSave control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
<field name="cmdUpload">
<declaration><![CDATA[protected LinkButton cmdUpload;]]></declaration>
<documentation>
<summary>
cmdUpload control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
<field name="ddlConfig">
<declaration><![CDATA[protected DnnComboBox ddlConfig;]]></declaration>
<documentation>
<summary>
ddlConfig control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
<field name="lblMessage">
<declaration><![CDATA[protected Label lblMessage;]]></declaration>
<documentation>
<summary>
lblMessage control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
<field name="Logger">
<declaration><![CDATA[private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(XmlMerge));]]></declaration>
<documentation>
</documentation>
</field>
<field name="plConfig">
<declaration><![CDATA[protected UserControl plConfig;]]></declaration>
<documentation>
<summary>
plConfig control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
<field name="plScript">
<declaration><![CDATA[protected UserControl plScript;]]></declaration>
<documentation>
<summary>
plScript control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
<field name="txtConfiguration">
<declaration><![CDATA[protected TextBox txtConfiguration;]]></declaration>
<documentation>
<summary>
txtConfiguration control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
<field name="txtScript">
<declaration><![CDATA[protected TextBox txtScript;]]></declaration>
<documentation>
<summary>
txtScript control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
<field name="uplScript">
<declaration><![CDATA[protected FileUpload uplScript;]]></declaration>
<documentation>
<summary>
uplScript control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks></documentation>
</field>
</fields>
<properties>
<property name="ConfirmText">
<declaration><![CDATA[protected string ConfirmText]]></declaration>
<documentation>
</documentation>
<codeblock>
<location sl="54" sc="7" el="61" ec="8">XmlMerge.ascx.cs</location>
<body hash="c046c32300807e681d5d5a5656aa6b9a"><![CDATA[{
if (ddlConfig.SelectedValue.ToLowerInvariant() == "web.config")
{
return Localization.GetSafeJSString("SaveWarning", LocalResourceFile);
}
return Localization.GetSafeJSString("SaveConfirm", LocalResourceFile);
}]]></body>
</codeblock>
</property>
</properties>
<events>
</events>
</class>
</namespace>
</root>