It's not entirely clear to me from your explanation whether you are using the built-in functionality to prevent the users from logging in prior to their account activation.
More info on this in the documentation:
- Registration widget > Account activation http://docs.sitefinity.com/registration-widget
- Account activation widget
Now regarding your request, you can extend the Login widget functionality by creating a custom Web User Control in Visual Studio in order to implement some checks where you verify the user's role for example, or anything else for that matter.
Then, you map the widget in the backend, so that Sitefinity redirects to your custom Login widget instead of the regular one.
However since this one extends the default login widget there is a no way to override the actual sending of the email when submitting the email in order to retrieve the "reset password link".
I came up with following logic to work around that. After submitting the email, the control will check the user's role and if this one is of "applicant" then:
- the error will be displayed: "Your account not ready yet - it is waiting approval, please try again later .... "
- the email will be temporarily changed into another nonexisting email which will be forwarded to the Login widget. Since the email is not in the system no mail will be sent and the error catched.
For the widget markup I used the same as the regular Login widget. Of course all the above can be tailored by you.
You can copy the attached files in the root of your project and build the solution.
Afterwards you need to map in the backend the custom Login widget to the standard one.
For this you navigate to Administration » Settings » Advanced » Controls » ViewMap
and click Create new
In the HostType
field, enter the following value:
In the LayoutTemplatePath
, enter the path to the widget:
Now your Login widget should have the implemented logic.
You can also instead of mapping the custom widget to the standard one create a complete new widget/control that you register in the Toolboxes to be used on your page.
For this, please have a look at the sample in the documentation: NewsRotator widget: Create the NewsRotator as a user widget
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal
and vote to affect the priority of the items