예제 #1
0
 public void SendPhoto(SPhotoData photo)
 {
     if (_CheckRight(EUserRights.UploadPhotos))
     {
         CVocaluxeServer.DoTask(CVocaluxeServer.SendPhoto, photo);
     }
 }
예제 #2
0
        public Stream Index()
        {
            if (WebOperationContext.Current != null)
            {
                WebOperationContext.Current.OutgoingResponse.ContentType = "text/html";
            }

            return(new MemoryStream(CVocaluxeServer.DoTask(CVocaluxeServer.GetSiteFile, "index.html")));
        }
예제 #3
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());
        }
예제 #4
0
        public Stream GetImgFile(string filename)
        {
            if (WebOperationContext.Current != null)
            {
                WebOperationContext.Current.OutgoingResponse.ContentType  = "image/png";
                WebOperationContext.Current.OutgoingResponse.LastModified = DateTime.UtcNow;
                WebOperationContext.Current.OutgoingResponse.Headers.Add(
                    HttpResponseHeader.Expires,
                    DateTime.UtcNow.AddYears(1).ToString("r"));
            }

            byte[] data = CVocaluxeServer.DoTask(CVocaluxeServer.GetSiteFile, "img/" + filename);

            if (data != null)
            {
                return(new MemoryStream(data));
            }
            if (WebOperationContext.Current != null)
            {
                WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.NotFound;
            }
            return(null);
        }
예제 #5
0
 public SProfileData[] GetProfileList()
 {
     return(CVocaluxeServer.DoTask(CVocaluxeServer.GetProfileList));
 }
예제 #6
0
 private static EUserRoles _GetUserRoles(Guid profileId)
 {
     return((EUserRoles)CVocaluxeServer.GetUserRole(profileId));
 }
예제 #7
0
 private static Guid _GetProfileIdFormUsername(string username)
 {
     return(CVocaluxeServer.GetUserIdFromUsername(username));
 }
예제 #8
0
 private static bool _ValidateUserAndPassword(string userName, string password)
 {
     return(CVocaluxeServer.ValidatePassword(_GetProfileIdFormUsername(userName), password));
 }