Exemplo n.º 1
0
 public void Monster()
 {
     if (PluginModel.PluginStatus("5"))
     {
         MonsterPluginModel.AddMonster();
     }
 }
Exemplo n.º 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());
        }
Exemplo n.º 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()));
        }
Exemplo n.º 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));
        }
Exemplo n.º 5
0
 public string PluginStatus(string input)
 {
     return(PluginModel.PluginStatus(input).ToString());
 }
Exemplo n.º 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()));
 }