Example #1
0
 public void Monster()
 {
     if (PluginModel.PluginStatus("5"))
     {
         MonsterPluginModel.AddMonster();
     }
 }
Example #2
0
        //
        // GET: /Admin/AllPosts/
        public ActionResult AllPosts()
        {
            // Redirect if the user isn't logged in
            if (!IdentityModel.CurrentUserLoggedIn || !PluginModel.PluginStatus("3"))
            {
                return(RedirectToAction("Login", "Admin"));
            }

            return(View());
        }
Example #3
0
        public ActionResult MediaUpload()
        {
            // Redirect if the user isn't logged in
            if (!IdentityModel.CurrentUserLoggedIn || !PluginModel.PluginStatus("4"))
            {
                return(RedirectToAction("Login", "Admin"));
            }

            return(View(new UploadImageModel()));
        }
Example #4
0
        public ActionResult MediaUpload(UploadImageModel model)
        {
            // Redirect if the user isn't logged in
            if (!IdentityModel.CurrentUserLoggedIn || !PluginModel.PluginStatus("4"))
            {
                return(RedirectToAction("Login", "Admin"));
            }

            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            Bitmap original = null;

            if (model.IsUrl)
            {
                original = UploadImageModel.GetImageFromUrl(model.Url);
            }
            else if (model.IsFlickr)
            {
                original = UploadImageModel.GetImageFromUrl(model.Flickr);
            }
            else if (model.File != null)
            {
                original = Image.FromStream(model.File.InputStream) as Bitmap;
            }

            if (original != null)
            {
                var img = UploadImageModel.CreateImage(original, model.X, model.Y, model.Width, model.Height);

                var pictureName = Guid.NewGuid().ToString().Replace("-", "").ToUpper();
                var fn          = Server.MapPath("~/database/" + pictureName + ".png");
                img.Save(fn, ImageFormat.Png);

                model = new UploadImageModel {
                    Done = true
                };
            }
            else
            {
                model.NotFile = true;
            }

            return(View(model));
        }
Example #5
0
 public string PluginStatus(string input)
 {
     return(PluginModel.PluginStatus(input).ToString());
 }
Example #6
0
 //
 // GET: /Admin/NewPost/
 public ActionResult NewPost()
 {
     // Redirect if the user isn't logged in
     if (!IdentityModel.CurrentUserLoggedIn || !IdentityModel.CurrentUserOwner || !PluginModel.PluginStatus("3"))
     {
         return(RedirectToAction("Index", "Admin"));
     }
     return(View(new PostModel()));
 }