protected UserInfo GetUserInfo() { YCookies cookie = new YCookies("cmsnt"); int uid = cookie.GetCookieIntValue("userid", 0); string password = cookie.GetCookieStringValue("password").Trim(); if (uid > 0 && password != string.Empty) { return(LiteCMS.Core.Users.GetUserInfo(uid, password)); } return(null); }
protected virtual bool IsAdminLogined() { //UserInfo userinfo = GetUserInfo(); if (userid > 0) { YCookies admincookie = new YCookies("cmsntadmin"); int adminid = admincookie.GetCookieIntValue("adminid", 0); string password = admincookie.GetCookieStringValue("password").Trim(); admininfo = null; if (adminid > 0 && password != string.Empty) { admininfo = Admins.GetAdminInfo(adminid, password); if (admininfo != null && admininfo.Uid == userid) { adminpath = admincookie.GetCookieStringValue("path").Trim(); return(true); } } } //登录失败 adminpath = ""; return(false); }
/// <summary> /// 验证登录 /// </summary> protected virtual void CheckLogin() { string cookiename = "cmsnt"; userid = YCookies.GetCookieIntValue("userid", cookiename, 0); adminid = YCookies.GetCookieIntValue("adminid", cookiename, 0); if (userid > 0) { username = YCookies.GetCookieStringValue("username", cookiename); } else { username = "******"; } }