ezpublish: New siteaccess require user to login - ezpublish

I added fre siteacces to ezpublish (tried with 2014.05.0 and 2014.03.2) but it require user to login.With eng siteaccess it is working just as it should.
This is my config:
ezpublish:
siteaccess:
default_siteaccess: eng
list: [eng, fre, apanel]
groups:
site_group: [eng, fre, apanel]
backend_group: [apanel]
frontend_group: [eng, fre]
match:
URIElement: '1'
repositories:
main: { engine: legacy, connection: my_connection }
system:
site_group:
repository: main
var_dir: var/lla
frontend_group:
translation_siteaccesses: [eng, fre]
eng:
languages: [eng-GB]
fre:
languages: [fre-FR, eng-GB]
Any help :S?

You need to add a policy for the anonymous role to view content in this new siteaccess. You can do this in the admin interface by editing the Anonymous role and adding a new policy: Setup -> Roles & Policies -> Anonymous -> Edit.
Check out https://doc.ez.no/eZ-Publish/Technical-manual/5.x/Concepts-and-basics/Access-control for more details.

Related

403 You are not permitted to execute the promotion 'snapshotToRelease'

I am trying to release a specific version via artifactory. Promoting to a release folder gives me a 403 error with below error:
{
"errors" : [ {
"status" : 403,
"message" : "You are not permitted to execute the promotion 'snapshotToRelease'."
} ]
}
Looking at the error it's a permission issue and I have tried most of the permissions for the user that tries to release the build but no luck. Below is the api resource I'm trying to execute
/api/plugins/build/promote/snapshotToRelease
I suppose you're using this plugin?
The way this promotion is configured, only the following users can run it:
Users with admin privileges
A user with the username "jenkins"
If neither of these describe the user in question, and you're allowed to edit the plugin file, you can change the code to work with other users:
snapshotToRelease(users: ["my-promoter"], params: ...) { buildName, buildNumber, params ->
// ...
}
Or any user in a group:
snapshotToRelease(groups: ["my-promote-group"], params: ...) { buildName, buildNumber, params ->
// ...
}
(See the documentation for more details.)

Symfony4: How to toggle entities using dotenv and multiple Entity Manager?

How it is possible through dotenv select different entity path with same name of entities.
Originally, We had application in Symfony 3 for people meetings on events of our organization. Then we decided to offer this application to our partners.
One of the partners asked us to customize the application for them with their data and specifications. We basically created a new instance of Symfony application with copy of database tables (with different prefix), changes in Entities to reflect new db table names, and some translation text changes.
It seems that other partners will follow this trend of customized instances.
Therefore, I am trying to update core application to Symfony 4 and I am trying to use multiple Entity Managers and dotenv to differentiate between partners database tables, as described bellow.
In a nutshell, I am trying to use multiple Entity Manager to switch db table names by prefix.
.env
###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Configure your db driver and server_version in config/packages/doctrine.yaml
DATABASE_URL=oci8://user:pass#127.0.0.1:1521/XE
EM_TYPE=OpenAccess
###< doctrine/doctrine-bundle ###
Only in security.yaml working env good
security:
encoders:
App\Entity\%env(EM_TYPE)%\Osoba:
providers:
our_db_provider:
entity:
class: App\Entity\%env(EM_TYPE)%\Osoba
property: username
When i tried get %env(EM_TYPE)% in default_entity_manager, then give error You have requested a non-existent service "doctrine.orm.%env(EM_TYPE)%_entity_manager". doctrine.yaml
parameters:
env(DATABASE_URL): ''
doctrine:
dbal:
default_connection: '%env(EM_TYPE)%'
connections:
MeetingTool:
driver: 'oci8'
charset: UTF8
schema_filter: /^MT_/
url: '%env(resolve:DATABASE_URL)%'
OpenAccess:
driver: 'oci8'
charset: UTF8
schema_filter: /^OA6_/
url: '%env(resolve:DATABASE_URL)%'
orm:
auto_generate_proxy_classes: true
default_entity_manager: '%env(EM_TYPE)%'
entity_managers:
MeetingTool:
connection: MeetingTool
mappings:
Main:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity/MeetingTool'
prefix: 'App\Entity\MeetingTool'
alias: App2
OpenAccess:
connection: OpenAccess
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity/OpenAccess'
prefix: 'App\Entity\OpenAccess'
alias: OpenAccess
and biggest problem is use, how i targeting right entity here? for example loginController.php
<?php
namespace App\Controller;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\OpenAccess\LogPrihlaseni;
//use App\Entity\MeetingTool\LogPrihlaseni;
class LoginController extends AbstractController {
private $entityManager;
public function __construct(EntityManagerInterface $entityManager)
{
$this->entityManager = $entityManager;
}
public function logPrihlaseni() {
$log = new LogPrihlaseni();

Parse-Server-Mailgun : How to edit templates and have them pushed to server

This is an extension to my previous question:
Setup mailgun with parse-server on Heroku
When you run '$ npm install parse-server-mailgun' it installs a bunch of directories and files on my current directory. However when i edit any of these, specifically the email templates, or anything thing that isnt in the main root directory of my parse-server-example folder, they don't push to Heroku.
I assume, if this is the case that it must just be pushing the main config files located in the root dir and then pulling the rest from nom somewhere?
How to i push the entire directory and all its sub folder/files to my Heroku server? Or edit the email templates already on the server?
Sorry this is a bit f a stupid question probably.
You should not modify the templates from the package's folder. Instead, create your own templates in your project's directory, and then reference those when initializing ParseServer. Then simply add these new files to your git repository and they'll be available on the server.
For instance:
emailAdapter: {
module: 'parse-server-mailgun',
options: {
// The address that your emails come from
fromAddress: 'Hello <hello#example.com>',
// Your domain from mailgun.com
domain: config.Mailgun.domain,
// Your API key from mailgun.com
apiKey: config.Mailgun.api,
templates: {
verificationEmail: {
subject: 'Please verify your e-mail for Example.com',
pathPlainText: './email/emailVerification/index.txt',
pathHtml: './email/emailVerification/index.html',
callback: function (user) { return { firstName: user.get('firstName') }; }
// Now you can use {{firstName}} in your templates
}
}
}
}
Simple fix. Put them in the root directory of the build. They will automatically be committed tot he server
You can use this mail adapter is really easy to use and also you can use it to multi language mails.
Hope that can help you. 😁👌
A little example of how you can use it.
emailAdapter: {
module: 'parse-smtp-template',
options: {
...
template: true,
templatePath: "views/templates/template.html",
// Custome options to your emails
// You can add more options if you need
passwordOptions: {
subject: "Password recovery",
body: "Custome pasword recovery email body",
btn: "Recover your password"
/* --EXTRA PARAMETERS--
others: {
extraParameter
}
*/
},
confirmOptions: {
subject: "E-mail confirmation",
body: "Custome email confirmation body",
btn: "confirm your email"
},
}
}
https://github.com/macarthuror/parse-smtp-template

FOSUserBundle Can only login one time

I'am trying to using the FOSUserBundle with Symfony 3.0.9.
After doing the tutorial here I was able to register a user and login with it, yesterday. The problem was that I couldn't login this morning with the same credentials. After a some tests I noticed that it's not possible to login with the user, when I closed the window.
So i have to delete the user from database and create a new one.
Can anybody help me out to fix this problem?
Surely a user should be able to login, logout and close the brwoser without a logout.
My SecurityController.php:
class SecurityController extends Controller
{
/**
* #Route("/login", name="login")
*/
public function loginAction(Request $request)
{
$authenticationUtils = $this->get('security.authentication_utils');
// get the login error if there is one
$error = $authenticationUtils->getLastAuthenticationError();
// last username entered by the user
$lastUsername = $authenticationUtils->getLastUsername();
return $this->render(
'security/login.html.twig',
array(
// last username entered by the user
'last_username' => $lastUsername,
'error' => $error,
)
);
}
}
security.yml:
# To get started with security, check out the documentation:
# http://symfony.com/doc/current/book/security.html
security:
encoders:
FOS\UserBundle\Model\UserInterface: bcrypt
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: ROLE_ADMIN
providers:
fos_userbundle:
id: fos_user.user_provider.username
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern: ^/
form_login:
provider: fos_userbundle
csrf_token_generator: security.csrf.token_manager
logout: true
anonymous: true
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/, role: ROLE_ADMIN }
At least my user entity in database:
The problem was that the session was set by /register and my /login never worked.
With the standard FOSUser Login it worked without problems.

Configuring catalog items through manifest.yml file

Using spring-cloud-cloudfoundry-service-broker we developed a service broker.
Initially we defined catalog items within application.yml file which gets bundled inside jar and this all works great.
Instead of bundling catalog items within jar file, we thought of supplying through manifest.yml file while pushing the service to cloud foundry.
But unfortunately application is not getting the catalog items specified in manigest.yml file. Could you please let us know how do we supply catalog items through manifest.yml file?
I have copied my code snippet here.
CatalogConfig.java
#ConfigurationProperties(prefix = "catalog")
#Component
public class CatalogConfig {
private List<ServiceDefinitionProxy> services;
public CatalogConfig() {
super();
}
#Bean
Catalog catalog() {
return new Catalog(services.stream().map(s -> s.unproxy())
.collect(Collectors.toList()));
}
public CatalogConfig(List<ServiceDefinitionProxy> services) {
super();
this.services = services;
}
public List<ServiceDefinitionProxy> getServices() {
return services;
}
public void setServices(List<ServiceDefinitionProxy> services) {
this.services = services;
}
public ServiceDefinitionProxy findServiceDefinition(String serviceId) {
return services.stream().filter(s -> s.getId().equals(serviceId))
.findFirst().get();
}
}
Manifest.yml
---
applications:
- name: my-service-broker
memory: 512M
instances: 1
host: my-service-broker
path: target/my-service-broker-1.0.0-SNAPSHOT.jar
env:
SPRING_PROFILES_DEFAULT: cloud
catalog:
services:
- id: f1478faa-d980-11e5-b5d2-0a1d41d68578
name: api-marketpace
description: API Marketplace
bindable: true
planUpdatable: true
head-type: api
tags:
- api
- Manage API Marketplace
metadata:
displayName: API Marketplace
imageUrl: https://my-service-broker.cf.com/images/logo.PNG
longDescription: API Marketplace.
providerDisplayName: API Team
documentationUrl: https://wikihub.com/display/ASC/Training
supportUrl: https://wikihub.com/display/ASC/Training
plans:
- id: f1478faa-d980-11e5-b5d2-0a1d41d68579
name: unlimited
description: free
metadata:
costs:
- amount:
usd: 0.00
unit: PER MONTH
bullets:
- Basic Unlimited
dashboardClient:
id: api-marketpace
secret: secret
redirectUrl: https://api.cf.com/
That won't work.
The manifest.yml file is used exclusively by the cf CLI to provide options when pushing apps to CF. Deployed applications never see this file or any of its contents. In fact the CF platform itself never sees the file or its contents - it is purely processed by the CLI on the client side.
The application.yml file is used by Spring Boot and the contents are provided to the app via #ConfigurationProperties and other means.
These are two completely separate concepts and mechanisms, both of which happen to use the YAML data format.

Resources