The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

webmaillogin.cgi

Discussion in 'User Experience' started by Radio_Head, Oct 31, 2002.

  1. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    38
    (p.s. webmaillogin.cgi is opened when the client click on webmail from the email account page )

    I created a new /usr/local/cpanel/base/webmaillogin.cgi file (see below) .

    The new webmaillogin.cgi looks really better of the original file , and it reduce the required login (especially using horde) .

    If you want use it , please be sure to backup your original file, then be sure to have Neomail and Horde enabled .

    It work really fine with ssl too . I will wait your suggestion and idea to improve .


    =======================

    #!/usr/bin/perl

    open(CF,&/var/cpanel/cpanel.config&);
    while(&CF&) {
    next if (/^#/);
    s/\n//g;
    ($var,$value) = split(/=/, $_);
    $$var = $value;
    }
    close(CF);


    $urlbase = $ARGV[0];
    if ($urlbase =~ /\@/) {
    $urlbase =~ s/\@/+/g;
    $urlbase = &/& . $urlbase;
    } else {
    $urlbase='';
    }

    print &&EOM;

    &html&
    &body bgcolor=#FFFFFF&
    &center&
    EOM

    if (!$skipneomail) {
    print &&EOM;
    EOM
    }

    if (!$skiphorde) {
    print &&EOM;
    EOM
    }

    print &&EOM;
    &b&Welcome&/b& , you are logged in as: &b&$ENV{'REMOTE_USER'}&/b&&br&
    &P ALIGN=&center&&&B&&FONT COLOR=&#CC3300&&Please choose your Webmail program&/FONT&&/B&
    EOM
    if ($ENV{'REMOTE_USER'} =~ /\@/) {
    print &&EOM;

    EOM
    }
    print &&br&\n&;
    if ($ENV{'SERVER_PORT'} =~ /2096/) {
    print &** SSL &img src=\&$urlbase/lock.gif\&&** &br&\n&;
    } else {
    my ($newhost) = $ENV{'HTTP_HOST'};
    $getuhost = $ENV{'HTTP_HOST'};
    $getuhost =~ s/www.//;
    print &Non-SSL &img src=\&$urlbase/unlock.gif\&& :: ( Click &a href=\&https://${newhost}:2096${urlbase}/\&&here&/a& for Secure Site \n Login with Email username &b&${onlyuser}&/b& and your email password) &br&&;

    }
    my ($newhost) = $ENV{'HTTP_HOST'};

    if ($ENV{'SERVER_PORT'} =~ /2096/) {
    $righturl = &https&;
    $rightport = &2096&;
    $extra = &(Horde will ask you to enter your Web Hosting Account user and password)&;
    } else {
    $righturl = &http&;
    $rightport = &2082&;
    }
    $newhostb = $ENV{'HTTP_HOST'};
    $newhostb =~ s/www.//;

    print &&EOM;
    &DIV ALIGN=&center&&
    &CENTER&
    &TABLE BORDER=&2& CELLPADDING=&4& CELLSPACING=&0& STYLE=&border-collapse: collapse& BORDERCOLOR=&#C0C0C0& WIDTH=&80%& ID=&AutoNumber1& HEIGHT=&16&&
    &TR&
    &TD WIDTH=&50%& HEIGHT=&16&&
    &P ALIGN=&center&&&IMG BORDER=&0& SRC=&$urlbase/neomail/neomail.gif&&&/TD&
    &TD WIDTH=&50%& HEIGHT=&16&&
    &P ALIGN=&center&&
    &IMG SRC=&$urlbase/neomail/horde-color.gif& BORDER=&0&&&/TD&
    &/TR&
    &TR&
    &TD WIDTH=&50%& HEIGHT=&16& VALIGN=&top&&
    &P ALIGN=&left&&NeoMail is a Web-based
    e-mail client . Some features worth mentioning: &BR&
    Sending/receiving messages with multiple attachments. &BR&
    Inline image attachment display. &BR&
    Friendly, attractive, icon-based user interface &BR&
    Multiple language support&BR&
    Multiple folders &BR&
    Address book&BR&&BR&

    &center&&b&NeoMail&/B&&/center&
    &center&Click &b&&a href=&$urlbase/neomail/neomail.pl&&here&/a&&/B& to login .&/center&

    &/TD&
    &TD WIDTH=&50%& HEIGHT=&16& VALIGN=&top&&
    &P ALIGN=&left&&Horde IMP is an IMAP based
    Webmail system. &BR&
    You can use it to check your mail from anywhere that you have web
    access. It adds advanced features such as a hierarchical mailbox
    navigator, attachments, spell-check, address books, multiple folders,
    Calendar ,and a clean user interface.&BR&


    &center&
    &P ALIGN=&center&&
    &FORM METHOD=&POST& ACTION=&${righturl}://${newhost}:${rightport}/horde/imp/redirect.php& NAME=&implogin& &
    &b&Horde Login&/b&&br&Please enter your Email password for &b&$ENV{'REMOTE_USER'}&/b&&BR&

    &input type=password name=pass size=16 maxlength=&66& STYLE=&color: #336699; background-color: #FFFFCC&&
    &/B&
    &INPUT TYPE=&submit& VALUE=&Check Email& NAME=&ck&&&/P&&br&${extra}
    &input type=&hidden& name=&server& value=&localhost& /&
    &input type=&hidden& name=&port& value=&143& /&
    &input type=&hidden& name=&namespace& value=&& /&
    &input type=&hidden& name=&maildomain& value=&${newhost}& /&
    &input type=&hidden& name=&protocol& value=&imap/notls& /&
    &input type=&hidden& name=&realm& value=&& /&
    &input type=&hidden& name=&imapuser& value=&$ENV{'REMOTE_USER'}& /&


    &/FORM&
    &/center&


    &/TD&
    &/TR&
    &/TABLE&
    &/CENTER&
    &/DIV&


    &/html&
    EOM
     
  2. promak

    promak Well-Known Member

    Joined:
    Oct 6, 2001
    Messages:
    248
    Likes Received:
    0
    Trophy Points:
    16
    Hi!
    Can you write a cgi to login 2082(cpanel)
    like webmail(use form action in html then type username and password press enter to login)
    Thank You!
     

Share This Page