Class Standard.User
- Namespace
- Dynamicweb.Notifications
- Assembly
- Dynamicweb.dll
Provides notification names for Users.
- Inheritance
-
Standard.
User
- Inherited Members
Examples
namespace Dynamicweb.Examples.Notifications.Standard
{
[Dynamicweb.Extensibility.Notifications.Subscribe(Dynamicweb.Notifications.Standard.User.OnExtranetLogin)]
public class OnExtranetLogOnObserver : Dynamicweb.Extensibility.Notifications.NotificationSubscriber
{
public override void OnNotify(string notification, Dynamicweb.Extensibility.Notifications.NotificationArgs args)
{
if (args == null)
return;
if (!(args is Dynamicweb.Notifications.Standard.User.OnExtranetLoginArgs))
return;
Dynamicweb.Notifications.Standard.User.OnExtranetLoginArgs item = (Dynamicweb.Notifications.Standard.User.OnExtranetLoginArgs)args;
//Pass user name to the notification e-mail
string emailBody = string.Format("The user ({0}) has been logged-in.", item.User.Name);
}
}
}
Fields
OnBeforeExtranetLogOff
User before extranet LogOff notification. Occurs when user is logging off, but before the user have been logged out and the session is killed.
Field Value
Examples
namespace Dynamicweb.Examples.Notifications.Standard
{
[Dynamicweb.Extensibility.Notifications.Subscribe(Dynamicweb.Notifications.Standard.User.OnBeforeExtranetLogOff)]
public class OnBeforeExtranetLogOffObserver : Dynamicweb.Extensibility.Notifications.NotificationSubscriber
{
public override void OnNotify(string notification, Dynamicweb.Extensibility.Notifications.NotificationArgs args)
{
if (args == null)
return;
Dynamicweb.Notifications.Standard.User.OnBeforeExtranetLogOffArgs onBeforeExtranetLogOffArgs = args as Dynamicweb.Notifications.Standard.User.OnBeforeExtranetLogOffArgs;
//Add code here
}
}
}
Remarks
The passed NotificationArgs is Dynamicweb.
OnBeforeExtranetLogin
The on before extranet login event
Field Value
OnBeforeForgotPassword
Forgotten password notification. Occurs before user is found in database.
Field Value
Remarks
The passed NotificationArgs is Dynamicweb.
OnExtranetLogin
User extranet login notification. Occurs when the user successfully logged in
Field Value
Examples
namespace Dynamicweb.Examples.Notifications.Standard
{
[Dynamicweb.Extensibility.Notifications.Subscribe(Dynamicweb.Notifications.Standard.User.OnExtranetLogin)]
public class OnExtranetLogOnObserver : Dynamicweb.Extensibility.Notifications.NotificationSubscriber
{
public override void OnNotify(string notification, Dynamicweb.Extensibility.Notifications.NotificationArgs args)
{
if (args == null)
return;
if (!(args is Dynamicweb.Notifications.Standard.User.OnExtranetLoginArgs))
return;
Dynamicweb.Notifications.Standard.User.OnExtranetLoginArgs item = (Dynamicweb.Notifications.Standard.User.OnExtranetLoginArgs)args;
//Pass user name to the notification e-mail
string emailBody = string.Format("The user ({0}) has been logged-in.", item.User.Name);
}
}
}
Remarks
The passed NotificationArgs is Dynamicweb.
OnExtranetLoginFailed
User extranet login failed notification. Occurs when authorization failed
Field Value
Examples
using Dynamicweb.Security.UserManagement;
using System;
namespace Dynamicweb.Examples.Notifications.Standard
{
[Dynamicweb.Extensibility.Notifications.Subscribe(Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailed)]
public class OnExtranetLogOnFailedObserver : Dynamicweb.Extensibility.Notifications.NotificationSubscriber
{
public override void OnNotify(string notification, Dynamicweb.Extensibility.Notifications.NotificationArgs args)
{
if (args == null)
return;
if (!(args is Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs))
return;
Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs item = (Dynamicweb.Notifications.Standard.User.OnExtranetLoginFailedArgs)args;
//Throw exception if login is incorrect
if(item.FailedReason == LogOnFailedReason.IncorrectLogin)
throw new Exception("Incorrect login");
}
}
}
Remarks
The passed NotificationArgs is Dynamicweb.