0
我有一個頁面,用戶可以在數據庫中修改自己的記錄。這很好,但我試圖整理所有的安全漏洞。正如你可以從下面的代碼看到的,這個頁面使用查詢字符串參數獲取數據。目前,任何人都可以更改此查詢字符串並編輯任何記錄。Webmatrix - 鎖定頁面
我如何在PropertyInfo表中使用「RequireAuthenticatedUser」和匹配的UserID字段進行檢查?
當前代碼:
@{
Layout = "~/_SiteLayout.cshtml";
WebSecurity.RequireAuthenticatedUser();
var db = Database.Open("StayInFlorida");
var rPropertyId = Request.QueryString["PropertyID"];
var Propertyinfo = "SELECT * FROM PropertyInfo WHERE [email protected]";
var qPropertyinfo = db.QuerySingle(Propertyinfo, rPropertyId);
}