Jump to:

23472 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Forcing a Login (SOLVED)

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 805 Views
  • TerryMiddleton
    Community Member
    108 Posts

    Forcing a Login (SOLVED) Link to this post

    *** I figured this out ***

    You can force a login by issuing this url:


    I'm using a CustomLoginForm, but this doesn't work. I get an error:

    Fatal error: Call to a member function getSession() on a non-object in /home/www/sites_on_nfs/public/radimage/htdocs/sapphire/core/Session.php on line 57

    Here is my CustomLoginForm:

    class CustomLoginForm extends MemberLoginForm {

       // this function is overloaded on our sublcass (this) to do something different
       public function dologin($data) {
          $email = Convert::raw2sql($data['Email']);
          //$accountenabled = 1; //Convert::raw2sql($data['AccountEnabled']);
          //Check to see if member already is in the db using their email address
    //      $Members = DataObject::get("Member", "Email='$email' and AccountEnabled = '$accountenabled'");
          $Members = DataObject::get_one("Member", "Email='$email' AND AccountEnabled = 1");
          if ($Members) {      
          //   parent::doLogin($data);
          } else {
             $data = null;

             //if member is not enabled - void login
          //   $data['Password'] = 'no';
          //   parent::doLogin($data);
       //      Director::redirect('runqueuea');


    } //class


Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.