Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

External authenticator and a weblogin form


Reply


594 Views

Avatar
hmph

Community Member, 1 Post

3 November 2010 at 7:07am

Background-
We've been using silverstripe for about 3 years as our companies intranet. A few months ago we switched hosting and decided to upgrade to the latest version (we were at 2.2). After the upgrade some of our module's and scripting was not compatible, most of which we have changed or recovered. This is one of the items that worked previously but for the life of me I can't get to work properly now.

Specific Info -
We use external authenticator for our employee login. We use its IMAP driver and our e-mail server for authentication. Works great. Once a employee is logged in one of the navigation menu links is to our Webmail. This link uses a form and javascript submit script to automatically log in the user to their webmail and references the current users email address and password for the value's of the input fields. This is the same login credentials used to initially sign in.

Problem-
The password value is no longer retrieved and users aren't automatically logged in with their credentials. Originally this was done like so in the Page.php

function GetUserPass()
   {
      return Session::get("MemberPass");      
   }


And then was called in the Navigation.ss like so

<form id="WebLogin" action="http://mail.domain.com" method="post" target="_blank">
                     <input type="hidden" name="_user" value="$GetUserEmail">
                     <input type="hidden" name="_pass" value="$GetUserPass">
                     <input type="hidden" name="_action" value="login">
                  </form>
                  <a href="#" onclick="javascript: document.getElementById('WebLogin').submit();">
                     Webmail
                  </a>


Since neither of these were initially working I changed the _user value to value="$CurrentMember.Email" which works fine.

I know there has been some changes in naming that I've missed somewhere or just some slight updating to the code but I just can't seem to get it. Hoping some fresh eyes will help! Thanks to anyone who can help and to all of you who already have with other posts throughout this forum!