Exemplo n.º 1
0
    public bool CheckAuthenticated(String Uri, String UserID)
    {
        bool authed = LeadsUtil.CheckGoogleAuthenticated(Uri, UserID);

        div_authenticate.Visible = !authed;

        if (authed)
        {
            lbl_authed.Text      = "You are authenticated with Google Mail API.";
            lbl_authed.ForeColor = System.Drawing.Color.Green;
        }
        return(authed);
    }
    // Google API
    protected bool CheckAuthenticated()
    {
        bool authed = LeadsUtil.CheckGoogleAuthenticated(hf_uri.Value, hf_user_id.Value);

        if (!authed)
        {
            div_authenticate.Visible = true;
            lbl_authed.Text          = "You are not authenticated with Google Mail API..";
            lbl_authed.ForeColor     = System.Drawing.Color.Red;
            //Page.ClientScript.RegisterStartupScript(this.GetType(), "OpenWindow", "var w=window.open('authwithgmapi.aspx','_newtab'); "+
            //"if(!w || w.closed || typeof w.closed=='undefined') { Alertify(\"You're not authenticated with Google yet.<br/><br/>Allow pop-ups at the top-right of your browser's address bar (see instructions in red) then close this window and re-load it, then you will be able to allow your Gmail account to talk to DataGeek.\", 'Need to authenticate..'); $get('" + div_blocked_popups.ClientID + "').style.display='block'; }", true);
        }

        return(authed);
    }