Exemplo n.º 1
0
        public ActionResult Credentials(string username, string password, string url)
        {
            var wordpress = MASTERdomain.wordpressSites;
            var cryptor   = new AESCrypt();

            if (wordpress == null)
            {
                wordpress = new wordpressSite()
                {
                    subdomainid = subdomainid.Value
                };
                repository.AddWordpress(wordpress);
            }

            wordpress.email    = username;
            wordpress.password = cryptor.Encrypt(password, subdomainid.Value.ToString());

            // validate url
            if (!url.Contains("http://"))
            {
                url = string.Concat("http://", url);
            }
            wordpress.url = url;
            repository.Save();
            return(Json("Credentials saved".ToJsonOKMessage()));
        }
Exemplo n.º 2
0
        public bool AddCredentials(wordpressSite site, long sdid)
        {
            if (site == null)
            {
                return(false);
            }
            var cryptor      = new AESCrypt();
            var decryptedpwd = cryptor.Decrypt(site.password, sdid.ToString());

            wrapper = new WordPressWrapper(site.url + "/xmlrpc.php", site.email, decryptedpwd);

            return(true);
        }
Exemplo n.º 3
0
 public void DeleteWordpress(wordpressSite wordpress)
 {
     db.wordpressSites.DeleteOnSubmit(wordpress);
     db.SubmitChanges();
 }
Exemplo n.º 4
0
 public void AddWordpress(wordpressSite wordpress)
 {
     db.wordpressSites.InsertOnSubmit(wordpress);
 }