示例#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));
 }