Пример #1
0
//-------------------------------------------------------------------------------------------
    protected void ActivateNext_Click(object sender, EventArgs e)
    {
        Weavver.Security.WeavverMembershipProvider memProvider = new Weavver.Security.WeavverMembershipProvider();
        MembershipUser user = Membership.GetUser();

        if (user != null)
        {
            bool activated = memProvider.ActivateUser(user.UserName, ((TextBox)GetControlFromWizard(ActivateStep, "ActivationCode")).Text);
            if (activated)
            {
                if (AccountActivated != null)
                {
                    AccountActivated(this, EventArgs.Empty);
                }
                else
                {
                    Wizard1.ActiveStepIndex++;
                }
            }
            else
            {
                ((Literal)GetControlFromWizard(ActivateStep, "ActivationFailed")).Visible = true;
            }
        }
        else
        {
            ((Literal)GetControlFromWizard(ActivateStep, "ActivationFailed")).Visible = true;
        }
    }
Пример #2
0
//-------------------------------------------------------------------------------------------
    protected void SendActivationEmail_Click(object sender, EventArgs e)
    {
        Weavver.Security.WeavverMembershipProvider memProvider = new Weavver.Security.WeavverMembershipProvider();
        memProvider.SendUserActivationInstructions(Membership.GetUser().UserName, BasePage.BaseURL);
        ((Literal)GetControlFromWizard(ActivateStep, "ActivationSent")).Visible = true;
    }
Пример #3
0
        public void Check()
        {
            System.IO.Stream reader = Console.OpenStandardInput();
               MiscUtil.Conversion.BigEndianBitConverter bebc = new MiscUtil.Conversion.BigEndianBitConverter();
               EndianBinaryWriter writer = new MiscUtil.IO.EndianBinaryWriter(bebc, Console.OpenStandardOutput());
               byte[] input = new byte[2];

               // is there a better way to check for data on the stream?
               while (reader.Read(input, 0, 2) > -1)
               {
                    ushort len = bebc.ToUInt16(input, 0);
                    byte[] incomingBytes = new byte[len];
                    reader.Read(incomingBytes, 0, len);
                    string incomingData = System.Text.Encoding.ASCII.GetString(incomingBytes);

                    using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\\output.log", true))
                    {
                         file.WriteLine(incomingData + "\r\n---------------------------------------\r\n");
                    }

                    string[] parse = System.Text.RegularExpressions.Regex.Split(incomingData, ":");
                    string command = parse[0];
                    string username = parse[1];
                    string domain = parse[2];

                    short aa = 2;
                    writer.Write(aa);
                    short bbtrue = 1;
                    short bbfalse = 0;
                    switch (command)
                    {
                         case "auth":
                              if (domain == "web.chat")
                              {
                                   writer.Write(bbtrue);
                              }
                              else
                              {
                                   string password = parse[3];
                                   WeavverMembershipProvider wup = new WeavverMembershipProvider();
                                   if (wup.ValidateUser(username, password))
                                   {
                                        writer.Write(bbtrue);
                                   }
                                   else
                                   {
                                        writer.Write(bbfalse);
                                   }
                              }
                              break;

                         case "isuser":
                              writer.Write(bbtrue);
                              break;

                         case "setpass":
                              writer.Write(bbfalse);
                              break;
                    }
               }
               System.Threading.Thread.Sleep(100);
        }