Ejemplo n.º 1
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (Session["FacebookUserId"] == null)
            {
                FacebookApp      facebookApp = new FacebookApp();
                CanvasAuthorizer authorizor  = new CanvasAuthorizer(facebookApp);
                authorizor.ReturnUrlPath = "default.aspx";
                authorizor.Perms         = "publish_stream"; //,offline_access
                authorizor.Authorize(Request, Response);
                IsLoggedIn = authorizor.IsAuthorized();

                if (IsLoggedIn)
                {
                    Session["FacebookUserId"] = facebookApp.UserId;
                }
                else
                {
                    Session["FacebookUserId"] = 0;
                }
            }

            FacebookUserId = (long)Session["FacebookUserId"];
            IsLoggedIn     = FacebookUserId > 0;
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CheckIfFacebookAppIsSetupCorrectly();

            var auth = new CanvasAuthorizer {
                Permissions = new[] { "user_about_me" }
            };

            if (auth.Authorize())
            {
                ShowFacebookContent();
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var auth = new CanvasAuthorizer {
                Perms = "publish_stream"
            };

            FacebookLayer fb = new FacebookLayer(auth);

            if (auth.Authorize())
            {
                if (Request.QueryString["action"] != null)
                {
                    LocationActions(Request.QueryString, fb);
                }
                ShowFacebookContent(fb);
            }
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                CheckIfFacebookAppIsSetupCorrectly();

                var auth = new CanvasAuthorizer {
                    Permissions = new[] { "user_about_me" }
                };

                if (auth.Authorize())
                {
                    ShowFacebookContent();
                }
            }
            else
            {
                AmazonSimpleDB sdb = GetSDB();

                // Should I clean out the AWS domain state?
                if (Page.Request.Params["delaws"] == "1")
                {
                    //Deleting a domain
                    DeleteDomainRequest deleteDomainAction = new DeleteDomainRequest().WithDomainName("ZigMeRecos");
                    sdb.DeleteDomain(deleteDomainAction);
                }

                // Now read from the AWS domain and populate the dropdown list

                // First check to see if a domain contain service types exists. if not then create it and populate it
                // Listing domains

                /*ListDomainsResponse sdbListDomainsResponse = sdb.ListDomains(new ListDomainsRequest());
                 * if (sdbListDomainsResponse.IsSetListDomainsResult())
                 * {
                 *  ListDomainsResult listDomainsResult = sdbListDomainsResponse.ListDomainsResult;
                 *
                 *  if (!listDomainsResult.DomainName.Contains("ZigMeServiceTypes"))
                 *  {
                 *  }
                 *  else
                 *  {
                 *      String selectExpression = "Select * From ZigMeServiceTypes";
                 *      SelectRequest selectRequestAction = new SelectRequest().WithSelectExpression(selectExpression);
                 *      SelectResponse selectResponse = sdb.Select(selectRequestAction);
                 *      if (selectResponse.IsSetSelectResult())
                 *      {
                 *          SelectResult selectResult = selectResponse.SelectResult;
                 *          foreach (Item item in selectResult.Item)
                 *          {
                 *              foreach (Amazon.SimpleDB.Model.Attribute attribute in item.Attribute)
                 *              {
                 *                  if (attribute.IsSetName() && attribute.IsSetValue())
                 *                  {
                 *                  }
                 *              }
                 *          }
                 *      }
                 *  }
                 * }*/
            }
        }