コード例 #1
0
        public int GetOwnProfileId()
        {
            Guid sessionKey = _GetSession();

            if (sessionKey == Guid.Empty)
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingResponse.StatusCode        = HttpStatusCode.Forbidden;
                    WebOperationContext.Current.OutgoingResponse.StatusDescription = "No session";
                }
                return(-1);
            }
            int profileId = CSessionControl.GetUserIdFromSession(sessionKey);

            if (profileId < 0)
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingResponse.StatusCode        = HttpStatusCode.Forbidden;
                    WebOperationContext.Current.OutgoingResponse.StatusDescription = "No session";
                }
                return(-1);
            }
            return(profileId);
        }
コード例 #2
0
        public SProfileData GetProfile(int profileId)
        {
            Guid sessionKey = _GetSession();

            if (CSessionControl.GetUserIdFromSession(sessionKey) == profileId || _CheckRight(EUserRights.ViewOtherProfiles))
            {
                bool isReadonly = (!CSessionControl.RequestRight(sessionKey, EUserRights.EditAllProfiles) &&
                                   CSessionControl.GetUserIdFromSession(sessionKey) != profileId);


                return(CVocaluxeServer.DoTask(CVocaluxeServer.GetProfileData, profileId, isReadonly));
            }
            return(new SProfileData());
        }
コード例 #3
0
        public void SendProfile(SProfileData profile)
        {
            Guid sessionKey = _GetSession();

            if (profile.ProfileId != -1) //-1 is the id for a new profile
            {
                if (CSessionControl.GetUserIdFromSession(sessionKey) != profile.ProfileId &&
                    !(_CheckRight(EUserRights.EditAllProfiles)))
                {
                    return;
                }
            }

            CVocaluxeServer.DoTask(CVocaluxeServer.SendProfileData, profile);
        }