Version 0.3.5 beta
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
namespace Nibiru\Model;
|
||||
use Nibiru\Adapter\Db;
|
||||
use Nibiru\Pdo;
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: kasdorf
|
||||
* Date: 21.11.17
|
||||
* Time: 11:22
|
||||
*/
|
||||
|
||||
class Users extends Db
|
||||
{
|
||||
const TABLE = array(
|
||||
'table' => 'user',
|
||||
'field' => array(
|
||||
'user_id' => 'user_id',
|
||||
'user_name' => 'user_name',
|
||||
'user_pass' => 'user_pass',
|
||||
'user_active' => 'user_active',
|
||||
'user_date' => 'user_date'
|
||||
)
|
||||
);
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
self::initTable( self::TABLE );
|
||||
}
|
||||
|
||||
public function selectRowsetById($id = false)
|
||||
{
|
||||
$id = array(
|
||||
self::TABLE['field']['user_id'] => $id
|
||||
);
|
||||
return Pdo::fetchRowInArrayById(
|
||||
self::TABLE['table'], $id
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
57
application/model/users.php
Normal file
57
application/model/users.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
namespace Nibiru\Model;
|
||||
use Nibiru\Adapter\Db;
|
||||
use Nibiru\Pdo;
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: kasdorf
|
||||
* Date: 21.11.17
|
||||
* Time: 11:22
|
||||
*/
|
||||
|
||||
class User extends Db
|
||||
{
|
||||
const TALBE = array(
|
||||
'table' => 'user',
|
||||
'field' => array(
|
||||
'user_id' => 'user_id',
|
||||
'user_name' => 'user_name',
|
||||
'user_pass' => 'user_pass',
|
||||
'user_email' => 'user_email',
|
||||
'user_firstname' => 'user_firstname',
|
||||
'user_login' => 'user_login',
|
||||
'user_account_active' => 'user_account_active'
|
||||
)
|
||||
);
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
self::initTable( self::TABLE );
|
||||
}
|
||||
|
||||
public function selectRowsetById($id = false)
|
||||
{
|
||||
$id = array(
|
||||
self::TABLE['field']['user_id'] => $id
|
||||
);
|
||||
return Pdo::fetchRowInArrayById(
|
||||
self::TABLE['table'], $id
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @desc saves user data to the user table in the database
|
||||
* @param $userdata
|
||||
*/
|
||||
public function saveUserDataToTable( $userdata )
|
||||
{
|
||||
$insert = array();
|
||||
foreach ($userdata as $key=>$entry)
|
||||
{
|
||||
if(array_key_exists($key, self::TALBE['field']))
|
||||
{
|
||||
$insert[$key] = $entry;
|
||||
}
|
||||
}
|
||||
$this->insertArrayIntoTable($insert, 'user_pass');
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,22 @@ config_dir = "/../../application/view/configs/"
|
||||
class_file = "core/l/Smarty/Smarty.class.php"
|
||||
debugbar = false
|
||||
|
||||
[EMAIL]
|
||||
register.smtp = 1
|
||||
register.smtp[password] = "YOURPASSWORD"
|
||||
register.smtp[username] = "YOUREMAILUSERNAME"
|
||||
register.smtp[host] = "YOURSMTP"
|
||||
register.smtp[port] = "25"
|
||||
register.from = "YOURFROMMAIL"
|
||||
register.sender = "YOURSENDER"
|
||||
register.subject = "YOURSUBJECTLINE"
|
||||
register.text = "PATHTOYOURHTMLTEMPLATE"
|
||||
|
||||
[SETTINGS]
|
||||
pageurl = "YOURPAGEURLWITHPROTOCOL"
|
||||
navigation = "navigation.json"
|
||||
dbmodel = "/../../application/model/"
|
||||
modul = "/../../application/modul/"
|
||||
background.img[] = "public/img/nibiru3.jpg"
|
||||
smarty.css[] = "public/css/v3/roboto.css"
|
||||
smarty.css[] = "public/css/v3/toolkit-inverse.css"
|
||||
|
||||
Reference in New Issue
Block a user