TinyPortal

Development => Block Codes => Topic started by: zooner on March 04, 2006, 02:15:41 PM

Title: A working gmail login block code!!!
Post by: zooner on March 04, 2006, 02:15:41 PM
I spent over 12 hours working on this, finally getting a bunch of different sources to get something work!

this is:
Quotejust a basic login form for gmail, make it a script block!

<div id=login style="font-family: arial,sans-serif">
             <script type="text/javascript"><!--
 


function gaia_setFocus() {
  var f = null;
  if (document.getElementById) {
    f = document.getElementById("gaia_loginform");
  } else if (window.gaia_loginform) {
    f = window.gaia_loginform;
  }
  if (f) {
    if (f.Email.value == null || f.Email.value == "") {
      f.Email.focus();
    } else {
      f.Passwd.focus();
    }
  }
}

//--> </script> <div style= id="gaia_loginbox" class="body"> <form action="https://www.google.com/accounts/ServiceLoginAuth" id="gaia_loginform" method="post">       <input type="hidden" name="continue" value="http://gmail.google.com/gmail?ui=html&zy=l">    <input type="hidden" name="service" value="mail">                      <table cellpadding="1" cellspacing="0" border="0" id="gaia_table"> <tr>
               <td class="alt1" style="font-family: arial,sans-serif">
               <font color="#aa1002" style="font-family: arial,sans-serif"> <div class="errorbox-good">  </div> </font> </td> </tr> <tr>
               <td class="alt1" nowrap style="font-family: arial,sans-serif" align="center">
                <font size="-1" face="Arial, sans-serif" style="font-family: arial,sans-serif">Username</font></td>
               </tr> <tr>
                 <td class="alt1" style="font-family: arial,sans-serif" align="center">
                 <div align="left" style="font-family: arial,sans-serif"> <input type="text" name="Email" value="" size="18"></div> </td>
               </tr> <tr>
               <td class="alt1" style="font-family: arial,sans-serif" align="center">
                <font size="-1">Password</font></td>
               </tr> <tr>
                 <td class="alt1" style="font-family: arial,sans-serif" align="center">
                 <div class="alt1" align="left" style="font-family: arial,sans-serif"> <input type="password" name="Passwd" autocomplete="off" size="18"></div> </td>
               </tr>  <tr>
                 <td class="alt1" style="font-family: arial,sans-serif" align="center">
                 <div class="alt1" style="font-family: arial,sans-serif"> <input type="submit" name="null" value="Sign in"> </div> </td> </tr> </table>  </form> </div>

</div>

<script>
<!--
if (is_browser_supported) {
  var form = el("gaia_loginform");
  var url = form["continue"].value;
  url = StripParam(url, "ui=html");
  url = StripParam(url, "zy=l");
  form["continue"].value = url;
}
// -->
              </script>

Title: Re: A working gmail login block code!!!
Post by: ontap on March 04, 2006, 02:32:38 PM
12 hours?.. wow thats a long time   :P

kinda fixed it up a bit for you....


<script type="text/javascript">
<!--

function gaia_setFocus() {
  var f = null;
  if (document.getElementById) {
    f = document.getElementById("gaia_loginform");
  } else if (window.gaia_loginform) {
    f = window.gaia_loginform;
  }
  if (f) {
    if (f.Email.value == null || f.Email.value == "") {
      f.Email.focus();
    } else {
      f.Passwd.focus();
    }
  }
}

// -->
</script>
<script type="text/javascript">
<!--

if (is_browser_supported) {
  var form = el("gaia_loginform");
  var url = form["continue"].value;
  url = StripParam(url, "ui=html");
  url = StripParam(url, "zy=l");
  form["continue"].value = url;
}
// -->
</script>

<div style= id="gaia_loginbox" class="body">
<form action="https://www.google.com/accounts/ServiceLoginAuth" id="gaia_loginform" method="post" target="new">       
<input type="hidden" name="continue" value="http://gmail.google.com/gmail?ui=html&zy=l">
<input type="hidden" name="service" value="mail">

<table cellpadding="1" cellspacing="0" border="0" id="gaia_table"><tr>
<td class="alt1" style="font-family: arial,sans-serif">
<font color="#aa1002" style="font-family: arial,sans-serif"> <div class="errorbox-good">  </div> </font> </td> </tr> <tr>
<td class="alt1" nowrap style="font-family: arial,sans-serif" align="center">
<font size="-1" face="Arial, sans-serif" style="font-family: arial,sans-serif">Username</font></td>
</tr> <tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<div align="left" style="font-family: arial,sans-serif"> <input type="text" name="Email" value="" size="18"></div> </td>
</tr> <tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<font size="-1">Password</font></td>
</tr> <tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<div class="alt1" align="left" style="font-family: arial,sans-serif"> <input type="password" name="Passwd" autocomplete="off" size="18"></div> </td>
</tr><tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<div class="alt1" style="font-family: arial,sans-serif"> <input type="submit" name="null" value="Sign in"> </div> </td> </tr> </table>  </form> </div>
</div>
Title: Re: A working gmail login block code!!!
Post by: crip on March 04, 2006, 02:36:44 PM
Where is this code added?
Title: Re: A working gmail login block code!!!
Post by: ontap on March 04, 2006, 03:07:23 PM
Quote from: ÂÃ,»cripÂÃ,« on March 04, 2006, 02:36:44 PM
Where is this code added?

what do you mean crip?
Title: Re: A working gmail login block code!!!
Post by: Gargoyle on March 04, 2006, 03:20:46 PM
So what does this do ? I understand it's a gmail login but does it list your recent g-mails as well or something like that ??

Also do you ad this to a html block or a php block or something else ?

This looks like it could be a really neat script.. ;D
Title: Re: A working gmail login block code!!!
Post by: crip on March 04, 2006, 03:27:32 PM
I'm not sure what it does, or where and how to add it..kind of looks like an alterrate login/register script, you know the cursor ready dea, like on Googel/Yahool..but it do look interesting.
Title: Re: A working gmail login block code!!!
Post by: ontap on March 04, 2006, 03:41:29 PM
just a basic login form for gmail, make it a script block!



Title: Re: A working gmail login block code!!!
Post by: RoarinRow on March 04, 2006, 04:41:39 PM
Very cool, thanks for all your hard work.  Works like a charm!
Title: Re: A working gmail login block code!!!
Post by: zooner on March 04, 2006, 08:58:24 PM
Quote from: OnTap! on March 04, 2006, 03:41:29 PM

just a basic login form for gmail, make it a script block!


sorry for the lack of clarification!

I wanted to head off to bed, but wanted to share it with the tinyportal community asap.

Now I need to change it so that it's using the enhanced interface instead of standard html.
Title: Re: A working gmail login block code!!!
Post by: Porky on March 05, 2006, 10:40:52 AM
What would be cool if it can be done is to make it an all access to all email accounts by order of a dropdown box... Ie put in your name and pass then select from a drop down and select your email(yahoo, gmail, hotmail, etc)
Title: Re: A working gmail login block code!!!
Post by: zooner on March 05, 2006, 11:14:43 AM
I have come across scripts for other email addresses (yahoo, hotmail, etc).

it was the gmail one that I could find, also the one I needed.
Title: Re: A working gmail login block code!!!
Post by: RoarinRow on March 05, 2006, 06:15:23 PM
Quote from: humanporkrind on March 05, 2006, 10:40:52 AM
What would be cool if it can be done is to make it an all access to all email accounts by order of a dropdown box... Ie put in your name and pass then select from a drop down and select your email(yahoo, gmail, hotmail, etc)

That would be cool.   O0
Title: Re: A working gmail login block code!!!
Post by: alan s on March 05, 2006, 06:27:02 PM
love this script. thanks for all the hard work that went into it
Title: Re: A working gmail login block code!!!
Post by: Hawkes on March 06, 2006, 02:42:16 AM
Just a thought, but it would be great if this checked the member's profile to see if they have a GMail account populated (using the gmail field mod of course).  That way if you don't have gmail, you don't see it.
Title: Re: A working gmail login block code!!!
Post by: firefly on March 06, 2006, 09:29:43 AM
First, thanks for this code: it works a treat.
The proposal by Hawkes is good, both specifically and in general, for I am keen to see more cross-referencing of user information (e.g. with user articles and mods such as arcade results and coppermine 'my gallery').
Title: Re: A working gmail login block code!!!
Post by: zooner on March 06, 2006, 10:25:59 AM
it'd be very interesting to use the script and pair it with this:

https://www.google.com/hosted/Home

Title: Re: A working gmail login block code!!!
Post by: firefly on March 06, 2006, 11:03:37 AM
Quote from: zooner on March 06, 2006, 10:25:59 AM
it'd be very interesting to use the script and pair it with this:

https://www.google.com/hosted/Home
A good link - I've just gone there and applied for my site to join. Thanks.
Title: Re: A working gmail login block code!!!
Post by: RoarinRow on March 07, 2006, 01:33:08 AM
I put this gmail code in my left block and noticed a yellow warning triangle in the bottom left of my broswer window.

See attached error.  When I Googled the error message I find this - http://www.gmailforums.com/lofiversion/index.php/t14844.html

When I disabled the Gmail block the yellow triangle error goes away.

[attachment deleted by admin]
Title: Re: A working gmail login block code!!!
Post by: Mitch on March 15, 2006, 12:26:38 AM
Hope you dont mind but I centered everything and just added a link to gmail and a gmail image just to make it look better.

<center>
<a href="https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=http%3A%2F%2Fmail.google.com%2Fmail%3Fui%3Dhtml%26zy%3Dl&ltmpl=yj_wsad&ltmplcache=2&hl=en">
<img src="http://mail.google.com/mail/help/images/logo1.gif"></a>

<script type="text/javascript">
<!--

function gaia_setFocus() {
  var f = null;
  if (document.getElementById) {
    f = document.getElementById("gaia_loginform");
  } else if (window.gaia_loginform) {
    f = window.gaia_loginform;
  }
  if (f) {
    if (f.Email.value == null || f.Email.value == "") {
      f.Email.focus();
    } else {
      f.Passwd.focus();
    }
  }
}

// -->
</script>
<script type="text/javascript">
<!--

if (is_browser_supported) {
  var form = el("gaia_loginform");
  var url = form["continue"].value;
  url = StripParam(url, "ui=html");
  url = StripParam(url, "zy=l");
  form["continue"].value = url;
}
// -->
</script>

<div style= id="gaia_loginbox" class="body">
<form action="https://www.google.com/accounts/ServiceLoginAuth" id="gaia_loginform" method="post" target="new">       
<input type="hidden" name="continue" value="http://gmail.google.com/gmail?ui=html&zy=l">
<input type="hidden" name="service" value="mail">

<table cellpadding="1" cellspacing="0" border="0" id="gaia_table"><tr>
<td class="alt1" style="font-family: arial,sans-serif">
<font color="#aa1002" style="font-family: arial,sans-serif"> <div class="errorbox-good">  </div> </font> </td> </tr> <tr>
<td class="alt1" nowrap style="font-family: arial,sans-serif" align="center">
<font size="-1" face="Arial, sans-serif" style="font-family: arial,sans-serif">Username</font></td>
</tr> <tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<div align="left" style="font-family: arial,sans-serif"> <input type="text" name="Email" value="" size="18"></div> </td>
</tr> <tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<font size="-1">Password</font></td>
</tr> <tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<div class="alt1" align="left" style="font-family: arial,sans-serif"> <input type="password" name="Passwd" autocomplete="off" size="18"></div> </td>
</tr><tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<div class="alt1" style="font-family: arial,sans-serif"> <input type="submit" name="null" value="Sign in"> </div> </td> </tr> </table>  </form> </div>
</div>
</center>
Title: Re: A working gmail login block code!!!
Post by: crip on March 15, 2006, 12:34:44 AM
Still throws out the same error in IE..
Title: Re: A working gmail login block code!!!
Post by: Mitch on March 15, 2006, 12:35:55 AM
Quote from: ÂÃ,»cripÂÃ,« on March 15, 2006, 12:34:44 AM
Still throws out the same error in IE..

Ya I wasnt messing with that. Thats why I use ff or opera.
Sorry :(
Title: Re: A working gmail login block code!!!
Post by: Mitch on March 15, 2006, 03:33:18 AM
Just one thing. its a bit bigger so it makes my content box extend a little bit for some reason Just wondering fi I could fix that.
Title: Re: A working gmail login block code!!!
Post by: funxlab on February 13, 2007, 08:48:38 AM
Any help to pair it with google's Domain Apps...
(Google service that gives all your domain users 2GB email account)..like you@yoursite.com   hosted by Google.
Title: Re: A working gmail login block code!!!
Post by: vdubbia on March 07, 2007, 09:51:39 PM
anyone?
Title: Re: A working gmail login block code!!!
Post by: Shadow on March 15, 2007, 10:50:18 PM
This is good to use on a forum?
Title: Re: A working gmail login block code!!!
Post by: vdubbia on March 16, 2007, 06:44:19 PM
sure it is, especially if you are using Google as the backend for email.
Title: Re: A working gmail login block code!!!
Post by: Crip on March 16, 2007, 06:48:31 PM
It gives errors?
Title: Re: A working gmail login block code!!!
Post by: Shadow on March 16, 2007, 10:09:09 PM
I don't know crip...

I ain't trying it on my live site....Umm I can see if that does or not.
Title: Re: A working gmail login block code!!!
Post by: vdubbia on April 05, 2007, 02:01:05 AM
has there been any update on this so it can be used with 'Google for your domain'?  I have my domain signed up with Google and this would be the perfect way to tie in the login with my Gmail hosted email.

any takers?
Title: Re: A working gmail login block code!!!
Post by: Shadow on April 05, 2007, 02:03:09 AM
I dont know how to sing up my domain for this...
Title: Re: A working gmail login block code!!!
Post by: knat on April 05, 2007, 10:08:38 AM
Quote from: Shadow Queen on April 05, 2007, 02:03:09 AM
I dont know how to sing up my domain for this...

Invite sent to gabrielle_sin_1984. ;D

You can now create your own 2+ GB Gmail account - Enjoy
Title: Re: A working gmail login block code!!!
Post by: Shadow on April 05, 2007, 05:59:17 PM
Thank you very much
Title: Re: A working gmail login block code!!!
Post by: vdubbia on April 06, 2007, 11:28:04 PM
Quote from: Tank on April 05, 2007, 10:08:38 AM
Quote from: Shadow Queen on April 05, 2007, 02:03:09 AM
I dont know how to sing up my domain for this...

Invite sent to gabrielle_sin_1984. ;D

You can now create your own 2+ GB Gmail account - Enjoy

fyi, you don't need to have an invite for Gmail anymore.

And if want to sign your domain up you can go to this link: http://www.google.com/a/help/intl/en/admins/editions.html

So back to my question... anyone have a block where I can login to my gmail hosted domain/email?
Title: Re: A working gmail login block code!!!
Post by: Zanyth on April 14, 2007, 04:17:01 AM
This is what I've got so far for the google domains hosted gmail, I realized after that it was using the post methods they had listed for actual applications, but I'm sure it can be worked out to actually log them into their account, couldn't it?

It returns SID, LSID, and Auth values, and from what I understand of the page, should somehow be able to use that Auth key to login to their account properly, (maybe it would need a redirect-page to handle that?)

Any ideas/help from more experienced developers? I'm pretty much at my limit without more documentation

Google API page is here: http://code.google.com/apis/accounts/AuthForInstalledApps.html

<center>
<script type="text/javascript">
<!--

function gaia_setFocus() {
  var f = null;
  if (document.getElementById) {
    f = document.getElementById("gaia_loginform");
  } else if (window.gaia_loginform) {
    f = window.gaia_loginform;
  }
  if (f) {
    if (f.Email.value == null || f.Email.value == "") {
      f.Email.focus();
    } else {
      f.Passwd.focus();
    }
  }
}

// -->
</script>
<script type="text/javascript">
<!--

if (is_browser_supported) {
  var form = el("gaia_loginform");
  var url = form["continue"].value;
  url = StripParam(url, "ui=html");
  url = StripParam(url, "zy=l");
  form["continue"].value = url;
}
// -->
</script>

<div style= id="gaia_loginbox" class="body">
<form action="https://www.google.com/accounts/ClientLogin" id="gaia_loginform" method="post" target="new">
<input type="hidden" name="accountType" value="HOSTED"">
<input type="hidden" name="service" value="mail">
<input type="hidden" name="source" value="yoursite-maillogin-1">

<table cellpadding="1" cellspacing="0" border="0" id="gaia_table"><tr>
<td class="alt1" style="font-family: arial,sans-serif">
<font color="#aa1002" style="font-family: arial,sans-serif"> <div class="errorbox-good">  </div> </font> </td> </tr> <tr>
<td class="alt1" nowrap style="font-family: arial,sans-serif" align="center">
<font size="-1" face="Arial, sans-serif" style="font-family: arial,sans-serif">Username</font></td>
</tr> <tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<div align="left" style="font-family: arial,sans-serif"> <input type="text" name="Email" value="@yoursite.com" size="18"></div> </td>
</tr> <tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<font size="-1">Password</font></td>
</tr> <tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<div class="alt1" align="left" style="font-family: arial,sans-serif"> <input type="password" name="Passwd" autocomplete="off" size="18"></div> </td>
</tr><tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<div class="alt1" style="font-family: arial,sans-serif"> <input type="submit" name="null" value="Sign in"> </div> </td> </tr> </table>  </form> </div>
</div>
</center>
Title: Re: A working gmail login block code!!!
Post by: vdubbia on April 14, 2007, 08:44:10 PM
thanks for keeping on this, it looks like you've made decent progress.
Title: Re: A working gmail login block code!!!
Post by: pinnatus on April 17, 2007, 10:33:43 PM
I'm really eager to have a Gmail for your Domain version of this, too bad I can't code. :(
Title: Re: A working gmail login block code!!!
Post by: Lord Anubis on April 18, 2007, 01:57:47 AM
I have tried, it only goes directly to the service login and says that you need to fill in a username and password

Here's what I have got so far
(I also changed the image to this (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fnextsite.org%2Fgmail.gif&hash=1019db97f8ea5d84e683fb8ab937b2fa1ed71dfb) , I think it looks cleaner)

<center>
<a href="https://www.google.com/a/nextsite.org/ServiceLogin?service=mail&passive=true&nui=1&continue=http%3A%2F%2Fmail.google.com%2Fa%2Fnextsite.org&hl=en">
<img src="http://nextsite.org/gmail.gif"></a>

<script type="text/javascript">
<!--

function gaia_setFocus() {
  var f = null;
  if (document.getElementById) {
    f = document.getElementById("gaia_loginform");
  } else if (window.gaia_loginform) {
    f = window.gaia_loginform;
  }
  if (f) {
    if (f.Email.value == null || f.Email.value == "") {
      f.Email.focus();
    } else {
      f.Passwd.focus();
    }
  }
}

// -->
</script>
<script type="text/javascript">
<!--

if (is_browser_supported) {
  var form = el("gaia_loginform");
  var url = form["continue"].value;
  url = StripParam(url, "ui=html");
  url = StripParam(url, "zy=l");
  form["continue"].value = url;
}
// -->
</script>

<div style= id="gaia_loginbox" class="body">
<form action="https://www.google.com/a/nextsite.org/ServiceLogin" id="gaia_loginform" method="post" target="new">       
<input type="hidden" name="continue" value="http://mail.google.com/a/nextsite.org/?ui=html&zy=l
">
<input type="hidden" name="service" value="mail">

<table cellpadding="1" cellspacing="0" border="0" id="gaia_table"><tr>
<td class="alt1" style="font-family: arial,sans-serif">
<font color="#aa1002" style="font-family: arial,sans-serif"> <div class="errorbox-good">  </div> </font> </td> </tr> <tr>
<td class="alt1" nowrap style="font-family: arial,sans-serif" align="center">
<font size="-1" face="Arial, sans-serif" style="font-family: arial,sans-serif">Username</font></td>
</tr> <tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<div align="left" style="font-family: arial,sans-serif"> <input type="text" name="Email" value="" size="18"></div> </td>
</tr> <tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<font size="-1">Password</font></td>
</tr> <tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<div class="alt1" align="left" style="font-family: arial,sans-serif"> <input type="password" name="Passwd" autocomplete="off" size="18"></div> </td>
</tr><tr>
<td class="alt1" style="font-family: arial,sans-serif" align="center">
<div class="alt1" style="font-family: arial,sans-serif"> <input type="submit" name="null" value="Sign in"> </div> </td> </tr> </table>  </form> </div>
</div>
</center>


Now just need to get it to input the correct values  :tickedoff:
Title: Re: A working gmail login block code!!!
Post by: pinnatus on April 18, 2007, 07:32:08 PM
HEY!  I changed the URLs for your domain to mine and it works perfectly!  I also removed the icon since you're hosting it, but that's all I did.  8)

Perhaps others should try, it seems we have a working 'Gmail For Your Domain' block code snippit!
Title: Re: A working gmail login block code!!!
Post by: Zanyth on April 18, 2007, 07:36:45 PM
I think perhaps you were already logged in when you tried?
For me I get the username/password screen and it says "Required field must not be blank" below each field
Title: Re: A working gmail login block code!!!
Post by: pinnatus on April 18, 2007, 07:38:22 PM
Yeah, you're right, it's funny, even if I click Logout (in Firefox) it just reloads the page and logs me in.  But yeah, it's definitely a good start. :)
Title: Re: A working gmail login block code!!!
Post by: Zanyth on April 18, 2007, 07:47:15 PM
Well with the latest batch of code that gives the "Required field must not be blank" errors, it seems as though it would actually work if we somehow filled in those fields, maybe it's not passing the input from the first form properly?
Title: Re: A working gmail login block code!!!
Post by: vdubbia on April 23, 2007, 12:08:15 PM
can anyone give this some more attention?  seems like a solution is close at hand.  thanks!
Title: Re: A working gmail login block code!!!
Post by: Lord Anubis on May 24, 2007, 03:04:58 AM
I have still been working on this and have had no success...I am wondering what is wrong with the gaia login code that is where I know the problem is...  I am sure it is something simple like just connecting to the correct address

Well I will still be on it!  Hopefully others can try and lets see if we can get it to work!!!
Title: Re: A working gmail login block code!!!
Post by: vdubbia on July 04, 2007, 07:04:55 PM
any luck?
Title: Re: A working gmail login block code!!!
Post by: ash on March 12, 2008, 05:48:49 PM
Quote from: zooner on March 04, 2006, 08:58:24 PM
sorry for the lack of clarification!
Good work man!  Even if it needed a little work im sure eeven without max around you caould have finished it off!  GJ Again!!!
Title: Re: A working gmail login block code!!!
Post by: vdubbia on March 14, 2008, 12:44:32 PM
can this be modified to login into hosted gmail?  this would allow seamless login to a hosted gmail account via the forum.
Title: Re: A working gmail login block code!!!
Post by: phfire on April 03, 2008, 09:07:22 AM
some guy from vbulletin emailed google and got a reply saying it can't be done yet.
Title: Re: A working gmail login block code!!!
Post by: Max on April 11, 2008, 09:52:33 AM

as far as i know google uses secure connections for its Domain logins,
its blocked allowing the passin of values like email & password outside its domains.

they has talked about this on their blog before, it may be available in the future but only to "Premier Edition" users.  :(