mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-03-30 19:10:14 +02:00
Fix limitazioni di accesso per segmenti
This commit is contained in:
parent
c171761065
commit
f61f08d872
@ -12,9 +12,12 @@ if (empty($id_record) && !empty($id_module)) {
|
||||
|
||||
include_once App::filepath('include|custom|', 'top.php');
|
||||
|
||||
Util\Query::setSegments(false);
|
||||
$query = Util\Query::getQuery($structure, [
|
||||
'id' => $id_record,
|
||||
]);
|
||||
Util\Query::setSegments(true);
|
||||
|
||||
$has_access = !empty($query) ? $dbo->fetchNum($query) : true;
|
||||
|
||||
if ($has_access) {
|
||||
|
@ -13,10 +13,22 @@ use Translator;
|
||||
*/
|
||||
class Query
|
||||
{
|
||||
protected static $segments = true;
|
||||
|
||||
/**
|
||||
* Imposta l'utilizzo o meno dei segmenti per le query.
|
||||
*
|
||||
* @param bool $segments
|
||||
*/
|
||||
public static function setSegments($segments)
|
||||
{
|
||||
self::$segments = $segments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce un'insieme di array comprendenti le informazioni per la costruzione della query del modulo indicato.
|
||||
*
|
||||
* @param $element
|
||||
* @param array $element
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
@ -45,7 +57,7 @@ class Query
|
||||
$id_parent = filter('id_parent');
|
||||
|
||||
$id_module = Modules::getCurrent()['id'];
|
||||
$segment = $_SESSION['module_'.$id_module]['id_segment'];
|
||||
$segment = !empty(self::$segments) ? $_SESSION['module_'.$id_module]['id_segment'] : null;
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user