public function __construct(\Fp\Core\Init $O) { if ($O->glob('crypt_function')) { $this->crypt_function = $O->glob('crypt_function'); } /* @TODO delete after Table test validation $tableLoginPassword = $this->table; $columnLoginPassword = array('uid','password','password_tmp'); $this->tableLoginPassword = Table::set(Db::get_link(), $tableLoginPassword, $columnLoginPassword); $this->tableLoginPassword->setPrimary('uid'); $this->tableLoginPassword->setUnique(array()); $this->tableLoginPassword->setSortable(array('uid','password','password_tmp')); $this->tableLoginPassword->setSearchable(array ( 'uid' => 'bigint', 'password' => 'varchar', 'password_tmp' => 'varchar', )); $this->tableLoginPassword->setAutoIncrement(); */ $dbLink = Db::get_link(); $this->table = $O->glob('prefix') . $this->table; $shemaPassword = array('table' => $this->table, 'column' => array('uid' => array('type' => 'bigint', 'primary' => 1, 'sortable' => 1, 'searchable' => 1), 'password' => array('type' => 'varchar', 'sortable' => 1, 'searchable' => 1), 'password_tmp' => array('type' => 'varchar', 'sortable' => 1, 'searchable' => 1))); $this->tablePassword = Table::setTable($dbLink, $shemaPassword); $this->dbLoginPassword = new Query($this->tablePassword, 'LoginPassword'); }
public function __construct(\Fp\Core\Init $O) { $tableLoginFacebook = $O->glob('prefix') . $this->table; $columnLoginFacebook = array('uid', 'fb_uid', 'app_id'); $this->tableLoginFacebook = Table::set(Db::get_link(), $tableLoginFacebook, $columnLoginFacebook); $this->tableLoginFacebook->setPrimary('uid'); $this->tableLoginFacebook->setUnique(array('fb_uid', 'uid')); $this->tableLoginFacebook->setSortable(array('uid', 'fb_uid')); $this->tableLoginFacebook->setSearchable(array('uid' => 'bigint')); $this->tableLoginFacebook->setAutoIncrement(); $this->dbLoginFacebook = new Table_query($this->tableLoginFacebook, 'LoginFacebook'); }
public function __construct(\Fp\Core\Init $O) { $tableLoginMail = $O->glob('prefix') . $this->table; $columnLoginMail = array('uid', 'mail', 'tmp_mail', 'status'); $this->tableLoginMail = Table::set(Db::get_link(), $tableLoginMail, $columnLoginMail); $this->tableLoginMail->setPrimary('uid'); $this->tableLoginMail->setUnique(array('mail')); $this->tableLoginMail->setSortable(array('uid', 'mail', 'tmp_mail', 'status')); $this->tableLoginMail->setSearchable(array('uid' => 'bigint', 'tmp_mail' => 'varchar', 'status' => 'int')); $this->tableLoginMail->setAutoIncrement(); $this->dbLoginMail = new Table_query($this->tableLoginMail, 'LoginMail'); }
/** * @param string $prefix * @return Auth */ public function __construct(\Fp\Core\Init $O) { $this->O = $O; $this->data = array(); $this->table = $O->glob('prefix') . $this->table; $this->session_key = md5($this->salt_session_key); $this->session = $O->session(); $dbLink = Db::get_link(); $tableLogin = $O->glob('prefix') . $this->table; $shemaLogin = array('table' => $tableLogin, 'options' => array('auto_increment' => 1), 'column' => array('uid' => array('type' => 'bigint', 'primary' => 1, 'sortable' => 1, 'searchable' => 1), 'time' => array('type' => 'datetime', 'sortable' => 1, 'searchable' => 1), 'status' => array('type' => 'int', 'sortable' => 1, 'searchable' => 1))); $this->tableLogin = Table::setTable($dbLink, $shemaLogin); $this->dbLogin = new Query($this->tableLogin, 'Login'); }
/** * @return Db */ public function db() { if (!isset($this->db)) { require_once __DIR__ . '/../Db/Db.php'; # initialisation bdd $type = array_key_exists('type', $this->global_private['db'][0]) ? $this->global_private['db'][0]['type'] : ''; Db::connect($this->global_private['db'][0]['id'], $this->global_private['db'][0]['host'], $this->global_private['db'][0]['user'], $this->global_private['db'][0]['pass'], $this->global_private['db'][0]['base'], $type); $this->db = Db::get_link($this->global_private['db'][0]['id']); } return $this->db; }
public function __construct(\Fp\Core\Init $O) { $this->O = $O; $this->prefix = $O->glob('prefix'); $dbLink = Db::get_link(); /* * Groupe */ $shema = array('table' => $this->prefix . $this->table_Group, 'options' => array('auto_increment' => 1), 'column' => array('gid' => array('type' => 'bigint', 'primary' => 1, 'sortable' => 1, 'searchable' => 1), 'name' => array('type' => 'varchar', 'unique' => 1, 'sortable' => 1, 'searchable' => 1), 'timestamp' => array('type' => 'timestamp'))); $this->tableGroup = Table::setTable($dbLink, $shema); $this->dbGroup = new Table_query($this->tableGroup, 'g'); /* * Zone */ $shemaZone = array('table' => 'permissions_zone', 'options' => array('auto_increment' => 1), 'column' => array('zid' => array('type' => 'bigint', 'primary' => 1, 'sortable' => 1, 'searchable' => 1), 'name' => array('type' => 'varchar', 'unique' => 1, 'sortable' => 1, 'searchable' => 1), 'timestamp' => array('type' => 'timestamp', 'sortable' => 1, 'searchable' => 1))); $this->tableZone = Table::setTable($dbLink, $shemaZone); $this->dbZone = new Table_query($this->tableZone, 'z'); /* * GroupUser */ $shemaGroupUser = array('table' => 'permissions_group_user', 'column' => array('gid' => array('type' => 'bigint', 'primary' => 1, 'sortable' => 1, 'searchable' => 1), 'uid' => array('type' => 'bigint', 'sortable' => 1, 'searchable' => 1), 'permission' => array('type' => 'int'), 'timestamp' => array('type' => 'timestamp', 'sortable' => 1, 'searchable' => 1))); $this->tableGroupUser = Table::setTable($dbLink, $shemaGroupUser); $this->dbGroupUser = new Table_query($this->tableGroupUser, 'gu'); $this->dbGroupUser->innerJoin($this->tableGroup, 'g', 'gu.gid=g.gid '); /* * Group Zone */ $shemaGroupZone = array('table' => 'permissions_group_zone', 'column' => array('gid' => array('type' => 'bigint', 'primary' => 1, 'sortable' => 1, 'searchable' => 1), 'zid' => array('type' => 'bigint', 'sortable' => 1, 'searchable' => 1), 'permission' => array('type' => 'int', 'sortable' => 1, 'searchable' => 1), 'timestamp' => array('type' => 'timestamp', 'sortable' => 1, 'searchable' => 1))); $this->tableGroupZone = Table::setTable($dbLink, $shemaGroupZone); $this->dbGroupZone = new Table_query($this->tableGroupZone, 'gz'); $this->dbGroupZone->innerJoin($this->tableGroup, 'g', 'gz.gid=g.gid '); $this->dbGroupZone->innerJoin($this->tableZone, 'z', 'gz.zid=z.zid '); }