PHP Classes
elePHPant
Icontem

File: examples/two-step-login/config.php

Recommend this page to a friend!
  Classes of Subin Siby  >  Secure PHP Login System  >  examples/two-step-login/config.php  >  Download  
File: examples/two-step-login/config.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Secure PHP Login System
Register and login users using a database via PDO
Author: By
Last change: Changed session library

* Now uses non-blocking sessions
* Removed usage of native PHP sessions
* Allow to rename session cookie
* Removed defunct TwoStepLogin tests
Merge branch 'MaterializeExample' into dev
Date: 1 year ago
Size: 1,739 bytes
 

Contents

Class file image Download
<?php
/**
 * For Development Purposes
 */
ini_set('display_errors', 'on');

require
__DIR__ . '/../../vendor/autoload.php';

$config = array(
   
'basic' => array(
       
'company' => 'My Site',
       
'email' => 'emails@mysite.com',
    ),
   
'db' => array(
       
'host' => 'localhost',
       
'port' => 3306,
       
'username' => 'root',
       
'password' => '',
       
'name' => 'test',
       
'table' => 'users',
    ),
   
'features' => array(
       
'auto_init' => true,
       
'two_step_login' => true,
    ),
   
/**
     * These are my localhost paths, change it to yours
     */
   
'pages' => array(
       
'no_login' => array(
           
'/examples/two-step-login/',
           
'/examples/two-step-login/reset.php',
           
'/examples/two-step-login/register.php',
        ),
       
'everyone' => array(
           
'/examples/two-step-login/status.php',
        ),
       
'login_page' => '/examples/two-step-login/login.php',
       
'home_page' => '/examples/two-step-login/home.php',
    ),
   
'two_step_login' => array(
       
'instruction' => 'A token was sent to your E-Mail Address. Please see the mail in your inbox and paste the token found in the textbox below :',
       
'send_callback' => function (&$LS, $userID, $token) {
           
$email = $LS->getUser('email', $userID);
           
$LS->sendMail($email, "Verify Yourself", "Someone tried to login to your account. If it was you, then use the following token to complete logging in : <blockquote>". $token ."</blockquote>If it was not you, then ignore this email and please consider to change your account's password.");
        },
    ),
);

$LS = new \Fr\LS($config);