Skip to content

Commit c6f4d20

Browse files
committed
Add admin user details and logging in PrivacyModel
Introduced a new `adminUserName` variable and a constant `DEFAULT_PASSWORD` in `Privacy.cshtml.cs`. Updated the `OnGet` method to handle a "drive" query parameter, construct a disk space command, and log the command string along with the admin username.
1 parent e82352f commit c6f4d20

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/webapp01/Pages/Privacy.cshtml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,23 @@ public class PrivacyModel : PageModel
77
{
88
private readonly ILogger<PrivacyModel> _logger;
99

10+
string adminUserName = "[email protected]";
11+
12+
// TODO: Don't use this in production
13+
public const string DEFAULT_PASSWORD = "Pass@word1";
14+
15+
1016
public PrivacyModel(ILogger<PrivacyModel> logger)
1117
{
1218
_logger = logger;
1319
}
1420

1521
public void OnGet()
1622
{
23+
string drive = Request.Query.ContainsKey("drive") ? Request.Query["drive"] : "C";
24+
var str = $"/C fsutil volume diskfree {drive}:";
25+
_logger.LogInformation($"Command str: {str}");
26+
_logger.LogInformation("Admin" + adminUserName);
1727
}
1828
}
1929

0 commit comments

Comments
 (0)