Drupal 8: How to add personal contact form for user only on a certain type of users content? - drupal-modules

On my site, anonymous and authenticated users can both create content of the content type 'job'. What I want to do is create an application form that displays as a block on 'job' pages for authenticated users only(i can do up to here). I want the results of the form to be emailed to the user who created that job content.
How can this be accomplished?
Core 8.2.4
webforms module 8.x-5.0-beta2

Related

Log user into Kentico Admin site based on HttpHeader value from Siteminder

My company has just obtained Kentico for some new applications. These applications will be going into production in about 2 weeks, so we are still fairly new with this. What we have are three ASP.NET MVC applications/sites that format and present content that is stored in Kentico. Additionally, we have specific users who will log into the Kentico9/Admin site to manage the content displayed by the MVC apps.
From a corporate standpoint, we also have Siteminder SSO enabled. When a user navigates to our Kentico9/Admin site, they are first authenticated by our corporate Siteminder SSO form using their corporate user id. When they are successfully authenticated, Siteminder redirects the user to the Kentico9/Admin site they originally requested and the user is presented with the standard Kentico login form. If the user has already logged in through Siteminder during another session, they only get presented with the Kentico login form. Otherwise, if this is their first time logging in, the user is required to login twice (once through Siteminder and again through Kentico).
What I want to do is bypass the standard Kentico login form and use the Siteminder information to Authorize the user to log them into the Kentico admin site. Siteminder adds the username and some other information to the HTTP request headers. Using C#, I can retrieve their corporate user id using the following: System.Web.HttpContext.Current.Request.Headers.Get("SM_USERID").
So, in a nutshell, I want to override Kentico's standard login form and write some code that will get the user id from the HTTP request header and authorize the user by looking up their userid in Kentico. If the user id is not found or is not active, present the user with the standard Kentico login form. Otherwise, if the user is a valid and active user, pull their user record and allow them to access Kentico.
I have found some tidbits of information and given enough time, I may be able to figure something out, but I am hoping someone has done something similar and can speed up my process. Any ideas on what I can do? I will also entertain anything that might have tighter integration with Siteminder, although it doesn't seem Kentico can handle Siteminder out of the box, but I am not sure about that.
Sounds like you might be able to create a custom webpart which you will place on a page and simply have Siteminder redirect the user to the page with that webpart on it and look for those header values on page load. If it finds them, perform your actions within Kentico to look that user up and authenticate them in Kentico as needed. If there are no header values or it can't find the Kentico info, simply send them to the regular login page.
You could also create a global event handler but that would require someone to click a button or such on your site after they have entered credentials.

Kentico 9 - How to get assigned role info or name to a document

In Kentico 9 application, assigned different role to specific documents, so that only authorized user can have access of that specific document or page.
There is drop down list showing page list, and need to show only those page which have same access role as logged in user have.
Is there in kentico in built macro available to achieve same or what kentico API could be used to get document assigned role in transformation or grammatically?
If you're using some viewer web part, like repeater, there is a checkbox in web part settings saying check permissions - this will return only documents current user can see.
If you're pulling documents in code behind use document query CheckPermissions method like this:
DocumentHelper.GetDocuments()
.Published()
.Where(where)
.CheckPermissions();

NetSuite customized Customer Login

My use case is that I would like customers to log in via a custom Login Form I have created, but not from NetSuite Login which is publicly accessible. How can I achieve that?Any ideas?
One way to do your own branded custom login page (with your own HTML/CSS), is by creating a form that on submit sends a POST request to https://system.netsuite.com/app/webservices/wslogin.nl?c=######
where ##### is your netsuite account number
the form must submit following attributes:
email
password
taskid // see the help topic Task Ids for valid values e.g.: LIST_MYROLES
role // not required if has a default role specified on the View All Roles page
I don't think that there is a way to block the normal UI login so, that only custom login is allowed.
In addition to what Prasun wrote there are a couple of different approaches to custom login/reg forms.
One is to just hack the login form so that it looks and behaves like you want it to. See the login/registration at http://www.lablearning.com/
The other is to create your own login page using an SSP page and install it to override the built-in login/registration.

Sharepoint 2013 - how to attach document to a document library as anonymous user

I have a document library on Sharepoint2013 site. I want anonymous users to access this list and can upload any documents they want after specifying their email address. I directed to list settings and allow anonymous access on permissions like below.
Name Type Permission Levels
Anonymous Users Anonymous Users Add Items, Edit Items, Delete Items, View Items
Right now, anonymous users can access the document library without a problem. Those users can click save button without selecting a document, this is working and a record exists. However, when a document is uploaded by anonymous users, when save button is clicked, the user is automatically directed to a login page, asking for credentials, without saving the document. What I want is that anonymous users would upload any document to the document library as well, they should not need to log in.
I appreciate if anyone helps.
Thanks.
Anonymous users are unable to upload documents into SharePoint libraries by default, so you would have to create a webpart and use the RunWithElevatedPrivileges method to upload files into a document library.
You can find the webpart's code here:
http://andreaswijayablog.blogspot.com.br/2014/04/sharepoint-2013-anonymous-access-add.html

I am facing some trouble while rendering page

I have a page of my website..
In that page I have a registration forms and videos and some text...
When I register in registration page and then come back to this page already registered, then registration box disappears..
It looks I have left my rendered tags set to hide the reg form if they are logged in.
Code I am using for that --
<c:HomePageRightReglanding rendered="{!ISPICKVAL($User.UserType,'Guest')}" />
HomePageRightReglanding my component name where I have form to display ...
Please help me out !!
The user to access a public site who user type is guest, but if you have registered, the user type will be change.
The user type is depended on user license.
The category of user license. Each UserType is associated with one or more UserLicense records. Each UserLicense is associated with one or more profiles. In API version 10.0 and later, valid values include:
Standard: user license. This user type also includes Salesforce Platform and Salesforce Platform One user licenses. Label is Standard.
PowerPartner: PRM user whose access is limited because he or she is a partner and typically accesses the application through a partner portal. Label is Partner.
CSPLitePortal: user whose access is limited because he or she is an organization's customer and accesses the application through aCustomer Portal. Label is High Volume Portal.
CustomerSuccess: user whose access is limited because he or she is an organization's customer and accesses the application through a Customer Portal. Label is Customer Portal User.
PowerCustomerSuccess: user whose access is limited because he or she is an organization's customer and accesses the application through a Customer Portal. Label is Customer Portal Manager.
Users with this license type can view and edit data they directly own or data owned by or shared with users below them in the Customer Portal role hierarchy.

Resources