Skip to content
Snippets Groups Projects
Commit 06cf8130 authored by Damien's avatar Damien
Browse files

[FEAT] [PARA V2] Fix where clause @

parent 95ed7f5e
No related branches found
No related tags found
No related merge requests found
......@@ -335,11 +335,15 @@ class SecurityControler
* @param $userId string User identifier
* @return string Proper where clause
*/
public function process_security_where_clause($whereClause, $userId)
public function process_security_where_clause($whereClause, $userId, $addWhere = true)
{
if (!empty($whereClause)) {
$whereClause = str_replace("'", "'", $whereClause);
$where = ' where ' . $whereClause;
if ($addWhere) {
$where = ' where ' . $whereClause;
} else {
$where = $whereClause;
}
// Process with the core vars
$where = $this->process_where_clause($where, $userId);
// Process with the modules vars
......
......@@ -14,6 +14,7 @@
*/
require_once 'apps/maarch_entreprise/services/Table.php';
require_once 'core/class/SecurityControler.php';
class BasketsModelAbstract extends Apps_Table_Service {
......@@ -35,7 +36,8 @@ class BasketsModelAbstract extends Apps_Table_Service {
return [];
}
$where = str_replace('@user', "'" .$_SESSION['user']['UserId']. "'", $aBasket[0]['basket_clause']);
$sec = new SecurityControler();
$where = $sec->process_security_where_clause($aBasket[0]['basket_clause'], $_SESSION['user']['UserId'], false);
$aResList = static::select(
[
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment