/** * @return bool */ public function canRead(array $params) { $isPublic = $params['isPublic']; $isFull = $params['isFull']; $restrictionLevel = $this->applicationLocalized->restrictionLevel(); if( $restrictionLevel == ApplicationObject::RESTRICTION_LEVEL_LIMITED) { $id = MMUsers::getCurrentUserId(); $authorizedUsers = MMLimitedApplicationsAllowedUsers::fetchAllowedUsersByApplication($this->applicationLocalized->application_id); if(empty($authorizedUsers) || !in_array($id, $authorizedUsers)){ return false; } else { return true; } } $allowsPublicView = $this->getApplicationCustomParamater('allowsPublicView'); if( $isPublic && $allowsPublicView && MMUserHeader::tokenExists( isset( $_GET['t'] ) ? $_GET['t'] : false ) != null) { return true; } elseif( $isPublic ) { return false; } if( !BlockDefault::user() || // or if ToU not validated ( (bool)BlockDefault::user() && !BlockDefault::user()->toUValidated() && BlockDefault::iniMerck()->hasVariable( 'LoginSettings', 'ToUCheck' ) && BlockDefault::iniMerck()->variable( 'LoginSettings', 'ToUCheck') != 'disabled' ) ) { return !$isFull; } return null; }
/** * @return array */ public function prcuh() { header("Cache-Control: no-cache, must-revalidate"); return MMUserHeader::add( $_POST['content']); }