mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
- Changed controller system/FAS_UDF, less busy now
- Method execReadOnlyQuery of DB_Model less strict check against SQL statements - Added new public method setup to DB_Model to setup the model after initialization - Added new constants to UDFLib - Added new private method _printEndUDFBlock and _printEndUDFBlock to UDFLib - Added new public methods setUDFUniqueId, getSession, getSessionElement, setSession, setSessionElement, saveUDFs and isAllowed to UDFLib - Removed model system/FAS_UDF_model - View views/system/fas_udf now uses the view templates/FHC-Header - Added new parameter udfs to view templates/FHC-Header - Added new properties to UDFWidget - Added new private methods _initUDFWidget, _checkParameters and _startUDFWidget to UDFWidget
This commit is contained in:
@@ -60,6 +60,20 @@ class DB_Model extends CI_Model
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* This method provides a way to setup a database model without declaring one
|
||||
*/
|
||||
public function setup($schema, $table, $primaryKey, $hasSequence = true)
|
||||
{
|
||||
//
|
||||
if (!isEmptyString($schema) && !isEmptyString($table) && !isEmptyString($primaryKey) && is_bool($hasSequence))
|
||||
{
|
||||
$this->dbTable = $schema.'.'.$table;
|
||||
$this->pk = $primaryKey;
|
||||
$this->hasSequence = $hasSequence;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert Data into DB-Table
|
||||
*
|
||||
@@ -690,7 +704,7 @@ class DB_Model extends CI_Model
|
||||
*/
|
||||
public function hasUDF()
|
||||
{
|
||||
if($this->fieldExists(UDFLib::COLUMN_NAME))
|
||||
if ($this->fieldExists(UDFLib::COLUMN_NAME))
|
||||
{
|
||||
$resultUDFsDefinitions = $this->UDFModel->getUDFsDefinitions($this->dbTable);
|
||||
if (hasData($resultUDFsDefinitions))
|
||||
@@ -727,8 +741,8 @@ class DB_Model extends CI_Model
|
||||
$cleanedQuery = trim(preg_replace('/\t|\n|\r|;/', '', $query)); //
|
||||
|
||||
//
|
||||
if (stripos($cleanedQuery, 'SELECT') == 0
|
||||
&& (stripos($cleanedQuery, 'INSERT') > 0 || stripos($cleanedQuery, 'INSERT') == false)
|
||||
if (
|
||||
(stripos($cleanedQuery, 'INSERT') > 0 || stripos($cleanedQuery, 'INSERT') == false)
|
||||
&& (stripos($cleanedQuery, 'UPDATE') > 0 || stripos($cleanedQuery, 'UPDATE') == false)
|
||||
&& (stripos($cleanedQuery, 'CREATE') > 0 || stripos($cleanedQuery, 'CREATE') == false)
|
||||
&& (stripos($cleanedQuery, 'DELETE') > 0 || stripos($cleanedQuery, 'DELETE') == false)
|
||||
|
||||
Reference in New Issue
Block a user