closed #138 added new cookie based login

This commit is contained in:
Exodus4D
2016-05-01 17:20:16 +02:00
parent 7f23e31984
commit 2b58853bfb
20 changed files with 1016 additions and 219 deletions

View File

@@ -0,0 +1,54 @@
<?php
/**
* Created by PhpStorm.
* User: Exodus
* Date: 25.04.2016
* Time: 19:33
*/
namespace Model;
use DB\SQL\Schema;
class CharacterAuthenticationModel extends BasicModel{
protected $table = 'character_authentication';
protected $fieldConf = [
'active' => [
'type' => Schema::DT_BOOL,
'nullable' => false,
'default' => 1,
'index' => true
],
'characterId' => [
'type' => Schema::DT_INT,
'index' => true,
'belongs-to-one' => 'Model\CharacterModel',
'constraint' => [
[
'table' => 'character',
'on-delete' => 'CASCADE'
]
]
],
'selector' => [
'type' => Schema::DT_VARCHAR128,
'nullable' => false,
'default' => '',
'index' => true,
'unique' => true
],
'token' => [
'type' => Schema::DT_VARCHAR128,
'nullable' => false,
'default' => '',
'index' => true
],
'expires' => [
'type' => Schema::DT_TIMESTAMP,
'default' => Schema::DF_CURRENT_TIMESTAMP,
'index' => true
]
];
}