示例#1
0
 /// <summary>
 /// 验证用户
 /// </summary>
 /// <param name="User">管理员信息</param>
 /// <returns></returns>
 private bool ValidateUser(EyouSoft.SSOComponent.Entity.MasterUserInfo User)
 {
     try
     {
         if (User == null)
         {
             return(false);
         }
         EyouSoft.SSOComponent.Entity.LocalUserInfo LocalUser = GetLoginTicket(TicketType.UserCookieName);
         if (LocalUser.LoginTicket == User.LoginTicket)
         {
             if (LocalUser.DecryptLoginTicket.ExpireTime > DateTime.Now ||
                 User.UserName.ToString() != LocalUser.DecryptLoginTicket.UserName)
             {
                 return(false);
             }
         }
     }
     catch
     {
         return(false);
     }
     return(true);
 }
示例#2
0
 /// <summary>
 /// 验证管理员权限
 /// </summary>
 /// <param name="PermissionID">权限号</param>
 /// <returns></returns>
 public bool CheckMasterGrant(int PermissionID)
 {
     EyouSoft.SSOComponent.Entity.MasterUserInfo User = GetMaster();
     return(User.Permissions.Contains(PermissionID));
 }