if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require 'vendor/autoload.php';
class Users_start_login extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->library('form_validation');
$this->load->library('session');
$this->load->helper(array('form', 'url'));
// $this->load->database();
$this->output->set_template('default3_passwordless');
$this->_init();
}
private function _init()
{
$this->load->js('assets/themes/default/js/jquery-1.9.1.min.js');
$this->load->js('assets/themes/default/hero_files/bootstrap-transition.js');
$this->load->js('assets/themes/default/hero_files/bootstrap-collapse.js');
//load up data needed for fa
$_SESSION['apiKey'] = getenv('apiKey');
$_SESSION['applicationID_survey'] = getenv('applicationID_survey');
$_SESSION['applicationID_login'] = getenv('applicationID_login');
$_SESSION['applicationID_admin_login'] = getenv('applicationID_admin_login');
$_SESSION['applicationID_admin_register_login'] = getenv('applicationID_admin_register_login'); //this is for both register and login
$_SESSION['emailTemplate'] = getenv('emailTemplate');
$_SESSION['tenantID_survey'] = getenv('tenantID_survey');
$_SESSION['tenantID_login'] = getenv('tenantID_login');
$_SESSION['client'] = new FusionAuth\FusionAuthClient($_SESSION['apiKey'], "http://fusionauth:9011");
}
public function get_email()
{
$id=0;
$email=html_escape($_POST['email']);
passwordless_login_admin($email,$id);
if (isset($email)) {
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$emailErr = "Invalid email format";
}
}
}
public function passwordless_login_admin($email,$id)
{
//start the passwordless
....
}