How to add list of SonataUserBundle Users to admin dashboard (SonataAdminBundle)? - symfony-sonata

How to add Users to admin dashboard?
My app:
Symfony 2.0.16
FOSUserBundle 1.2.x
SonataAdminBundle
SonataMediaBundle
SonataPageBundle
SonataUserBundle
I've followed the instructions in sonata-project.org and I get no errors, but my admin dashboard is empty! I would like to manage my Users and Groups.
I don't know if thats relevant but Sonata is added in kernel as:
new SonataUserBundle('FOSUserBundle')
How to add CRUD for User's and Groups to my admin dashboard?
If you want to see my config, just tell me which part. I did not post all my configs, becouse there are alot of lines of code and I wanted to keep this question clean.

This config works well for me
sonata_admin:
...
dashboard:
...
groups:
...
user:
label: Users management
items:
- sonata.user.admin.user
- sonata.user.admin.group

It seems the docs in many parts are outdated or with typo's.
removeing groups
sonata_admin:
dashbpard:
groups:
default: ~
from config did the trick.

Related

How to make our customised dashboard as default dashboard on kibana

I have modified my dashboard and tried saving it as home and I get the below message
Home Set This page has been set as your default Kibana dashboard
Still I am not able to load the modified dashboard as default dashboard, please suggest me on how to do it.
For Kibana 4. Create dashboard with name "Default".
Change default_app_id in kibana/config/kibana.yml.
# The default application to load.
default_app_id: "dashboard/Default"
And then restart kibana to apply changes
service kibana restart
With kibana 4.4.2 it's OK with
kibana.defaultAppId: "dashboard/all.dashboard"
With a dashboard named all.dashboard
If you don't want to see dashboard as a first thing when you open that is still being resolved as you can see here:
https://github.com/elastic/kibana/pull/7626
What I did is hacked our local kibana, currently dashboard route resolver looks like this (found in %kibana_installation_path%\src\core_plugins\kibana\public\dashboard):
.when('/dashboard', {
template: indexTemplate,
resolve: {
dash: function (savedDashboards, config) {
return savedDashboards.get();
}
}
})
I just changed savedDashboards.get() -> savedDashboards.get('System-overview')
where System-overview is name of our dashboard (you can see it in url when you open your dashboard)
if you don't want to compile that change you will have to change it directly in the minified file which can be found here:
%kibana_installation_path%\optimize\bundles\kibana.bundle.js
I have found the solution to show default dashboard in kibana :-
Steps :-
Copy id of the dashboard. For that go to your dashboard which you want to show as a default. At top right corner - click on SHARE after that you will see a link url something like :- http://localhost:5601/app/kibana#/dashboard/b55f44a0-4a78-11e7-8976-bcua7acbj?_g=()
From the url copy id after dashboard/ like in this url id is :- b55f44a0-4a78-11e7-8976-bcua7acbj
Go to kibana/config/kibana.yml file and change :-
kibana.defaultAppId: "discover" to
kibana.defaultAppId: "dashboard/b55f44a0-4a78-11e7-8976-bcua7acbj"
Now restart kibana.service :- "sudo systemctl restart kibana.service"
And it is done :)

Joomla3 - Warning You cannot access the private section of this site

My joomla is 3.3.6. Just installed. All php configuration are as it's required.
I have create a new Group at backend:
https://www.evernote.com/shard/s396/sh/ ... 2973ff37f1
After i did that, i turned the "New User Registration Group" at Users Configuration (tab component) to my new Group "Volunteer":
https://www.evernote.com/shard/s396/sh/ ... 0843e0d80b
Then, in Frontend i registered a new user as usual with the register form. Here you can see is saved at backend as a user in the Volunteer Group: [dont have 10 point of rep] imagin the picture
Now i go to my login in my frontend, i do the login with my user and pass and i got this:
[dont have 10 point of rep] imagin the picture
Does anyone know why the system is throwing me this Warning:
??? I really appreciate the help.
Thnaks All
It means the page that it redirects to after logging in is for "Registered" users (users in the Registered user group), not Volunteers.

Grails Spring Security & LDAP Auth Failure

ISSUE: Grails ADMIN logs in via LDAP but no other account does.
System = Win 7, grails 2.2.1, Active Dir lightweight
I have created a simple grails default application, installed the latest grails spring security and ldap plugins. I then followed the following tutorial to configure the spring security setup. Tutorial located at http://blog.springsource.com/2010/08/11/simplified-spring-security-with-grails/
Anyway got spring security working fairly fast, next step was setting up LDAP to use the anonymousAuthenticationProvider so my grails app would log in without checking its own DB for passwords, only LDAP. I am using windows Active Directory. Anyway, followed this configuration setup http://grails-plugins.github.io/grails-spring-security-ldap/docs/manual/guide/2.%20Usage.html . All seems to start fine, except the only user that seems to log in correctly is admin, no other user works. I get a can not find user with that username / password error. I have added error, warn and info log output for spring security but does not seem to give much info at all except for the admin account which actually works. I verified it works as I gave the spring security db password a different password to the ldap password, and once the ldap was configured the only password that worked for the admin was the ldap one. Unfortunately no other users worked though.
Here is my grails config:
// Added by the Spring Security Core plugin:
grails.plugins.springsecurity.userLookup.userDomainClassName = 'org.example.SecUser'
grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'org.example.SecUserSecRole'
grails.plugins.springsecurity.authority.className = 'org.example.SecRole'
grails.plugins.springsecurity.ldap.context.managerDn = 'CN=admin,OU=people,OU=imApp,DC=example,DC=org'
grails.plugins.springsecurity.ldap.context.managerPassword = 'password'
grails.plugins.springsecurity.ldap.context.server = 'ldap://localhost:55000/'
grails.plugins.springsecurity.ldap.authorities.ignorePartialResultException = true
grails.plugins.springsecurity.ldap.search.base = 'OU=people,OU=imApp,DC=example,DC=org'
grails.plugins.springsecurity.ldap.search.filter='uid={0}' //ad use sAMAccountName instead of uid
grails.plugins.springsecurity.ldap.search.searchSubtree =true
grails.plugins.springsecurity.ldap.auth.hideUserNotFoundExceptions= false
grails.plugins.springsecurity.ldap.search.derefLink = true
// specify this when you want to skip attempting to load from db and only use LDAP
grails.plugins.springsecurity.providerNames = ['ldapAuthProvider', 'anonymousAuthenticationProvider']
grails.plugins.springsecurity.conf.ldap.authorities.retrieveGroupRoles = false
grails.plugins.springsecurity.conf.ldap.authorities.retrieveDatabaseRoles = false
//grails.plugins.springsecurity.ldap.authorities.groupSearchBase = 'ou=groups,ou=imApp,dc=mcommunity,dc=org'
//role specific ldap config
grails.plugins.springsecurity.ldap.useRememberMe = false
I have tried a few variations of this config, for example it says Active Dir requires sAMAccountName as the search.filter but when I use this no accounts work, if i comment it out completely it works as already memntioned, admin logs in but no other account does. If I remove the springsecurity.providerNames the app starts but uses DB as password auth provider. I came across some blogs mentioned removing password for model class and db, or making it null-able which I tried but had no effect on outcome.
My Active Dir structure is as follows:
DC=example,dc=org
OU=imApp
OU=groups
OU=people
CN=admin user CN=admin,OU=people,OU=imApp,DC=example,DC=org
CN=user1 user CN=user1,OU=people,OU=imApp,DC=example,DC=org
CN=LostAndFound
CN= NTDS Quotas
CN=Roles
I have given each account a LDAP password, and added a parameter uid matching that of their username (CN). I have not used a Custom UserDetailsContextMapper, just default. However, I did try a Custom UserDetailsContextMapper and just came across the same issue, so reverted back to using just standard. Also I noticed Active Dir has a lower case dc for org so I tried using same lower case dc in Grails config but has same result.
Has anyone come across this issue or know where I may be going worng? Any help appreciated.
Best,
Marklw16
Try these settings:
grails.plugins.springsecurity.ldap.authorities.groupSearchBase ='DC=example,dc=org'
grails.plugins.springsecurity.ldap.authorities.groupSearchFilter = 'member={0}'

Raven-js errors not getting "site" property in sentry, while python raven errors are?

I have three python clients and a javascript client (all raven) connecting to a single sentry server. I have a unique site set for each client. However, while errors generated by the three python clients have site properly set in the sentry interface, errors generated by the javascript client have no site set.
My raven-js setup (pardon my Django):
require(['lib/raven-1.0.7'], function(Raven){
Raven.config('{% sentry_public_dsn %}', {
// escapere is a custom tag, simply wraps python's re.escape
includePaths: [new RegExp('{{ request.build_absolute_uri|escapere }}')],
site: 'AJAX'
}).install();
Raven.setUser({
email: "{{ user.email|escapejs }}",
id: "{{ user.id|escapejs }}"
});
});
I did a little bit of digging in the sentry code (using the highly scientific scatter-some-logging-statements-around method), and I'm convinced that the "site" parameter is, indeed, being sent to the sentry API, but for some reason it's getting lost between there and creating the actual event Group.
It seems sentry is moving away from the site parameter in favor of tags. Upgrading to the latest master from the raven-js repo and changing
site: 'AJAX'
to
tags: {site: 'AJAX'}
Makes things behave as expected.

Linking to Magento Admin from Outside Admin Panel

I'm trying to build some CRM tools that send emails to my sales guys and link back to pages inside the Magento Admin. I've been building the URLS like this:
Mage::getUrl('*/quotes/edit', array('id'=>$quote->getQuoteId(), '_current'=>true))
The problem is it only sends them to the dashboard. I'm assuming it is because the setting for "_current" is changed when they login, thus invalidating the link and sending them to the default page. Any ideas on how I could make a link into the Admin that doesn't include the session in the url?
I came up with the following that turns off the secret key based on the action name:
public function preDispatch()
{
if ($this->getRequest()->getActionName() == 'update') Mage::getSingleton('adminhtml/url')->turnOffSecretKey();
parent::preDispatch();
}
Tested in ver 1.6.2.0. Paste that in your controller, don't forget to change the action name 'update' to yours or remove the if statement to effect for all actions within your controller.
Disabling secret key from admin URLs should solve your problem.
To disable secret key from admin URLs:-
Login to admin
Go to System -> Configuration -> ADVANCED -> Admin -> Security -> Add Secret Key to URLs
Select No
Save Config

Resources