Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 04:51 pm EDT

Geeklog Forums

How to create a Squirrelmail login block


Status: offline

Kutulu

Forum User
Newbie
Registered: 06/04/04
Posts: 6
I wanted to be able to login to my Squiremail from the home page so I created a block to do so. Thought I'd share.

Please note that your paths my differ a bit than mine so check them out.

Also, I have a link in the block for a SSL login redirect. If you don't use SSL, just take it out.

Type of block - Normal Block
Normal Block Options (code)-

<html>
<table><tr><td align="center">
<form method="post" action="http://yourdomain.com/src/redirect.php">
<input type="hidden" name="js_autodetect_results" value="0">
UserFrownyou@domain.com)<br> <input type="text" name="login_username" size="10"><br>
Password:<br> <input type="password" name="secretkey" size="10">
<br><input type="submit" value="Login">
<br><br><a href='https://yourdomain.com/src/login.php'>Secure Login</a><br>
</form></td></tr></table>
</html>

Any issues... feel free to holler!
 Quote

Status: offline

jnordquist

Forum User
Full Member
Registered: 03/14/03
Posts: 129
Location:Kenosha
on mine, it just brings up another user authentication. Doesn't take the gl authentication or the post data.
John Nordquist,
Applications Specialist, medical Technologies
 Quote

Status: offline

Euan

Forum User
Full Member
Registered: 04/22/02
Posts: 292
Works for me, but you don't need any of the < html > tags.

<form method="post" action="http://yourdomain.com/src/redirect.php">
<input type="hidden" name="js_autodetect_results" value="0">
UserFrownyou@domain.com)<br> <input type="text" name="login_username" size="10"><br>
Password:<br> <input type="password" name="secretkey" size="10">
<br><input type="submit" value="Login">
<br><br><a href='https://yourdomain.com/src/login.php'>Secure Login</a><br>
</form>

should be enough. What is your Squirrelmail version?

Cheers,

Euan.
-- Heather Engineering
-- No job too small
 Quote

Status: offline

Kutulu

Forum User
Newbie
Registered: 06/04/04
Posts: 6
Know what?? That's a good point Euan.

Versions DO matter in the real world dont' they?!?!

I'm running...

GL 1.3.9
SM 1.4.2

That code should run fine on any of the SM 1.4.X releases.

Also... thanks for pointing out the over abundance of html tags. Still kinda new to gl and wasn't even thinking on that one.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
looks good, but it doesn't work for me.
keeps giving me a cpanel login box

i changed the paths and "redirect.php" to "login.php" and for some reason I have to use a port number. My newbie self just doesn't get it. any suggestions? running gl139 and sm14x.

mach
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
i often reveal my idiot nature--you'll get used to it.

anyway, your stuff works great just the way it was, i just typed my password wrong

but now, because i like it so much, i'm gonna see if i can wrap the squirrel mail page itself into the gl interface
 Quote

Status: offline

Kutulu

Forum User
Newbie
Registered: 06/04/04
Posts: 6
Machinari,

Good to hear! And I thought versions matter? Correct passwords are the REAL kicker!

Wrapping it in gl would be sweet. The only problem I could see with that is that it would definitely be custom and not to universal. I mean, SM likes to use alot of space in the browser and once you get logged in I have a feeling that depending on the gl theme your using it could look all squished (tech term!) together once logged in. Know what I mean Vern?

 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
caffeinated
ok, my progress report. no problem wrapping SM in GL. I used an iframe in a static page and just readusted the path in the block form, Kutulu's code above, setting action to the static page url, using the target attribute, target="frame name"--and i gave the iframe a name, obviously.

as for squishyitus, i display the page without the right blocks and for the most part its all good. then you log out and the target="top" on the signout link gets ya--kinda defeats the purpose. Crap!

so i used neomail instead and it works great. except i cant get the login to work from the block so i'm just using the static page and signing into the http auth box that pops up.

my static page for NeoMail then is like this:
--create new static page
--check add to menu, you can always set perms at the bottom
--page format=left blocks, depending on your theme
--change your ID to something a bit more readable just incase you want to link to it from a sign in block like Kutulu's block for Squirrel Mail.
--set your perms
--done
--oh ya, here is my code
Text Formatted Code
<iframe name="webmail" width="100%" height="600"
src="http://mydomain.ca/neomail/neomail.pl">
<a href="http://mydomain.ca/neomail/neomail.pl" target="_blank">
If you see this, then your browser is not supporting frames
and you will need to be shot.  Pull rope...</a>
</iframe>


 
nothing magical about that except that now i feel like i should dye my hair blond in keeping with the amount of times that i've edited this fixing spelling booboos. 3:30am and nothing better to do than spill coffee on my keyboard..
 Quote

Status: offline

kr

Forum User
Newbie
Registered: 03/02/06
Posts: 4
Location:Germany
I like your ideas to swallow Squirrelmail into geeklog.

On our site i have used the iframe staticpages variation. Running into the same problem as machinari that the logout target=_top was not where i want to go. Cause i did not want to change to neomail - don't ask me why ... maybe cause "never touch a running system" ;-) - i've modified the target destination in the squirrelmail codebase.

If anyone else like to have the same here is the required change (based on Squirrelmail v1.4.4).

File: /usr/share/squirrelmail/functions/page_header.php
Text Formatted Code

    270     //displayInternalLink ('src/signout.php', _("Sign Out"), $frame_top);
    271     displayInternalLink ('src/signout.php', _("Sign Out"), "_parent");

 

As you can see i've simply commented out the usage of _top as target and replaced by _parent.

Have fun in the sun ... c'ya ... KR
 Quote

ptd-net.com

Anonymous
ur script didnt conatin /webmail

&lt;html&gt;
&lt;table&gt;&lt;tr&gt;&lt;td width=&quot;202&quot; align=&quot;center&quot;&gt;
&lt;form method=&quot;post&quot; action=&quot;http://ur domain.com/webmail/src/redirect.php&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;js_autodetect_results&quot; value=&quot;0&quot;&gt;
Ptd-net.com Webmail Login
&lt;br&gt; &lt;input type=&quot;text&quot; name=&quot;login_username&quot; size=&quot;20&quot;&gt;
&lt;br&gt;
Password:&lt;br&gt;
&lt;input type=&quot;password&quot; name=&quot;secretkey&quot; size=&quot;20&quot; /&gt;
&lt;br&gt;
&lt;input type=&quot;submit&quot; value=&quot;Login&quot;&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/form&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/html&gt;
 Quote

Kutulu

Anonymous
angry
That is the most stupid reply to a post I've ever seen.

"ur script didnt conatin /webmail"

Well... no kidding... why would it have webmail when I don't have webmail in my path! That's is a user defineable parameter in your apache configuration. I other words... you have it... I don't... but the ../src directory is the same.

Do you actually think yourdomain.com in my example is my real domain? No... it's an example so take it as such and leave the "you forgot this.." somewhere else. I'd love to say that I have time to build your site for you but eventually, you will actually have to think a little. Cut and pasting too much code is hazardous to your health!

Kutulu
 Quote

coteyr

Anonymous
I like this to swollow a page in geeklog
Text Formatted Code

<script type="text/javascript">

/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

</script>   <iframe scrolling="no" frameborder="0" id="myframe" src="/flyspray/" marginwidth="0" marginheight="0" vspace="0" hspace="0" style="overflow: visible; width: 100%; display: none;"></iframe>
 


should work with squirlmail too
 Quote

All times are EDT. The time is now 04:51 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content