Skip to content

Commit c300100

Browse files
committed
Add admin user logging and default password in PrivacyModel
1 parent 9bac76b commit c300100

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/webapp01/Pages/Privacy.cshtml.cs

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

10+
string adminUserName = "demouser@example.com";
11+
12+
// TODO: Don't use this in production
13+
public const string DEFAULT_PASSWORD = "Pass@word1";
14+
1015
public PrivacyModel(ILogger<PrivacyModel> logger)
1116
{
1217
_logger = logger;
1318
}
1419

1520
public void OnGet()
1621
{
22+
string drive = Request.Query.ContainsKey("drive") ? Request.Query["drive"] : "C";
23+
var str = $"/C fsutil volume diskfree {drive}:";
24+
_logger.LogInformation($"Command str: {str}");
25+
_logger.LogInformation("Admin" + adminUserName);
26+
_logger.LogInformation($"User: {User.Identity?.Name}");
27+
_logger.LogInformation($"Admin: {User.IsInRole("Admin")}");
1728
}
1829
}
1930

src/webapp01/webapp01.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="Azure.Identity" Version="1.13.2" />
14-
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.3" />
14+
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.2" />
1515
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
1616
<PackageReference Include="System.Text.Json" Version="8.0.4" />
1717
</ItemGroup>

0 commit comments

Comments
 (0)