Example #1
0
        protected void lbnOK_Click(object sender, EventArgs e)
        {
            ClientRegistrationKeyController ctrl = new ClientRegistrationKeyController();
            ClientRegistrationKey key;
            if (_keyID == -1)
            {
                key = new ClientRegistrationKey();
            }
            else
            {
                key = ctrl.Get(_keyID, 0);
            }

            key.Notes = txtNotes.Text;
            key.RegKey = txtKey.Text;

            if (_keyID == -1)
            {
                ctrl.Create(key);
            }
            else
            {
                ctrl.Update(key);
            }

            Response.Redirect(Globals.NavigateURL());
        }
Example #2
0
        protected void lbnDelete_Click(object sender, EventArgs e)
        {
            ClientRegistrationKeyController ctrl = new ClientRegistrationKeyController();
            ClientRegistrationKey key = ctrl.Get(_keyID, 0);

            ctrl.Delete(key);
            Response.Redirect(Globals.NavigateURL());
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    linkNewKey.NavigateUrl = EditUrl();

                    ClientRegistrationKeyController ctrl = new ClientRegistrationKeyController();
                    gridRegistrations.DataSource = ctrl.GetItems(0);
                    gridRegistrations.DataBind();
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Example #4
0
        public static RegistrationClientAPIResult IsRegistered(string SiteAlias, string ProductName, string DeveloperSeed)
        {
            try
            {
                //check for null values
                if (SiteAlias == null || ProductName == null || DeveloperSeed == null)
                    return RegistrationClientAPIResult.NotRegistered;

                //check for localhost
                if (SiteAlias.Substring(0,9).Equals("localhost", StringComparison.InvariantCultureIgnoreCase))
                {
                    return RegistrationClientAPIResult.Localhost;
                }

                //generate hash
                string strGenRegKey = GenerateRegistrationKey(DeveloperSeed, SiteAlias, ProductName);

                //find hash in key list
                ClientRegistrationKeyController ctrl = new ClientRegistrationKeyController();
                ClientRegistrationKey key = ctrl.GetKeyByHash(strGenRegKey);

                //return result
                if (key != null)
                {
                    key.LastUsed = System.DateTime.Now.ToString();
                    ctrl.Update(key);
                    return RegistrationClientAPIResult.Registered;
                }
                else
                {
                    return RegistrationClientAPIResult.NotRegistered;
                }
            }
            catch (Exception ex)
            {
                return RegistrationClientAPIResult.Error;
            }
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Get Reg ID
            if (this.Request.QueryString["ID"] != null) //if none, then _regID = -1
            {
                _keyID = Int32.Parse(this.Request.QueryString["ID"]);
            }

            try
            {
                if (!Page.IsPostBack)
                {

                    string message = "<b>Instructions</b><br />1. Type the registration key generated by the vendor of the QuickRegistration enabled module.<br />2. Type notes to help keep track of what the registration key is used for.<br />3. Click the Save button to immediately apply the registration code.<br /><br />QuickRegistration enabled modules will automatically lookup the registration code from the QuickRegistration Client entries.";
                    DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, message, DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.BlueInfo);

                    if (_keyID == -1)
                    {
                        lbnDelete.Visible = false;
                    }
                    else
                    {
                        lbnDelete.Attributes.Add("onClick", "javascript:return confirm('Are you sure?');");

                        ClientRegistrationKeyController ctrl = new ClientRegistrationKeyController();
                        ClientRegistrationKey key = ctrl.Get(_keyID, 0);

                        txtKey.Text = key.RegKey;
                        txtNotes.Text = key.Notes;
                    }
                }

            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }