Thanks for the detailed information. With this information I will be able to start something.
Thus the question about the session can still be resolved, here is the snippet of the code.
handlers/Login.cfc
`
component name=“login” extends=“coldbox.system.EventHandler” output=“false” autowire=“true” {
public any function init(controller) {
super.init(arguments.controller);
return this;
}
function index(event,rc,prc) {
setNextEvent(“login.signin”);
}
/*
- ====================================
- Login prozedure
- ====================================
*/
function signin(event,rc,prc) {
Event.setValue(“subpageTitle”,“Login”);
if(!isDefined(“session.AuthenticationService”)) {
session.AuthenticationService = new model.AuthenticationService();
}
Event.setView(‘login/Login.Signin’);
Event.setLayout(‘Layout.Login’);
}
/*
- ====================================
- Check Login credentials prozedure
- ====================================
*/
function process(event,rc,prc) {
Event.noRender();
Event.paramValue(“Usermail”,"");
Event.paramValue(“Userpass”,"");
if(!isDefined(“session.AuthenticationService”)) {
setNextEvent(“login.signin”);
};
if(Session.AuthenticationService.process(rc)){
setNextEvent(“login.successful”);
} else {
getPlugin(“MessageBox”).setMessage(“error”,"#getResource(‘error-title-error’)# Login information not valid");
setNextEvent(“login.signin”);
}
}
/*
- ====================================
- Login prozedure successful
- ====================================
*/
function successful(event,rc,prc) {
// Enable this debug
//
structDelete(session, “AuthenticationService”);
getPlugin(“MessageBox”).setMessage(“info”,"#getResource(‘error-title-success’)# Login erfolgreich.");
setNextEvent(“Login.mymavok”);
}
`
model/AuthenticationService.cfc
`
component name=“AuthenticationService “accessors=“true” output=“false” autowire=“true” {
property name=“Usermail” type=“string” default=””;
property name=“Userpass” type=“string” default="";
property name=“dbName” inject=“coldbox:datasource:mavokPortal”;
AuthenticationService function init() {
return this;
}
public boolean function process(rc) {
// set the properties with values passed by rc
setUsermail(rc.Usermail);
setUserpass(rc.Userpass);
// do some minor validation
if(
trim(Usermail) == “” or
trim(Userpass) == “”
){
return false;
}
}
}
`
I hope this information helps