Websitepanel user account lockout and state management added
This commit is contained in:
parent
008fc296d5
commit
72348041f0
27 changed files with 1705 additions and 373 deletions
|
@ -667,6 +667,8 @@ CREATE TABLE [dbo].[Users](
|
||||||
[CompanyName] [nvarchar](100) COLLATE Latin1_General_CI_AS NULL,
|
[CompanyName] [nvarchar](100) COLLATE Latin1_General_CI_AS NULL,
|
||||||
[EcommerceEnabled] [bit] NULL,
|
[EcommerceEnabled] [bit] NULL,
|
||||||
[AdditionalParams] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL,
|
[AdditionalParams] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL,
|
||||||
|
[LoginStatusId] [int] NULL,
|
||||||
|
[FailedLogins] [int] NULL,
|
||||||
CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED
|
CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED
|
||||||
(
|
(
|
||||||
[UserID] ASC
|
[UserID] ASC
|
||||||
|
@ -9749,7 +9751,7 @@ GO
|
||||||
|
|
||||||
CREATE VIEW [dbo].[UsersDetailed]
|
CREATE VIEW [dbo].[UsersDetailed]
|
||||||
AS
|
AS
|
||||||
SELECT U.UserID, U.RoleID, U.StatusID, U.OwnerID, U.Created, U.Changed, U.IsDemo, U.Comments, U.IsPeer, U.Username, U.FirstName, U.LastName, U.Email,
|
SELECT U.UserID, U.RoleID, U.StatusID, U.LoginStatusId, U.FailedLogins, U.OwnerID, U.Created, U.Changed, U.IsDemo, U.Comments, U.IsPeer, U.Username, U.FirstName, U.LastName, U.Email,
|
||||||
U.CompanyName, U.FirstName + ' ' + U.LastName AS FullName, UP.Username AS OwnerUsername, UP.FirstName AS OwnerFirstName,
|
U.CompanyName, U.FirstName + ' ' + U.LastName AS FullName, UP.Username AS OwnerUsername, UP.FirstName AS OwnerFirstName,
|
||||||
UP.LastName AS OwnerLastName, UP.RoleID AS OwnerRoleID, UP.FirstName + ' ' + UP.LastName AS OwnerFullName, UP.Email AS OwnerEmail, UP.RoleID AS Expr1,
|
UP.LastName AS OwnerLastName, UP.RoleID AS OwnerRoleID, UP.FirstName + ' ' + UP.LastName AS OwnerFullName, UP.Email AS OwnerEmail, UP.RoleID AS Expr1,
|
||||||
(SELECT COUNT(PackageID) AS Expr1
|
(SELECT COUNT(PackageID) AS Expr1
|
||||||
|
@ -11983,6 +11985,8 @@ SELECT
|
||||||
U.UserID,
|
U.UserID,
|
||||||
U.RoleID,
|
U.RoleID,
|
||||||
U.StatusID,
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
U.OwnerID,
|
U.OwnerID,
|
||||||
U.Created,
|
U.Created,
|
||||||
U.Changed,
|
U.Changed,
|
||||||
|
@ -12048,6 +12052,7 @@ RETURN
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GO
|
GO
|
||||||
|
@ -12085,7 +12090,7 @@ GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CREATE PROCEDURE GetUserDomainsPaged
|
CREATE PROCEDURE [dbo].[GetUserDomainsPaged]
|
||||||
(
|
(
|
||||||
@ActorID int,
|
@ActorID int,
|
||||||
@UserID int,
|
@UserID int,
|
||||||
|
@ -12134,6 +12139,8 @@ SELECT
|
||||||
U.UserID,
|
U.UserID,
|
||||||
U.RoleID,
|
U.RoleID,
|
||||||
U.StatusID,
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
U.OwnerID,
|
U.OwnerID,
|
||||||
U.Created,
|
U.Created,
|
||||||
U.Changed,
|
U.Changed,
|
||||||
|
@ -12187,7 +12194,6 @@ RETURN
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GO
|
GO
|
||||||
|
@ -19490,6 +19496,8 @@ AS
|
||||||
U.UserID,
|
U.UserID,
|
||||||
U.RoleID,
|
U.RoleID,
|
||||||
U.StatusID,
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
U.OwnerID,
|
U.OwnerID,
|
||||||
U.Created,
|
U.Created,
|
||||||
U.Changed,
|
U.Changed,
|
||||||
|
@ -19536,6 +19544,8 @@ AS
|
||||||
U.UserID,
|
U.UserID,
|
||||||
U.RoleID,
|
U.RoleID,
|
||||||
U.StatusID,
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
U.OwnerID,
|
U.OwnerID,
|
||||||
U.Created,
|
U.Created,
|
||||||
U.Changed,
|
U.Changed,
|
||||||
|
@ -19897,6 +19907,8 @@ SELECT
|
||||||
U.UserID,
|
U.UserID,
|
||||||
U.RoleID,
|
U.RoleID,
|
||||||
U.StatusID,
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
U.OwnerID,
|
U.OwnerID,
|
||||||
U.Created,
|
U.Created,
|
||||||
U.Changed,
|
U.Changed,
|
||||||
|
@ -20015,6 +20027,8 @@ SELECT
|
||||||
U.UserID,
|
U.UserID,
|
||||||
U.RoleID,
|
U.RoleID,
|
||||||
U.StatusID,
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
U.OwnerID,
|
U.OwnerID,
|
||||||
U.Created,
|
U.Created,
|
||||||
U.Changed,
|
U.Changed,
|
||||||
|
@ -25166,6 +25180,7 @@ CREATE PROCEDURE [dbo].[AddUser]
|
||||||
@OwnerID int,
|
@OwnerID int,
|
||||||
@RoleID int,
|
@RoleID int,
|
||||||
@StatusID int,
|
@StatusID int,
|
||||||
|
@LoginStatusID int,
|
||||||
@IsDemo bit,
|
@IsDemo bit,
|
||||||
@IsPeer bit,
|
@IsPeer bit,
|
||||||
@Comments ntext,
|
@Comments ntext,
|
||||||
|
@ -25209,6 +25224,7 @@ INSERT INTO Users
|
||||||
OwnerID,
|
OwnerID,
|
||||||
RoleID,
|
RoleID,
|
||||||
StatusID,
|
StatusID,
|
||||||
|
LoginStatusID,
|
||||||
Created,
|
Created,
|
||||||
Changed,
|
Changed,
|
||||||
IsDemo,
|
IsDemo,
|
||||||
|
@ -25238,6 +25254,7 @@ VALUES
|
||||||
@OwnerID,
|
@OwnerID,
|
||||||
@RoleID,
|
@RoleID,
|
||||||
@StatusID,
|
@StatusID,
|
||||||
|
@LoginStatusID,
|
||||||
GetDate(),
|
GetDate(),
|
||||||
GetDate(),
|
GetDate(),
|
||||||
@IsDemo,
|
@IsDemo,
|
||||||
|
@ -25305,7 +25322,6 @@ RETURN
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GO
|
GO
|
||||||
|
@ -25444,6 +25460,7 @@ CREATE PROCEDURE [dbo].[UpdateUser]
|
||||||
@UserID int,
|
@UserID int,
|
||||||
@RoleID int,
|
@RoleID int,
|
||||||
@StatusID int,
|
@StatusID int,
|
||||||
|
@LoginStatusId int,
|
||||||
@IsDemo bit,
|
@IsDemo bit,
|
||||||
@IsPeer bit,
|
@IsPeer bit,
|
||||||
@Comments ntext,
|
@Comments ntext,
|
||||||
|
@ -25473,9 +25490,17 @@ AS
|
||||||
RETURN
|
RETURN
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IF @LoginStatusId = 0
|
||||||
|
BEGIN
|
||||||
|
UPDATE Users SET
|
||||||
|
FailedLogins = 0
|
||||||
|
WHERE UserID = @UserID
|
||||||
|
END
|
||||||
|
|
||||||
UPDATE Users SET
|
UPDATE Users SET
|
||||||
RoleID = @RoleID,
|
RoleID = @RoleID,
|
||||||
StatusID = @StatusID,
|
StatusID = @StatusID,
|
||||||
|
LoginStatusId = @LoginStatusId,
|
||||||
Changed = GetDate(),
|
Changed = GetDate(),
|
||||||
IsDemo = @IsDemo,
|
IsDemo = @IsDemo,
|
||||||
IsPeer = @IsPeer,
|
IsPeer = @IsPeer,
|
||||||
|
@ -25522,17 +25547,44 @@ GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CREATE PROCEDURE [dbo].[UpdateUserFailedLoginAttempt]
|
||||||
|
(
|
||||||
|
@UserID int,
|
||||||
|
@LockOut int,
|
||||||
|
@Reset int
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
|
||||||
|
IF (@Reset = 1)
|
||||||
|
BEGIN
|
||||||
|
UPDATE Users SET FailedLogins = 0 WHERE UserID = @UserID
|
||||||
|
END
|
||||||
|
ELSE
|
||||||
|
BEGIN
|
||||||
|
IF (@LockOut <= (SELECT FailedLogins FROM USERS WHERE UserID = @UserID))
|
||||||
|
BEGIN
|
||||||
|
UPDATE Users SET LoginStatusId = 2 WHERE UserID = @UserID
|
||||||
|
END
|
||||||
|
ELSE
|
||||||
|
BEGIN
|
||||||
|
IF ((SELECT FailedLogins FROM Users WHERE UserID = @UserID) IS NULL)
|
||||||
|
BEGIN
|
||||||
|
UPDATE Users SET FailedLogins = 1 WHERE UserID = @UserID
|
||||||
|
END
|
||||||
|
ELSE
|
||||||
|
UPDATE Users SET FailedLogins = FailedLogins + 1 WHERE UserID = @UserID
|
||||||
|
END
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GO
|
||||||
|
SET ANSI_NULLS ON
|
||||||
|
GO
|
||||||
|
SET QUOTED_IDENTIFIER ON
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CREATE PROCEDURE DeleteComment
|
CREATE PROCEDURE DeleteComment
|
||||||
|
@ -28695,6 +28747,8 @@ SELECT
|
||||||
U.UserID,
|
U.UserID,
|
||||||
U.RoleID,
|
U.RoleID,
|
||||||
U.StatusID,
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
U.OwnerID,
|
U.OwnerID,
|
||||||
U.Created,
|
U.Created,
|
||||||
U.Changed,
|
U.Changed,
|
||||||
|
@ -28861,6 +28915,8 @@ AS
|
||||||
U.UserID,
|
U.UserID,
|
||||||
U.RoleID,
|
U.RoleID,
|
||||||
U.StatusID,
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
U.OwnerID,
|
U.OwnerID,
|
||||||
U.Created,
|
U.Created,
|
||||||
U.Changed,
|
U.Changed,
|
||||||
|
@ -28912,6 +28968,8 @@ AS
|
||||||
U.UserID,
|
U.UserID,
|
||||||
U.RoleID,
|
U.RoleID,
|
||||||
U.StatusID,
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
U.OwnerID,
|
U.OwnerID,
|
||||||
U.Created,
|
U.Created,
|
||||||
U.Changed,
|
U.Changed,
|
||||||
|
|
|
@ -1009,6 +1009,15 @@ END
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='Users' AND COLS.name='LoginStatusId')
|
||||||
|
BEGIN
|
||||||
|
ALTER TABLE [dbo].[Users] ADD
|
||||||
|
[LoginStatusId] [int] NULL,
|
||||||
|
[FailedLogins] [int] NULL
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='GlobalDnsRecords' AND COLS.name='SrvPriority')
|
IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='GlobalDnsRecords' AND COLS.name='SrvPriority')
|
||||||
BEGIN
|
BEGIN
|
||||||
ALTER TABLE [dbo].[GlobalDnsRecords] ADD
|
ALTER TABLE [dbo].[GlobalDnsRecords] ADD
|
||||||
|
@ -1028,6 +1037,19 @@ UPDATE [dbo].[ResourceGroups] SET ShowGroup=1
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
ALTER VIEW [dbo].[UsersDetailed]
|
||||||
|
AS
|
||||||
|
SELECT U.UserID, U.RoleID, U.StatusID, U.LoginStatusId, U.FailedLogins, U.OwnerID, U.Created, U.Changed, U.IsDemo, U.Comments, U.IsPeer, U.Username, U.FirstName, U.LastName, U.Email,
|
||||||
|
U.CompanyName, U.FirstName + ' ' + U.LastName AS FullName, UP.Username AS OwnerUsername, UP.FirstName AS OwnerFirstName,
|
||||||
|
UP.LastName AS OwnerLastName, UP.RoleID AS OwnerRoleID, UP.FirstName + ' ' + UP.LastName AS OwnerFullName, UP.Email AS OwnerEmail, UP.RoleID AS Expr1,
|
||||||
|
(SELECT COUNT(PackageID) AS Expr1
|
||||||
|
FROM dbo.Packages AS P
|
||||||
|
WHERE (UserID = U.UserID)) AS PackagesNumber, U.EcommerceEnabled
|
||||||
|
FROM dbo.Users AS U LEFT OUTER JOIN
|
||||||
|
dbo.Users AS UP ON U.OwnerID = UP.UserID
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
ALTER PROCEDURE [dbo].[AddDnsRecord]
|
ALTER PROCEDURE [dbo].[AddDnsRecord]
|
||||||
(
|
(
|
||||||
@ActorID int,
|
@ActorID int,
|
||||||
|
@ -3920,6 +3942,169 @@ GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[AddUser]
|
||||||
|
(
|
||||||
|
@ActorID int,
|
||||||
|
@UserID int OUTPUT,
|
||||||
|
@OwnerID int,
|
||||||
|
@RoleID int,
|
||||||
|
@StatusID int,
|
||||||
|
@LoginStatusID int,
|
||||||
|
@IsDemo bit,
|
||||||
|
@IsPeer bit,
|
||||||
|
@Comments ntext,
|
||||||
|
@Username nvarchar(50),
|
||||||
|
@Password nvarchar(200),
|
||||||
|
@FirstName nvarchar(50),
|
||||||
|
@LastName nvarchar(50),
|
||||||
|
@Email nvarchar(255),
|
||||||
|
@SecondaryEmail nvarchar(255),
|
||||||
|
@Address nvarchar(200),
|
||||||
|
@City nvarchar(50),
|
||||||
|
@State nvarchar(50),
|
||||||
|
@Country nvarchar(50),
|
||||||
|
@Zip varchar(20),
|
||||||
|
@PrimaryPhone varchar(30),
|
||||||
|
@SecondaryPhone varchar(30),
|
||||||
|
@Fax varchar(30),
|
||||||
|
@InstantMessenger nvarchar(200),
|
||||||
|
@HtmlMail bit,
|
||||||
|
@CompanyName nvarchar(100),
|
||||||
|
@EcommerceEnabled bit
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
|
||||||
|
-- check if the user already exists
|
||||||
|
IF EXISTS(SELECT UserID FROM Users WHERE Username = @Username)
|
||||||
|
BEGIN
|
||||||
|
SET @UserID = -1
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
-- check actor rights
|
||||||
|
IF dbo.CanCreateUser(@ActorID, @OwnerID) = 0
|
||||||
|
BEGIN
|
||||||
|
SET @UserID = -2
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
INSERT INTO Users
|
||||||
|
(
|
||||||
|
OwnerID,
|
||||||
|
RoleID,
|
||||||
|
StatusID,
|
||||||
|
LoginStatusID,
|
||||||
|
Created,
|
||||||
|
Changed,
|
||||||
|
IsDemo,
|
||||||
|
IsPeer,
|
||||||
|
Comments,
|
||||||
|
Username,
|
||||||
|
Password,
|
||||||
|
FirstName,
|
||||||
|
LastName,
|
||||||
|
Email,
|
||||||
|
SecondaryEmail,
|
||||||
|
Address,
|
||||||
|
City,
|
||||||
|
State,
|
||||||
|
Country,
|
||||||
|
Zip,
|
||||||
|
PrimaryPhone,
|
||||||
|
SecondaryPhone,
|
||||||
|
Fax,
|
||||||
|
InstantMessenger,
|
||||||
|
HtmlMail,
|
||||||
|
CompanyName,
|
||||||
|
EcommerceEnabled
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
@OwnerID,
|
||||||
|
@RoleID,
|
||||||
|
@StatusID,
|
||||||
|
@LoginStatusID,
|
||||||
|
GetDate(),
|
||||||
|
GetDate(),
|
||||||
|
@IsDemo,
|
||||||
|
@IsPeer,
|
||||||
|
@Comments,
|
||||||
|
@Username,
|
||||||
|
@Password,
|
||||||
|
@FirstName,
|
||||||
|
@LastName,
|
||||||
|
@Email,
|
||||||
|
@SecondaryEmail,
|
||||||
|
@Address,
|
||||||
|
@City,
|
||||||
|
@State,
|
||||||
|
@Country,
|
||||||
|
@Zip,
|
||||||
|
@PrimaryPhone,
|
||||||
|
@SecondaryPhone,
|
||||||
|
@Fax,
|
||||||
|
@InstantMessenger,
|
||||||
|
@HtmlMail,
|
||||||
|
@CompanyName,
|
||||||
|
@EcommerceEnabled
|
||||||
|
)
|
||||||
|
|
||||||
|
SET @UserID = SCOPE_IDENTITY()
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[GetUserById]
|
||||||
|
(
|
||||||
|
@ActorID int,
|
||||||
|
@UserID int
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
-- user can retrieve his own account, his users accounts
|
||||||
|
-- and his reseller account (without pasword)
|
||||||
|
SELECT
|
||||||
|
U.UserID,
|
||||||
|
U.RoleID,
|
||||||
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
|
U.OwnerID,
|
||||||
|
U.Created,
|
||||||
|
U.Changed,
|
||||||
|
U.IsDemo,
|
||||||
|
U.Comments,
|
||||||
|
U.IsPeer,
|
||||||
|
U.Username,
|
||||||
|
CASE WHEN dbo.CanGetUserPassword(@ActorID, @UserID) = 1 THEN U.Password
|
||||||
|
ELSE '' END AS Password,
|
||||||
|
U.FirstName,
|
||||||
|
U.LastName,
|
||||||
|
U.Email,
|
||||||
|
U.SecondaryEmail,
|
||||||
|
U.Address,
|
||||||
|
U.City,
|
||||||
|
U.State,
|
||||||
|
U.Country,
|
||||||
|
U.Zip,
|
||||||
|
U.PrimaryPhone,
|
||||||
|
U.SecondaryPhone,
|
||||||
|
U.Fax,
|
||||||
|
U.InstantMessenger,
|
||||||
|
U.HtmlMail,
|
||||||
|
U.CompanyName,
|
||||||
|
U.EcommerceEnabled,
|
||||||
|
U.[AdditionalParams]
|
||||||
|
FROM Users AS U
|
||||||
|
WHERE U.UserID = @UserID
|
||||||
|
AND dbo.CanGetUserDetails(@ActorID, @UserID) = 1 -- actor user rights
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -3931,3 +4116,608 @@ GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[GetUserByIdInternally]
|
||||||
|
(
|
||||||
|
@UserID int
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
SELECT
|
||||||
|
U.UserID,
|
||||||
|
U.RoleID,
|
||||||
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
|
U.OwnerID,
|
||||||
|
U.Created,
|
||||||
|
U.Changed,
|
||||||
|
U.IsDemo,
|
||||||
|
U.Comments,
|
||||||
|
U.IsPeer,
|
||||||
|
U.Username,
|
||||||
|
U.Password,
|
||||||
|
U.FirstName,
|
||||||
|
U.LastName,
|
||||||
|
U.Email,
|
||||||
|
U.SecondaryEmail,
|
||||||
|
U.Address,
|
||||||
|
U.City,
|
||||||
|
U.State,
|
||||||
|
U.Country,
|
||||||
|
U.Zip,
|
||||||
|
U.PrimaryPhone,
|
||||||
|
U.SecondaryPhone,
|
||||||
|
U.Fax,
|
||||||
|
U.InstantMessenger,
|
||||||
|
U.HtmlMail,
|
||||||
|
U.CompanyName,
|
||||||
|
U.EcommerceEnabled,
|
||||||
|
U.[AdditionalParams]
|
||||||
|
FROM Users AS U
|
||||||
|
WHERE U.UserID = @UserID
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[GetUserByUsername]
|
||||||
|
(
|
||||||
|
@ActorID int,
|
||||||
|
@Username nvarchar(50)
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
U.UserID,
|
||||||
|
U.RoleID,
|
||||||
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
|
U.OwnerID,
|
||||||
|
U.Created,
|
||||||
|
U.Changed,
|
||||||
|
U.IsDemo,
|
||||||
|
U.Comments,
|
||||||
|
U.IsPeer,
|
||||||
|
U.Username,
|
||||||
|
CASE WHEN dbo.CanGetUserPassword(@ActorID, UserID) = 1 THEN U.Password
|
||||||
|
ELSE '' END AS Password,
|
||||||
|
U.FirstName,
|
||||||
|
U.LastName,
|
||||||
|
U.Email,
|
||||||
|
U.SecondaryEmail,
|
||||||
|
U.Address,
|
||||||
|
U.City,
|
||||||
|
U.State,
|
||||||
|
U.Country,
|
||||||
|
U.Zip,
|
||||||
|
U.PrimaryPhone,
|
||||||
|
U.SecondaryPhone,
|
||||||
|
U.Fax,
|
||||||
|
U.InstantMessenger,
|
||||||
|
U.HtmlMail,
|
||||||
|
U.CompanyName,
|
||||||
|
U.EcommerceEnabled,
|
||||||
|
U.[AdditionalParams]
|
||||||
|
FROM Users AS U
|
||||||
|
WHERE U.Username = @Username
|
||||||
|
AND dbo.CanGetUserDetails(@ActorID, UserID) = 1 -- actor user rights
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[GetUserByUsernameInternally]
|
||||||
|
(
|
||||||
|
@Username nvarchar(50)
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
SELECT
|
||||||
|
U.UserID,
|
||||||
|
U.RoleID,
|
||||||
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
|
U.OwnerID,
|
||||||
|
U.Created,
|
||||||
|
U.Changed,
|
||||||
|
U.IsDemo,
|
||||||
|
U.Comments,
|
||||||
|
U.IsPeer,
|
||||||
|
U.Username,
|
||||||
|
U.Password,
|
||||||
|
U.FirstName,
|
||||||
|
U.LastName,
|
||||||
|
U.Email,
|
||||||
|
U.SecondaryEmail,
|
||||||
|
U.Address,
|
||||||
|
U.City,
|
||||||
|
U.State,
|
||||||
|
U.Country,
|
||||||
|
U.Zip,
|
||||||
|
U.PrimaryPhone,
|
||||||
|
U.SecondaryPhone,
|
||||||
|
U.Fax,
|
||||||
|
U.InstantMessenger,
|
||||||
|
U.HtmlMail,
|
||||||
|
U.CompanyName,
|
||||||
|
U.EcommerceEnabled,
|
||||||
|
U.[AdditionalParams]
|
||||||
|
FROM Users AS U
|
||||||
|
WHERE U.Username = @Username
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[GetUserDomainsPaged]
|
||||||
|
(
|
||||||
|
@ActorID int,
|
||||||
|
@UserID int,
|
||||||
|
@FilterColumn nvarchar(50) = '',
|
||||||
|
@FilterValue nvarchar(50) = '',
|
||||||
|
@SortColumn nvarchar(50),
|
||||||
|
@StartRow int,
|
||||||
|
@MaximumRows int
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
-- build query and run it to the temporary table
|
||||||
|
DECLARE @sql nvarchar(2000)
|
||||||
|
|
||||||
|
SET @sql = '
|
||||||
|
DECLARE @HasUserRights bit
|
||||||
|
SET @HasUserRights = dbo.CheckActorUserRights(@ActorID, @UserID)
|
||||||
|
|
||||||
|
DECLARE @EndRow int
|
||||||
|
SET @EndRow = @StartRow + @MaximumRows
|
||||||
|
DECLARE @Users TABLE
|
||||||
|
(
|
||||||
|
ItemPosition int IDENTITY(1,1),
|
||||||
|
UserID int,
|
||||||
|
DomainID int
|
||||||
|
)
|
||||||
|
INSERT INTO @Users (UserID, DomainID)
|
||||||
|
SELECT
|
||||||
|
U.UserID,
|
||||||
|
D.DomainID
|
||||||
|
FROM Users AS U
|
||||||
|
INNER JOIN UsersTree(@UserID, 1) AS UT ON U.UserID = UT.UserID
|
||||||
|
LEFT OUTER JOIN Packages AS P ON U.UserID = P.UserID
|
||||||
|
LEFT OUTER JOIN Domains AS D ON P.PackageID = D.PackageID
|
||||||
|
WHERE
|
||||||
|
U.UserID <> @UserID AND U.IsPeer = 0
|
||||||
|
AND @HasUserRights = 1 '
|
||||||
|
|
||||||
|
IF @FilterColumn <> '' AND @FilterValue <> ''
|
||||||
|
SET @sql = @sql + ' AND ' + @FilterColumn + ' LIKE @FilterValue '
|
||||||
|
|
||||||
|
IF @SortColumn <> '' AND @SortColumn IS NOT NULL
|
||||||
|
SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' '
|
||||||
|
|
||||||
|
SET @sql = @sql + ' SELECT COUNT(UserID) FROM @Users;
|
||||||
|
SELECT
|
||||||
|
U.UserID,
|
||||||
|
U.RoleID,
|
||||||
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
|
U.OwnerID,
|
||||||
|
U.Created,
|
||||||
|
U.Changed,
|
||||||
|
U.IsDemo,
|
||||||
|
U.Comments,
|
||||||
|
U.IsPeer,
|
||||||
|
U.Username,
|
||||||
|
U.FirstName,
|
||||||
|
U.LastName,
|
||||||
|
U.Email,
|
||||||
|
D.DomainName
|
||||||
|
FROM @Users AS TU
|
||||||
|
INNER JOIN Users AS U ON TU.UserID = U.UserID
|
||||||
|
LEFT OUTER JOIN Domains AS D ON TU.DomainID = D.DomainID
|
||||||
|
WHERE TU.ItemPosition BETWEEN @StartRow AND @EndRow'
|
||||||
|
|
||||||
|
exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @UserID int, @FilterValue nvarchar(50), @ActorID int',
|
||||||
|
@StartRow, @MaximumRows, @UserID, @FilterValue, @ActorID
|
||||||
|
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[GetUserParents]
|
||||||
|
(
|
||||||
|
@ActorID int,
|
||||||
|
@UserID int
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
|
||||||
|
-- check rights
|
||||||
|
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
|
||||||
|
RAISERROR('You are not allowed to access this account', 16, 1)
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
U.UserID,
|
||||||
|
U.RoleID,
|
||||||
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
|
U.OwnerID,
|
||||||
|
U.Created,
|
||||||
|
U.Changed,
|
||||||
|
U.IsDemo,
|
||||||
|
U.Comments,
|
||||||
|
U.IsPeer,
|
||||||
|
U.Username,
|
||||||
|
U.FirstName,
|
||||||
|
U.LastName,
|
||||||
|
U.Email,
|
||||||
|
U.CompanyName,
|
||||||
|
U.EcommerceEnabled
|
||||||
|
FROM UserParents(@ActorID, @UserID) AS UP
|
||||||
|
INNER JOIN Users AS U ON UP.UserID = U.UserID
|
||||||
|
ORDER BY UP.UserOrder DESC
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[GetUserPeers]
|
||||||
|
(
|
||||||
|
@ActorID int,
|
||||||
|
@UserID int
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
|
||||||
|
DECLARE @CanGetDetails bit
|
||||||
|
SET @CanGetDetails = dbo.CanGetUserDetails(@ActorID, @UserID)
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
U.UserID,
|
||||||
|
U.RoleID,
|
||||||
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
|
U.OwnerID,
|
||||||
|
U.Created,
|
||||||
|
U.Changed,
|
||||||
|
U.IsDemo,
|
||||||
|
U.Comments,
|
||||||
|
U.IsPeer,
|
||||||
|
U.Username,
|
||||||
|
U.FirstName,
|
||||||
|
U.LastName,
|
||||||
|
U.Email,
|
||||||
|
U.FullName,
|
||||||
|
(U.FirstName + ' ' + U.LastName) AS FullName,
|
||||||
|
U.CompanyName,
|
||||||
|
U.EcommerceEnabled
|
||||||
|
FROM UsersDetailed AS U
|
||||||
|
WHERE U.OwnerID = @UserID AND IsPeer = 1
|
||||||
|
AND @CanGetDetails = 1 -- actor rights
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[GetUsers]
|
||||||
|
(
|
||||||
|
@ActorID int,
|
||||||
|
@OwnerID int,
|
||||||
|
@Recursive bit = 0
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
|
||||||
|
DECLARE @CanGetDetails bit
|
||||||
|
SET @CanGetDetails = dbo.CanGetUserDetails(@ActorID, @OwnerID)
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
U.UserID,
|
||||||
|
U.RoleID,
|
||||||
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
|
U.OwnerID,
|
||||||
|
U.Created,
|
||||||
|
U.Changed,
|
||||||
|
U.IsDemo,
|
||||||
|
U.Comments,
|
||||||
|
U.IsPeer,
|
||||||
|
U.Username,
|
||||||
|
U.FirstName,
|
||||||
|
U.LastName,
|
||||||
|
U.Email,
|
||||||
|
U.FullName,
|
||||||
|
U.OwnerUsername,
|
||||||
|
U.OwnerFirstName,
|
||||||
|
U.OwnerLastName,
|
||||||
|
U.OwnerRoleID,
|
||||||
|
U.OwnerFullName,
|
||||||
|
U.PackagesNumber,
|
||||||
|
U.CompanyName,
|
||||||
|
U.EcommerceEnabled
|
||||||
|
FROM UsersDetailed AS U
|
||||||
|
WHERE U.UserID <> @OwnerID AND
|
||||||
|
((@Recursive = 1 AND dbo.CheckUserParent(@OwnerID, U.UserID) = 1) OR
|
||||||
|
(@Recursive = 0 AND U.OwnerID = @OwnerID))
|
||||||
|
AND U.IsPeer = 0
|
||||||
|
AND @CanGetDetails = 1 -- actor user rights
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[GetUsersPaged]
|
||||||
|
(
|
||||||
|
@ActorID int,
|
||||||
|
@UserID int,
|
||||||
|
@FilterColumn nvarchar(50) = '',
|
||||||
|
@FilterValue nvarchar(50) = '',
|
||||||
|
@StatusID int,
|
||||||
|
@RoleID int,
|
||||||
|
@SortColumn nvarchar(50),
|
||||||
|
@StartRow int,
|
||||||
|
@MaximumRows int,
|
||||||
|
@Recursive bit
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
-- build query and run it to the temporary table
|
||||||
|
DECLARE @sql nvarchar(2000)
|
||||||
|
|
||||||
|
SET @sql = '
|
||||||
|
|
||||||
|
DECLARE @HasUserRights bit
|
||||||
|
SET @HasUserRights = dbo.CheckActorUserRights(@ActorID, @UserID)
|
||||||
|
|
||||||
|
DECLARE @EndRow int
|
||||||
|
SET @EndRow = @StartRow + @MaximumRows
|
||||||
|
DECLARE @Users TABLE
|
||||||
|
(
|
||||||
|
ItemPosition int IDENTITY(0,1),
|
||||||
|
UserID int
|
||||||
|
)
|
||||||
|
INSERT INTO @Users (UserID)
|
||||||
|
SELECT
|
||||||
|
U.UserID
|
||||||
|
FROM UsersDetailed AS U
|
||||||
|
WHERE
|
||||||
|
U.UserID <> @UserID AND U.IsPeer = 0 AND
|
||||||
|
(
|
||||||
|
(@Recursive = 0 AND OwnerID = @UserID) OR
|
||||||
|
(@Recursive = 1 AND dbo.CheckUserParent(@UserID, U.UserID) = 1)
|
||||||
|
)
|
||||||
|
AND ((@StatusID = 0) OR (@StatusID > 0 AND U.StatusID = @StatusID))
|
||||||
|
AND ((@RoleID = 0) OR (@RoleID > 0 AND U.RoleID = @RoleID))
|
||||||
|
AND @HasUserRights = 1 '
|
||||||
|
|
||||||
|
IF @FilterColumn <> '' AND @FilterValue <> ''
|
||||||
|
SET @sql = @sql + ' AND ' + @FilterColumn + ' LIKE @FilterValue '
|
||||||
|
|
||||||
|
IF @SortColumn <> '' AND @SortColumn IS NOT NULL
|
||||||
|
SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' '
|
||||||
|
|
||||||
|
SET @sql = @sql + ' SELECT COUNT(UserID) FROM @Users;
|
||||||
|
SELECT
|
||||||
|
U.UserID,
|
||||||
|
U.RoleID,
|
||||||
|
U.StatusID,
|
||||||
|
U.LoginStatusId,
|
||||||
|
U.FailedLogins,
|
||||||
|
U.OwnerID,
|
||||||
|
U.Created,
|
||||||
|
U.Changed,
|
||||||
|
U.IsDemo,
|
||||||
|
dbo.GetItemComments(U.UserID, ''USER'', @ActorID) AS Comments,
|
||||||
|
U.IsPeer,
|
||||||
|
U.Username,
|
||||||
|
U.FirstName,
|
||||||
|
U.LastName,
|
||||||
|
U.Email,
|
||||||
|
U.FullName,
|
||||||
|
U.OwnerUsername,
|
||||||
|
U.OwnerFirstName,
|
||||||
|
U.OwnerLastName,
|
||||||
|
U.OwnerRoleID,
|
||||||
|
U.OwnerFullName,
|
||||||
|
U.OwnerEmail,
|
||||||
|
U.PackagesNumber,
|
||||||
|
U.CompanyName,
|
||||||
|
U.EcommerceEnabled
|
||||||
|
FROM @Users AS TU
|
||||||
|
INNER JOIN UsersDetailed AS U ON TU.UserID = U.UserID
|
||||||
|
WHERE TU.ItemPosition BETWEEN @StartRow AND @EndRow'
|
||||||
|
|
||||||
|
exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @UserID int, @FilterValue nvarchar(50), @ActorID int, @Recursive bit, @StatusID int, @RoleID int',
|
||||||
|
@StartRow, @MaximumRows, @UserID, @FilterValue, @ActorID, @Recursive, @StatusID, @RoleID
|
||||||
|
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[UpdateUser]
|
||||||
|
(
|
||||||
|
@ActorID int,
|
||||||
|
@UserID int,
|
||||||
|
@RoleID int,
|
||||||
|
@StatusID int,
|
||||||
|
@LoginStatusId int,
|
||||||
|
@IsDemo bit,
|
||||||
|
@IsPeer bit,
|
||||||
|
@Comments ntext,
|
||||||
|
@FirstName nvarchar(50),
|
||||||
|
@LastName nvarchar(50),
|
||||||
|
@Email nvarchar(255),
|
||||||
|
@SecondaryEmail nvarchar(255),
|
||||||
|
@Address nvarchar(200),
|
||||||
|
@City nvarchar(50),
|
||||||
|
@State nvarchar(50),
|
||||||
|
@Country nvarchar(50),
|
||||||
|
@Zip varchar(20),
|
||||||
|
@PrimaryPhone varchar(30),
|
||||||
|
@SecondaryPhone varchar(30),
|
||||||
|
@Fax varchar(30),
|
||||||
|
@InstantMessenger nvarchar(200),
|
||||||
|
@HtmlMail bit,
|
||||||
|
@CompanyName nvarchar(100),
|
||||||
|
@EcommerceEnabled BIT,
|
||||||
|
@AdditionalParams NVARCHAR(max)
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
|
||||||
|
-- check actor rights
|
||||||
|
IF dbo.CanUpdateUserDetails(@ActorID, @UserID) = 0
|
||||||
|
BEGIN
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF @LoginStatusId = 0
|
||||||
|
BEGIN
|
||||||
|
UPDATE Users SET
|
||||||
|
FailedLogins = 0
|
||||||
|
WHERE UserID = @UserID
|
||||||
|
END
|
||||||
|
|
||||||
|
UPDATE Users SET
|
||||||
|
RoleID = @RoleID,
|
||||||
|
StatusID = @StatusID,
|
||||||
|
LoginStatusId = @LoginStatusId,
|
||||||
|
Changed = GetDate(),
|
||||||
|
IsDemo = @IsDemo,
|
||||||
|
IsPeer = @IsPeer,
|
||||||
|
Comments = @Comments,
|
||||||
|
FirstName = @FirstName,
|
||||||
|
LastName = @LastName,
|
||||||
|
Email = @Email,
|
||||||
|
SecondaryEmail = @SecondaryEmail,
|
||||||
|
Address = @Address,
|
||||||
|
City = @City,
|
||||||
|
State = @State,
|
||||||
|
Country = @Country,
|
||||||
|
Zip = @Zip,
|
||||||
|
PrimaryPhone = @PrimaryPhone,
|
||||||
|
SecondaryPhone = @SecondaryPhone,
|
||||||
|
Fax = @Fax,
|
||||||
|
InstantMessenger = @InstantMessenger,
|
||||||
|
HtmlMail = @HtmlMail,
|
||||||
|
CompanyName = @CompanyName,
|
||||||
|
EcommerceEnabled = @EcommerceEnabled,
|
||||||
|
[AdditionalParams] = @AdditionalParams
|
||||||
|
WHERE UserID = @UserID
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'UpdateUserFailedLoginAttempt')
|
||||||
|
BEGIN
|
||||||
|
EXEC sp_executesql N' CREATE PROCEDURE [dbo].[UpdateUserFailedLoginAttempt]
|
||||||
|
(
|
||||||
|
@UserID int,
|
||||||
|
@LockOut int,
|
||||||
|
@Reset int
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
|
||||||
|
IF (@Reset = 1)
|
||||||
|
BEGIN
|
||||||
|
UPDATE Users SET FailedLogins = 0 WHERE UserID = @UserID
|
||||||
|
END
|
||||||
|
ELSE
|
||||||
|
BEGIN
|
||||||
|
IF (@LockOut <= (SELECT FailedLogins FROM USERS WHERE UserID = @UserID))
|
||||||
|
BEGIN
|
||||||
|
UPDATE Users SET LoginStatusId = 2 WHERE UserID = @UserID
|
||||||
|
END
|
||||||
|
ELSE
|
||||||
|
BEGIN
|
||||||
|
IF ((SELECT FailedLogins FROM Users WHERE UserID = @UserID) IS NULL)
|
||||||
|
BEGIN
|
||||||
|
UPDATE Users SET FailedLogins = 1 WHERE UserID = @UserID
|
||||||
|
END
|
||||||
|
ELSE
|
||||||
|
UPDATE Users SET FailedLogins = FailedLogins + 1 WHERE UserID = @UserID
|
||||||
|
END
|
||||||
|
END'
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
|
@ -64,6 +64,9 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
public const int ERROR_INVALID_USER_NAME = -111;
|
public const int ERROR_INVALID_USER_NAME = -111;
|
||||||
public const int ERROR_USER_ACCOUNT_NOT_ENOUGH_PERMISSIONS = -112;
|
public const int ERROR_USER_ACCOUNT_NOT_ENOUGH_PERMISSIONS = -112;
|
||||||
public const int ERROR_USER_ACCOUNT_ROLE_NOT_ALLOWED = -113;
|
public const int ERROR_USER_ACCOUNT_ROLE_NOT_ALLOWED = -113;
|
||||||
|
|
||||||
|
public const int ERROR_USER_ACCOUNT_DISABLED = -114;
|
||||||
|
public const int ERROR_USER_ACCOUNT_LOCKEDOUT = -115;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Packages
|
#region Packages
|
||||||
|
|
|
@ -33,225 +33,249 @@ using System.Xml.Linq;
|
||||||
|
|
||||||
namespace WebsitePanel.EnterpriseServer
|
namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// User account.
|
/// User account.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class UserInfo
|
public class UserInfo
|
||||||
{
|
{
|
||||||
private int userId;
|
private int userId;
|
||||||
private int ownerId;
|
private int ownerId;
|
||||||
private int roleId;
|
private int roleId;
|
||||||
private int statusId;
|
private int statusId;
|
||||||
private DateTime created;
|
private int loginStatusId;
|
||||||
private DateTime changed;
|
private int failedLogins;
|
||||||
private bool isPeer;
|
private DateTime created;
|
||||||
private bool isDemo;
|
private DateTime changed;
|
||||||
private string comments;
|
private bool isPeer;
|
||||||
private string username;
|
private bool isDemo;
|
||||||
private string password;
|
private string comments;
|
||||||
private string firstName;
|
private string username;
|
||||||
private string lastName;
|
private string password;
|
||||||
private string email;
|
private string firstName;
|
||||||
private string secondaryEmail;
|
private string lastName;
|
||||||
private string address;
|
private string email;
|
||||||
private string city;
|
private string secondaryEmail;
|
||||||
private string country;
|
private string address;
|
||||||
private string state;
|
private string city;
|
||||||
private string zip;
|
private string country;
|
||||||
private string primaryPhone;
|
private string state;
|
||||||
private string secondaryPhone;
|
private string zip;
|
||||||
private string fax;
|
private string primaryPhone;
|
||||||
private string instantMessenger;
|
private string secondaryPhone;
|
||||||
|
private string fax;
|
||||||
|
private string instantMessenger;
|
||||||
private bool htmlMail;
|
private bool htmlMail;
|
||||||
private string companyName;
|
private string companyName;
|
||||||
private bool ecommerceEnabled;
|
private bool ecommerceEnabled;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new instance of UserInfo class.
|
/// Creates a new instance of UserInfo class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public UserInfo()
|
public UserInfo()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// User role ID:
|
/// User role ID:
|
||||||
/// Administrator = 1,
|
/// Administrator = 1,
|
||||||
/// Reseller = 2,
|
/// Reseller = 2,
|
||||||
/// User = 3
|
/// User = 3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int RoleId
|
public int RoleId
|
||||||
{
|
{
|
||||||
get { return roleId; }
|
get { return roleId; }
|
||||||
set { roleId = value; }
|
set { roleId = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// User role.
|
|
||||||
/// </summary>
|
|
||||||
public UserRole Role
|
|
||||||
{
|
|
||||||
get { return (UserRole)roleId; }
|
|
||||||
set { roleId = (int)value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// User account status:
|
/// User role.
|
||||||
/// Active = 1,
|
/// </summary>
|
||||||
/// Suspended = 2,
|
public UserRole Role
|
||||||
/// Cancelled = 3,
|
{
|
||||||
/// Pending = 4
|
get { return (UserRole)roleId; }
|
||||||
/// </summary>
|
set { roleId = (int)value; }
|
||||||
public int StatusId
|
}
|
||||||
{
|
|
||||||
get { return statusId; }
|
|
||||||
set { statusId = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// User account status.
|
/// User account status:
|
||||||
/// </summary>
|
/// Active = 1,
|
||||||
public UserStatus Status
|
/// Suspended = 2,
|
||||||
{
|
/// Cancelled = 3,
|
||||||
get { return (UserStatus)statusId; }
|
/// Pending = 4
|
||||||
set { statusId = (int)value; }
|
/// </summary>
|
||||||
}
|
public int StatusId
|
||||||
|
{
|
||||||
|
get { return statusId; }
|
||||||
|
set { statusId = value; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// User account unique identifier.
|
/// User account status.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int UserId
|
public UserStatus Status
|
||||||
{
|
{
|
||||||
get { return userId; }
|
get { return (UserStatus)statusId; }
|
||||||
set { userId = value; }
|
set { statusId = (int)value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public int OwnerId
|
|
||||||
{
|
|
||||||
get { return ownerId; }
|
|
||||||
set { ownerId = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsPeer
|
public int LoginStatusId
|
||||||
{
|
{
|
||||||
get { return isPeer; }
|
get { return loginStatusId; }
|
||||||
set { isPeer = value; }
|
set { loginStatusId = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public DateTime Created
|
public UserLoginStatus LoginStatus
|
||||||
{
|
{
|
||||||
get { return created; }
|
get { return (UserLoginStatus)loginStatusId; }
|
||||||
set { created = value; }
|
set { loginStatusId = (int)value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public DateTime Changed
|
public int FailedLogins
|
||||||
{
|
{
|
||||||
get { return changed; }
|
get { return failedLogins; }
|
||||||
set { changed = value; }
|
set { failedLogins = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsDemo
|
|
||||||
{
|
|
||||||
get { return isDemo; }
|
|
||||||
set { isDemo = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Comments
|
|
||||||
{
|
|
||||||
get { return comments; }
|
|
||||||
set { comments = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public string LastName
|
/// <summary>
|
||||||
{
|
/// User account unique identifier.
|
||||||
get { return this.lastName; }
|
/// </summary>
|
||||||
set { this.lastName = value; }
|
public int UserId
|
||||||
}
|
{
|
||||||
|
get { return userId; }
|
||||||
|
set { userId = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public string Username
|
public int OwnerId
|
||||||
{
|
{
|
||||||
get { return this.username; }
|
get { return ownerId; }
|
||||||
set { this.username = value; }
|
set { ownerId = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Password
|
public bool IsPeer
|
||||||
{
|
{
|
||||||
get { return this.password; }
|
get { return isPeer; }
|
||||||
set { this.password = value; }
|
set { isPeer = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string FirstName
|
public DateTime Created
|
||||||
{
|
{
|
||||||
get { return this.firstName; }
|
get { return created; }
|
||||||
set { this.firstName = value; }
|
set { created = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Email
|
public DateTime Changed
|
||||||
{
|
{
|
||||||
get { return this.email; }
|
get { return changed; }
|
||||||
set { this.email = value; }
|
set { changed = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string PrimaryPhone
|
public bool IsDemo
|
||||||
{
|
{
|
||||||
get { return this.primaryPhone; }
|
get { return isDemo; }
|
||||||
set { this.primaryPhone = value; }
|
set { isDemo = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Zip
|
public string Comments
|
||||||
{
|
{
|
||||||
get { return this.zip; }
|
get { return comments; }
|
||||||
set { this.zip = value; }
|
set { comments = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string InstantMessenger
|
public string LastName
|
||||||
{
|
{
|
||||||
get { return this.instantMessenger; }
|
get { return this.lastName; }
|
||||||
set { this.instantMessenger = value; }
|
set { this.lastName = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Fax
|
public string Username
|
||||||
{
|
{
|
||||||
get { return this.fax; }
|
get { return this.username; }
|
||||||
set { this.fax = value; }
|
set { this.username = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string SecondaryPhone
|
public string Password
|
||||||
{
|
{
|
||||||
get { return this.secondaryPhone; }
|
get { return this.password; }
|
||||||
set { this.secondaryPhone = value; }
|
set { this.password = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string SecondaryEmail
|
public string FirstName
|
||||||
{
|
{
|
||||||
get { return this.secondaryEmail; }
|
get { return this.firstName; }
|
||||||
set { this.secondaryEmail = value; }
|
set { this.firstName = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Country
|
public string Email
|
||||||
{
|
{
|
||||||
get { return this.country; }
|
get { return this.email; }
|
||||||
set { this.country = value; }
|
set { this.email = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Address
|
public string PrimaryPhone
|
||||||
{
|
{
|
||||||
get { return this.address; }
|
get { return this.primaryPhone; }
|
||||||
set { this.address = value; }
|
set { this.primaryPhone = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string City
|
public string Zip
|
||||||
{
|
{
|
||||||
get { return this.city; }
|
get { return this.zip; }
|
||||||
set { this.city = value; }
|
set { this.zip = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string State
|
public string InstantMessenger
|
||||||
{
|
{
|
||||||
get { return this.state; }
|
get { return this.instantMessenger; }
|
||||||
set { this.state = value; }
|
set { this.instantMessenger = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string Fax
|
||||||
|
{
|
||||||
|
get { return this.fax; }
|
||||||
|
set { this.fax = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string SecondaryPhone
|
||||||
|
{
|
||||||
|
get { return this.secondaryPhone; }
|
||||||
|
set { this.secondaryPhone = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string SecondaryEmail
|
||||||
|
{
|
||||||
|
get { return this.secondaryEmail; }
|
||||||
|
set { this.secondaryEmail = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Country
|
||||||
|
{
|
||||||
|
get { return this.country; }
|
||||||
|
set { this.country = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Address
|
||||||
|
{
|
||||||
|
get { return this.address; }
|
||||||
|
set { this.address = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string City
|
||||||
|
{
|
||||||
|
get { return this.city; }
|
||||||
|
set { this.city = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string State
|
||||||
|
{
|
||||||
|
get { return this.state; }
|
||||||
|
set { this.state = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public bool HtmlMail
|
public bool HtmlMail
|
||||||
{
|
{
|
||||||
|
@ -259,17 +283,17 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
set { this.htmlMail = value; }
|
set { this.htmlMail = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string CompanyName
|
public string CompanyName
|
||||||
{
|
{
|
||||||
get { return this.companyName; }
|
get { return this.companyName; }
|
||||||
set { this.companyName = value; }
|
set { this.companyName = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool EcommerceEnabled
|
public bool EcommerceEnabled
|
||||||
{
|
{
|
||||||
get { return this.ecommerceEnabled; }
|
get { return this.ecommerceEnabled; }
|
||||||
set { this.ecommerceEnabled = value; }
|
set { this.ecommerceEnabled = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string AdditionalParams { get; set; }
|
public string AdditionalParams { get; set; }
|
||||||
|
|
||||||
|
@ -289,10 +313,10 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
XElement vLansElement = doc.Root.Element("VLans");
|
XElement vLansElement = doc.Root.Element("VLans");
|
||||||
if (vLansElement != null)
|
if (vLansElement != null)
|
||||||
{
|
{
|
||||||
foreach(var item in vLansElement.Elements("VLan"))
|
foreach (var item in vLansElement.Elements("VLan"))
|
||||||
result.Add(new UserVlan
|
result.Add(new UserVlan
|
||||||
{
|
{
|
||||||
VLanID = item.Attribute("VLanID") != null ? ushort.Parse(item.Attribute("VLanID").Value) : (ushort) 0,
|
VLanID = item.Attribute("VLanID") != null ? ushort.Parse(item.Attribute("VLanID").Value) : (ushort)0,
|
||||||
Comment = item.Attribute("Comment") != null ? item.Attribute("Comment").Value : null
|
Comment = item.Attribute("Comment") != null ? item.Attribute("Comment").Value : null
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -304,7 +328,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// User's VLans
|
/// User's VLans
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
// Copyright (c) 2012, Outercurve Foundation.
|
||||||
|
// All rights reserved.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
// are permitted provided that the following conditions are met:
|
||||||
|
//
|
||||||
|
// - Redistributions of source code must retain the above copyright notice, this
|
||||||
|
// list of conditions and the following disclaimer.
|
||||||
|
//
|
||||||
|
// - Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer in the documentation
|
||||||
|
// and/or other materials provided with the distribution.
|
||||||
|
//
|
||||||
|
// - Neither the name of the Outercurve Foundation nor the names of its
|
||||||
|
// contributors may be used to endorse or promote products derived from this
|
||||||
|
// software without specific prior written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||||
|
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace WebsitePanel.EnterpriseServer
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Summary description for AccountLoginStatus.
|
||||||
|
/// </summary>
|
||||||
|
public enum UserLoginStatus
|
||||||
|
{
|
||||||
|
Enabled = 0,
|
||||||
|
Disabled = 1,
|
||||||
|
LockedOut = 2
|
||||||
|
}
|
||||||
|
}
|
|
@ -41,6 +41,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
public const string PACKAGE_SUMMARY_LETTER = "PackageSummaryLetter";
|
public const string PACKAGE_SUMMARY_LETTER = "PackageSummaryLetter";
|
||||||
public const string PASSWORD_REMINDER_LETTER = "PasswordReminderLetter";
|
public const string PASSWORD_REMINDER_LETTER = "PasswordReminderLetter";
|
||||||
public const string EXCHANGE_MAILBOX_SETUP_LETTER = "ExchangeMailboxSetupLetter";
|
public const string EXCHANGE_MAILBOX_SETUP_LETTER = "ExchangeMailboxSetupLetter";
|
||||||
|
public const string EXCHANGE_HOSTED_EDITION_ORGANIZATION_SUMMARY = "ExchangeHostedEditionOrganizationSummary";
|
||||||
public const string HOSTED_SOLUTION_REPORT = "HostedSoluitonReportSummaryLetter";
|
public const string HOSTED_SOLUTION_REPORT = "HostedSoluitonReportSummaryLetter";
|
||||||
public const string ORGANIZATION_USER_SUMMARY_LETTER = "OrganizationUserSummaryLetter";
|
public const string ORGANIZATION_USER_SUMMARY_LETTER = "OrganizationUserSummaryLetter";
|
||||||
public const string VPS_SUMMARY_LETTER = "VpsSummaryLetter";
|
public const string VPS_SUMMARY_LETTER = "VpsSummaryLetter";
|
||||||
|
@ -51,7 +52,8 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
public const string MYSQL_POLICY = "MySqlPolicy";
|
public const string MYSQL_POLICY = "MySqlPolicy";
|
||||||
public const string SHAREPOINT_POLICY = "SharePointPolicy";
|
public const string SHAREPOINT_POLICY = "SharePointPolicy";
|
||||||
public const string OS_POLICY = "OsPolicy";
|
public const string OS_POLICY = "OsPolicy";
|
||||||
public const string EXCHANGE_POLICY = "ExchangePolicy";
|
public const string EXCHANGE_POLICY = "ExchangePolicy";
|
||||||
|
public const string EXCHANGE_HOSTED_EDITION_POLICY = "ExchangeHostedEditionPolicy";
|
||||||
public const string WEBSITEPANEL_POLICY = "WebsitePanelPolicy";
|
public const string WEBSITEPANEL_POLICY = "WebsitePanelPolicy";
|
||||||
public const string VPS_POLICY = "VpsPolicy";
|
public const string VPS_POLICY = "VpsPolicy";
|
||||||
public const string DISPLAY_PREFS = "DisplayPreferences";
|
public const string DISPLAY_PREFS = "DisplayPreferences";
|
||||||
|
|
|
@ -30,14 +30,14 @@ using System;
|
||||||
|
|
||||||
namespace WebsitePanel.EnterpriseServer
|
namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Summary description for AccountStatus.
|
/// Summary description for AccountStatus.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum UserStatus
|
public enum UserStatus
|
||||||
{
|
{
|
||||||
Active = 1,
|
Active = 1,
|
||||||
Suspended = 2,
|
Suspended = 2,
|
||||||
Cancelled = 3,
|
Cancelled = 3,
|
||||||
Pending = 4
|
Pending = 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,6 +156,7 @@
|
||||||
<Compile Include="Tasks\BackgroundTask.cs" />
|
<Compile Include="Tasks\BackgroundTask.cs" />
|
||||||
<Compile Include="Tasks\BackgroundTaskLogRecord.cs" />
|
<Compile Include="Tasks\BackgroundTaskLogRecord.cs" />
|
||||||
<Compile Include="Users\UserInfo.cs" />
|
<Compile Include="Users\UserInfo.cs" />
|
||||||
|
<Compile Include="Users\UserLoginStatus.cs" />
|
||||||
<Compile Include="Users\UsernamePolicy.cs" />
|
<Compile Include="Users\UsernamePolicy.cs" />
|
||||||
<Compile Include="Users\UserRole.cs" />
|
<Compile Include="Users\UserRole.cs" />
|
||||||
<Compile Include="Users\UserSettings.cs" />
|
<Compile Include="Users\UserSettings.cs" />
|
||||||
|
|
|
@ -190,7 +190,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
new SqlParameter("@Username", username));
|
new SqlParameter("@Username", username));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int AddUser(int actorId, int ownerId, int roleId, int statusId, bool isDemo,
|
public static int AddUser(int actorId, int ownerId, int roleId, int statusId, int loginStatusId, bool isDemo,
|
||||||
bool isPeer, string comments, string username, string password,
|
bool isPeer, string comments, string username, string password,
|
||||||
string firstName, string lastName, string email, string secondaryEmail,
|
string firstName, string lastName, string email, string secondaryEmail,
|
||||||
string address, string city, string country, string state, string zip,
|
string address, string city, string country, string state, string zip,
|
||||||
|
@ -208,6 +208,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
new SqlParameter("@OwnerID", ownerId),
|
new SqlParameter("@OwnerID", ownerId),
|
||||||
new SqlParameter("@RoleID", roleId),
|
new SqlParameter("@RoleID", roleId),
|
||||||
new SqlParameter("@StatusId", statusId),
|
new SqlParameter("@StatusId", statusId),
|
||||||
|
new SqlParameter("@LoginStatusId", loginStatusId),
|
||||||
new SqlParameter("@IsDemo", isDemo),
|
new SqlParameter("@IsDemo", isDemo),
|
||||||
new SqlParameter("@IsPeer", isPeer),
|
new SqlParameter("@IsPeer", isPeer),
|
||||||
new SqlParameter("@Comments", comments),
|
new SqlParameter("@Comments", comments),
|
||||||
|
@ -227,13 +228,13 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
new SqlParameter("@fax", fax),
|
new SqlParameter("@fax", fax),
|
||||||
new SqlParameter("@instantMessenger", instantMessenger),
|
new SqlParameter("@instantMessenger", instantMessenger),
|
||||||
new SqlParameter("@htmlMail", htmlMail),
|
new SqlParameter("@htmlMail", htmlMail),
|
||||||
new SqlParameter("@CompanyName", companyName),
|
new SqlParameter("@CompanyName", companyName),
|
||||||
new SqlParameter("@EcommerceEnabled", ecommerceEnabled));
|
new SqlParameter("@EcommerceEnabled", ecommerceEnabled));
|
||||||
|
|
||||||
return Convert.ToInt32(prmUserId.Value);
|
return Convert.ToInt32(prmUserId.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UpdateUser(int actorId, int userId, int roleId, int statusId, bool isDemo,
|
public static void UpdateUser(int actorId, int userId, int roleId, int statusId, int loginStatusId, bool isDemo,
|
||||||
bool isPeer, string comments, string firstName, string lastName, string email, string secondaryEmail,
|
bool isPeer, string comments, string firstName, string lastName, string email, string secondaryEmail,
|
||||||
string address, string city, string country, string state, string zip,
|
string address, string city, string country, string state, string zip,
|
||||||
string primaryPhone, string secondaryPhone, string fax, string instantMessenger, bool htmlMail,
|
string primaryPhone, string secondaryPhone, string fax, string instantMessenger, bool htmlMail,
|
||||||
|
@ -245,6 +246,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
new SqlParameter("@ActorId", actorId),
|
new SqlParameter("@ActorId", actorId),
|
||||||
new SqlParameter("@RoleID", roleId),
|
new SqlParameter("@RoleID", roleId),
|
||||||
new SqlParameter("@StatusId", statusId),
|
new SqlParameter("@StatusId", statusId),
|
||||||
|
new SqlParameter("@LoginStatusId", loginStatusId),
|
||||||
new SqlParameter("@UserID", userId),
|
new SqlParameter("@UserID", userId),
|
||||||
new SqlParameter("@IsDemo", isDemo),
|
new SqlParameter("@IsDemo", isDemo),
|
||||||
new SqlParameter("@IsPeer", isPeer),
|
new SqlParameter("@IsPeer", isPeer),
|
||||||
|
@ -263,11 +265,20 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
new SqlParameter("@fax", fax),
|
new SqlParameter("@fax", fax),
|
||||||
new SqlParameter("@instantMessenger", instantMessenger),
|
new SqlParameter("@instantMessenger", instantMessenger),
|
||||||
new SqlParameter("@htmlMail", htmlMail),
|
new SqlParameter("@htmlMail", htmlMail),
|
||||||
new SqlParameter("@CompanyName", companyName),
|
new SqlParameter("@CompanyName", companyName),
|
||||||
new SqlParameter("@EcommerceEnabled", ecommerceEnabled),
|
new SqlParameter("@EcommerceEnabled", ecommerceEnabled),
|
||||||
new SqlParameter("@AdditionalParams", additionalParams));
|
new SqlParameter("@AdditionalParams", additionalParams));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void UpdateUserFailedLoginAttempt(int userId, int lockOut, bool reset)
|
||||||
|
{
|
||||||
|
SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure,
|
||||||
|
ObjectQualifier + "UpdateUserFailedLoginAttempt",
|
||||||
|
new SqlParameter("@UserID", userId),
|
||||||
|
new SqlParameter("@LockOut", lockOut),
|
||||||
|
new SqlParameter("@Reset", reset));
|
||||||
|
}
|
||||||
|
|
||||||
public static void DeleteUser(int actorId, int userId)
|
public static void DeleteUser(int actorId, int userId)
|
||||||
{
|
{
|
||||||
SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure,
|
SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure,
|
||||||
|
|
|
@ -49,56 +49,92 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return (user != null);
|
return (user != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int AuthenticateUser(string username, string password, string ip)
|
public static int AuthenticateUser(string username, string password, string ip)
|
||||||
{
|
{
|
||||||
// start task
|
// start task
|
||||||
TaskManager.StartTask("USER", "AUTHENTICATE", username);
|
TaskManager.StartTask("USER", "AUTHENTICATE", username);
|
||||||
TaskManager.WriteParameter("IP", ip);
|
TaskManager.WriteParameter("IP", ip);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// try to get user from database
|
// try to get user from database
|
||||||
UserInfo user = GetUserInternally(username);
|
UserInfo user = GetUserInternally(username);
|
||||||
|
|
||||||
// check if the user exists
|
// check if the user exists
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
TaskManager.WriteWarning("Wrong username");
|
TaskManager.WriteWarning("Wrong username");
|
||||||
return BusinessErrorCodes.ERROR_USER_WRONG_USERNAME;
|
return BusinessErrorCodes.ERROR_USER_WRONG_USERNAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
// compare user passwords
|
// check if the user is disabled
|
||||||
if (user.Password != password)
|
if (user.LoginStatus == UserLoginStatus.Disabled)
|
||||||
{
|
{
|
||||||
TaskManager.WriteWarning("Wrong password");
|
TaskManager.WriteWarning("User disabled");
|
||||||
return BusinessErrorCodes.ERROR_USER_WRONG_PASSWORD;
|
return BusinessErrorCodes.ERROR_USER_ACCOUNT_DISABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check status
|
// check if the user is locked out
|
||||||
if (user.Status == UserStatus.Cancelled)
|
if (user.LoginStatus == UserLoginStatus.LockedOut)
|
||||||
{
|
{
|
||||||
TaskManager.WriteWarning("Account cancelled");
|
TaskManager.WriteWarning("User locked out");
|
||||||
return BusinessErrorCodes.ERROR_USER_ACCOUNT_CANCELLED;
|
return BusinessErrorCodes.ERROR_USER_ACCOUNT_LOCKEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.Status == UserStatus.Pending)
|
//Get the password policy
|
||||||
{
|
UserSettings userSettings = UserController.GetUserSettings(user.UserId, UserSettings.WEBSITEPANEL_POLICY);
|
||||||
TaskManager.WriteWarning("Account pending");
|
int lockOut = -1;
|
||||||
return BusinessErrorCodes.ERROR_USER_ACCOUNT_PENDING;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
if (!string.IsNullOrEmpty(userSettings["PasswordPolicy"]))
|
||||||
|
{
|
||||||
|
string passwordPolicy = userSettings["PasswordPolicy"];
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// parse settings
|
||||||
|
string[] parts = passwordPolicy.Split(';');
|
||||||
|
lockOut = Convert.ToInt32(parts[7]);
|
||||||
|
}
|
||||||
|
catch { /* skip */ }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
// compare user passwords
|
||||||
{
|
if (user.Password != password)
|
||||||
throw TaskManager.WriteError(ex);
|
{
|
||||||
}
|
if (lockOut >= 0)
|
||||||
finally
|
DataProvider.UpdateUserFailedLoginAttempt(user.UserId, lockOut, false);
|
||||||
{
|
|
||||||
TaskManager.CompleteTask();
|
TaskManager.WriteWarning("Wrong password");
|
||||||
}
|
return BusinessErrorCodes.ERROR_USER_WRONG_PASSWORD;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
DataProvider.UpdateUserFailedLoginAttempt(user.UserId, lockOut, true);
|
||||||
|
|
||||||
|
// check status
|
||||||
|
if (user.Status == UserStatus.Cancelled)
|
||||||
|
{
|
||||||
|
TaskManager.WriteWarning("Account cancelled");
|
||||||
|
return BusinessErrorCodes.ERROR_USER_ACCOUNT_CANCELLED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user.Status == UserStatus.Pending)
|
||||||
|
{
|
||||||
|
TaskManager.WriteWarning("Account pending");
|
||||||
|
return BusinessErrorCodes.ERROR_USER_ACCOUNT_PENDING;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw TaskManager.WriteError(ex);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
TaskManager.CompleteTask();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static UserInfo GetUserByUsernamePassword(string username, string password, string ip)
|
public static UserInfo GetUserByUsernamePassword(string username, string password, string ip)
|
||||||
{
|
{
|
||||||
|
@ -382,6 +418,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
user.OwnerId,
|
user.OwnerId,
|
||||||
user.RoleId,
|
user.RoleId,
|
||||||
user.StatusId,
|
user.StatusId,
|
||||||
|
user.LoginStatusId,
|
||||||
user.IsDemo,
|
user.IsDemo,
|
||||||
user.IsPeer,
|
user.IsPeer,
|
||||||
user.Comments,
|
user.Comments,
|
||||||
|
@ -525,6 +562,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
user.UserId,
|
user.UserId,
|
||||||
user.RoleId,
|
user.RoleId,
|
||||||
user.StatusId,
|
user.StatusId,
|
||||||
|
user.LoginStatusId,
|
||||||
user.IsDemo,
|
user.IsDemo,
|
||||||
user.IsPeer,
|
user.IsPeer,
|
||||||
user.Comments,
|
user.Comments,
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 719 B |
|
@ -8,6 +8,11 @@
|
||||||
EnableViewState="False" EmptyDataText="usersList"
|
EnableViewState="False" EmptyDataText="usersList"
|
||||||
CssSelectorClass="NormalGridView">
|
CssSelectorClass="NormalGridView">
|
||||||
<Columns>
|
<Columns>
|
||||||
|
<asp:TemplateField>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Image ID="img2" runat="server" Width="16px" Height="16px" ImageUrl='<%# GetStateImage(Eval("LoginStatusId")) %>' ImageAlign="AbsMiddle" />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
<asp:TemplateField SortExpression="Username" HeaderText="usersListUsername">
|
<asp:TemplateField SortExpression="Username" HeaderText="usersListUsername">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:hyperlink id="lnkEdit" runat="server" NavigateUrl='<%# EditUrl("PeerID", Eval("UserID").ToString(), "edit_peer", "UserID=" + PanelSecurity.SelectedUserId.ToString()) %>'>
|
<asp:hyperlink id="lnkEdit" runat="server" NavigateUrl='<%# EditUrl("PeerID", Eval("UserID").ToString(), "edit_peer", "UserID=" + PanelSecurity.SelectedUserId.ToString()) %>'>
|
||||||
|
|
|
@ -86,5 +86,34 @@ namespace WebsitePanel.Portal
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected string GetStateImage(object status)
|
||||||
|
{
|
||||||
|
string imgName = "enabled.png";
|
||||||
|
|
||||||
|
if (status != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
switch ((int)status)
|
||||||
|
{
|
||||||
|
case (int)UserLoginStatus.Disabled:
|
||||||
|
imgName = "disabled.png";
|
||||||
|
break;
|
||||||
|
case (int)UserLoginStatus.LockedOut:
|
||||||
|
imgName = "locked.png";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
imgName = "enabled.png";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
return GetThemedImage("Exchange/" + imgName);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,32 +1,3 @@
|
||||||
// Copyright (c) 2012, Outercurve Foundation.
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
// are permitted provided that the following conditions are met:
|
|
||||||
//
|
|
||||||
// - Redistributions of source code must retain the above copyright notice, this
|
|
||||||
// list of conditions and the following disclaimer.
|
|
||||||
//
|
|
||||||
// - Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
// this list of conditions and the following disclaimer in the documentation
|
|
||||||
// and/or other materials provided with the distribution.
|
|
||||||
//
|
|
||||||
// - Neither the name of the Outercurve Foundation nor the names of its
|
|
||||||
// contributors may be used to endorse or promote products derived from this
|
|
||||||
// software without specific prior written permission.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
||||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
||||||
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
||||||
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
|
|
@ -101,6 +101,18 @@
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr id="roleLoginStatus" runat="server">
|
||||||
|
<td class="SubHead" valign="top">
|
||||||
|
<asp:Label ID="lblLoginStatus" runat="server" meta:resourcekey="lblLoginStatus" Text="Login Status:"></asp:Label>
|
||||||
|
</td>
|
||||||
|
<td class="NormalBold" valign="top">
|
||||||
|
<asp:DropDownList id="loginStatus" runat="server" resourcekey="loginStatus" CssClass="NormalTextBox">
|
||||||
|
<asp:ListItem Value="Enabled"></asp:ListItem>
|
||||||
|
<asp:ListItem Value="Disabled"></asp:ListItem>
|
||||||
|
<asp:ListItem Value="Locked Out"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="SubHead">
|
<td class="SubHead">
|
||||||
<asp:Label ID="lblDemoAccount" runat="server" meta:resourcekey="lblDemoAccount" Text="Demo Account:"></asp:Label>
|
<asp:Label ID="lblDemoAccount" runat="server" meta:resourcekey="lblDemoAccount" Text="Demo Account:"></asp:Label>
|
||||||
|
|
|
@ -127,6 +127,9 @@ namespace WebsitePanel.Portal
|
||||||
if (user.RoleId == (int)UserRole.Reseller) role.SelectedIndex = 2;
|
if (user.RoleId == (int)UserRole.Reseller) role.SelectedIndex = 2;
|
||||||
if (user.RoleId == (int)UserRole.Administrator) role.SelectedIndex = 2;
|
if (user.RoleId == (int)UserRole.Administrator) role.SelectedIndex = 2;
|
||||||
|
|
||||||
|
// select loginStatus
|
||||||
|
loginStatus.SelectedIndex = user.LoginStatusId;
|
||||||
|
|
||||||
// contact info
|
// contact info
|
||||||
contact.CompanyName = user.CompanyName;
|
contact.CompanyName = user.CompanyName;
|
||||||
contact.Address = user.Address;
|
contact.Address = user.Address;
|
||||||
|
@ -195,6 +198,8 @@ namespace WebsitePanel.Portal
|
||||||
user.Password = userPassword.Password;
|
user.Password = userPassword.Password;
|
||||||
user.IsDemo = chkDemo.Checked;
|
user.IsDemo = chkDemo.Checked;
|
||||||
|
|
||||||
|
user.LoginStatusId = loginStatus.SelectedIndex;
|
||||||
|
|
||||||
// contact info
|
// contact info
|
||||||
user.CompanyName = contact.CompanyName;
|
user.CompanyName = contact.CompanyName;
|
||||||
user.Address = contact.Address;
|
user.Address = contact.Address;
|
||||||
|
|
|
@ -1,32 +1,3 @@
|
||||||
// Copyright (c) 2012, Outercurve Foundation.
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
// are permitted provided that the following conditions are met:
|
|
||||||
//
|
|
||||||
// - Redistributions of source code must retain the above copyright notice, this
|
|
||||||
// list of conditions and the following disclaimer.
|
|
||||||
//
|
|
||||||
// - Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
// this list of conditions and the following disclaimer in the documentation
|
|
||||||
// and/or other materials provided with the distribution.
|
|
||||||
//
|
|
||||||
// - Neither the name of the Outercurve Foundation nor the names of its
|
|
||||||
// contributors may be used to endorse or promote products derived from this
|
|
||||||
// software without specific prior written permission.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
||||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
||||||
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
||||||
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
@ -302,6 +273,33 @@ namespace WebsitePanel.Portal {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.DropDownList ddlMailFormat;
|
protected global::System.Web.UI.WebControls.DropDownList ddlMailFormat;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// roleLoginStatus control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlTableRow roleLoginStatus;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblLoginStatus control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Label lblLoginStatus;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// loginStatus control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.DropDownList loginStatus;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// lblDemoAccount control.
|
/// lblDemoAccount control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -88,6 +88,20 @@
|
||||||
<asp:CheckBox id="chkDemo" runat="server" meta:resourcekey="chkDemo" Text="Yes"></asp:CheckBox>
|
<asp:CheckBox id="chkDemo" runat="server" meta:resourcekey="chkDemo" Text="Yes"></asp:CheckBox>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr id="roleLoginStatus" runat="server">
|
||||||
|
<td class="SubHead" valign="top">
|
||||||
|
<asp:Label ID="lblLoginStatus" runat="server" meta:resourcekey="lblLoginStatus" Text="Login Status:"></asp:Label>
|
||||||
|
</td>
|
||||||
|
<td class="NormalBold" valign="top">
|
||||||
|
<asp:DropDownList id="loginStatus" runat="server" resourcekey="loginStatus" CssClass="NormalTextBox">
|
||||||
|
<asp:ListItem Value="Enabled"></asp:ListItem>
|
||||||
|
<asp:ListItem Value="Disabled"></asp:ListItem>
|
||||||
|
<asp:ListItem Value="Locked Out"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr id="rowEcommerceEnbl" runat="server">
|
<tr id="rowEcommerceEnbl" runat="server">
|
||||||
<td class="SubHead"><asp:Localize runat="server" meta:resourcekey="lclEcommerceEnabled" /></td>
|
<td class="SubHead"><asp:Localize runat="server" meta:resourcekey="lclEcommerceEnabled" /></td>
|
||||||
<td class="Normal"><asp:CheckBox runat="server" ID="chkEcommerceEnbl" Text="Yes"/></td>
|
<td class="Normal"><asp:CheckBox runat="server" ID="chkEcommerceEnbl" Text="Yes"/></td>
|
||||||
|
|
|
@ -61,6 +61,9 @@ namespace WebsitePanel.Portal
|
||||||
// select role
|
// select role
|
||||||
Utils.SelectListItem(role, user.Role.ToString());
|
Utils.SelectListItem(role, user.Role.ToString());
|
||||||
|
|
||||||
|
// select loginStatus
|
||||||
|
loginStatus.SelectedIndex = user.LoginStatusId;
|
||||||
|
|
||||||
// bind ec
|
// bind ec
|
||||||
chkEcommerceEnbl.Checked = user.EcommerceEnabled;
|
chkEcommerceEnbl.Checked = user.EcommerceEnabled;
|
||||||
BindEcommerceEnabled();
|
BindEcommerceEnabled();
|
||||||
|
@ -120,6 +123,8 @@ namespace WebsitePanel.Portal
|
||||||
//
|
//
|
||||||
user.EcommerceEnabled = chkEcommerceEnbl.Checked;
|
user.EcommerceEnabled = chkEcommerceEnbl.Checked;
|
||||||
|
|
||||||
|
user.LoginStatusId = loginStatus.SelectedIndex;
|
||||||
|
|
||||||
// account info
|
// account info
|
||||||
user.FirstName = Server.HtmlEncode(txtFirstName.Text);
|
user.FirstName = Server.HtmlEncode(txtFirstName.Text);
|
||||||
user.LastName = Server.HtmlEncode(txtLastName.Text);
|
user.LastName = Server.HtmlEncode(txtLastName.Text);
|
||||||
|
|
|
@ -210,6 +210,33 @@ namespace WebsitePanel.Portal {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.CheckBox chkDemo;
|
protected global::System.Web.UI.WebControls.CheckBox chkDemo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// roleLoginStatus control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlTableRow roleLoginStatus;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblLoginStatus control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Label lblLoginStatus;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// loginStatus control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.DropDownList loginStatus;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// rowEcommerceEnbl control.
|
/// rowEcommerceEnbl control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -112,10 +112,10 @@
|
||||||
<value>2.0</value>
|
<value>2.0</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="reader">
|
<resheader name="reader">
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="chkEnabled.Text" xml:space="preserve">
|
<data name="chkEnabled.Text" xml:space="preserve">
|
||||||
<value>Enable Policy</value>
|
<value>Enable Policy</value>
|
||||||
|
@ -123,6 +123,9 @@
|
||||||
<data name="chkNotEqualUsername.Text" xml:space="preserve">
|
<data name="chkNotEqualUsername.Text" xml:space="preserve">
|
||||||
<value>Should not be equal to username</value>
|
<value>Should not be equal to username</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="lblLockedOut.Text" xml:space="preserve">
|
||||||
|
<value>Lock out after # attempts:</value>
|
||||||
|
</data>
|
||||||
<data name="lblMaximumLength.Text" xml:space="preserve">
|
<data name="lblMaximumLength.Text" xml:space="preserve">
|
||||||
<value>Maximum length:</value>
|
<value>Maximum length:</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -141,6 +144,9 @@
|
||||||
<data name="lblShouldContain.Text" xml:space="preserve">
|
<data name="lblShouldContain.Text" xml:space="preserve">
|
||||||
<value>Password should contain at least:</value>
|
<value>Password should contain at least:</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="valCorrectLockedOut.Text" xml:space="preserve">
|
||||||
|
<value>*</value>
|
||||||
|
</data>
|
||||||
<data name="valCorrectMaxLength.Text" xml:space="preserve">
|
<data name="valCorrectMaxLength.Text" xml:space="preserve">
|
||||||
<value>*</value>
|
<value>*</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
@ -72,6 +72,18 @@
|
||||||
<asp:CheckBox id="chkNotEqualUsername" runat="server" meta:resourcekey="chkNotEqualUsername" Text="Should not be equal to username" />
|
<asp:CheckBox id="chkNotEqualUsername" runat="server" meta:resourcekey="chkNotEqualUsername" Text="Should not be equal to username" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="Normal">
|
||||||
|
<asp:Label ID="lblLockedOut" runat="server"
|
||||||
|
meta:resourcekey="lblLockedOut" Text="Lock out after :"></asp:Label>
|
||||||
|
</td>
|
||||||
|
<td class="Normal"><asp:TextBox ID="txtLockedOut" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
|
||||||
|
<asp:RegularExpressionValidator ID="valCorrectLockedOut" runat="server" ControlToValidate="txtLockedOut" meta:resourcekey="valCorrectLockedOut"
|
||||||
|
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,10}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
|
|
|
@ -53,7 +53,9 @@ namespace WebsitePanel.Portal
|
||||||
sb.Append(txtMinimumUppercase.Text).Append(";");
|
sb.Append(txtMinimumUppercase.Text).Append(";");
|
||||||
sb.Append(txtMinimumNumbers.Text).Append(";");
|
sb.Append(txtMinimumNumbers.Text).Append(";");
|
||||||
sb.Append(txtMinimumSymbols.Text).Append(";");
|
sb.Append(txtMinimumSymbols.Text).Append(";");
|
||||||
sb.Append(chkNotEqualUsername.Checked.ToString());
|
sb.Append(chkNotEqualUsername.Checked.ToString()).Append(";");
|
||||||
|
sb.Append(txtLockedOut.Text).Append(";");
|
||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
|
@ -67,6 +69,7 @@ namespace WebsitePanel.Portal
|
||||||
txtMinimumUppercase.Text = "0";
|
txtMinimumUppercase.Text = "0";
|
||||||
txtMinimumNumbers.Text = "0";
|
txtMinimumNumbers.Text = "0";
|
||||||
txtMinimumSymbols.Text = "0";
|
txtMinimumSymbols.Text = "0";
|
||||||
|
txtLockedOut.Text = "3";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -81,10 +84,11 @@ namespace WebsitePanel.Portal
|
||||||
txtMinimumNumbers.Text = parts[4];
|
txtMinimumNumbers.Text = parts[4];
|
||||||
txtMinimumSymbols.Text = parts[5];
|
txtMinimumSymbols.Text = parts[5];
|
||||||
chkNotEqualUsername.Checked = Utils.ParseBool(parts[6], false);
|
chkNotEqualUsername.Checked = Utils.ParseBool(parts[6], false);
|
||||||
|
txtLockedOut.Text = parts[7];
|
||||||
}
|
}
|
||||||
catch { /* skip */ }
|
catch { /* skip */ }
|
||||||
}
|
}
|
||||||
ToggleControls();
|
ToggleControls();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,14 +96,14 @@ namespace WebsitePanel.Portal
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ToggleControls()
|
private void ToggleControls()
|
||||||
{
|
{
|
||||||
PolicyTable.Visible = chkEnabled.Checked;
|
PolicyTable.Visible = chkEnabled.Checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void chkEnabled_CheckedChanged(object sender, EventArgs e)
|
protected void chkEnabled_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
ToggleControls();
|
ToggleControls();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:2.0.50727.42
|
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
|
@ -10,32 +9,268 @@
|
||||||
|
|
||||||
namespace WebsitePanel.Portal {
|
namespace WebsitePanel.Portal {
|
||||||
|
|
||||||
|
|
||||||
public partial class PasswordPolicyEditor {
|
public partial class PasswordPolicyEditor {
|
||||||
protected System.Web.UI.UpdatePanel PasswordPolicyPanel;
|
|
||||||
protected System.Web.UI.WebControls.CheckBox chkEnabled;
|
/// <summary>
|
||||||
protected System.Web.UI.HtmlControls.HtmlTable PolicyTable;
|
/// PasswordPolicyPanel control.
|
||||||
protected System.Web.UI.WebControls.Label lblMinimumLength;
|
/// </summary>
|
||||||
protected System.Web.UI.WebControls.TextBox txtMinimumLength;
|
/// <remarks>
|
||||||
protected System.Web.UI.WebControls.RequiredFieldValidator valRequireMinLength;
|
/// Auto-generated field.
|
||||||
protected System.Web.UI.WebControls.RegularExpressionValidator valCorrectMinLength;
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
protected System.Web.UI.WebControls.Label lblMaximumLength;
|
/// </remarks>
|
||||||
protected System.Web.UI.WebControls.TextBox txtMaximumLength;
|
protected global::System.Web.UI.UpdatePanel PasswordPolicyPanel;
|
||||||
protected System.Web.UI.WebControls.RequiredFieldValidator valRequireMaxLength;
|
|
||||||
protected System.Web.UI.WebControls.RegularExpressionValidator valCorrectMaxLength;
|
/// <summary>
|
||||||
protected System.Web.UI.WebControls.Label lblShouldContain;
|
/// chkEnabled control.
|
||||||
protected System.Web.UI.WebControls.Label lblMinimumUppercase;
|
/// </summary>
|
||||||
protected System.Web.UI.WebControls.TextBox txtMinimumUppercase;
|
/// <remarks>
|
||||||
protected System.Web.UI.WebControls.RequiredFieldValidator valRequireUppercase;
|
/// Auto-generated field.
|
||||||
protected System.Web.UI.WebControls.RegularExpressionValidator valCorrectUppercase;
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
protected System.Web.UI.WebControls.Label lblMinimumNumbers;
|
/// </remarks>
|
||||||
protected System.Web.UI.WebControls.TextBox txtMinimumNumbers;
|
protected global::System.Web.UI.WebControls.CheckBox chkEnabled;
|
||||||
protected System.Web.UI.WebControls.RequiredFieldValidator valRequireNumbers;
|
|
||||||
protected System.Web.UI.WebControls.RegularExpressionValidator valCorrectNumbers;
|
/// <summary>
|
||||||
protected System.Web.UI.WebControls.Label lblMinimumSymbols;
|
/// PolicyTable control.
|
||||||
protected System.Web.UI.WebControls.TextBox txtMinimumSymbols;
|
/// </summary>
|
||||||
protected System.Web.UI.WebControls.RequiredFieldValidator valRequireSymbols;
|
/// <remarks>
|
||||||
protected System.Web.UI.WebControls.RegularExpressionValidator valCorrectSymbols;
|
/// Auto-generated field.
|
||||||
protected System.Web.UI.HtmlControls.HtmlTableRow rowEqualUsername;
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
protected System.Web.UI.WebControls.CheckBox chkNotEqualUsername;
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlTable PolicyTable;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblMinimumLength control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Label lblMinimumLength;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtMinimumLength control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.TextBox txtMinimumLength;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// valRequireMinLength control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireMinLength;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// valCorrectMinLength control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectMinLength;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblMaximumLength control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Label lblMaximumLength;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtMaximumLength control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.TextBox txtMaximumLength;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// valRequireMaxLength control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireMaxLength;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// valCorrectMaxLength control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectMaxLength;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblShouldContain control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Label lblShouldContain;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblMinimumUppercase control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Label lblMinimumUppercase;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtMinimumUppercase control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.TextBox txtMinimumUppercase;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// valRequireUppercase control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireUppercase;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// valCorrectUppercase control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectUppercase;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblMinimumNumbers control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Label lblMinimumNumbers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtMinimumNumbers control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.TextBox txtMinimumNumbers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// valRequireNumbers control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireNumbers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// valCorrectNumbers control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectNumbers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblMinimumSymbols control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Label lblMinimumSymbols;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtMinimumSymbols control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.TextBox txtMinimumSymbols;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// valRequireSymbols control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireSymbols;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// valCorrectSymbols control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectSymbols;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// rowEqualUsername control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlTableRow rowEqualUsername;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// chkNotEqualUsername control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.CheckBox chkNotEqualUsername;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblLockedOut control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Label lblLockedOut;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtLockedOut control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.TextBox txtLockedOut;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// valCorrectLockedOut control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectLockedOut;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,11 @@
|
||||||
DataSourceID="odsUsersPaged" EnableViewState="False"
|
DataSourceID="odsUsersPaged" EnableViewState="False"
|
||||||
EmptyDataText="gvUsers">
|
EmptyDataText="gvUsers">
|
||||||
<Columns>
|
<Columns>
|
||||||
|
<asp:TemplateField>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Image ID="img2" runat="server" Width="16px" Height="16px" ImageUrl='<%# GetStateImage(Eval("LoginStatusId")) %>' ImageAlign="AbsMiddle" />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
<asp:TemplateField SortExpression="Username" HeaderText="gvUsersUsername" HeaderStyle-Wrap="false">
|
<asp:TemplateField SortExpression="Username" HeaderText="gvUsersUsername" HeaderStyle-Wrap="false">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:hyperlink id=lnkEdit runat="server" NavigateUrl='<%# GetUserHomePageUrl((int)Eval("UserID")) %>'>
|
<asp:hyperlink id=lnkEdit runat="server" NavigateUrl='<%# GetUserHomePageUrl((int)Eval("UserID")) %>'>
|
||||||
|
|
|
@ -37,6 +37,8 @@ using System.Web.UI.WebControls;
|
||||||
using System.Web.UI.WebControls.WebParts;
|
using System.Web.UI.WebControls.WebParts;
|
||||||
using System.Web.UI.HtmlControls;
|
using System.Web.UI.HtmlControls;
|
||||||
|
|
||||||
|
using WebsitePanel.EnterpriseServer;
|
||||||
|
|
||||||
namespace WebsitePanel.Portal
|
namespace WebsitePanel.Portal
|
||||||
{
|
{
|
||||||
public partial class UserCustomers : WebsitePanelModuleBase
|
public partial class UserCustomers : WebsitePanelModuleBase
|
||||||
|
@ -85,5 +87,37 @@ namespace WebsitePanel.Portal
|
||||||
Response.Redirect(EditUrl(PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(), "create_user",
|
Response.Redirect(EditUrl(PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(), "create_user",
|
||||||
"frm=customers"));
|
"frm=customers"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected string GetStateImage(object status)
|
||||||
|
{
|
||||||
|
string imgName = "enabled.png";
|
||||||
|
|
||||||
|
if (status != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
switch ((int)status)
|
||||||
|
{
|
||||||
|
case (int)UserLoginStatus.Disabled:
|
||||||
|
imgName = "disabled.png";
|
||||||
|
break;
|
||||||
|
case (int)UserLoginStatus.LockedOut:
|
||||||
|
imgName = "locked.png";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
imgName = "enabled.png";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return GetThemedImage("Exchange/" + imgName);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -106,6 +106,7 @@
|
||||||
<Content Include="App_Themes\Default\Images\Exchange\disabled.png" />
|
<Content Include="App_Themes\Default\Images\Exchange\disabled.png" />
|
||||||
<Content Include="App_Themes\Default\Images\Exchange\disabled_16.png" />
|
<Content Include="App_Themes\Default\Images\Exchange\disabled_16.png" />
|
||||||
<Content Include="App_Themes\Default\Images\Exchange\enabled.png" />
|
<Content Include="App_Themes\Default\Images\Exchange\enabled.png" />
|
||||||
|
<Content Include="App_Themes\Default\Images\Exchange\locked.png" />
|
||||||
<Content Include="App_Themes\Default\Images\Exchange\lync16.png" />
|
<Content Include="App_Themes\Default\Images\Exchange\lync16.png" />
|
||||||
<Content Include="App_Themes\Default\Images\FileManager\vbhtml.png" />
|
<Content Include="App_Themes\Default\Images\FileManager\vbhtml.png" />
|
||||||
<Content Include="App_Themes\Default\Images\lync16.png" />
|
<Content Include="App_Themes\Default\Images\lync16.png" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue