Exemple #1
0
        public LoginResponse login(string username, string password)
        {
            if ("".Equals(username) || "".Equals(password))
            {
                return(new LoginResponse("0", "-2"));
            }
            // verify user credentials
            int rc = DatabaseHandle.dblogin(username, password);

            if (rc == 0)
            {
                return(new LoginResponse(UIDFactory.generateUID(), rc + ""));
            }
            else
            {
                return(new LoginResponse("0", rc + ""));
            }
        }
Exemple #2
0
        private void EnsureProperties()
        {
            if (string.IsNullOrEmpty(UID))
            {
                // Create a new UID for the component
                UID = new UIDFactory().Build();
            }

            // NOTE: removed setting the 'CREATED' property here since it breaks serialization.
            // See https://sourceforge.net/projects/dday-ical/forums/forum/656447/topic/3754354
            if (DTStamp == null)
            {
                // Here, we don't simply set to DateTime.Now because DateTime.Now contains milliseconds, and
                // the iCalendar standard doesn't care at all about milliseconds.  Therefore, when comparing
                // two calendars, one generated, and one loaded from file, they may be functionally identical,
                // but be determined to be different due to millisecond differences.
                //
                // NOTE: also ensure we're in UTC, so our CLR implementation closely matches the RFC.
                // See bug #3485766.
                DateTime now = DateTime.UtcNow;
                DTStamp = new iCalDateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second);
                DTStamp.IsUniversalTime = true;
            }            
        }
Exemple #3
0
 public RegisterUserResponse register(string username, string password, string email)
 {
     // register user
     DatabaseHandle.register(username, password, email);
     return(new RegisterUserResponse(UIDFactory.generateUID(), "0"));
 }