This commit is contained in:
me 2015-04-29 10:15:41 +04:00
commit ec10aa7f0c
328 changed files with 70724 additions and 2992 deletions

File diff suppressed because it is too large Load diff

View file

@ -10031,6 +10031,37 @@ UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetLetterTextBo
GO
DECLARE @UserPasswordResetSMSBody nvarchar(2500)
Set @UserPasswordResetSMSBody = N'Password reset link:
#passwordResetLink#
'
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'PasswordResetLinkSmsBody' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetLetter', N'PasswordResetLinkSmsBody', @UserPasswordResetSMSBody)
END
ELSE
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetSMSBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'PasswordResetLinkSmsBody'
GO
DECLARE @UserPasswordPincodeSMSBody nvarchar(2500)
Set @UserPasswordPincodeSMSBody = N'
Your password reset pincode:
#passwordResetPincode#'
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'PasswordResetPincodeSmsBody' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetLetter', N'PasswordResetPincodeSmsBody', @UserPasswordPincodeSMSBody)
END
ELSE
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordPincodeSMSBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'PasswordResetPincodeSmsBody'
GO
-- Exchange setup EMAIL TEMPLATE
@ -10300,79 +10331,79 @@ GO
DECLARE @ExchangeMailboxSetupLetterTextBody nvarchar(2500)
Set @ExchangeMailboxSetupLetterTextBody = N'<ad:if test="#Email#">
Hello #Account.DisplayName#,
Thanks for choosing VirtuWorks as your Exchange hosting provider.
</ad:if>
<ad:if test="#not(PMM)#">
User Accounts
The following user accounts have been created for you.
Username: #Account.UserPrincipalName#
E-mail: #Account.PrimaryEmailAddress#
<ad:if test="#PswResetUrl#">
Password Reset Url: #PswResetUrl#
</ad:if>
</ad:if>
=================================
DNS
=================================
In order for us to accept mail for your domain, you will need to point your MX records to:
<ad:foreach collection="#SmtpServers#" var="SmtpServer" index="i">#SmtpServer#</ad:foreach>
=================================
Webmail (OWA, Outlook Web Access)
=================================
https://mail.virtuworks.net/owa
=================================
Outlook (Windows Clients)
=================================
To configure Outlook 2010 to work with VirtuWorks servers, please reference:
https://portal.virtuworks.net/whmcs/knowledgebase.php?action=displayarticle&id=2
If you need to download and install the Outlook 2010 client:
Outlook 2010 Download URL:
32 Bit - http://www.virtuworks.net/downloads/Outlook2010-32bit.zip
64 Bit - http://www.virtuworks.net/downloads/Outlook2010-64bit.zip
KEY: HXGFV-DY3HM-4W2BQ-3R7KQ-K8P49
=================================
ActiveSync, iPhone, iPad
=================================
Server: #ActiveSyncServer#
Domain: #SamDomain#
SSL: must be checked
Your username: #SamUsername#
=================================
Password Changes
=================================
Passwords can be changed at any time using Webmail or the Control Panel (https://controlpanel.virtuworks.net).
=================================
Control Panel
=================================
If you need to change the details of your account, you can easily do this using the Control Panel (https://controlpanel.virtuworks.net).
=================================
Support
=================================
Set @ExchangeMailboxSetupLetterTextBody = N'<ad:if test="#Email#">
Hello #Account.DisplayName#,
Thanks for choosing VirtuWorks as your Exchange hosting provider.
</ad:if>
<ad:if test="#not(PMM)#">
User Accounts
The following user accounts have been created for you.
Username: #Account.UserPrincipalName#
E-mail: #Account.PrimaryEmailAddress#
<ad:if test="#PswResetUrl#">
Password Reset Url: #PswResetUrl#
</ad:if>
</ad:if>
=================================
DNS
=================================
In order for us to accept mail for your domain, you will need to point your MX records to:
<ad:foreach collection="#SmtpServers#" var="SmtpServer" index="i">#SmtpServer#</ad:foreach>
=================================
Webmail (OWA, Outlook Web Access)
=================================
https://mail.virtuworks.net/owa
=================================
Outlook (Windows Clients)
=================================
To configure Outlook 2010 to work with VirtuWorks servers, please reference:
https://portal.virtuworks.net/whmcs/knowledgebase.php?action=displayarticle&id=2
If you need to download and install the Outlook 2010 client:
Outlook 2010 Download URL:
32 Bit - http://www.virtuworks.net/downloads/Outlook2010-32bit.zip
64 Bit - http://www.virtuworks.net/downloads/Outlook2010-64bit.zip
KEY: HXGFV-DY3HM-4W2BQ-3R7KQ-K8P49
=================================
ActiveSync, iPhone, iPad
=================================
Server: #ActiveSyncServer#
Domain: #SamDomain#
SSL: must be checked
Your username: #SamUsername#
=================================
Password Changes
=================================
Passwords can be changed at any time using Webmail or the Control Panel (https://controlpanel.virtuworks.net).
=================================
Control Panel
=================================
If you need to change the details of your account, you can easily do this using the Control Panel (https://controlpanel.virtuworks.net).
=================================
Support
=================================
You have 2 options, email help@virtuworks.com or use the web interface at http://www.virtuworks.com/contact/'
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'ExchangeMailboxSetupLetter' AND [PropertyName]= N'TextBody' )
@ -10685,3 +10716,229 @@ SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetSearchObject')
DROP PROCEDURE GetSearchObject
GO
CREATE PROCEDURE [dbo].[GetSearchObject]
(
@ActorID int,
@UserID int,
@FilterColumn nvarchar(50) = '',
@FilterValue nvarchar(50) = '',
@StatusID int,
@RoleID int,
@SortColumn nvarchar(50),
@StartRow int,
@MaximumRows int = 0,
@Recursive bit,
@ColType nvarchar(50) = ''
)
AS
IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0
RAISERROR('You are not allowed to access this account', 16, 1)
DECLARE @columnUsername nvarchar(20)
SET @columnUsername = 'Username'
DECLARE @columnEmail nvarchar(20)
SET @columnEmail = 'Email'
DECLARE @columnCompanyName nvarchar(20)
SET @columnCompanyName = 'CompanyName'
DECLARE @columnFullName nvarchar(20)
SET @columnFullName = 'FullName'
DECLARE @curUsers cursor
DECLARE @curSpace cursor
DECLARE @sqlSpace nvarchar(2000)
DECLARE @sqlUsers nvarchar(2000)
DECLARE @sqlReturn nvarchar(2000)
IF @FilterColumn = '' AND @FilterValue <> ''
SET @FilterColumn = 'TextSearch'
SET @sqlUsers = '
DECLARE @HasUserRights bit
SET @HasUserRights = dbo.CheckActorUserRights(@ActorID, @UserID)
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
SET @curValue = cursor local for
SELECT
U.ItemID,
U.TextSearch,
U.ColumnType,
''Users'' as FullType,
0 as PackageID
FROM @Users AS TU
INNER JOIN
(
SELECT ItemID, TextSearch, ColumnType
FROM(
SELECT U0.UserID as ItemID, U0.Username as TextSearch, @columnUsername as ColumnType
FROM dbo.Users AS U0
UNION
SELECT U1.UserID as ItemID, U1.Email as TextSearch, @columnEmail as ColumnType
FROM dbo.Users AS U1
UNION
SELECT U2.UserID as ItemID, U2.CompanyName as TextSearch, @columnCompanyName as ColumnType
FROM dbo.Users AS U2
UNION
SELECT U3.UserID as ItemID, U3.FirstName + '' '' + U3.LastName as TextSearch, @columnFullName as ColumnType
FROM dbo.Users AS U3) as U
WHERE TextSearch<>'' '' OR ISNULL(TextSearch, 0) > 0
)
AS U ON TU.UserID = U.ItemID'
SET @sqlUsers = @sqlUsers + ' open @curValue'
exec sp_executesql @sqlUsers, N'@UserID int, @FilterValue nvarchar(50), @ActorID int, @Recursive bit, @StatusID int, @RoleID int, @columnUsername nvarchar(20), @columnEmail nvarchar(20), @columnCompanyName nvarchar(20), @columnFullName nvarchar(20), @curValue cursor output',
@UserID, @FilterValue, @ActorID, @Recursive, @StatusID, @RoleID, @columnUsername, @columnEmail, @columnCompanyName, @columnFullName, @curValue=@curUsers output
SET @sqlSpace = '
DECLARE @ItemsService TABLE
(
ItemID int
)
INSERT INTO @ItemsService (ItemID)
SELECT
SI.ItemID
FROM ServiceItems AS SI
INNER JOIN Packages AS P ON P.PackageID = SI.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
WHERE
dbo.CheckUserParent(@UserID, P.UserID) = 1
DECLARE @ItemsDomain TABLE
(
ItemID int
)
INSERT INTO @ItemsDomain (ItemID)
SELECT
D.DomainID
FROM Domains AS D
INNER JOIN Packages AS P ON P.PackageID = D.PackageID
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
WHERE
dbo.CheckUserParent(@UserID, P.UserID) = 1
SET @curValue = cursor local for
SELECT
SI.ItemID as ItemID,
SI.ItemName as TextSearch,
STYPE.DisplayName as ColumnType,
SI.ItemName as FullType,
SI.PackageID as PackageID
FROM @ItemsService AS I
INNER JOIN ServiceItems AS SI ON I.ItemID = SI.ItemID
INNER JOIN ServiceItemTypes AS STYPE ON SI.ItemTypeID = STYPE.ItemTypeID
WHERE STYPE.Searchable = 1
UNION
SELECT
D.DomainID AS ItemID,
D.DomainName as TextSearch,
''Domain'' as ColumnType,
''Domain'' as FullType,
D.PackageID as PackageID
FROM @ItemsDomain AS I
INNER JOIN Domains AS D ON I.ItemID = D.DomainID
WHERE D.IsDomainPointer=0'
SET @sqlSpace = @sqlSpace + ' open @curValue'
exec sp_executesql @sqlSpace, N'@UserID int, @FilterValue nvarchar(50), @ActorID int, @curValue cursor output',
@UserID, @FilterValue, @ActorID, @curValue=@curSpace output
SET @sqlReturn = '
DECLARE @ItemID int
DECLARE @TextSearch nvarchar(500)
DECLARE @ColumnType nvarchar(50)
DECLARE @FullType nvarchar(50)
DECLARE @PackageID int
DECLARE @EndRow int
SET @EndRow = @StartRow + @MaximumRows
DECLARE @ItemsAll TABLE
(
ItemPosition int IDENTITY(1,1),
ItemID int,
TextSearch nvarchar(500),
ColumnType nvarchar(50),
FullType nvarchar(50),
PackageID int
)
FETCH NEXT FROM @curSpaceValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO @ItemsAll(ItemID, TextSearch, ColumnType, FullType, PackageID)
VALUES(@ItemID, @TextSearch, @ColumnType, @FullType, @PackageID)
FETCH NEXT FROM @curSpaceValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID
END
FETCH NEXT FROM @curUsersValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO @ItemsAll(ItemID, TextSearch, ColumnType, FullType, PackageID)
VALUES(@ItemID, @TextSearch, @ColumnType, @FullType, @PackageID)
FETCH NEXT FROM @curUsersValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID
END
DECLARE @ItemsReturn TABLE
(
ItemPosition int IDENTITY(1,1),
ItemID int,
TextSearch nvarchar(500),
ColumnType nvarchar(50),
FullType nvarchar(50),
PackageID int
)
INSERT INTO @ItemsReturn(ItemID, TextSearch, ColumnType, FullType, PackageID)
SELECT ItemID, TextSearch, ColumnType, FullType, PackageID
FROM @ItemsAll AS IA'
IF @FilterValue <> ''
SET @sqlReturn = @sqlReturn + ' WHERE IA.' + @FilterColumn + ' LIKE @FilterValue '
IF @SortColumn <> '' AND @SortColumn IS NOT NULL
SET @sqlReturn = @sqlReturn + ' ORDER BY ' + @SortColumn + ' '
SET @sqlReturn = @sqlReturn + '
SELECT COUNT(ItemID) FROM @ItemsReturn;
SELECT DISTINCT(ColumnType) FROM @ItemsReturn;
SELECT ItemPosition, ItemID, TextSearch, ColumnType, FullType, PackageID
FROM @ItemsReturn AS IR WHERE (1 = 1)
'
IF @MaximumRows > 0
SET @sqlReturn = @sqlReturn + ' AND IR.ItemPosition BETWEEN @StartRow AND @EndRow';
IF @ColType <> ''
SET @sqlReturn = @sqlReturn + ' AND ColumnType in ( ' + @ColType + ' ) ';
exec sp_executesql @sqlReturn, N'@StartRow int, @MaximumRows int, @FilterValue nvarchar(50), @curSpaceValue cursor, @curUsersValue cursor',
@StartRow, @MaximumRows, @FilterValue, @curSpace, @curUsers
CLOSE @curSpace
DEALLOCATE @curSpace
CLOSE @curUsers
DEALLOCATE @curUsers
RETURN

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
</configuration>

Binary file not shown.

View file

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
<!-- Enable the restore command to run before builds -->
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
<!-- Property that enables building a package from a project -->
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
<!-- Determines if package restore consent is required to restore packages -->
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
<!-- Download NuGet.exe if it does not already exist -->
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
</PropertyGroup>
<ItemGroup Condition=" '$(PackageSources)' == '' ">
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
<!--
<PackageSource Include="https://www.nuget.org/api/v2/" />
<PackageSource Include="https://my-nuget-source/nuget/" />
-->
</ItemGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
<!-- Windows specific commands -->
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
</PropertyGroup>
<PropertyGroup>
<PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
<PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig>
</PropertyGroup>
<PropertyGroup>
<PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig>
<PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</PackagesConfig>
</PropertyGroup>
<PropertyGroup>
<!-- NuGet command -->
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 "$(NuGetExePath)"</NuGetCommand>
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
<!-- Commands -->
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
<!-- We need to ensure packages are restored prior to assembly resolve -->
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
RestorePackages;
$(BuildDependsOn);
</BuildDependsOn>
<!-- Make the build depend on restore packages -->
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
$(BuildDependsOn);
BuildPackage;
</BuildDependsOn>
</PropertyGroup>
<Target Name="CheckPrerequisites">
<!-- Raise an error if we're unable to locate nuget.exe -->
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
<!--
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
This effectively acts as a lock that makes sure that the download operation will only happen once and all
parallel builds will have to wait for it to complete.
-->
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
</Target>
<Target Name="_DownloadNuGet">
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
</Target>
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)"
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true"
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
</Target>
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(BuildCommand)"
Condition=" '$(OS)' != 'Windows_NT' " />
<Exec Command="$(BuildCommand)"
LogStandardErrorAsError="true"
Condition=" '$(OS)' == 'Windows_NT' " />
</Target>
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<OutputFilename ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Net" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
OutputFilename = Path.GetFullPath(OutputFilename);
Log.LogMessage("Downloading latest version of NuGet.exe...");
WebClient webClient = new WebClient();
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
return true;
}
catch (Exception ex) {
Log.LogErrorFromException(ex);
return false;
}
]]>
</Code>
</Task>
</UsingTask>
</Project>

View file

@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.7</ProductVersion>
<ProductVersion>3.9</ProductVersion>
<ProjectGuid>3f3f1c39-6719-4862-bb45-4c227f13b821</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>WebsitePanel.LocalizationToolkit</OutputName>
@ -63,4 +63,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View file

@ -1,7 +1,7 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.34014
' Runtime Version:4.0.30319.34209
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.

View file

@ -47,6 +47,14 @@ namespace WebsitePanel.EnterpriseServer
public const string PACKAGE_DISPLAY_SETTINGS = "PackageDisplaySettings";
public const string RDS_SETTINGS = "RdsSettings";
public const string WEBDAV_PORTAL_SETTINGS = "WebdavPortalSettings";
public const string TWILIO_SETTINGS = "TwilioSettings";
//Keys
public const string TWILIO_ACCOUNTSID_KEY = "TwilioAccountSid";
public const string TWILIO_AUTHTOKEN_KEY = "TwilioAuthToken";
public const string TWILIO_PHONEFROM_KEY = "TwilioPhoneFrom";
public const string WEBDAV_PASSWORD_RESET_ENABLED_KEY = "WebdavPswResetEnabled";
// key to access to wpi main & custom feed in wpi settings

View file

@ -11,6 +11,12 @@
//
// This source code was auto-generated by wsdl, Version=2.0.50727.3038.
//
using WebsitePanel.Providers;
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.ResultObjects;
namespace WebsitePanel.EnterpriseServer {
using System.Xml.Serialization;
using System.Web.Services;
@ -19,10 +25,6 @@ namespace WebsitePanel.EnterpriseServer {
using System;
using System.Diagnostics;
using System.Data;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.Providers;
/// <remarks/>
@ -4311,24 +4313,26 @@ namespace WebsitePanel.EnterpriseServer {
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMailboxSetupInstructions", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string GetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup) {
public string GetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string passwordResetUrl) {
object[] results = this.Invoke("GetMailboxSetupInstructions", new object[] {
itemId,
accountId,
pmm,
emailMode,
signup});
signup,
passwordResetUrl});
return ((string)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup, System.AsyncCallback callback, object asyncState) {
public System.IAsyncResult BeginGetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string passwordResetUrl, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetMailboxSetupInstructions", new object[] {
itemId,
accountId,
pmm,
emailMode,
signup}, callback, asyncState);
signup,
passwordResetUrl}, callback, asyncState);
}
/// <remarks/>
@ -4338,12 +4342,12 @@ namespace WebsitePanel.EnterpriseServer {
}
/// <remarks/>
public void GetMailboxSetupInstructionsAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup) {
this.GetMailboxSetupInstructionsAsync(itemId, accountId, pmm, emailMode, signup, null);
public void GetMailboxSetupInstructionsAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string passwordResetUrl) {
this.GetMailboxSetupInstructionsAsync(itemId, accountId, pmm, emailMode, signup, passwordResetUrl, null);
}
/// <remarks/>
public void GetMailboxSetupInstructionsAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup, object userState) {
public void GetMailboxSetupInstructionsAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string passwordResetUrl, object userState) {
if ((this.GetMailboxSetupInstructionsOperationCompleted == null)) {
this.GetMailboxSetupInstructionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMailboxSetupInstructionsOperationCompleted);
}
@ -4352,7 +4356,8 @@ namespace WebsitePanel.EnterpriseServer {
accountId,
pmm,
emailMode,
signup}, this.GetMailboxSetupInstructionsOperationCompleted, userState);
signup,
passwordResetUrl}, this.GetMailboxSetupInstructionsOperationCompleted, userState);
}
private void OnGetMailboxSetupInstructionsOperationCompleted(object arg) {

View file

@ -80,6 +80,12 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
private System.Threading.SendOrPostCallback SetDefaultOrganizationOperationCompleted;
private System.Threading.SendOrPostCallback GetUserGeneralSettingsWithExtraDataOperationCompleted;
private System.Threading.SendOrPostCallback SendResetUserPasswordLinkSmsOperationCompleted;
private System.Threading.SendOrPostCallback SendResetUserPasswordPincodeSmsOperationCompleted;
private System.Threading.SendOrPostCallback AddOrganizationDomainOperationCompleted;
private System.Threading.SendOrPostCallback ChangeOrganizationDomainTypeOperationCompleted;
@ -229,6 +235,15 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
/// <remarks/>
public event SetDefaultOrganizationCompletedEventHandler SetDefaultOrganizationCompleted;
/// <remarks/>
public event GetUserGeneralSettingsWithExtraDataCompletedEventHandler GetUserGeneralSettingsWithExtraDataCompleted;
/// <remarks/>
public event SendResetUserPasswordLinkSmsCompletedEventHandler SendResetUserPasswordLinkSmsCompleted;
/// <remarks/>
public event SendResetUserPasswordPincodeSmsCompletedEventHandler SendResetUserPasswordPincodeSmsCompleted;
/// <remarks/>
public event AddOrganizationDomainCompletedEventHandler AddOrganizationDomainCompleted;
@ -1310,6 +1325,144 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetUserGeneralSettingsWithExtraData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public OrganizationUser GetUserGeneralSettingsWithExtraData(int itemId, int accountId) {
object[] results = this.Invoke("GetUserGeneralSettingsWithExtraData", new object[] {
itemId,
accountId});
return ((OrganizationUser)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetUserGeneralSettingsWithExtraData(int itemId, int accountId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetUserGeneralSettingsWithExtraData", new object[] {
itemId,
accountId}, callback, asyncState);
}
/// <remarks/>
public OrganizationUser EndGetUserGeneralSettingsWithExtraData(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((OrganizationUser)(results[0]));
}
/// <remarks/>
public void GetUserGeneralSettingsWithExtraDataAsync(int itemId, int accountId) {
this.GetUserGeneralSettingsWithExtraDataAsync(itemId, accountId, null);
}
/// <remarks/>
public void GetUserGeneralSettingsWithExtraDataAsync(int itemId, int accountId, object userState) {
if ((this.GetUserGeneralSettingsWithExtraDataOperationCompleted == null)) {
this.GetUserGeneralSettingsWithExtraDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetUserGeneralSettingsWithExtraDataOperationCompleted);
}
this.InvokeAsync("GetUserGeneralSettingsWithExtraData", new object[] {
itemId,
accountId}, this.GetUserGeneralSettingsWithExtraDataOperationCompleted, userState);
}
private void OnGetUserGeneralSettingsWithExtraDataOperationCompleted(object arg) {
if ((this.GetUserGeneralSettingsWithExtraDataCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetUserGeneralSettingsWithExtraDataCompleted(this, new GetUserGeneralSettingsWithExtraDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendResetUserPasswordLinkSms", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public ResultObject SendResetUserPasswordLinkSms(int itemId, int accountId, string reason, string phoneTo) {
object[] results = this.Invoke("SendResetUserPasswordLinkSms", new object[] {
itemId,
accountId,
reason,
phoneTo});
return ((ResultObject)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginSendResetUserPasswordLinkSms(int itemId, int accountId, string reason, string phoneTo, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SendResetUserPasswordLinkSms", new object[] {
itemId,
accountId,
reason,
phoneTo}, callback, asyncState);
}
/// <remarks/>
public ResultObject EndSendResetUserPasswordLinkSms(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ResultObject)(results[0]));
}
/// <remarks/>
public void SendResetUserPasswordLinkSmsAsync(int itemId, int accountId, string reason, string phoneTo) {
this.SendResetUserPasswordLinkSmsAsync(itemId, accountId, reason, phoneTo, null);
}
/// <remarks/>
public void SendResetUserPasswordLinkSmsAsync(int itemId, int accountId, string reason, string phoneTo, object userState) {
if ((this.SendResetUserPasswordLinkSmsOperationCompleted == null)) {
this.SendResetUserPasswordLinkSmsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendResetUserPasswordLinkSmsOperationCompleted);
}
this.InvokeAsync("SendResetUserPasswordLinkSms", new object[] {
itemId,
accountId,
reason,
phoneTo}, this.SendResetUserPasswordLinkSmsOperationCompleted, userState);
}
private void OnSendResetUserPasswordLinkSmsOperationCompleted(object arg) {
if ((this.SendResetUserPasswordLinkSmsCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SendResetUserPasswordLinkSmsCompleted(this, new SendResetUserPasswordLinkSmsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendResetUserPasswordPincodeSms", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public ResultObject SendResetUserPasswordPincodeSms(System.Guid token, string phoneTo) {
object[] results = this.Invoke("SendResetUserPasswordPincodeSms", new object[] {
token,
phoneTo});
return ((ResultObject)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginSendResetUserPasswordPincodeSms(System.Guid token, string phoneTo, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SendResetUserPasswordPincodeSms", new object[] {
token,
phoneTo}, callback, asyncState);
}
/// <remarks/>
public ResultObject EndSendResetUserPasswordPincodeSms(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ResultObject)(results[0]));
}
/// <remarks/>
public void SendResetUserPasswordPincodeSmsAsync(System.Guid token, string phoneTo) {
this.SendResetUserPasswordPincodeSmsAsync(token, phoneTo, null);
}
/// <remarks/>
public void SendResetUserPasswordPincodeSmsAsync(System.Guid token, string phoneTo, object userState) {
if ((this.SendResetUserPasswordPincodeSmsOperationCompleted == null)) {
this.SendResetUserPasswordPincodeSmsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendResetUserPasswordPincodeSmsOperationCompleted);
}
this.InvokeAsync("SendResetUserPasswordPincodeSms", new object[] {
token,
phoneTo}, this.SendResetUserPasswordPincodeSmsOperationCompleted, userState);
}
private void OnSendResetUserPasswordPincodeSmsOperationCompleted(object arg) {
if ((this.SendResetUserPasswordPincodeSmsCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SendResetUserPasswordPincodeSmsCompleted(this, new SendResetUserPasswordPincodeSmsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddOrganizationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public int AddOrganizationDomain(int itemId, string domainName) {
@ -2495,21 +2648,23 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendResetUserPasswordEmail", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public void SendResetUserPasswordEmail(int itemId, int accountId, string reason, string mailTo) {
public void SendResetUserPasswordEmail(int itemId, int accountId, string reason, string mailTo, bool finalStep) {
this.Invoke("SendResetUserPasswordEmail", new object[] {
itemId,
accountId,
reason,
mailTo});
mailTo,
finalStep});
}
/// <remarks/>
public System.IAsyncResult BeginSendResetUserPasswordEmail(int itemId, int accountId, string reason, string mailTo, System.AsyncCallback callback, object asyncState) {
public System.IAsyncResult BeginSendResetUserPasswordEmail(int itemId, int accountId, string reason, string mailTo, bool finalStep, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SendResetUserPasswordEmail", new object[] {
itemId,
accountId,
reason,
mailTo}, callback, asyncState);
mailTo,
finalStep}, callback, asyncState);
}
/// <remarks/>
@ -2518,12 +2673,12 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
}
/// <remarks/>
public void SendResetUserPasswordEmailAsync(int itemId, int accountId, string reason, string mailTo) {
this.SendResetUserPasswordEmailAsync(itemId, accountId, reason, mailTo, null);
public void SendResetUserPasswordEmailAsync(int itemId, int accountId, string reason, string mailTo, bool finalStep) {
this.SendResetUserPasswordEmailAsync(itemId, accountId, reason, mailTo, finalStep, null);
}
/// <remarks/>
public void SendResetUserPasswordEmailAsync(int itemId, int accountId, string reason, string mailTo, object userState) {
public void SendResetUserPasswordEmailAsync(int itemId, int accountId, string reason, string mailTo, bool finalStep, object userState) {
if ((this.SendResetUserPasswordEmailOperationCompleted == null)) {
this.SendResetUserPasswordEmailOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendResetUserPasswordEmailOperationCompleted);
}
@ -2531,7 +2686,8 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
itemId,
accountId,
reason,
mailTo}, this.SendResetUserPasswordEmailOperationCompleted, userState);
mailTo,
finalStep}, this.SendResetUserPasswordEmailOperationCompleted, userState);
}
private void OnSendResetUserPasswordEmailOperationCompleted(object arg) {
@ -3816,6 +3972,84 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void SetDefaultOrganizationCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void GetUserGeneralSettingsWithExtraDataCompletedEventHandler(object sender, GetUserGeneralSettingsWithExtraDataCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetUserGeneralSettingsWithExtraDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetUserGeneralSettingsWithExtraDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public OrganizationUser Result {
get {
this.RaiseExceptionIfNecessary();
return ((OrganizationUser)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void SendResetUserPasswordLinkSmsCompletedEventHandler(object sender, SendResetUserPasswordLinkSmsCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class SendResetUserPasswordLinkSmsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal SendResetUserPasswordLinkSmsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public ResultObject Result {
get {
this.RaiseExceptionIfNecessary();
return ((ResultObject)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void SendResetUserPasswordPincodeSmsCompletedEventHandler(object sender, SendResetUserPasswordPincodeSmsCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class SendResetUserPasswordPincodeSmsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal SendResetUserPasswordPincodeSmsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public ResultObject Result {
get {
this.RaiseExceptionIfNecessary();
return ((ResultObject)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void AddOrganizationDomainCompletedEventHandler(object sender, AddOrganizationDomainCompletedEventArgs e);

View file

@ -906,7 +906,28 @@ namespace WebsitePanel.EnterpriseServer {
object[] results = this.EndInvoke(asyncResult);
return ((System.Data.DataSet)(results[0]));
}
/// <remarks/>
/// //TODO START
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetSearchObject", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public System.Data.DataSet GetSearchObject(int userId, string filterColumn, string filterValue, int statusId, int roleId, string sortColumn, int startRow, int maximumRows, string colType)
{
object[] results = this.Invoke("GetSearchObject", new object[] {
userId,
filterColumn,
filterValue,
statusId,
roleId,
sortColumn,
startRow,
maximumRows,
colType
});
return ((System.Data.DataSet)(results[0]));
}
//TODO END
/// <remarks/>
public void SearchServiceItemsPagedAsync(int userId, int itemTypeId, string filterValue, string sortColumn, int startRow, int maximumRows) {
this.SearchServiceItemsPagedAsync(userId, itemTypeId, filterValue, sortColumn, startRow, maximumRows, null);

View file

@ -139,6 +139,27 @@ namespace WebsitePanel.EnterpriseServer
new SqlParameter("@recursive", recursive));
}
//TODO START
public static DataSet GetSearchObject(int actorId, int userId, string filterColumn, string filterValue,
int statusId, int roleId, string sortColumn, int startRow, int maximumRows, string colType, bool recursive)
{
return SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure,
ObjectQualifier + "GetSearchObject",
new SqlParameter("@actorId", actorId),
new SqlParameter("@UserID", userId),
new SqlParameter("@FilterColumn", VerifyColumnName(filterColumn)),
new SqlParameter("@FilterValue", VerifyColumnValue(filterValue)),
new SqlParameter("@statusId", statusId),
new SqlParameter("@roleId", roleId),
new SqlParameter("@SortColumn", VerifyColumnName(sortColumn)),
new SqlParameter("@startRow", startRow),
new SqlParameter("@maximumRows", maximumRows),
new SqlParameter("@recursive", recursive),
new SqlParameter("@ColType", colType));
}
//TODO END
public static DataSet GetUsersSummary(int actorId, int userId)
{
return SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure,

View file

@ -2564,7 +2564,7 @@ namespace WebsitePanel.EnterpriseServer
}
}
public static string GetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup)
public static string GetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string passwordResetUrl)
{
#region Demo Mode
if (IsDemoMode)
@ -2589,12 +2589,11 @@ namespace WebsitePanel.EnterpriseServer
if (String.IsNullOrEmpty(body))
return null;
string result = EvaluateMailboxTemplate(itemId, accountId, pmm, false, false, body);
string result = EvaluateMailboxTemplate(itemId, accountId, pmm, false, false, body, passwordResetUrl);
return user.HtmlMail ? result : result.Replace("\n", "<br/>");
}
private static string EvaluateMailboxTemplate(int itemId, int accountId,
bool pmm, bool emailMode, bool signup, string template)
private static string EvaluateMailboxTemplate(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string template, string passwordResetUrl)
{
Hashtable items = new Hashtable();
@ -2616,7 +2615,10 @@ namespace WebsitePanel.EnterpriseServer
items["AccountDomain"] = account.PrimaryEmailAddress.Substring(account.PrimaryEmailAddress.IndexOf("@") + 1);
items["DefaultDomain"] = org.DefaultDomain;
var passwordResetUrl = OrganizationController.GenerateUserPasswordResetLink(account.ItemId, account.AccountId);
Guid token;
passwordResetUrl = OrganizationController.GenerateUserPasswordResetLink(account.ItemId, account.AccountId, out token, string.Empty, passwordResetUrl);
if (!string.IsNullOrEmpty(passwordResetUrl))
{
items["PswResetUrl"] = passwordResetUrl;
@ -2694,8 +2696,8 @@ namespace WebsitePanel.EnterpriseServer
if (to == null)
to = user.Email;
subject = EvaluateMailboxTemplate(itemId, accountId, false, true, signup, subject);
body = EvaluateMailboxTemplate(itemId, accountId, false, true, signup, body);
subject = EvaluateMailboxTemplate(itemId, accountId, false, true, signup, subject, string.Empty);
body = EvaluateMailboxTemplate(itemId, accountId, false, true, signup, body, string.Empty);
// send message
return MailHelper.SendMessage(from, to, cc, subject, body, priority, isHtml);

View file

@ -30,10 +30,13 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration;
using System.Data;
using System.Globalization;
using System.Net.Mail;
using System.Text;
using System.Threading.Tasks;
using Twilio;
using WebsitePanel.EnterpriseServer.Code.HostedSolution;
using WebsitePanel.EnterpriseServer.Code.SharePoint;
using WebsitePanel.EnterpriseServer.Extensions;
@ -1560,6 +1563,173 @@ namespace WebsitePanel.EnterpriseServer
return expiredUsersDb;
}
public static ResultObject SendResetUserPasswordLinkSms(int itemId, int accountId, string reason,
string phoneTo = null)
{
var result = TaskManager.StartResultTask<ResultObject>("ORGANIZATION", "SEND_USER_PASSWORD_RESET_SMS",
itemId);
try
{
// load organization
Organization org = GetOrganization(itemId);
if (org == null)
{
throw new Exception(string.Format("Organization not found (ItemId = {0})", itemId));
}
UserInfo owner = PackageController.GetPackageOwner(org.PackageId);
OrganizationUser user = OrganizationController.GetUserGeneralSettingsWithExtraData(itemId, accountId);
user.ItemId = itemId;
if (string.IsNullOrEmpty(phoneTo))
{
phoneTo = user.MobilePhone;
}
UserSettings settings = UserController.GetUserSettings(owner.UserId,
UserSettings.USER_PASSWORD_RESET_LETTER);
string body = settings["PasswordResetLinkSmsBody"];
var pincode = GeneratePincode();
Guid token;
var items = new Hashtable();
items["passwordResetLink"] = GenerateUserPasswordResetLink(user.ItemId, user.AccountId, out token, pincode);
body = PackageController.EvaluateTemplate(body, items);
TaskManager.Write("Organization ID : " + user.ItemId);
TaskManager.Write("Account : " + user.DisplayName);
TaskManager.Write("Reason : " + reason);
TaskManager.Write("SmsTo : " + phoneTo);
// send Sms message
var response = SendSms(phoneTo, body);
if (response.RestException != null)
{
throw new Exception(response.RestException.Message);
}
SetAccessTokenResponse(token, pincode);
}
catch (Exception ex)
{
TaskManager.WriteError(ex);
TaskManager.CompleteResultTask(result);
result.AddError("", ex);
return result;
}
TaskManager.CompleteResultTask();
return result;
}
public static ResultObject SendResetUserPasswordPincodeSms(Guid token, string phoneTo = null)
{
var result = TaskManager.StartResultTask<ResultObject>("ORGANIZATION", "SEND_USER_PASSWORD_RESET_SMS_PINCODE");
try
{
var accessToken = OrganizationController.GetAccessToken(token, AccessTokenTypes.PasswrodReset);
if (accessToken == null)
{
throw new Exception(string.Format("Access token not found"));
}
// load organization
Organization org = GetOrganization(accessToken.ItemId);
if (org == null)
{
throw new Exception(string.Format("Organization not found"));
}
UserInfo owner = PackageController.GetPackageOwner(org.PackageId);
OrganizationUser user = OrganizationController.GetUserGeneralSettingsWithExtraData(accessToken.ItemId,
accessToken.AccountId);
if (string.IsNullOrEmpty(phoneTo))
{
phoneTo = user.MobilePhone;
}
UserSettings settings = UserController.GetUserSettings(owner.UserId, UserSettings.USER_PASSWORD_RESET_LETTER);
string body = settings["PasswordResetPincodeSmsBody"];
var items = new Hashtable();
var pincode = GeneratePincode();
items["passwordResetPincode"] = pincode;
body = PackageController.EvaluateTemplate(body, items);
TaskManager.Write("Organization ID : " + user.ItemId);
TaskManager.Write("Account : " + user.DisplayName);
TaskManager.Write("SmsTo : " + phoneTo);
// send Sms message
var response = SendSms(phoneTo, body);
if (response.RestException != null)
{
throw new Exception(response.RestException.Message);
}
SetAccessTokenResponse(token, pincode);
}
catch (Exception ex)
{
TaskManager.WriteError(ex);
TaskManager.CompleteResultTask(result);
result.AddError("", ex);
return result;
}
TaskManager.CompleteResultTask();
return result;
}
private static string GeneratePincode()
{
var random = new Random(Guid.NewGuid().GetHashCode());
return random.Next(10000, 99999).ToString(CultureInfo.InvariantCulture);
}
private static SMSMessage SendSms(string to, string body)
{
SystemSettings settings = SystemController.GetSystemSettingsInternal(SystemSettings.TWILIO_SETTINGS, false);
if (settings == null)
{
throw new Exception("Twilio settings are not set");
}
string accountSid = settings.GetValueOrDefault(SystemSettings.TWILIO_ACCOUNTSID_KEY, string.Empty);
string authToken = settings.GetValueOrDefault(SystemSettings.TWILIO_AUTHTOKEN_KEY, string.Empty);
string phoneFrom = settings.GetValueOrDefault(SystemSettings.TWILIO_PHONEFROM_KEY, string.Empty);
if (string.IsNullOrEmpty(accountSid) || string.IsNullOrEmpty(accountSid) || string.IsNullOrEmpty(accountSid))
{
throw new Exception("Twilio settings are not set (System settings)");
}
var client = new TwilioRestClient(accountSid, authToken);
return client.SendSmsMessage(phoneFrom, to, body);
}
/// <summary>
/// Send reset user password email
/// </summary>
@ -1567,7 +1737,8 @@ namespace WebsitePanel.EnterpriseServer
/// <param name="accountId">User Id</param>
/// <param name="reason">Reason why reset email is sent.</param>
/// <param name="mailTo">Optional, if null accountID user PrimaryEmailAddress will be used</param>
public static void SendResetUserPasswordEmail(int itemId, int accountId, string reason, string mailTo = null)
/// <param name="finalStep">Url direction</param>
public static void SendResetUserPasswordEmail(int itemId, int accountId, string reason, string mailTo, bool finalStep)
{
// load organization
Organization org = GetOrganization(itemId);
@ -1581,11 +1752,9 @@ namespace WebsitePanel.EnterpriseServer
UserInfo owner = PackageController.GetPackageOwner(org.PackageId);
OrganizationUser user = OrganizationController.GetAccount(itemId, accountId);
OrganizationUser user = OrganizationController.GetUserGeneralSettingsWithExtraData(itemId, accountId);
OrganizationUser settings = orgProxy.GetUserGeneralSettings(user.AccountName, org.OrganizationId);
user.PasswordExpirationDateTime = settings.PasswordExpirationDateTime;
user.ItemId = itemId;
if (string.IsNullOrEmpty(mailTo))
{
@ -1596,16 +1765,16 @@ namespace WebsitePanel.EnterpriseServer
var logoUrl = generalSettings != null ? generalSettings.OrganizationLogoUrl : string.Empty;
SendUserPasswordEmail(owner, user, reason, mailTo, logoUrl, UserSettings.USER_PASSWORD_RESET_LETTER, "USER_PASSWORD_RESET_LETTER");
SendUserPasswordEmail(owner, user, reason, mailTo, logoUrl, UserSettings.USER_PASSWORD_RESET_LETTER, "USER_PASSWORD_RESET_LETTER", finalStep);
}
public static void SendUserExpirationPasswordEmail(UserInfo owner, OrganizationUser user, string reason,
string mailTo, string logoUrl)
{
SendUserPasswordEmail(owner, user, reason, user.PrimaryEmailAddress, logoUrl, UserSettings.USER_PASSWORD_EXPIRATION_LETTER, "USER_PASSWORD_EXPIRATION_LETTER");
SendUserPasswordEmail(owner, user, reason, user.PrimaryEmailAddress, logoUrl, UserSettings.USER_PASSWORD_EXPIRATION_LETTER, "USER_PASSWORD_EXPIRATION_LETTER", false);
}
public static void SendUserPasswordEmail(UserInfo owner, OrganizationUser user, string reason, string mailTo, string logoUrl, string settingsName, string taskName)
public static void SendUserPasswordEmail(UserInfo owner, OrganizationUser user, string reason, string mailTo, string logoUrl, string settingsName, string taskName, bool finalStep)
{
UserSettings settings = UserController.GetUserSettings(owner.UserId,
settingsName);
@ -1632,14 +1801,23 @@ namespace WebsitePanel.EnterpriseServer
priority = (MailPriority) Enum.Parse(typeof (MailPriority), settings["Priority"], true);
}
Guid token;
string pincode = finalStep ? GeneratePincode() : null;
Hashtable items = new Hashtable();
items["user"] = user;
items["logoUrl"] = logoUrl;
items["passwordResetLink"] = GenerateUserPasswordResetLink(user.ItemId, user.AccountId);
items["passwordResetLink"] = GenerateUserPasswordResetLink(user.ItemId, user.AccountId, out token, pincode);
body = PackageController.EvaluateTemplate(body, items);
if (finalStep)
{
SetAccessTokenResponse(token, pincode);
}
TaskManager.Write("Organization ID : " + user.ItemId);
TaskManager.Write("Account : " + user.DisplayName);
TaskManager.Write("Reason : " + reason);
@ -1658,6 +1836,8 @@ namespace WebsitePanel.EnterpriseServer
}
}
public static AccessToken GetAccessToken(Guid accessToken, AccessTokenTypes type)
{
return ObjectUtils.FillObjectFromDataReader<AccessToken>(DataProvider.GetAccessTokenByAccessToken(accessToken, type));
@ -1678,23 +1858,38 @@ namespace WebsitePanel.EnterpriseServer
return SystemController.GetSystemSettingsInternal(SystemSettings.WEBDAV_PORTAL_SETTINGS, false);
}
public static string GenerateUserPasswordResetLink(int itemId, int accountId)
public static string GenerateUserPasswordResetLink(int itemId, int accountId, out Guid tokenGuid, string pincode = null, string resetUrl = null)
{
string passwordResetUrlFormat = "account/password-reset/step-2";
var settings = GetWebDavSystemSettings();
tokenGuid = new Guid();
if (settings == null || !settings.GetValueOrDefault(SystemSettings.WEBDAV_PASSWORD_RESET_ENABLED_KEY, false) ||!settings.Contains("WebdavPortalUrl"))
if (settings == null || !settings.GetValueOrDefault(SystemSettings.WEBDAV_PASSWORD_RESET_ENABLED_KEY, false) || !settings.Contains("WebdavPortalUrl"))
{
return string.Empty;
}
if (string.IsNullOrEmpty(resetUrl) == false)
{
return resetUrl;
}
string passwordResetUrlFormat = string.IsNullOrEmpty(pincode) ? "account/password-reset/step-2" : "account/password-reset/step-final";
var webdavPortalUrl = new Uri(settings["WebdavPortalUrl"]);
var token = CreateAccessToken(itemId, accountId, AccessTokenTypes.PasswrodReset);
return webdavPortalUrl.Append(passwordResetUrlFormat)
.Append(token.AccessTokenGuid.ToString("n")).ToString();
tokenGuid = token.AccessTokenGuid;
var resultUrl = webdavPortalUrl.Append(passwordResetUrlFormat)
.Append(token.AccessTokenGuid.ToString("n"));
if (string.IsNullOrEmpty(pincode) == false)
{
resultUrl = resultUrl.Append(pincode);
}
return resultUrl.ToString();
}
private static AccessToken CreateAccessToken(int itemId, int accountId, AccessTokenTypes type)
@ -1804,7 +1999,8 @@ namespace WebsitePanel.EnterpriseServer
AccountLockoutDuration = GetValueSafe(parts, 9, 0),
ResetAccountLockoutCounterAfter = GetValueSafe(parts, 10, 0),
LockoutSettingsEnabled = GetValueSafe(parts, 11, false),
PasswordComplexityEnabled = GetValueSafe(parts, 11, true),
PasswordComplexityEnabled = GetValueSafe(parts, 12, true),
MaxPasswordAge = GetValueSafe(parts, 13, 42),
};
@ -2668,6 +2864,50 @@ namespace WebsitePanel.EnterpriseServer
return (account);
}
public static OrganizationUser GetUserGeneralSettingsWithExtraData(int itemId, int accountId)
{
OrganizationUser account = null;
Organization org = null;
try
{
// load organization
org = GetOrganization(itemId);
if (org == null)
return null;
// load account
account = GetAccount(itemId, accountId);
}
catch (Exception) { }
try
{
// get mailbox settings
Organizations orgProxy = GetOrganizationProxy(org.ServiceId);
string accountName = GetAccountName(account.AccountName);
OrganizationUser retUser = orgProxy.GetOrganizationUserWithExtraData(accountName, org.OrganizationId);
retUser.AccountId = accountId;
retUser.AccountName = account.AccountName;
retUser.PrimaryEmailAddress = account.PrimaryEmailAddress;
retUser.AccountType = account.AccountType;
retUser.CrmUserId = CRMController.GetCrmUserId(accountId);
retUser.IsOCSUser = DataProvider.CheckOCSUserExists(accountId);
retUser.IsLyncUser = DataProvider.CheckLyncUserExists(accountId);
retUser.IsBlackBerryUser = BlackBerryController.CheckBlackBerryUserExists(accountId);
retUser.SubscriberNumber = account.SubscriberNumber;
retUser.LevelId = account.LevelId;
retUser.IsVIP = account.IsVIP;
return retUser;
}
catch { }
return (account);
}
public static int SetUserGeneralSettings(int itemId, int accountId, string displayName,
string password, bool hideAddressBook, bool disabled, bool locked, string firstName, string initials,
string lastName, string address, string city, string state, string zip, string country,

View file

@ -317,6 +317,15 @@ namespace WebsitePanel.EnterpriseServer
sortColumn, startRow, maximumRows);
}
//TODO START
public static DataSet GetSearchObject(int userId, string filterColumn, string filterValue,
int statusId, int roleId, string sortColumn, int startRow, int maximumRows, string colType)
{
return DataProvider.GetSearchObject(SecurityContext.User.UserId, userId,
filterColumn, filterValue, statusId, roleId, sortColumn, startRow, maximumRows, colType, false);
}
//TODO END
public static DataSet GetPackageQuotas(int packageId)
{
return DataProvider.GetPackageQuotas(SecurityContext.User.UserId, packageId);

View file

@ -57,11 +57,6 @@ namespace WebsitePanel.EnterpriseServer
}
}
}
// send mail message
// MailHelper.SendMessage(mailFrom, mailTo, mailSubject, mailBody, false);
}
}
}

View file

@ -12,6 +12,8 @@
<AssemblyName>WebsitePanel.EnterpriseServer.Code</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -42,6 +44,9 @@
<HintPath>..\..\Lib\Microsoft.Web.Services3.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="RestSharp">
<HintPath>..\packages\RestSharp.105.0.1\lib\net4\RestSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
@ -55,6 +60,9 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Twilio.Api">
<HintPath>..\packages\Twilio.3.6.29\lib\3.5\Twilio.Api.dll</HintPath>
</Reference>
<Reference Include="WebsitePanel.EnterpriseServer.Base, Version=2.1.0.1, Culture=neutral, PublicKeyToken=da8782a6fc4d0081, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Bin\WebsitePanel.EnterpriseServer.Base.dll</HintPath>
@ -202,8 +210,17 @@
<Name>WebsitePanel.Whois</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="RestSharp" version="105.0.1" targetFramework="net40" />
<package id="Twilio" version="3.6.29" targetFramework="net40" />
</packages>

View file

@ -315,9 +315,9 @@ namespace WebsitePanel.EnterpriseServer
}
[WebMethod]
public string GetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup)
public string GetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup, string passwordResetUrl)
{
return ExchangeServerController.GetMailboxSetupInstructions(itemId, accountId, pmm, emailMode, signup);
return ExchangeServerController.GetMailboxSetupInstructions(itemId, accountId, pmm, emailMode, signup, passwordResetUrl);
}
[WebMethod]

View file

@ -93,7 +93,7 @@ namespace WebsitePanel.EnterpriseServer
[WebMethod]
public SystemSettings GetWebDavSystemSettings()
{
return OrganizationController.GetWebDavSystemSettings();
return OrganizationController.GetWebDavSystemSettings();
}
[WebMethod]
@ -185,7 +185,27 @@ namespace WebsitePanel.EnterpriseServer
OrganizationController.SetDefaultOrganization(newDefaultOrganizationId, currentDefaultOrganizationId);
}
#endregion
[WebMethod]
public OrganizationUser GetUserGeneralSettingsWithExtraData(int itemId, int accountId)
{
return OrganizationController.GetUserGeneralSettingsWithExtraData(itemId, accountId);
}
[WebMethod]
public ResultObject SendResetUserPasswordLinkSms(int itemId, int accountId, string reason, string phoneTo = null)
{
return OrganizationController.SendResetUserPasswordLinkSms(itemId, accountId, reason, phoneTo);
}
[WebMethod]
public ResultObject SendResetUserPasswordPincodeSms(Guid token, string phoneTo = null)
{
return OrganizationController.SendResetUserPasswordPincodeSms(token, phoneTo);
}
#endregion
#region Domains
@ -336,9 +356,9 @@ namespace WebsitePanel.EnterpriseServer
}
[WebMethod]
public void SendResetUserPasswordEmail(int itemId, int accountId, string reason, string mailTo = null)
public void SendResetUserPasswordEmail(int itemId, int accountId, string reason, string mailTo, bool finalStep)
{
OrganizationController.SendResetUserPasswordEmail(itemId, accountId, reason, mailTo);
OrganizationController.SendResetUserPasswordEmail(itemId, accountId, reason, mailTo, finalStep);
}
#endregion

View file

@ -134,6 +134,16 @@ namespace WebsitePanel.EnterpriseServer
sortColumn, startRow, maximumRows);
}
//TODO START
[WebMethod]
public DataSet GetSearchObject(int userId, string filterColumn, string filterValue,
int statusId, int roleId, string sortColumn, int startRow, int maximumRows, string colType)
{
return PackageController.GetSearchObject(userId, filterColumn, filterValue, statusId, roleId, sortColumn, startRow, maximumRows, colType);
}
//TODO END
[WebMethod]
public DataSet GetPackagesPaged(int userId, string filterColumn, string filterValue,
string sortColumn, int startRow, int maximumRows)

View file

@ -102,5 +102,7 @@ namespace WebsitePanel.Providers.HostedSolution
void ApplyPasswordSettings(string organizationId, OrganizationPasswordSettings passwordSettings);
bool CheckPhoneNumberIsInUse(string phoneNumber, string userSamAccountName = null);
OrganizationUser GetOrganizationUserWithExtraData(string loginName, string organizationId);
}
}

View file

@ -5,6 +5,7 @@
public int MinimumLength { get; set; }
public int MaximumLength { get; set; }
public int EnforcePasswordHistory { get; set; }
public int MaxPasswordAge { get; set; }
public bool LockoutSettingsEnabled { get; set; }
public int AccountLockoutDuration { get; set; }

View file

@ -740,7 +740,8 @@ namespace WebsitePanel.Providers.HostedSolution
cmd.Parameters.Add("MinPasswordLength", settings.MinimumLength);
cmd.Parameters.Add("PasswordHistoryCount", settings.EnforcePasswordHistory);
cmd.Parameters.Add("ComplexityEnabled", false);
cmd.Parameters.Add("ReversibleEncryptionEnabled", false);
cmd.Parameters.Add("ReversibleEncryptionEnabled", false);
cmd.Parameters.Add("MaxPasswordAge", new TimeSpan(settings.MaxPasswordAge * 24, 0, 0));
if (settings.LockoutSettingsEnabled)
{
@ -777,6 +778,7 @@ namespace WebsitePanel.Providers.HostedSolution
cmd.Parameters.Add("PasswordHistoryCount", settings.EnforcePasswordHistory);
cmd.Parameters.Add("ComplexityEnabled", false);
cmd.Parameters.Add("ReversibleEncryptionEnabled", false);
cmd.Parameters.Add("MaxPasswordAge", new TimeSpan(settings.MaxPasswordAge*24, 0, 0));
if (settings.LockoutSettingsEnabled)
{
@ -1008,10 +1010,30 @@ namespace WebsitePanel.Providers.HostedSolution
retUser.UserPrincipalName = (string)entry.InvokeGet(ADAttributes.UserPrincipalName);
retUser.UserMustChangePassword = GetUserMustChangePassword(entry);
return retUser;
}
public OrganizationUser GetOrganizationUserWithExtraData(string loginName, string organizationId)
{
HostedSolutionLog.LogStart("GetOrganizationUserWithExtraData");
HostedSolutionLog.DebugInfo("loginName : {0}", loginName);
HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId);
if (string.IsNullOrEmpty(loginName))
throw new ArgumentNullException("loginName");
var psoName = FormOrganizationPSOName(organizationId);
string path = GetUserPath(organizationId, loginName);
OrganizationUser retUser = GetUser(organizationId, path);
DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path);
retUser.PasswordExpirationDateTime = GetPasswordExpirationDate(psoName, entry);
HostedSolutionLog.LogEnd("GetOrganizationUserWithExtraData");
return retUser;
}

View file

@ -98,6 +98,8 @@ namespace WebsitePanel.Providers.HostedSolution {
private System.Threading.SendOrPostCallback CheckPhoneNumberIsInUseOperationCompleted;
private System.Threading.SendOrPostCallback GetOrganizationUserWithExtraDataOperationCompleted;
/// <remarks/>
public Organizations() {
this.Url = "http://localhost:9003/Organizations.asmx";
@ -196,6 +198,9 @@ namespace WebsitePanel.Providers.HostedSolution {
/// <remarks/>
public event CheckPhoneNumberIsInUseCompletedEventHandler CheckPhoneNumberIsInUseCompleted;
/// <remarks/>
public event GetOrganizationUserWithExtraDataCompletedEventHandler GetOrganizationUserWithExtraDataCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/OrganizationExists", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
@ -1773,6 +1778,51 @@ namespace WebsitePanel.Providers.HostedSolution {
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationUserWithExtraData", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public OrganizationUser GetOrganizationUserWithExtraData(string loginName, string organizationId) {
object[] results = this.Invoke("GetOrganizationUserWithExtraData", new object[] {
loginName,
organizationId});
return ((OrganizationUser)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetOrganizationUserWithExtraData(string loginName, string organizationId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetOrganizationUserWithExtraData", new object[] {
loginName,
organizationId}, callback, asyncState);
}
/// <remarks/>
public OrganizationUser EndGetOrganizationUserWithExtraData(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((OrganizationUser)(results[0]));
}
/// <remarks/>
public void GetOrganizationUserWithExtraDataAsync(string loginName, string organizationId) {
this.GetOrganizationUserWithExtraDataAsync(loginName, organizationId, null);
}
/// <remarks/>
public void GetOrganizationUserWithExtraDataAsync(string loginName, string organizationId, object userState) {
if ((this.GetOrganizationUserWithExtraDataOperationCompleted == null)) {
this.GetOrganizationUserWithExtraDataOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationUserWithExtraDataOperationCompleted);
}
this.InvokeAsync("GetOrganizationUserWithExtraData", new object[] {
loginName,
organizationId}, this.GetOrganizationUserWithExtraDataOperationCompleted, userState);
}
private void OnGetOrganizationUserWithExtraDataOperationCompleted(object arg) {
if ((this.GetOrganizationUserWithExtraDataCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetOrganizationUserWithExtraDataCompleted(this, new GetOrganizationUserWithExtraDataCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
@ -2188,4 +2238,30 @@ namespace WebsitePanel.Providers.HostedSolution {
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void GetOrganizationUserWithExtraDataCompletedEventHandler(object sender, GetOrganizationUserWithExtraDataCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetOrganizationUserWithExtraDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetOrganizationUserWithExtraDataCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public OrganizationUser Result {
get {
this.RaiseExceptionIfNecessary();
return ((OrganizationUser)(this.results[0]));
}
}
}
}

View file

@ -273,5 +273,11 @@ namespace WebsitePanel.Server
{
return Organization.CheckPhoneNumberIsInUse(phoneNumber, userSamAccountName);
}
[WebMethod, SoapHeader("settings")]
public OrganizationUser GetOrganizationUserWithExtraData(string loginName, string organizationId)
{
return Organization.GetOrganizationUserWithExtraData(loginName, organizationId);
}
}
}

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0"?>
<configuration>
<!-- Custom configuration sections -->
<configSections>
@ -7,34 +7,34 @@
<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings,Microsoft.Practices.EnterpriseLibrary.Caching"/>
</configSections>
<appSettings>
<add key="WebsitePanel.HyperV.UseDiskPartClearReadOnlyFlag" value="false" />
<add key="WebsitePanel.Exchange.ClearQueryBaseDN" value="false" />
<add key="WebsitePanel.Exchange.enableSP2abp" value="false" />
<add key="SCVMMServerName" value="" />
<add key="SCVMMServerPort" value="" />
<add key="WebsitePanel.HyperV.UseDiskPartClearReadOnlyFlag" value="false"/>
<add key="WebsitePanel.Exchange.ClearQueryBaseDN" value="false"/>
<add key="WebsitePanel.Exchange.enableSP2abp" value="false"/>
<add key="SCVMMServerName" value=""/>
<add key="SCVMMServerPort" value=""/>
</appSettings>
<system.diagnostics>
<switches>
<add name="Log" value="2" />
<add name="Log" value="2"/>
<!-- 0 - Off, 1 - Error, 2 - Warning, 3 - Info, 4 - Verbose -->
</switches>
<trace autoflush="true">
<listeners>
<add name="DefaultListener" type="WebsitePanel.Server.Utils.EventLogTraceListener, WebsitePanel.Server.Utils" initializeData="WebsitePanel" />
<add name="DefaultListener" type="WebsitePanel.Server.Utils.EventLogTraceListener, WebsitePanel.Server.Utils" initializeData="WebsitePanel"/>
<!-- Writes log to the file
<add name="DefaultListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="WebsitePanel.Server.log" />
-->
<remove name="Default" />
<remove name="Default"/>
</listeners>
</trace>
</system.diagnostics>
<!-- Caching Configuration -->
<cachingConfiguration defaultCacheManager="Default Cache Manager">
<backingStores>
<add name="inMemory" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching" />
<add name="inMemory" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching"/>
</backingStores>
<cacheManagers>
<add name="Default Cache Manager" expirationPollFrequencyInSeconds="43200" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="inMemory" />
<add name="Default Cache Manager" expirationPollFrequencyInSeconds="43200" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="inMemory"/>
</cacheManagers>
</cachingConfiguration>
<!-- WebsitePanel Configuration -->
@ -42,127 +42,72 @@
<!-- Security settings -->
<security>
<!-- Perform security check -->
<enabled value="true" />
<enabled value="true"/>
<!-- Server password -->
<password value="+uxnDOdf55yuH6iZYXgYAxsfIBw=" />
<password value="+uxnDOdf55yuH6iZYXgYAxsfIBw="/>
</security>
</websitepanel.server>
<system.web>
<!-- Disable any authentication -->
<authentication mode="None" />
<authentication mode="None"/>
<!-- Correct HTTP runtime settings -->
<httpRuntime executionTimeout="3600" maxRequestLength="16384" />
<httpRuntime executionTimeout="3600" maxRequestLength="16384"/>
<!-- Set globalization settings -->
<globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8" />
<globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8"/>
<!-- Web Services settings -->
<webServices>
<protocols>
<remove name="HttpPost" />
<remove name="HttpPostLocalhost" />
<remove name="HttpGet" />
<remove name="HttpPost"/>
<remove name="HttpPostLocalhost"/>
<remove name="HttpGet"/>
</protocols>
<soapServerProtocolFactory type="Microsoft.Web.Services3.WseProtocolFactory, Microsoft.Web.Services3" />
<soapServerProtocolFactory type="Microsoft.Web.Services3.WseProtocolFactory, Microsoft.Web.Services3"/>
</webServices>
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
</compilation>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
<compilation debug="true" targetFramework="4.0"/>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>
<!-- WSE 3.0 settings -->
<microsoft.web.services3>
<diagnostics>
<trace enabled="false" input="InputTrace.webinfo" output="OutputTrace.webinfo" />
<trace enabled="false" input="InputTrace.webinfo" output="OutputTrace.webinfo"/>
</diagnostics>
<messaging>
<maxMessageLength value="-1" />
<mtom serverMode="optional" clientMode="On" />
<maxMessageLength value="-1"/>
<mtom serverMode="optional" clientMode="On"/>
</messaging>
<security>
<securityTokenManager>
<add type="WebsitePanel.Server.ServerUsernameTokenManager, WebsitePanel.Server" namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" localName="UsernameToken" />
<add type="WebsitePanel.Server.ServerUsernameTokenManager, WebsitePanel.Server" namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" localName="UsernameToken"/>
</securityTokenManager>
<timeToleranceInSeconds value="86400" />
<timeToleranceInSeconds value="86400"/>
</security>
<policy fileName="WsePolicyCache.Config" />
<policy fileName="WsePolicyCache.Config"/>
</microsoft.web.services3>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IVirtualMachineManagementService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="10485760" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
<transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default"/>
</security>
</binding>
<binding name="WSHttpBinding_IMonitoringService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="10485760" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
<transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5" />
<providerOption name="WarnAsError" value="false" />
</compiler>
</compilers>
</system.codedom>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<remove name="ScriptModule" />
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<remove name="ScriptHandlerFactory" />
<remove name="ScriptHandlerFactoryAppServices" />
<remove name="ScriptResource" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin/Crm2011;bin/Crm2013;bin/Exchange2013;bin/Sharepoint2013;bin/Lync2013;bin/Lync2013HP;bin/Dns2012;bin/IceWarp;bin/IIs80;bin/HyperV2012R2;bin/Crm2015" />
<probing privatePath="bin/Crm2011;bin/Crm2013;bin/Exchange2013;bin/Sharepoint2013;bin/Lync2013;bin/Lync2013HP;bin/Dns2012;bin/IceWarp;bin/IIs80;bin/HyperV2012R2;bin/Crm2015"/>
</assemblyBinding>
</runtime>
</configuration>

View file

@ -17,7 +17,7 @@
<OldToolsVersion>4.0</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile />
<UseIISExpress>false</UseIISExpress>
<IISExpressSSLPort />
@ -80,6 +80,7 @@
<Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Web" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.Extensions" />
@ -235,18 +236,12 @@
<Content Include="bin\WebsitePanel.Providers.OS.Windows2012.pdb" />
<Content Include="bin\WebsitePanel.Providers.RemoteDesktopServices.Windows2012.dll" />
<Content Include="bin\WebsitePanel.Providers.RemoteDesktopServices.Windows2012.pdb" />
<Content Include="bin\WebsitePanel.Providers.SharePoint.Sps20.dll" />
<Content Include="bin\WebsitePanel.Providers.SharePoint.Sps20.pdb" />
<Content Include="bin\WebsitePanel.Providers.SharePoint.Sps30.dll" />
<Content Include="bin\WebsitePanel.Providers.SharePoint.Sps30.pdb" />
<Content Include="bin\WebsitePanel.Providers.Statistics.AWStats.dll" />
<Content Include="bin\WebsitePanel.Providers.Statistics.AWStats.pdb" />
<Content Include="bin\WebsitePanel.Providers.Statistics.SmarterStats.dll" />
<Content Include="bin\WebsitePanel.Providers.Statistics.SmarterStats.pdb" />
<Content Include="bin\WebsitePanel.Providers.Virtualization.HyperV.dll" />
<Content Include="bin\WebsitePanel.Providers.Virtualization.HyperV.pdb" />
<Content Include="bin\WebsitePanel.Providers.Virtualization.HyperV2012R2.dll" />
<Content Include="bin\WebsitePanel.Providers.Virtualization.HyperV2012R2.pdb" />
<Content Include="bin\WebsitePanel.Providers.VirtualizationForPC.HyperVForPC.dll" />
<Content Include="bin\WebsitePanel.Providers.VirtualizationForPC.HyperVForPC.pdb" />
<Content Include="bin\WebsitePanel.Providers.Web.HeliconZoo.dll" />
@ -259,8 +254,6 @@
<Content Include="bin\WebsitePanel.Providers.Web.IIs80.pdb" />
<Content Include="bin\WebsitePanel.Providers.Web.WebDav.dll" />
<Content Include="bin\WebsitePanel.Providers.Web.WebDav.pdb" />
<Content Include="bin\WebsitePanel.Server.Client.dll" />
<Content Include="bin\WebsitePanel.Server.Client.pdb" />
<Content Include="bin\WebsitePanel.Server.dll" />
<Content Include="bin\WebsitePanel.Server.pdb" />
<Content Include="bin\WebsitePanel.Server.Utils.dll" />
@ -433,10 +426,6 @@
<Project>{684C932A-6C75-46AC-A327-F3689D89EB42}</Project>
<Name>WebsitePanel.Providers.Base</Name>
</ProjectReference>
<ProjectReference Include="..\WebsitePanel.Server.Client\WebsitePanel.Server.Client.csproj">
<Project>{990c4a2a-34a5-4be0-9546-e10abdfffd0e}</Project>
<Name>WebsitePanel.Server.Client</Name>
</ProjectReference>
<ProjectReference Include="..\WebsitePanel.Server.Utils\WebsitePanel.Server.Utils.csproj">
<Project>{E91E52F3-9555-4D00-B577-2B1DBDD87CA7}</Project>
<Name>WebsitePanel.Server.Utils</Name>

View file

@ -70,7 +70,7 @@ namespace WebsitePanel.WebDav.Core.Config.Entities
get
{
SessionKeysElement sessionKey =
_sessionKeys.FirstOrDefault(x => x.Key == SessionKeysElement.PassswordResetSmsKey);
_sessionKeys.FirstOrDefault(x => x.Key == SessionKeysElement.PasswordResetSmsKey);
return sessionKey != null ? sessionKey.Value : null;
}
}

View file

@ -12,7 +12,7 @@ namespace WebsitePanel.WebDav.Core.Config.WebConfigSections
public const string WebDavManagerKey = "WebDavManagerSessionKey";
public const string UserGroupsKey = "UserGroupsKey";
public const string WebDavRootFolderPermissionsKey = "WebDavRootFolderPermissionsKey";
public const string PassswordResetSmsKey = "PassswordResetSmsKey";
public const string PasswordResetSmsKey = "PasswordResetSmsKey";
public const string ResourseRenderCountKey = "ResourseRenderCountSessionKey";
public const string ItemIdSessionKey = "ItemId";
public const string OwaEditFoldersSessionKey = "OwaEditFoldersSession";

View file

@ -1,5 +1,6 @@
using System;
using System.Globalization;
using log4net;
using WebsitePanel.WebDav.Core.Config;
using WebsitePanel.WebDav.Core.Interfaces.Security;
using WebsitePanel.WebDav.Core.Interfaces.Services;
@ -9,10 +10,12 @@ namespace WebsitePanel.WebDav.Core.Security.Authentication
public class SmsAuthenticationService : ISmsAuthenticationService
{
private ISmsDistributionService _smsService;
private readonly ILog Log;
public SmsAuthenticationService(ISmsDistributionService smsService)
{
_smsService = smsService;
Log = LogManager.GetLogger(this.GetType());
}
public bool VerifyResponse( Guid token, string response)

View file

@ -38,14 +38,20 @@ namespace WebsitePanel.WebDavPortal
routes.MapRoute(
name: AccountRouteNames.PasswordResetSendSms,
url: "account/password-reset/step-final/{token}",
url: "account/password-reset/send-new-sms/{token}",
defaults: new { controller = "Account", action = "PasswordResetSendSms" }
);
routes.MapRoute(
name: AccountRouteNames.PasswordResetFinalStep,
url: "account/password-reset/send-new-sms/{token}",
defaults: new { controller = "Account", action = "PasswordResetFinalStep" }
url: "account/password-reset/step-final/{token}/{pincode}",
defaults: new { controller = "Account", action = "PasswordResetFinalStep", pincode = UrlParameter.Optional }
);
routes.MapRoute(
name: AccountRouteNames.PasswordResetSuccess,
url: "account/password-reset/success",
defaults: new { controller = "Account", action = "PasswordSuccessfullyChanged" }
);
routes.MapRoute(

View file

@ -16,6 +16,7 @@ namespace WebsitePanel.WebDavPortal.UI.Routes
public const string PasswordResetSms = "PasswordResetSmsRoute";
public const string PasswordResetSendSms = "PasswordResetSendSmsRoute";
public const string PasswordResetFinalStep = "PasswordResetFinalStepRoute";
public const string PasswordResetSuccess = "PasswordResetSuccess";
public const string PhoneNumberIsAvailible = "PhoneNumberIsAvailibleRoute";
}

View file

@ -4,6 +4,8 @@ using System.Net;
using System.Web.Mvc;
using System.Web.Routing;
using AutoMapper;
using log4net;
using Microsoft.Web.Services3.Addressing;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.WebDav.Core.Config;
using WebsitePanel.WebDav.Core.Security.Authentication;
@ -27,12 +29,15 @@ namespace WebsitePanel.WebDavPortal.Controllers
private readonly ICryptography _cryptography;
private readonly IAuthenticationService _authenticationService;
private readonly ISmsAuthenticationService _smsAuthService;
private readonly ILog Log;
public AccountController(ICryptography cryptography, IAuthenticationService authenticationService, ISmsAuthenticationService smsAuthService)
{
_cryptography = cryptography;
_authenticationService = authenticationService;
_smsAuthService = smsAuthService;
Log = LogManager.GetLogger(this.GetType());
}
[HttpGet]
@ -182,7 +187,7 @@ namespace WebsitePanel.WebDavPortal.Controllers
return View(model);
}
WspContext.Services.Organizations.SendResetUserPasswordEmail(exchangeAccount.ItemId, exchangeAccount.AccountId, Resources.Messages.PasswordResetUserReason, exchangeAccount.PrimaryEmailAddress);
WspContext.Services.Organizations.SendResetUserPasswordEmail(exchangeAccount.ItemId, exchangeAccount.AccountId, Resources.Messages.PasswordResetUserReason, exchangeAccount.PrimaryEmailAddress, false);
return View("PasswordResetEmailSent");
}
@ -205,11 +210,15 @@ namespace WebsitePanel.WebDavPortal.Controllers
return View(model);
}
if (accessToken.IsSmsSent == false)
{
var user = WspContext.Services.Organizations.GetUserGeneralSettings(accessToken.ItemId, accessToken.AccountId);
if (SendPasswordResetSms(accessToken.AccessTokenGuid, user.MobilePhone))
if (accessToken != null && accessToken.IsSmsSent == false)
{
var user = WspContext.Services.Organizations.GetUserGeneralSettings(accessToken.ItemId,
accessToken.AccountId);
var result = WspContext.Services.Organizations.SendResetUserPasswordPincodeSms(token, user.MobilePhone);
if (result.IsSuccess)
{
AddMessage(MessageType.Success, Resources.Messages.SmsWasSent);
}
@ -249,15 +258,16 @@ namespace WebsitePanel.WebDavPortal.Controllers
[HttpGet]
[AllowAnonymous]
public ActionResult PasswordResetFinalStep(Guid token)
public ActionResult PasswordResetFinalStep(Guid token, string pincode)
{
var smsResponse = Session[WebDavAppConfigManager.Instance.SessionKeys.PasswordResetSmsKey] as string;
var result = VerifyPincode(token, pincode);
if (_smsAuthService.VerifyResponse(token, smsResponse) == false)
if (result != null)
{
return RedirectToRoute(AccountRouteNames.PasswordResetSms);
return result;
}
var model = new PasswordEditor();
return View(model);
@ -265,20 +275,18 @@ namespace WebsitePanel.WebDavPortal.Controllers
[HttpPost]
[AllowAnonymous]
public ActionResult PasswordResetFinalStep(Guid token, PasswordEditor model)
public ActionResult PasswordResetFinalStep(Guid token, string pincode, PasswordEditor model)
{
if (!ModelState.IsValid)
{
return View(model);
}
var smsResponse = Session[WebDavAppConfigManager.Instance.SessionKeys.PasswordResetSmsKey] as string;
var result = VerifyPincode(token, pincode);
if (_smsAuthService.VerifyResponse(token, smsResponse) == false)
if (result != null)
{
AddMessage(MessageType.Error, Resources.Messages.IncorrectSmsResponse);
return RedirectToRoute(AccountRouteNames.PasswordResetSms);
return result;
}
var tokenEntity = WspContext.Services.Organizations.GetPasswordresetAccessToken(token);
@ -291,7 +299,14 @@ namespace WebsitePanel.WebDavPortal.Controllers
AddMessage(MessageType.Success, Resources.Messages.PasswordSuccessfullyChanged);
return RedirectToRoute(AccountRouteNames.Login);
return RedirectToRoute(AccountRouteNames.PasswordResetSuccess);
}
[HttpGet]
[AllowAnonymous]
public ActionResult PasswordSuccessfullyChanged()
{
return View();
}
[HttpGet]
@ -308,8 +323,10 @@ namespace WebsitePanel.WebDavPortal.Controllers
var user = WspContext.Services.Organizations.GetUserGeneralSettings(accessToken.ItemId,
accessToken.AccountId);
var result = WspContext.Services.Organizations.SendResetUserPasswordPincodeSms(accessToken.AccessTokenGuid,
user.MobilePhone);
if (SendPasswordResetSms(accessToken.AccessTokenGuid, user.MobilePhone))
if (result.IsSuccess)
{
AddMessage(MessageType.Success, Resources.Messages.SmsWasSent);
}
@ -323,22 +340,37 @@ namespace WebsitePanel.WebDavPortal.Controllers
#region Helpers
private bool SendPasswordResetSms(Guid token, string mobilePhone)
/// <summary>
/// Verify pincode, if it's absent - verifying pincode from session
/// </summary>
/// <param name="token">Password reset token</param>
/// <param name="pincode">Pincode to verify if session pincode is absent</param>
private ActionResult VerifyPincode(Guid token, string pincode)
{
var response = _smsAuthService.SendRequestMessage(mobilePhone);
var smsResponse = Session[WebDavAppConfigManager.Instance.SessionKeys.PasswordResetSmsKey] as string;
if (string.IsNullOrEmpty(response))
if (string.IsNullOrEmpty(pincode) == false)
{
return false;
smsResponse = pincode;
}
WspContext.Services.Organizations.SetAccessTokenResponse(token, response);
return true;
if (_smsAuthService.VerifyResponse(token, smsResponse) == false)
{
AddMessage(MessageType.Error, Resources.Messages.IncorrectSmsResponse);
return RedirectToRoute(AccountRouteNames.PasswordResetSms);
}
var tokenEntity = WspContext.Services.Organizations.GetPasswordresetAccessToken(token);
Session[WebDavAppConfigManager.Instance.SessionKeys.ItemId] = tokenEntity.ItemId;
return null;
}
private UserProfile GetUserProfileModel(int itemId, int accountId)
{
var user = WspContext.Services.Organizations.GetUserGeneralSettings(itemId, accountId);
var user = WspContext.Services.Organizations.GetUserGeneralSettingsWithExtraData(itemId, accountId);
return Mapper.Map<OrganizationUser, UserProfile>(user);
}

View file

@ -60,6 +60,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Account.
/// </summary>
public static string Account {
get {
return ResourceManager.GetString("Account", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Actions.
/// </summary>
@ -123,6 +132,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to You can now access your {0}..
/// </summary>
public static string CanAccessYourFormat {
get {
return ResourceManager.GetString("CanAccessYourFormat", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Cancel.
/// </summary>
@ -537,6 +555,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Your new password has been set..
/// </summary>
public static string NewPasswordBeenSet {
get {
return ResourceManager.GetString("NewPasswordBeenSet", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Confirm password.
/// </summary>
@ -627,6 +654,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Password never expires. If you want to change password then please click {0}..
/// </summary>
public static string PasswordNeverExpiresFormat {
get {
return ResourceManager.GetString("PasswordNeverExpiresFormat", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Password reset.
/// </summary>

View file

@ -393,4 +393,16 @@
<data name="Login" xml:space="preserve">
<value>Login</value>
</data>
<data name="PasswordNeverExpiresFormat" xml:space="preserve">
<value>Password never expires. If you want to change password then please click {0}.</value>
</data>
<data name="Account" xml:space="preserve">
<value>Account</value>
</data>
<data name="CanAccessYourFormat" xml:space="preserve">
<value>You can now access your {0}.</value>
</data>
<data name="NewPasswordBeenSet" xml:space="preserve">
<value>Your new password has been set.</value>
</data>
</root>

View file

@ -0,0 +1,18 @@
@using WebsitePanel.WebDavPortal.Resources
@using WebsitePanel.WebDavPortal.UI.Routes
@{
string message = string.Format(UI.CanAccessYourFormat, Html.RouteLink(UI.Account,AccountRouteNames.Login));
}
<div class="container row">
<div class="form-group">
<h3>@Messages.PasswordSuccessfullyChanged</h3>
</div>
<div class="form-group">
<div>
@UI.NewPasswordBeenSet @Html.Raw(message)
</div>
</div>
</div>

View file

@ -5,8 +5,17 @@
@{
Layout = "~/Views/Shared/_Layout.cshtml";
var passwordExpriationText = string.Empty;
var passwordExpriationText = string.Format(UI.PasswordExpirationFormat, Model.PasswordExpirationDateTime.ToString(Formats.DateFormatWithTime), Html.RouteLink(UI.Here.ToLowerInvariant(), AccountRouteNames.PasswordChange));
if (Model.PasswordExpirationDateTime == DateTime.MaxValue)
{
passwordExpriationText = string.Format(UI.PasswordNeverExpiresFormat, Html.RouteLink(UI.Here.ToLowerInvariant(), AccountRouteNames.PasswordChange));
}
else
{
passwordExpriationText = string.Format(UI.PasswordExpirationFormat, Model.PasswordExpirationDateTime.ToString(Formats.DateFormatWithTime), Html.RouteLink(UI.Here.ToLowerInvariant(), AccountRouteNames.PasswordChange));
}
}
<div class="container row">

View file

@ -53,7 +53,7 @@
<add key="ItemIdSessionKey" value="ItemId" />
<add key="UserGroupsKey" value="UserGroups" />
<add key="OwaEditFoldersSession" value="OwaEditFolders" />
<add key="PassswordResetSmsKey" value="PassswordResetSms" />
<add key="PasswordResetSmsKey" value="PasswordResetSms" />
</sessionKeys>
<fileIcons defaultPath="~/Content/Images/other-icon.png" folderPath="~/Content/Images/folder_100x100.png">
<add extension=".txt" path="~/Content/Images/txt-icon.png" />
@ -101,7 +101,6 @@
<add extension=".txt" mimeType="text/plain" isTargetBlank="true" />
<add extension=".pdf" mimeType="application/pdf" isTargetBlank="true" />
</typeOpener>
<twilio accountSid="s" authorizationToken="s" phoneFrom="s"/>
</webDavExplorerConfigurationSettings>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.

View file

@ -489,6 +489,7 @@
<Content Include="Views\Account\PasswordResetEmailSent.cshtml" />
<Content Include="Views\Account\PasswordResetSms.cshtml" />
<Content Include="Views\Account\PasswordResetFinalStep.cshtml" />
<Content Include="Views\Account\PasswordSuccessfullyChanged.cshtml" />
</ItemGroup>
<ItemGroup>
<Folder Include="Models\FileSystem\Enums\" />

View file

@ -0,0 +1 @@
<%@ WebHandler Language="C#" Class="WebsitePanel.WebPortal.WebsitePanelAjaxHandler,WebsitePanel.Portal.Modules" %>

View file

@ -29,6 +29,9 @@
<NestedSpacesPage>NestedSpaces</NestedSpacesPage>
<UsersSearchPage>SearchUsers</UsersSearchPage>
<SpacesSearchPage>SearchSpaces</SpacesSearchPage>
<!--TODO START-->
<SearchObjectPage>SearchObject</SearchObjectPage>
<!--TODO END-->
<LoggedUserAccountPage>LoggedUserDetails</LoggedUserAccountPage>
<!-- Skins and Containers -->
<PortalSkin>Browse2.ascx</PortalSkin>

View file

@ -25,6 +25,14 @@
</Controls>
</ModuleDefinition>
<!--TODO START-->
<ModuleDefinition id="SearchObject">
<Controls>
<Control key="" src="WebsitePanel/SearchObject.ascx" title="SearchObject" type="View" />
</Controls>
</ModuleDefinition>
<!--TODO END-->
<!-- User Account -->
<ModuleDefinition id="LoggedUserDetails">
<Controls>

View file

@ -32,6 +32,14 @@
</Content>
</Page>
<!--TODO START-->
<Page name="SearchObject" roles="Administrator,Reseller,PlatformCSR,ResellerCSR,PlatformHelpdesk,ResellerHelpdesk,User" hidden="True" skin="Browse1.ascx">
<Content id="ContentPane">
<Module moduleDefinitionID="SearchObject" title="SearchObject" icon="sphere_zoom_48.png" container="Edit.ascx" />
</Content>
</Page>
<!--TODO END-->
<Page name="Home" roles="Administrator,Reseller,PlatformCSR,ResellerCSR,PlatformHelpdesk,ResellerHelpdesk,User" skin="Browse3.ascx" align="right">
<Content id="LeftPane">
<Module moduleDefinitionID="UserAccountMenu" title="UserMenu" container="Clear.ascx">

View file

@ -711,6 +711,9 @@
<data name="ModuleTitle.SearchSpaces" xml:space="preserve">
<value>Search Hosting Spaces</value>
</data>
<data name="ModuleTitle.SearchObject" xml:space="preserve">
<value>Search Objects</value>
</data>
<data name="ModuleTitle.SearchUsers" xml:space="preserve">
<value>Search User Accounts</value>
</data>

View file

@ -141,6 +141,12 @@
<data name="PageTitle.SearchSpaces" xml:space="preserve">
<value>{user} - Search Hosting Spaces</value>
</data>
<data name="PageName.SearchObject" xml:space="preserve">
<value>Search Objects</value>
</data>
<data name="PageTitle.SearchObject" xml:space="preserve">
<value>{user} - Search Objects</value>
</data>
<data name="PageName.Home" xml:space="preserve">
<value>Account Home</value>
</data>

View file

@ -5178,7 +5178,6 @@
<data name="Quota.VPSForPC.StartShutdownAllowed" xml:space="preserve">
<value>Allow user to Start, Turn off VPS</value>
</data>
<data name="ResourceGroup.VPS2012" xml:space="preserve">
<value>Virtual Private Servers 2012</value>
</data>
@ -5245,7 +5244,6 @@
<data name="Quota.VPS2012.StartShutdownAllowed" xml:space="preserve">
<value>Allow user to Start, Turn off VPS</value>
</data>
<data name="Error.CreateCheckPointError" xml:space="preserve">
<value>Error creating CheckPoint</value>
</data>
@ -5831,7 +5829,7 @@
<data name="ERROR.REMOTE_DESKTOP_SERVICES_VIEW_SESSION" xml:space="preserve">
<value>View session error</value>
</data>
<data name="ERROR.REMOTE_DESKTOP_SERVICES_CONTROL_SESSION" xml:space="preserve">
<data name="ERROR.REMOTE_DESKTOP_SERVICES_CONTROL_SESSION" xml:space="preserve">
<value>Control session error</value>
</data>
<data name="ERROR.REMOTE_DESKTOP_SERVICES_USER_SESSIONS" xml:space="preserve">
@ -5852,4 +5850,7 @@
<data name="Error.UNABLETOLOADPASSWORDSETTINGS" xml:space="preserve">
<value>Unable to load password settings</value>
</data>
<data name="Error.SEND_USER_PASSWORD_RESET_SMS" xml:space="preserve">
<value>Sms was not sent.</value>
</data>
</root>

View file

@ -307,4 +307,76 @@ p.warningText {font-size:14px; color:Red; text-align:center;}
.Hidden {display: none;}
.LinkText {color:#428bca;}
.WrapText { white-space: normal;}
.chosen-container { margin-top: -30px; }
.chosen-container { margin-top: -30px; }
.ui-autocomplete {z-index: 200 !important; }
.ui-button {
padding: 5px 5px;
margin: 3px;
background: #20A0D0;
color: white;
border: 1px solid #2080A0;
float: left;
cursor: pointer;
display: block;
}
.ui-button:hover {
background: #20B0E0;
}
.ui-popupdialog {
display: none;
position: absolute;
background-color: #FFF;
border: 1px solid #C0C0C0;
border: 1px solid rgba(0, 0, 0, 0.15);
box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.176);
background-clip: padding-box;
}
.ui-popupdialog .title {
padding: 5px;
background: #F8F8F8;
}
.ui-popupdialog .content {
padding: 10px;
}
.ui-popupdialog .actions {
padding: 5px;
border-top: 1px solid #C0C0C0;
background: #F0F0F0;
}
.ui-menu {
background-color: #FFF;
border: 1px solid #C0C0C0;
border: 1px solid rgba(0, 0, 0, 0.15);
box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.176);
background-clip: padding-box;
}
.ui-menu-item {
}
.ui-widget-content {
background: #FFF;
}
.ui-corner-all {
border-radius: 0px;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
}
.ui-menu-item .ui-state-hover
{
background: #f0f0f0;
border-radius: 0px;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-color: #f0f0f0;
color: #000;
}
.ui-menu-item:hover {
background-color: #f0f0f0;
}

View file

@ -842,6 +842,13 @@ namespace WebsitePanel.Portal
return PortalConfiguration.SiteSettings["SpacesSearchPage"];
}
//TODO START
public static string GetObjectSearchPageId()
{
return PortalConfiguration.SiteSettings["SearchObjectPage"];
}
//TODO END
public static string GetNestedSpacesPageId()
{
return PortalConfiguration.SiteSettings["NestedSpacesPage"];

View file

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="gvType.Header" xml:space="preserve">
<value>Type</value>
</data>
<data name="gvText.Header" xml:space="preserve">
<value>Search text</value>
</data>
<data name="gvFullType.Header" xml:space="preserve">
<value>Full Type</value>
</data>
</root>

View file

@ -141,6 +141,12 @@
<data name="lblNoChangesTextBody.Text" xml:space="preserve">
<value>No Changes Text Body:</value>
</data>
<data name="lblPasswordResetLinkSmsBody.Text" xml:space="preserve">
<value>Password Reset Link Sms Body:</value>
</data>
<data name="lblPasswordResetPincodeSmsBody.Text" xml:space="preserve">
<value>Password Reset Link Pincode Body:</value>
</data>
<data name="lblPriority.Text" xml:space="preserve">
<value>Priority:</value>
</data>

View file

@ -180,4 +180,16 @@
<data name="locEnablePasswordReset.Text" xml:space="preserve">
<value>Enable password reset:</value>
</data>
<data name="lblAccountSid.Text" xml:space="preserve">
<value>AccountSID</value>
</data>
<data name="lblAuthToken.Text" xml:space="preserve">
<value>AuthToken</value>
</data>
<data name="lblPhoneFrom.Text" xml:space="preserve">
<value>Phone From</value>
</data>
<data name="TwilioSettings.Text" xml:space="preserve">
<value>Twilio</value>
</data>
</root>

View file

@ -0,0 +1,68 @@
using System;
using System.Web;
using System.Web.Script.Serialization;
using System.Collections.Generic;
using System.Data;
using WebsitePanel.Portal;
namespace WebsitePanel.WebPortal
{
public class WebsitePanelAjaxHandler : IHttpHandler
{
public bool IsReusable { get { return true; } }
public void ProcessRequest(HttpContext context)
{
String filterValue = context.Request.Params["term"];
String fullType = context.Request.Params["fullType"];
String columnType = context.Request.Params["columnType"];
if (fullType == "Spaces")
{
String strItemType = context.Request.Params["itemType"];
int itemType = Int32.Parse(strItemType);
DataSet dsObjectItems = ES.Services.Packages.SearchServiceItemsPaged(PanelSecurity.EffectiveUserId, itemType,
String.Format("%{0}%", filterValue),
"",0, 100);
DataTable dt = dsObjectItems.Tables[1];
List<Dictionary<string, string>> dataList = new List<Dictionary<string, string>>();
for (int i = 0; i < dt.Rows.Count; ++i)
{
DataRow row = dt.Rows[i];
Dictionary<string, string> obj = new Dictionary<string, string>();
obj["ColumnType"] = "PackageName";
obj["TextSearch"] = row["PackageName"].ToString();
obj["FullType"] = "Space";
dataList.Add(obj);
}
var jsonSerialiser = new JavaScriptSerializer();
var json = jsonSerialiser.Serialize(dataList);
context.Response.ContentType = "text/plain";
context.Response.Write(json);
}
else
{
DataSet dsObjectItems = ES.Services.Packages.GetSearchObject(PanelSecurity.EffectiveUserId, null,
String.Format("%{0}%", filterValue),
0, 0, "", 0, 100, columnType);
DataTable dt = dsObjectItems.Tables[2];
List<Dictionary<string, string>> dataList = new List<Dictionary<string, string>>();
for (int i = 0; i < dt.Rows.Count; ++i)
{
DataRow row = dt.Rows[i];
Dictionary<string, string> obj = new Dictionary<string, string>();
obj["ColumnType"] = row["ColumnType"].ToString();
obj["TextSearch"] = row["TextSearch"].ToString();
obj["FullType"] = row["FullType"].ToString();
dataList.Add(obj);
}
var jsonSerialiser = new JavaScriptSerializer();
var json = jsonSerialiser.Serialize(dataList);
context.Response.ContentType = "text/plain";
context.Response.Write(json);
}
}
}
};

View file

@ -36,6 +36,7 @@ using System.Web.Caching;
using WebsitePanel.EnterpriseServer;
using System.Collections;
using System.Collections.Generic;
namespace WebsitePanel.Portal
{
@ -244,5 +245,33 @@ namespace WebsitePanel.Portal
return dsServiceItemsPaged.Tables[1];
}
#endregion
//TODO START
#region Service Items Paged Search
DataSet dsObjectItemsPaged;
public int SearchObjectItemsPagedCount(string filterColumn, string filterValue, string colType)
{
return (int)dsObjectItemsPaged.Tables[0].Rows[0][0];
}
public DataTable SearchObjectItemsPaged(int maximumRows, int startRowIndex, string sortColumn,
string filterColumn, string filterValue, string colType)
{
dsObjectItemsPaged = ES.Services.Packages.GetSearchObject(PanelSecurity.EffectiveUserId, filterColumn,
String.Format("%{0}%", filterValue),
0, 0, sortColumn, startRowIndex, maximumRows, colType);
return dsObjectItemsPaged.Tables[2];
}
public DataTable SearchObjectTypes(string filterColumn, string filterValue, string sortColumn)
{
dsObjectItemsPaged = ES.Services.Packages.GetSearchObject(PanelSecurity.EffectiveUserId, filterColumn,
String.Format("%{0}%", filterValue),
0, 0, sortColumn, 0, 0, "");
return dsObjectItemsPaged.Tables[1];
}
//TODO END
#endregion
}
}

View file

@ -219,4 +219,13 @@
<data name="valResetAccountLockout.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="lblMaxPasswordAge.Text" xml:space="preserve">
<value>Max Password Age (days):</value>
</data>
<data name="valCorrectMaxPasswordAge.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valRequireMaxPasswordAge.Text" xml:space="preserve">
<value>*</value>
</data>
</root>

View file

@ -123,10 +123,22 @@
<data name="locEmailAddress.Text" xml:space="preserve">
<value>Email:</value>
</data>
<data name="locMobile.Text" xml:space="preserve">
<value>Mobile</value>
</data>
<data name="locReason.Text" xml:space="preserve">
<value>Reason:</value>
</data>
<data name="locSendTo.Text" xml:space="preserve">
<value>Send to:</value>
</data>
<data name="locTitle.Text" xml:space="preserve">
<value>Reset Password</value>
</data>
<data name="rbtnEmail.Text" xml:space="preserve">
<value>Email</value>
</data>
<data name="rbtnMobile.Text" xml:space="preserve">
<value>Mobile</value>
</data>
</root>

View file

@ -51,7 +51,7 @@ namespace WebsitePanel.Portal.ExchangeServer
{
BindPasswordSettings();
string instructions = ES.Services.ExchangeServer.GetMailboxSetupInstructions(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false);
string instructions = ES.Services.ExchangeServer.GetMailboxSetupInstructions(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false, " ");
if (!string.IsNullOrEmpty(instructions))
{
chkSendInstructions.Checked = chkSendInstructions.Visible = sendInstructionEmail.Visible = true;

View file

@ -47,7 +47,12 @@ namespace WebsitePanel.Portal.ExchangeServer
// load content
litContent.Text = ES.Services.ExchangeServer.GetMailboxSetupInstructions(
PanelRequest.ItemID, PanelRequest.AccountID,
false, false, false);
false, false, false,
PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(),
"user_reset_password",
"SpaceID=" + PanelSecurity.PackageId,
"Context=Mailbox",
"AccountID=" + PanelRequest.AccountID).Trim('~'));
// bind user details
PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId);

View file

@ -7,35 +7,35 @@
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<script type="text/javascript" src="/JavaScript/jquery.min.js?v=1.4.4"></script>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
<wsp:EnableAsyncTasksSupport ID="asyncTasks" runat="server" />
<div id="ExchangeContainer">
<div class="Module">
<div class="Left">
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="Image1" SkinID="ExchangeList48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit Settings"></asp:Localize>
<div class="Module">
<div class="Left">
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="Image1" SkinID="ExchangeList48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit Settings"></asp:Localize>
<asp:Literal ID="litOrganizationName" runat="server" Text="Organization" />
</div>
<div class="FormBody">
<asp:Literal ID="litOrganizationName" runat="server" Text="Organization" />
</div>
<div class="FormBody">
<wsp:CollectionTabs id="tabs" runat="server" SelectedTab="organization_settings_password_settings" />
<wsp:CollectionTabs ID="tabs" runat="server" SelectedTab="organization_settings_password_settings" />
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<asp:UpdatePanel runat="server" ID="PasswordPolicyPanel" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<wsp:CollapsiblePanel id="colPasswordSettings" runat="server" TargetControlID="panelPasswordSettings" meta:resourcekey="colPasswordSettings" Text="Password settings">
</wsp:CollapsiblePanel>
<asp:Panel runat="server" ID="panelPasswordSettings">
<table id="PolicyTable" runat="server" cellpadding="2">
<wsp:SimpleMessageBox ID="messageBox" runat="server" />
<asp:UpdatePanel runat="server" ID="PasswordPolicyPanel" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<wsp:CollapsiblePanel ID="colPasswordSettings" runat="server" TargetControlID="panelPasswordSettings" meta:ResourceKey="colPasswordSettings" Text="Password settings"></wsp:CollapsiblePanel>
<asp:Panel runat="server" ID="panelPasswordSettings">
<table id="PolicyTable" runat="server" cellpadding="2">
<tr>
<td class="Normal" style="width:150px;"><asp:Label ID="lblMinimumLength" runat="server"
meta:resourcekey="lblMinimumLength" Text="Minimum length:"></asp:Label></td>
<td class="Normal" style="width: 150px;">
<asp:Label ID="lblMinimumLength" runat="server"
meta:resourcekey="lblMinimumLength" Text="Minimum length:"></asp:Label></td>
<td class="Normal">
<asp:TextBox ID="txtMinimumLength" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireMinLength" runat="server" ControlToValidate="txtMinimumLength" meta:resourcekey="valRequireMinLength"
@ -44,19 +44,21 @@
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator></td>
</tr>
<tr>
<td class="Normal"><asp:Label ID="lblMaximumLength" runat="server"
meta:resourcekey="lblMaximumLength" Text="Maximum length:"></asp:Label></td>
<td class="Normal">
<asp:Label ID="lblMaximumLength" runat="server"
meta:resourcekey="lblMaximumLength" Text="Maximum length:"></asp:Label></td>
<td class="Normal">
<asp:TextBox ID="txtMaximumLength" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireMaxLength" runat="server" ControlToValidate="txtMaximumLength" meta:resourcekey="valRequireMaxLength"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectMaxLength" runat="server" ControlToValidate="txtMaximumLength" meta:resourcekey="valCorrectMaxLength"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator>
</td>
</td>
</tr>
<tr>
<td class="Normal" style="width:150px;"><asp:Label ID="lblEnforcePasswordHistory" runat="server"
meta:resourcekey="lblEnforcePasswordHistory" Text="Enforce Password History:"></asp:Label></td>
<td class="Normal" style="width: 150px;">
<asp:Label ID="lblEnforcePasswordHistory" runat="server"
meta:resourcekey="lblEnforcePasswordHistory" Text="Enforce Password History:"></asp:Label></td>
<td class="Normal">
<asp:TextBox ID="txtEnforcePasswordHistory" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireEnforcePasswordHistory" runat="server" ControlToValidate="txtEnforcePasswordHistory" meta:resourcekey="valRequireEnforcePasswordHistory"
@ -64,15 +66,27 @@
<asp:RegularExpressionValidator ID="valCorrectEnforcePasswordHistory" runat="server" ControlToValidate="txtEnforcePasswordHistory" meta:resourcekey="valCorrectEnforcePasswordHistory"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator></td>
</tr>
<tr>
<td class="Normal" style="width: 150px;">
<asp:Label ID="lblMaxPasswordAge" runat="server"
meta:resourcekey="lblMaxPasswordAge" Text="Max Password Age (days):"></asp:Label></td>
<td class="Normal">
<asp:TextBox ID="txtMaxPasswordAge" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireMaxPasswordAge" runat="server" ControlToValidate="txtMaxPasswordAge" meta:resourcekey="valRequireMaxPasswordAge"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectMaxPasswordAge" runat="server" ControlToValidate="txtMaxPasswordAge" meta:resourcekey="valCorrectMaxPasswordAge"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator></td>
</tr>
<tr id="RowChkLockOutSettigns" runat="server">
<td colspan="2" class="NormalBold">
<asp:CheckBox id="chkLockOutSettigns" runat="server" meta:resourcekey="chkLockOutSettigns"
Text="Enable Lockout Settings" CssClass="NormalBold" AutoPostBack="true" OnCheckedChanged="chkLockOutSettigns_CheckedChanged" />
<asp:CheckBox ID="chkLockOutSettigns" runat="server" meta:resourcekey="chkLockOutSettigns"
Text="Enable Lockout Settings" CssClass="NormalBold" AutoPostBack="true" OnCheckedChanged="chkLockOutSettigns_CheckedChanged" />
</td>
</tr>
<tr id="RowAccountLockoutDuration" runat="server">
<td class="Normal" style="width:150px;"><asp:Label ID="lblAccountLockoutDuration" runat="server"
meta:resourcekey="lblAccountLockoutDuration" Text="Account Lockout Duration (minutes):"></asp:Label></td>
<td class="Normal" style="width: 150px;">
<asp:Label ID="lblAccountLockoutDuration" runat="server"
meta:resourcekey="lblAccountLockoutDuration" Text="Account Lockout Duration (minutes):"></asp:Label></td>
<td class="Normal">
<asp:TextBox ID="txtAccountLockoutDuration" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireAccountLockoutDuration" runat="server" ControlToValidate="txtAccountLockoutDuration" meta:resourcekey="valRequireAccountLockoutDuration"
@ -85,7 +99,8 @@
<asp:Label ID="lblLockedOut" runat="server"
meta:resourcekey="lblLockedOut" Text="Account Lockout threshold:"></asp:Label>
</td>
<td class="Normal"><asp:TextBox ID="txtLockedOut" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<td class="Normal">
<asp:TextBox ID="txtLockedOut" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequiredLockedOut" runat="server" ControlToValidate="txtLockedOut" meta:resourcekey="valRequiredLockedOut"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectLockedOut" runat="server" ControlToValidate="txtLockedOut" meta:resourcekey="valCorrectLockedOut"
@ -97,7 +112,8 @@
<asp:Label ID="lblResetAccountLockout" runat="server"
meta:resourcekey="lblResetAccountLockout" Text="Reset account lockout counter after (minutes):"></asp:Label>
</td>
<td class="Normal"><asp:TextBox ID="txtResetAccountLockout" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<td class="Normal">
<asp:TextBox ID="txtResetAccountLockout" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireResetAccountLockout" runat="server" ControlToValidate="txtResetAccountLockout" meta:resourcekey="valRequireResetAccountLockout"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valResetAccountLockout" runat="server" ControlToValidate="txtResetAccountLockout" meta:resourcekey="valResetAccountLockout"
@ -107,8 +123,8 @@
<tr>
<td colspan="2" class="NormalBold">
<asp:CheckBox id="chkPasswordComplexity" runat="server" meta:resourcekey="chkPasswordComplexity"
Text="Enable Password Complexity" CssClass="NormalBold" AutoPostBack="true" OnCheckedChanged="chkPasswordComplexity_CheckedChanged" />
<asp:CheckBox ID="chkPasswordComplexity" runat="server" meta:resourcekey="chkPasswordComplexity"
Text="Enable Password Complexity" CssClass="NormalBold" AutoPostBack="true" OnCheckedChanged="chkPasswordComplexity_CheckedChanged" />
</td>
</tr>
<tr id="RowMinimumUppercase" runat="server">
@ -116,31 +132,34 @@
<asp:Label ID="lblMinimumUppercase" runat="server"
meta:resourcekey="lblMinimumUppercase" Text="Uppercase letters:"></asp:Label>
</td>
<td class="Normal"><asp:TextBox ID="txtMinimumUppercase" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<td class="Normal">
<asp:TextBox ID="txtMinimumUppercase" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireUppercase" runat="server" ControlToValidate="txtMinimumUppercase" meta:resourcekey="valRequireUppercase"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectUppercase" runat="server" ControlToValidate="txtMinimumUppercase" meta:resourcekey="valCorrectUppercase"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator>
</td>
</td>
</tr>
<tr id="RowMinimumNumbers" runat="server">
<td class="Normal">
<asp:Label ID="lblMinimumNumbers" runat="server"
meta:resourcekey="lblMinimumNumbers" Text="Numbers:"></asp:Label>
</td>
<td class="Normal"><asp:TextBox ID="txtMinimumNumbers" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<td class="Normal">
<asp:TextBox ID="txtMinimumNumbers" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireNumbers" runat="server" ControlToValidate="txtMinimumNumbers" meta:resourcekey="valRequireNumbers"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectNumbers" runat="server" ControlToValidate="txtMinimumNumbers" meta:resourcekey="valCorrectNumbers"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator>
</td>
</td>
</tr>
<tr id="RowMinimumSymbols" runat="server">
<td class="Normal">
<asp:Label ID="lblMinimumSymbols" runat="server"
meta:resourcekey="lblMinimumSymbols" Text="Non-alphanumeric symbols:"></asp:Label>
</td>
<td class="Normal"><asp:TextBox ID="txtMinimumSymbols" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<td class="Normal">
<asp:TextBox ID="txtMinimumSymbols" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireSymbols" runat="server" ControlToValidate="txtMinimumSymbols" meta:resourcekey="valRequireSymbols"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectSymbols" runat="server" ControlToValidate="txtMinimumSymbols" meta:resourcekey="valCorrectSymbols"
@ -149,20 +168,20 @@
</tr>
<tr id="rowEqualUsername" runat="server" visible="false">
<td class="Normal" colspan="2">
<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>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<div class="FormFooterClean">
<wsp:ItemButtonPanel id="buttonPanel" runat="server" ValidationGroup="SettingsEditor"
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<div class="FormFooterClean">
<wsp:ItemButtonPanel ID="buttonPanel" runat="server" ValidationGroup="SettingsEditor"
OnSaveClick="btnSave_Click" OnSaveExitClick="btnSaveExit_Click" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.UI;
@ -59,6 +60,8 @@ namespace WebsitePanel.Portal.ExchangeServer
txtResetAccountLockout.Text = PasswordPolicyEditor.GetValueSafe(parts, 10, "0");
chkLockOutSettigns.Checked = PasswordPolicyEditor.GetValueSafe(parts, 11, false);
chkPasswordComplexity.Checked = PasswordPolicyEditor.GetValueSafe(parts, 12, true);
txtMaxPasswordAge.Text = PasswordPolicyEditor.GetValueSafe(parts, 13, "42");
}
private void BindSettings(OrganizationPasswordSettings settings)
@ -75,6 +78,8 @@ namespace WebsitePanel.Portal.ExchangeServer
txtResetAccountLockout.Text = settings.ResetAccountLockoutCounterAfter.ToString();
chkLockOutSettigns.Checked = settings.LockoutSettingsEnabled;
chkPasswordComplexity.Checked = settings.PasswordComplexityEnabled;
txtMaxPasswordAge.Text = settings.MaxPasswordAge.ToString();
}
private OrganizationPasswordSettings GetSettings()
@ -94,6 +99,8 @@ namespace WebsitePanel.Portal.ExchangeServer
settings.LockoutSettingsEnabled = chkLockOutSettigns.Checked;
settings.PasswordComplexityEnabled =chkPasswordComplexity.Checked;
settings.MaxPasswordAge = Utils.ParseInt(txtMaxPasswordAge.Text, 42);
return settings;
}

View file

@ -210,6 +210,42 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectEnforcePasswordHistory;
/// <summary>
/// lblMaxPasswordAge 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 lblMaxPasswordAge;
/// <summary>
/// txtMaxPasswordAge 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 txtMaxPasswordAge;
/// <summary>
/// valRequireMaxPasswordAge 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 valRequireMaxPasswordAge;
/// <summary>
/// valCorrectMaxPasswordAge 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 valCorrectMaxPasswordAge;
/// <summary>
/// RowChkLockOutSettigns control.
/// </summary>

View file

@ -4,42 +4,69 @@
<div id="ExchangeContainer">
<div class="Module">
<div class="Left">
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="Image1" SkinID="OrganizationUser48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Reset Password"></asp:Localize>
-
<div class="Module">
<div class="Left">
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="Image1" SkinID="OrganizationUser48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Reset Password"></asp:Localize>
-
<asp:Literal ID="litDisplayName" runat="server" Text="John Smith" />
</div>
<div class="FormBody">
<table>
<tr>
<td class="FormLabel150" valign="top"><asp:Localize ID="locEmailAddress" runat="server" meta:resourcekey="locEmailAddress" ></asp:Localize></td>
<td>
<asp:TextBox runat="server" ID="txtEmailAddress" CssClass="TextBox200"/>
<asp:RequiredFieldValidator ID="valEmailAddress" runat="server" ErrorMessage="*" ControlToValidate="txtEmailAddress" ValidationGroup="ResetUserPassword"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regexEmailValid" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="ResetUserPassword" ControlToValidate="txtEmailAddress" ErrorMessage="Invalid Email Format"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="locReason" runat="server" meta:resourcekey="locReason" Text="Reason:"></asp:Localize></td>
<td>
<asp:TextBox ID="txtReason" runat="server" CssClass="TextBox200" Rows="4" TextMode="MultiLine"></asp:TextBox>
<asp:RequiredFieldValidator ID="valReason" runat="server" ErrorMessage="*" ControlToValidate="txtReason" ValidationGroup="ResetUserPassword"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
<div class="FormFooterClean">
<asp:Button id="btnResetPassoword" runat="server" Text="Send Password Reset Email" CssClass="Button1" meta:resourcekey="btnResetPassoword" ValidationGroup="ResetUserPassword" OnClick="btnResetPassoword_Click"></asp:Button>
</div>
</div>
</div>
</div>
</div>
<div class="FormBody">
<asp:UpdatePanel ID="PasswrodResetUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<table>
<tr>
<td class="FormLabel150">
<asp:Localize ID="locSendTo" runat="server" meta:resourcekey="locSendTo" Text="Send to:"></asp:Localize></td>
<td class="FormRBtnL">
<asp:RadioButton ID="rbtnEmail" runat="server" meta:resourcekey="rbtnEmail" Text="Email" GroupName="SendToGroup" AutoPostBack="true" Checked="true" OnCheckedChanged="SendToGroupCheckedChanged" />
<asp:RadioButton ID="rbtnMobile" runat="server" meta:resourcekey="rbtnMobile" Text="Mobile" GroupName="SendToGroup" AutoPostBack="true" OnCheckedChanged="SendToGroupCheckedChanged" />
<br />
<br />
</td>
</tr>
<tr id="EmailRow" runat="server">
<td class="FormLabel150" valign="top">
<asp:Localize ID="locEmailAddress" runat="server" meta:resourcekey="locEmailAddress"></asp:Localize></td>
<td>
<asp:TextBox runat="server" ID="txtEmailAddress" CssClass="TextBox200" />
<asp:RequiredFieldValidator ID="valEmailAddress" runat="server" ErrorMessage="*" ControlToValidate="txtEmailAddress" ValidationGroup="ResetUserPassword"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regexEmailValid" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="ResetUserPassword" ControlToValidate="txtEmailAddress" ErrorMessage="Invalid Email Format"></asp:RegularExpressionValidator>
</td>
</tr>
<tr id="MobileRow" runat="server" visible="False">
<td class="FormLabel150" valign="top">
<asp:Localize ID="locMobile" runat="server" meta:resourcekey="locMobile"></asp:Localize></td>
<td>
<asp:TextBox runat="server" ID="txtMobile" CssClass="TextBox200" />
<asp:RequiredFieldValidator ID="valMobile" runat="server" ErrorMessage="*" ControlToValidate="txtMobile" ValidationGroup="ResetUserPassword"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regexMobileValid" runat="server" ValidationExpression="^\+?\d+$" ValidationGroup="ResetUserPassword" ControlToValidate="txtMobile" ErrorMessage="Invalid Mobile Format"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="FormLabel150">
<asp:Localize ID="locReason" runat="server" meta:resourcekey="locReason" Text="Reason:"></asp:Localize></td>
<td>
<asp:TextBox ID="txtReason" runat="server" CssClass="TextBox200" Rows="4" TextMode="MultiLine"></asp:TextBox>
<asp:RequiredFieldValidator ID="valReason" runat="server" ErrorMessage="*" ControlToValidate="txtReason" ValidationGroup="ResetUserPassword"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<div class="FormFooterClean">
<asp:Button ID="btnResetPassoword" runat="server" Text="Send Password Reset Email" CssClass="Button1" meta:resourcekey="btnResetPassoword" ValidationGroup="ResetUserPassword" OnClick="btnResetPassoword_Click"></asp:Button>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -26,6 +26,8 @@ namespace WebsitePanel.Portal.ExchangeServer
litDisplayName.Text = PortalAntiXSS.Encode(user.DisplayName);
txtEmailAddress.Text = user.PrimaryEmailAddress;
txtMobile.Text = user.MobilePhone;
}
protected void btnResetPassoword_Click(object sender, EventArgs e)
@ -35,11 +37,31 @@ namespace WebsitePanel.Portal.ExchangeServer
return;
}
ES.Services.Organizations.SendResetUserPasswordEmail(PanelRequest.ItemID,PanelRequest.AccountID, txtReason.Text, txtEmailAddress.Text);
if (rbtnEmail.Checked)
{
ES.Services.Organizations.SendResetUserPasswordEmail(PanelRequest.ItemID,PanelRequest.AccountID, txtReason.Text, txtEmailAddress.Text, true);
}
else
{
var result = ES.Services.Organizations.SendResetUserPasswordLinkSms(PanelRequest.ItemID, PanelRequest.AccountID, txtReason.Text, txtMobile.Text);
if (!result.IsSuccess)
{
ShowErrorMessage("SEND_USER_PASSWORD_RESET_SMS");
return;
}
}
Response.Redirect(PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(),
(PanelRequest.Context == "Mailbox") ? "mailboxes" : "users",
"SpaceID=" + PanelSecurity.PackageId));
}
protected void SendToGroupCheckedChanged(object sender, EventArgs e)
{
EmailRow.Visible = rbtnEmail.Checked;
MobileRow.Visible = !rbtnEmail.Checked;
}
}
}

View file

@ -39,6 +39,51 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litDisplayName;
/// <summary>
/// PasswrodResetUpdatePanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel PasswrodResetUpdatePanel;
/// <summary>
/// locSendTo 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.Localize locSendTo;
/// <summary>
/// rbtnEmail 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.RadioButton rbtnEmail;
/// <summary>
/// rbtnMobile 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.RadioButton rbtnMobile;
/// <summary>
/// EmailRow 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 EmailRow;
/// <summary>
/// locEmailAddress control.
/// </summary>
@ -75,6 +120,51 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::System.Web.UI.WebControls.RegularExpressionValidator regexEmailValid;
/// <summary>
/// MobileRow 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 MobileRow;
/// <summary>
/// locMobile 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.Localize locMobile;
/// <summary>
/// txtMobile 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 txtMobile;
/// <summary>
/// valMobile 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 valMobile;
/// <summary>
/// regexMobileValid 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 regexMobileValid;
/// <summary>
/// locReason control.
/// </summary>

View file

@ -70,7 +70,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
if (!hideItems) tabsList.Add(CreateTab("mailbox_mailflow", "Tab.Mailflow"));
if (!hideItems) tabsList.Add(CreateTab("mailbox_permissions", "Tab.Permissions"));
string instructions = ES.Services.ExchangeServer.GetMailboxSetupInstructions(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false);
string instructions = ES.Services.ExchangeServer.GetMailboxSetupInstructions(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false, " ");
if (!string.IsNullOrEmpty(instructions))
tabsList.Add(CreateTab("mailbox_setup", "Tab.Setup"));

View file

@ -0,0 +1,125 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SearchObject.ascx.cs" Inherits="WebsitePanel.Portal.SearchObject" %>
<%@ Import Namespace="WebsitePanel.Portal" %>
<script>
var estop = function (e) {
if (!e) e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
return e;
}
var CPopupDialog = function (el, e) {
if (typeof el == 'string')
el = document.getElementById(el);
e = estop(e);
var oldclick = document.body.onclick;
el.onclick = estop;
function close() {
el.style.display = "none";
document.body.onclick = oldclick;
}
function show(x, y) {
el.style.left = x ? x : e.clientX + document.documentElement.scrollLeft + "px";
el.style.top = y ? y : e.clientY + document.documentElement.scrollTop + "px";
el.style.display = "block";
document.body.onclick = close;
}
show();
};
$(document).ready(function () {
var loadFilters = function()
{
var typesSelected = JSON.parse($("#tbFilters").val());
$("#mydialog input[rel]").each(function () {
var rel = $(this).attr('rel');
if (typesSelected.indexOf(rel) >= 0)
$(this).val("1");
})
}
$("#btnSelectFilter").click(function(e)
{
var typesSelected = [];
$("#mydialog input[rel]").each(function () {
var val = $(this).attr("checked");
if (val) typesSelected.push($(this).attr('rel'));
});
$("#tbFilters").val(JSON.stringify(typesSelected));
document.forms[0].submit();
})
loadFilters();
});
</script>
<asp:GridView id="gvObjects" runat="server" AutoGenerateColumns="False"
AllowPaging="True" AllowSorting="True"
CssSelectorClass="NormalGridView"
DataSourceID="odsObjectsPaged" EnableViewState="False"
EmptyDataText="gvObjects">
<Columns>
<asp:TemplateField HeaderText="gvType" SortExpression="ColumnType">
<HeaderTemplate>
<a href="javascript: void(0)" onclick="CPopupDialog('mydialog',event)">Type</a>
</HeaderTemplate>
<ItemTemplate>
<%# Eval("ColumnType") %>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField SortExpression="TextSearch" HeaderText="gvText" HeaderStyle-Wrap="false">
<ItemTemplate>
<asp:hyperlink id=lnkUser runat="server" NavigateUrl='<%# GetItemPageUrl((string)Eval("FullType"), (string)Eval("ColumnType"), (int)Eval("ItemID"), (int)Eval("PackageID")) %>'>
<%# Eval("TextSearch") %>
</asp:hyperlink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FullType" HtmlEncode="false" SortExpression="FullType" HeaderText="gvFullType">
<HeaderStyle Wrap="false" />
</asp:BoundField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsObjectsPaged" runat="server" EnablePaging="True" SelectCountMethod="SearchObjectItemsPagedCount"
SelectMethod="SearchObjectItemsPaged" SortParameterName="sortColumn" TypeName="WebsitePanel.Portal.PackagesHelper" OnSelected="odsObjectPaged_Selected" OnSelecting="odsObjectPaged_Selecting">
<SelectParameters>
<asp:QueryStringParameter Name="filterColumn" QueryStringField="Criteria" />
<asp:QueryStringParameter Name="filterValue" QueryStringField="Query" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="odsObjectTypes" runat="server" EnablePaging="false"
SelectMethod="SearchObjectTypes" SortParameterName="sortColumn" TypeName="WebsitePanel.Portal.PackagesHelper">
<SelectParameters>
<asp:QueryStringParameter Name="filterColumn" QueryStringField="Criteria" />
<asp:QueryStringParameter Name="filterValue" QueryStringField="Query" />
</SelectParameters>
</asp:ObjectDataSource>
<div id="mydialog" class="ui-popupdialog">
<div class="title">Select filter</div>
<div class="content">
<asp:GridView runat="server" DataSourceID="odsObjectTypes" SortParameterName="sortColumn" ShowHeader="false" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<input type="checkbox" runat="server" rel='<%# Eval("ColumnType") %>'></input>
<%# Eval("ColumnType") %>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<div class="actions">
<a id="btnSelectFilter" href="javascript: void(0)" class="ui-button">Apply</a>
<a onclick="document.body.onclick.apply(event)" href="javascript: void(0)" class="ui-button">Close</a>
<div style="clear:both"></div>
</div>
<asp:TextBox ClientIDMode="Static" ID="tbFilters" type="hidden" runat="server"></asp:TextBox>
</div>

View file

@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Script.Serialization;
using WebsitePanel.WebPortal;
namespace WebsitePanel.Portal
{
public partial class SearchObject : WebsitePanelModuleBase
{
const string TYPE_WEBSITE = "WebSite";
const string TYPE_DOMAIN = "Domain";
const string TYPE_ORGANIZATION = "Organization";
const string PID_SPACE_WEBSITES = "SpaceWebSites";
const string PID_SPACE_DIMAINS = "SpaceDomains";
const string PID_SPACE_EXCHANGESERVER = "SpaceExchangeServer";
String m_strColTypes = "";
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
var jsonSerialiser = new JavaScriptSerializer();
String[] aTypes = jsonSerialiser.Deserialize<String[]>(tbFilters.Text);
if ((aTypes != null) && (aTypes.Length > 0))
m_strColTypes = "'" + String.Join("','", aTypes) + "'";
else
m_strColTypes = "";
}
}
protected void odsObjectPaged_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.InputParameters["colType"] = m_strColTypes;
}
protected void odsObjectPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
ProcessException(e.Exception.InnerException);
e.ExceptionHandled = true;
}
}
public string GetItemPageUrl(string fullType, string itemType, int itemId, int spaceId)
{
string res = "";
if (fullType.Equals("Users"))
{
res = PortalUtils.GetUserHomePageUrl(itemId);
}
else
{
switch (itemType)
{
case TYPE_WEBSITE:
res = PortalUtils.NavigatePageURL(PID_SPACE_WEBSITES, "ItemID", itemId.ToString(),
PortalUtils.SPACE_ID_PARAM + "=" + spaceId, DefaultPage.CONTROL_ID_PARAM + "=" + "edit_item",
"moduleDefId=websites");
break;
case TYPE_DOMAIN:
res = PortalUtils.NavigatePageURL(PID_SPACE_DIMAINS, "DomainID", itemId.ToString(),
PortalUtils.SPACE_ID_PARAM + "=" + spaceId, DefaultPage.CONTROL_ID_PARAM + "=" + "edit_item",
"moduleDefId=domains");
break;
case TYPE_ORGANIZATION:
res = PortalUtils.NavigatePageURL(PID_SPACE_EXCHANGESERVER, "ItemID", itemId.ToString(),
PortalUtils.SPACE_ID_PARAM + "=" + spaceId, DefaultPage.CONTROL_ID_PARAM + "=" + "organization_home",
"moduleDefId=ExchangeServer");
break;
default:
res = PortalUtils.GetSpaceHomePageUrl(itemId);
break;
}
}
return res;
}
}
}

View file

@ -0,0 +1,51 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal {
public partial class SearchObject {
/// <summary>
/// gvObjects 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.GridView gvObjects;
/// <summary>
/// odsObjectsPaged 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.ObjectDataSource odsObjectsPaged;
/// <summary>
/// odsObjectTypes 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.ObjectDataSource odsObjectTypes;
/// <summary>
/// tbFilters 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 tbFilters;
}
}

View file

@ -3,13 +3,94 @@
<%@ Register Src="UserControls/ServerDetails.ascx" TagName="ServerDetails" TagPrefix="uc3" %>
<%@ Register Src="UserControls/Comments.ascx" TagName="Comments" TagPrefix="uc4" %>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function () {
$("#tbSearch").autocomplete({
zIndex: 100,
source: function (request, response) {
$.ajax({
type: "post",
dataType: "json",
data: {
term: request.term,
fullType: 'Spaces',
itemType: $("#ddlItemType").val()
},
url: "AjaxHandler.ashx",
success: function (data) {
response($.map(data, function (item) {
return {
label: item.TextSearch,
code: item
};
}));
}
})
},
select: function (event, ui) {
var item = ui.item;
$("#ddlItemType").val(item.code.ColumnType);
$("#tbSearchFullType").val(item.code.FullType);
$("#tbSearchText").val(item.code.TextSearch);
}
});
});//]]>
</script>
<div class="FormButtonsBar">
<asp:Panel ID="tblSearch" runat="server" DefaultButton="cmdSearch" CssClass="NormalBold">
<asp:Label ID="lblSearch" runat="server" meta:resourcekey="lblSearch"></asp:Label>
<asp:DropDownList ID="ddlItemType" runat="server" CssClass="NormalTextBox">
</asp:DropDownList><asp:TextBox ID="txtFilterValue" runat="server" CssClass="NormalTextBox" Width="100"></asp:TextBox><asp:ImageButton ID="cmdSearch" Runat="server" SkinID="SearchButton" meta:resourcekey="cmdSearch"
CausesValidation="false" OnClick="cmdSearch_Click" />
<asp:Panel ID="tblSearch" runat="server" DefaultButton="ImageButton1" CssClass="NormalBold">
<asp:Label ID="lblSearch" runat="server" meta:resourcekey="lblSearch"></asp:Label>
<div align="center">
<table>
<tr>
<td>
<asp:DropDownList ClientIDMode="Static" ID="ddlItemType" runat="server" CssClass="NormalTextBox">
</asp:DropDownList>
</td>
<td>
<table cellpadding="0" cellspacing="0" align="right">
<tr>
<td align="left" class="SearchQuery">
<div class="ui-widget">
<asp:TextBox
ID="tbSearch"
ClientIDMode="Static"
runat="server"
CssClass="NormalTextBox"
Width="120px"
style="vertical-align: middle; z-index: 100;"
>
</asp:TextBox>
<asp:TextBox
ID="tbSearchFullType"
ClientIDMode="Static"
runat="server"
type="hidden"
>
</asp:TextBox>
<asp:TextBox
ID="tbSearchText"
ClientIDMode="Static"
runat="server"
type="hidden"
>
</asp:TextBox>
<asp:ImageButton
ID="ImageButton1"
runat="server"
SkinID="SearchButton"
OnClick="cmdSearch_Click"
CausesValidation="false"
style="vertical-align: middle;"
/>
</div>
</td>
</tr>
</table>
</td>
</tr>
</asp:Panel>
</div>

View file

@ -77,7 +77,7 @@ namespace WebsitePanel.Portal
// bind filter
Utils.SelectListItem(ddlItemType, Request["ItemTypeID"]);
txtFilterValue.Text = Request["Query"];
tbSearch.Text = Request["Query"];
}
}
@ -119,7 +119,9 @@ namespace WebsitePanel.Portal
protected void cmdSearch_Click(object sender, ImageClickEventArgs e)
{
string query = txtFilterValue.Text.Trim().Replace("%", "");
string query = tbSearchText.Text.Trim().Replace("%", "");
if (query.Length == 0)
query = tbSearch.Text.Trim().Replace("%", "");
Response.Redirect(NavigateURL(
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),

View file

@ -1,31 +1,3 @@
// Copyright (c) 2015, 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>
// This code was generated by a tool.
@ -68,22 +40,40 @@ namespace WebsitePanel.Portal {
protected global::System.Web.UI.WebControls.DropDownList ddlItemType;
/// <summary>
/// txtFilterValue control.
/// tbSearch 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 txtFilterValue;
protected global::System.Web.UI.WebControls.TextBox tbSearch;
/// <summary>
/// cmdSearch control.
/// tbSearchFullType 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.ImageButton cmdSearch;
protected global::System.Web.UI.WebControls.TextBox tbSearchFullType;
/// <summary>
/// tbSearchText 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 tbSearchText;
/// <summary>
/// ImageButton1 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.ImageButton ImageButton1;
/// <summary>
/// gvPackages control.

View file

@ -5,16 +5,100 @@
<%@ Register Src="UserControls/UserDetails.ascx" TagName="UserDetails" TagPrefix="uc2" %>
<%@ Register Src="UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function () {
$("#tbSearch").autocomplete({
zIndex: 100,
source: function (request, response) {
$.ajax({
type: "post",
dataType: "json",
data: {
term: request.term,
fullType: 'Users',
columnType: "'" + $("#ddlFilterColumn").val() + "'"
},
url: "AjaxHandler.ashx",
success: function (data) {
response($.map(data, function (item) {
return {
label: item.TextSearch,
code: item
};
}));
}
})
},
select: function (event, ui) {
var item = ui.item;
$("#ddlFilterColumn").val(item.code.ColumnType);
$("#tbSearchFullType").val(item.code.FullType);
$("#tbSearchText").val(item.code.TextSearch);
}
});
});//]]>
</script>
<div class="FormButtonsBar">
<asp:Panel ID="tblSearch" runat="server" DefaultButton="cmdSearch" CssClass="NormalBold">
<asp:Panel ID="tblSearch" runat="server" CssClass="NormalBold" DefaultButton="ImageButton1">
<asp:Label ID="lblSearch" runat="server" meta:resourcekey="lblSearch"></asp:Label>
<asp:DropDownList ID="ddlFilterColumn" runat="server" CssClass="NormalTextBox" resourcekey="ddlFilterColumn">
<asp:ListItem Value="Username">Username</asp:ListItem>
<asp:ListItem Value="Email">Email</asp:ListItem>
<asp:ListItem Value="FullName">FullName</asp:ListItem>
<asp:ListItem Value="CompanyName">CompanyName</asp:ListItem>
</asp:DropDownList><asp:TextBox ID="txtFilterValue" runat="server" CssClass="NormalTextBox" Width="100"></asp:TextBox><asp:ImageButton ID="cmdSearch" Runat="server" SkinID="SearchButton" meta:resourcekey="cmdSearch"
CausesValidation="false" OnClick="cmdSearch_Click" />
<div align="center">
<table>
<tr>
<td>
<asp:DropDownList ClientIDMode="Static" ID="ddlFilterColumn" runat="server" CssClass="NormalTextBox" resourcekey="ddlFilterColumn">
<asp:ListItem Value="Username">Username</asp:ListItem>
<asp:ListItem Value="Email">Email</asp:ListItem>
<asp:ListItem Value="FullName">FullName</asp:ListItem>
<asp:ListItem Value="CompanyName">CompanyName</asp:ListItem>
</asp:DropDownList>
</td>
<td>
<table cellpadding="0" cellspacing="0" align="right">
<tr>
<td align="left" class="SearchQuery">
<div class="ui-widget">
<asp:TextBox
ID="tbSearch"
ClientIDMode="Static"
runat="server"
CssClass="NormalTextBox"
Width="120px"
style="vertical-align: middle; z-index: 100;"
>
</asp:TextBox>
<asp:TextBox
ID="tbSearchFullType"
ClientIDMode="Static"
runat="server"
type="hidden"
>
</asp:TextBox>
<asp:TextBox
ID="tbSearchText"
ClientIDMode="Static"
runat="server"
type="hidden"
>
</asp:TextBox>
<asp:ImageButton
ID="ImageButton1"
runat="server"
SkinID="SearchButton"
OnClick="cmdSearch_Click"
CausesValidation="false"
style="vertical-align: middle;"
/>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</asp:Panel>
</div>

View file

@ -46,7 +46,7 @@ namespace WebsitePanel.Portal
if (!IsPostBack)
{
Utils.SelectListItem(ddlFilterColumn, Request["Criteria"]);
txtFilterValue.Text = Request["Query"];
tbSearch.Text = Request["Query"];
}
}
@ -57,7 +57,9 @@ namespace WebsitePanel.Portal
protected void cmdSearch_Click(object sender, ImageClickEventArgs e)
{
string query = txtFilterValue.Text.Trim().Replace("%", "");
string query = tbSearchText.Text.Trim().Replace("%", "");
if (query.Length == 0)
query = tbSearch.Text.Trim().Replace("%", "");
Response.Redirect(NavigateURL(
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),

View file

@ -1,31 +1,3 @@
// Copyright (c) 2015, 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>
// This code was generated by a tool.
@ -68,22 +40,40 @@ namespace WebsitePanel.Portal {
protected global::System.Web.UI.WebControls.DropDownList ddlFilterColumn;
/// <summary>
/// txtFilterValue control.
/// tbSearch 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 txtFilterValue;
protected global::System.Web.UI.WebControls.TextBox tbSearch;
/// <summary>
/// cmdSearch control.
/// tbSearchFullType 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.ImageButton cmdSearch;
protected global::System.Web.UI.WebControls.TextBox tbSearchFullType;
/// <summary>
/// tbSearchText 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 tbSearchText;
/// <summary>
/// ImageButton1 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.ImageButton ImageButton1;
/// <summary>
/// gvUsers control.

View file

@ -41,5 +41,20 @@
<td class="Normal" colspan="2">
<asp:TextBox ID="txtTextBody" runat="server" Rows="15" TextMode="MultiLine" Width="680px" CssClass="NormalTextBox" Wrap="false"></asp:TextBox></td>
</tr>
<tr>
<td class="SubHead" colspan="2"><br /><br /><asp:Label ID="lblPasswordResetLinkSmsBody" runat="server" meta:resourcekey="lblPasswordResetLinkSmsBody" Text="Password Reset Link Sms Body:"></asp:Label></td>
</tr>
<tr>
<td class="Normal" colspan="2">
<asp:TextBox ID="txtBodyPasswordResetLinkSmsBody" runat="server" Rows="15" TextMode="MultiLine" Width="680px" CssClass="NormalTextBox" Wrap="false"></asp:TextBox></td>
</tr>
tr>
<td class="SubHead" colspan="2"><br /><br /><asp:Label ID="lblPasswordResetPincodeSmsBody" runat="server" meta:resourcekey="lblPasswordResetPincodeSmsBody" Text="Password Reset Link Pincode Body:"></asp:Label></td>
</tr>
<tr>
<td class="Normal" colspan="2">
<asp:TextBox ID="txtPasswordResetPincodeSmsBody" runat="server" Rows="15" TextMode="MultiLine" Width="680px" CssClass="NormalTextBox" Wrap="false"></asp:TextBox></td>
</tr>
</table>

View file

@ -18,6 +18,9 @@ namespace WebsitePanel.Portal
txtHtmlBody.Text = settings["HtmlBody"];
txtTextBody.Text = settings["TextBody"];
txtLogoUrl.Text = settings["LogoUrl"];
txtBodyPasswordResetLinkSmsBody.Text = settings["PasswordResetLinkSmsBody"];
txtPasswordResetPincodeSmsBody.Text = settings["PasswordResetPincodeSmsBody"];
}
public void SaveSettings(UserSettings settings)
@ -28,6 +31,9 @@ namespace WebsitePanel.Portal
settings["HtmlBody"] = txtHtmlBody.Text;
settings["TextBody"] = txtTextBody.Text;
settings["LogoUrl"] = txtLogoUrl.Text;
settings["PasswordResetLinkSmsBody"]= txtBodyPasswordResetLinkSmsBody.Text;
settings["PasswordResetPincodeSmsBody"] =txtPasswordResetPincodeSmsBody.Text;
}
}
}

View file

@ -119,5 +119,41 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtTextBody;
/// <summary>
/// lblPasswordResetLinkSmsBody 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 lblPasswordResetLinkSmsBody;
/// <summary>
/// txtBodyPasswordResetLinkSmsBody 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 txtBodyPasswordResetLinkSmsBody;
/// <summary>
/// lblPasswordResetPincodeSmsBody 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 lblPasswordResetPincodeSmsBody;
/// <summary>
/// txtPasswordResetPincodeSmsBody 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 txtPasswordResetPincodeSmsBody;
}
}

View file

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="gvType.Header" xml:space="preserve">
<value>Type</value>
</data>
<data name="gvText.Header" xml:space="preserve">
<value>Search text</value>
</data>
<data name="gvFullType.Header" xml:space="preserve">
<value>Full Type</value>
</data>
</root>

View file

@ -1,54 +1,87 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="GlobalSearch.ascx.cs" Inherits="WebsitePanel.Portal.SkinControls.GlobalSearch" %>
<style>
.ui-menu-item a {white-space: nowrap; }
</style>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function () {
$("#<%= tbSearch.ClientID %>").autocomplete({
zIndex: 100,
source: function(request, response) {
$.ajax({
type: "post",
dataType: "json",
data: {
term: request.term
},
url: "AjaxHandler.ashx",
success: function(data)
{
response($.map(data, function (item) {
return {
label: item.TextSearch + " [" + item.FullType + "]",
code: item
};
}));
}
})
},
select: function (event, ui) {
var item = ui.item;
$("#<%= tbSearchColumnType.ClientID %>").val(item.code.ColumnType);
$("#<%= tbSearchFullType.ClientID %>").val(item.code.FullType);
$("#<%= tbSearchText.ClientID %>").val(item.code.TextSearch);
}
});
});//]]>
</script>
<asp:UpdatePanel runat="server" ID="updatePanelUsers" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<table cellpadding="0" cellspacing="0" align="right">
<tr>
<td align="left">
<asp:DataList ID="dlTabs" runat="server" RepeatDirection="Horizontal"
OnSelectedIndexChanged="dlTabs_SelectedIndexChanged" RepeatLayout="Table">
<ItemStyle Wrap="false" VerticalAlign="Top" />
<ItemTemplate>
<asp:LinkButton ID="lnkTab" runat="server" CommandName="select"
CausesValidation="false" CssClass="SearchMethod">
<%# Eval("Name") %>
</asp:LinkButton>
</ItemTemplate>
<SelectedItemStyle Wrap="false" />
<SelectedItemTemplate>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="SearchMethodSide" valign="top"></td>
<td class="SearchMethodSelected" valign="top"><%# Eval("Name")%></td>
<td class="SearchMethodSide" valign="top"></td>
</tr>
</table>
</SelectedItemTemplate>
</asp:DataList>
</td>
</tr>
<tr>
<td align="left" class="SearchQuery">
<asp:MultiView ID="tabs" runat="server" ActiveViewIndex="0">
<asp:View ID="tabSearchUsers" runat="server">
<asp:Panel ID="pnlSearchUsers" runat="server" DefaultButton="btnSearchUsers">
<asp:DropDownList ID="ddlUserFields" runat="server" resourcekey="ddlUserFields" CssClass="NormalTextBox" Width="150px" style="vertical-align: middle;">
<asp:ListItem Value="Username">Username</asp:ListItem>
<asp:ListItem Value="Email">Email</asp:ListItem>
<asp:ListItem Value="FullName">FullName</asp:ListItem>
<asp:ListItem Value="CompanyName">CompanyName</asp:ListItem>
</asp:DropDownList><asp:TextBox ID="txtUsersQuery" runat="server" CssClass="NormalTextBox" Width="120px" style="vertical-align: middle;"></asp:TextBox><asp:ImageButton ID="btnSearchUsers" runat="server" SkinID="SearchButton" OnClick="btnSearchUsers_Click" CausesValidation="false" style="vertical-align: middle;" />
</asp:Panel>
</asp:View>
<asp:View ID="tabSearchSpaces" runat="server">
<asp:Panel ID="pnlSearchSpaces" runat="server" DefaultButton="btnSearchSpaces">
<asp:DropDownList ID="ddlItemType" runat="server" Width="150px" CssClass="NormalTextBox" style="vertical-align: middle;">
</asp:DropDownList><asp:TextBox ID="txtSpacesQuery" runat="server" CssClass="NormalTextBox" Width="120px" style="vertical-align: middle;"></asp:TextBox><asp:ImageButton ID="btnSearchSpaces" runat="server" SkinID="SearchButton" OnClick="btnSearchSpaces_Click" CausesValidation="false" style="vertical-align: middle;" />
</asp:Panel>
</asp:View>
</asp:MultiView>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" align="right">
<tr>
<td align="left" class="SearchQuery">
<div class="ui-widget">
<asp:TextBox
ID="tbSearch"
runat="server"
CssClass="NormalTextBox"
Width="120px"
style="vertical-align: middle; z-index: 100;"
>
</asp:TextBox>
<asp:TextBox
ID="tbSearchColumnType"
runat="server"
type="hidden"
>
</asp:TextBox>
<asp:TextBox
ID="tbSearchFullType"
runat="server"
type="hidden"
>
</asp:TextBox>
<asp:TextBox
ID="tbSearchText"
runat="server"
type="hidden"
>
</asp:TextBox>
<asp:ImageButton
ID="ImageButton1"
runat="server"
SkinID="SearchButton"
OnClick="btnSearchObject_Click"
CausesValidation="false"
style="vertical-align: middle;"
/>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>

View file

@ -70,32 +70,20 @@ namespace WebsitePanel.Portal.SkinControls
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
ClientScriptManager cs = Page.ClientScript;
cs.RegisterClientScriptInclude("jquery",ResolveUrl("~/JavaScript/jquery-1.4.4.min.js"));
cs.RegisterClientScriptInclude("jqueryui",ResolveUrl("~/JavaScript/jquery-ui-1.8.9.min.js"));
// cs.RegisterClientScriptBlock(this.GetType(), "jquerycss",
// "<link rel='stylesheet' type='text/css' href='" + ResolveUrl("~/App_Themes/Default/Styles/jquery-ui-1.8.9.css") + "' />");
if (!IsPostBack)
{
BindTabs();
BindItemTypes();
}
}
private void BindTabs()
{
List<Tab> tabsList = new List<Tab>();
if (PanelSecurity.EffectiveUser.Role != UserRole.User)
tabsList.Add(new Tab(0, GetLocalizedString("Users.Text")));
tabsList.Add(new Tab(1, GetLocalizedString("Spaces.Text")));
if(dlTabs.SelectedIndex == -1)
dlTabs.SelectedIndex = 0;
dlTabs.DataSource = tabsList.ToArray();
dlTabs.DataBind();
tabs.ActiveViewIndex = tabsList[dlTabs.SelectedIndex].Index;
}
private void BindItemTypes()
{
// bind item types
/* // bind item types
DataTable dtItemTypes = ES.Services.Packages.GetSearchableServiceItemTypes().Tables[0];
foreach (DataRow dr in dtItemTypes.Rows)
{
@ -108,28 +96,63 @@ namespace WebsitePanel.Portal.SkinControls
}
//
ddlItemType.Items.Add(new ListItem(localizedStr, dr["ItemTypeID"].ToString()));
}
}
protected void dlTabs_SelectedIndexChanged(object sender, EventArgs e)
{
BindTabs();
} */
}
protected void btnSearchUsers_Click(object sender, EventArgs e)
{
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetUsersSearchPageId(),
/* Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetUsersSearchPageId(),
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
"Query=" + Server.UrlEncode(txtUsersQuery.Text),
"Criteria=" + ddlUserFields.SelectedValue));
"Criteria=" + ddlUserFields.SelectedValue)); */
}
protected void btnSearchSpaces_Click(object sender, EventArgs e)
{
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetSpacesSearchPageId(),
/* Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetSpacesSearchPageId(),
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
"Query=" + Server.UrlEncode(txtSpacesQuery.Text),
"ItemTypeID=" + ddlItemType.SelectedValue));
"ItemTypeID=" + ddlItemType.SelectedValue)); */
}
//TODO START
protected void btnSearchObject_Click(object sender, EventArgs e)
{
String strColumnType = tbSearchColumnType.Text;
String strFullType = tbSearchFullType.Text;
String strText = tbSearchText.Text;
if (strText.Length > 0)
{
if (strFullType == "Users")
{
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetUsersSearchPageId(),
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
"Query=" + Server.UrlEncode(strText),
"Criteria=" + Server.UrlEncode(strColumnType)
));
}
else if (strFullType == "Space")
{
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetSpacesSearchPageId(),
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
"Query=" + Server.UrlEncode(strText),
"Criteria=" + Server.UrlEncode(strColumnType)
));
}
else
{
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetObjectSearchPageId(),
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
"Query=" + Server.UrlEncode(strText)));
}
}
else
{
Response.Redirect(PortalUtils.NavigatePageURL(PortalUtils.GetObjectSearchPageId(),
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
"Query=" + Server.UrlEncode(tbSearch.Text)));
}
}
//TODO END
}
}

View file

@ -1,31 +1,3 @@
// Copyright (c) 2015, 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>
// This code was generated by a tool.
@ -50,111 +22,48 @@ namespace WebsitePanel.Portal.SkinControls {
protected global::System.Web.UI.UpdatePanel updatePanelUsers;
/// <summary>
/// dlTabs control.
/// tbSearch 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.DataList dlTabs;
protected global::System.Web.UI.WebControls.TextBox tbSearch;
/// <summary>
/// tabs control.
/// tbSearchColumnType 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.MultiView tabs;
protected global::System.Web.UI.WebControls.TextBox tbSearchColumnType;
/// <summary>
/// tabSearchUsers control.
/// tbSearchFullType 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.View tabSearchUsers;
protected global::System.Web.UI.WebControls.TextBox tbSearchFullType;
/// <summary>
/// pnlSearchUsers control.
/// tbSearchText 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.Panel pnlSearchUsers;
protected global::System.Web.UI.WebControls.TextBox tbSearchText;
/// <summary>
/// ddlUserFields control.
/// ImageButton1 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 ddlUserFields;
/// <summary>
/// txtUsersQuery 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 txtUsersQuery;
/// <summary>
/// btnSearchUsers 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.ImageButton btnSearchUsers;
/// <summary>
/// tabSearchSpaces 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.View tabSearchSpaces;
/// <summary>
/// pnlSearchSpaces 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.Panel pnlSearchSpaces;
/// <summary>
/// ddlItemType 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 ddlItemType;
/// <summary>
/// txtSpacesQuery 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 txtSpacesQuery;
/// <summary>
/// btnSearchSpaces 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.ImageButton btnSearchSpaces;
protected global::System.Web.UI.WebControls.ImageButton ImageButton1;
}
}

View file

@ -98,6 +98,24 @@
</tr>
</table>
</asp:Panel>
<wsp:CollapsiblePanel ID="TwilioSettings" runat="server" TargetControlID="PanelTwilioSettings" meta:resourcekey="TwilioSettings" Text="Webdav Portal" />
<asp:Panel ID="PanelTwilioSettings" runat="server" Height="0" style="overflow:hidden;">
<table>
<tr>
<td class="SubHead" style="width:200px;"><asp:Localize ID="lblAccountSid" runat="server" meta:resourcekey="lblAccountSid" />
<td><asp:TextBox runat="server" ID="txtAccountSid" Width="450px" /></td>
</tr>
<tr>
<td class="SubHead" style="width:200px;"><asp:Localize ID="lblAuthToken" runat="server" meta:resourcekey="lblAuthToken" />
<td><asp:TextBox runat="server" ID="txtAuthToken" Width="450px" /></td>
</tr>
<tr>
<td class="SubHead" style="width:200px;"><asp:Localize ID="lblPhoneFrom" runat="server" meta:resourcekey="lblPhoneFrom" />
<td><asp:TextBox runat="server" ID="txtPhoneFrom" Width="450px" /></td>
</tr>
</table>
</asp:Panel>
</div>
<div class="FormFooter">
<asp:Button runat="server" ID="btnSaveSettings" meta:resourcekey="btnSaveSettings"

View file

@ -167,6 +167,17 @@ namespace WebsitePanel.Portal
chkEnablePasswordReset.Checked = Utils.ParseBool(settings[WSP.SystemSettings.WEBDAV_PASSWORD_RESET_ENABLED_KEY], false);
txtWebdavPortalUrl.Text = settings[WEBDAV_PORTAL_URL];
}
// Twilio portal
settings = ES.Services.System.GetSystemSettings(WSP.SystemSettings.TWILIO_SETTINGS);
if (settings != null)
{
txtAccountSid.Text = settings.GetValueOrDefault(WSP.SystemSettings.TWILIO_ACCOUNTSID_KEY, string.Empty);
txtAuthToken.Text = settings.GetValueOrDefault(WSP.SystemSettings.TWILIO_AUTHTOKEN_KEY, string.Empty);
txtPhoneFrom.Text = settings.GetValueOrDefault(WSP.SystemSettings.TWILIO_PHONEFROM_KEY, string.Empty);
}
}
private void SaveSettings()
@ -253,6 +264,19 @@ namespace WebsitePanel.Portal
settings[WSP.SystemSettings.WEBDAV_PASSWORD_RESET_ENABLED_KEY] = chkEnablePasswordReset.Checked.ToString();
result = ES.Services.System.SetSystemSettings(WSP.SystemSettings.WEBDAV_PORTAL_SETTINGS, settings);
if (result < 0)
{
ShowResultMessage(result);
return;
}
// Twilio portal
settings = new WSP.SystemSettings();
settings[WSP.SystemSettings.TWILIO_ACCOUNTSID_KEY] = txtAccountSid.Text;
settings[WSP.SystemSettings.TWILIO_AUTHTOKEN_KEY] = txtAuthToken.Text;
settings[WSP.SystemSettings.TWILIO_PHONEFROM_KEY] = txtPhoneFrom.Text;
result = ES.Services.System.SetSystemSettings(WSP.SystemSettings.TWILIO_SETTINGS, settings);
if (result < 0)
{
ShowResultMessage(result);

View file

@ -282,6 +282,78 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtWebdavPortalUrl;
/// <summary>
/// TwilioSettings control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel TwilioSettings;
/// <summary>
/// PanelTwilioSettings 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.Panel PanelTwilioSettings;
/// <summary>
/// lblAccountSid 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.Localize lblAccountSid;
/// <summary>
/// txtAccountSid 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 txtAccountSid;
/// <summary>
/// lblAuthToken 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.Localize lblAuthToken;
/// <summary>
/// txtAuthToken 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 txtAuthToken;
/// <summary>
/// lblPhoneFrom 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.Localize lblPhoneFrom;
/// <summary>
/// txtPhoneFrom 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 txtPhoneFrom;
/// <summary>
/// btnSaveSettings control.
/// </summary>

View file

@ -210,4 +210,13 @@
<data name="valResetAccountLockout.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="lblMaxPasswordAge.Text" xml:space="preserve">
<value>Max Password Age (days):</value>
</data>
<data name="valCorrectMaxPasswordAge.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="valRequireMaxPasswordAge.Text" xml:space="preserve">
<value>*</value>
</data>
</root>

View file

@ -37,6 +37,16 @@
<asp:RegularExpressionValidator ID="valCorrectEnforcePasswordHistory" runat="server" ControlToValidate="txtEnforcePasswordHistory" meta:resourcekey="valCorrectEnforcePasswordHistory"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator></td>
</tr>
<tr>
<td class="Normal" style="width:150px;"><asp:Label ID="lblMaxPasswordAge" runat="server"
meta:resourcekey="lblMaxPasswordAge" Text="Max Password Age (days):"></asp:Label></td>
<td class="Normal">
<asp:TextBox ID="txtMaxPasswordAge" runat="server" CssClass="NormalTextBox" Width="40px"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireMaxPasswordAge" runat="server" ControlToValidate="txtMaxPasswordAge" meta:resourcekey="valRequireMaxPasswordAge"
ErrorMessage="*" ValidationGroup="SettingsEditor" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valCorrectMaxPasswordAge" runat="server" ControlToValidate="txtMaxPasswordAge" meta:resourcekey="valCorrectMaxPasswordAge"
Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"></asp:RegularExpressionValidator></td>
</tr>
<tr id="RowChkLockOutSettigns" runat="server">
<td colspan="2" class="NormalBold">
<asp:CheckBox id="chkLockOutSettigns" runat="server" meta:resourcekey="chkLockOutSettigns"

View file

@ -64,6 +64,8 @@ namespace WebsitePanel.Portal
sb.Append(chkLockOutSettigns.Checked.ToString()).Append(";");
sb.Append(chkPasswordComplexity.Checked.ToString()).Append(";");
sb.Append(txtMaxPasswordAge.Text).Append(";");
return sb.ToString();
}
set
@ -79,6 +81,7 @@ namespace WebsitePanel.Portal
txtMinimumSymbols.Text = "0";
txtLockedOut.Text = "3";
chkPasswordComplexity.Checked = true;
txtMaxPasswordAge.Text = "42";
}
else
{
@ -100,6 +103,8 @@ namespace WebsitePanel.Portal
txtResetAccountLockout.Text = GetValueSafe(parts, 10, "0");
chkLockOutSettigns.Checked = GetValueSafe(parts, 11, false) && ShowLockoutSettings;
chkPasswordComplexity.Checked = GetValueSafe(parts, 12, true);
txtMaxPasswordAge.Text = GetValueSafe(parts, 13, "42");
}
catch
{
@ -155,15 +160,19 @@ namespace WebsitePanel.Portal
public static T GetValueSafe<T>(string[] array, int index, T defaultValue)
{
if (array.Length > index)
try
{
if (string.IsNullOrEmpty(array[index]))
if (array.Length > index)
{
return defaultValue;
}
if (string.IsNullOrEmpty(array[index]))
{
return defaultValue;
}
return (T)Convert.ChangeType(array[index], typeof(T));
return (T)Convert.ChangeType(array[index], typeof(T));
}
}
catch{}
return defaultValue;
}

View file

@ -147,6 +147,42 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectEnforcePasswordHistory;
/// <summary>
/// lblMaxPasswordAge 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 lblMaxPasswordAge;
/// <summary>
/// txtMaxPasswordAge 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 txtMaxPasswordAge;
/// <summary>
/// valRequireMaxPasswordAge 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 valRequireMaxPasswordAge;
/// <summary>
/// valCorrectMaxPasswordAge 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 valCorrectMaxPasswordAge;
/// <summary>
/// RowChkLockOutSettigns control.
/// </summary>

View file

@ -1,7 +1,95 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SearchBox.ascx.cs" Inherits="WebsitePanel.Portal.SearchBox" %>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function () {
$("#tbSearch").keypress(function () {
$("#tbSearchText").val('');
});
$("#tbSearch").autocomplete({
zIndex: 100,
source: function (request, response) {
$.ajax({
type: "post",
dataType: "json",
data: {
term: request.term,
fullType: '',
columnType: "'" + $("#ddlFilterColumn").val() + "'"
},
url: "AjaxHandler.ashx",
success: function (data) {
response($.map(data, function (item) {
return {
label: item.TextSearch,
code: item
};
}));
}
})
},
select: function (event, ui) {
var item = ui.item;
$("#ddlFilterColumn").val(item.code.ColumnType);
$("#tbSearchFullType").val(item.code.FullType);
$("#tbSearchText").val(item.code.TextSearch);
}
});
});//]]>
</script>
<asp:Panel ID="tblSearch" runat="server" DefaultButton="cmdSearch" CssClass="NormalBold">
<asp:Label ID="lblSearch" runat="server" meta:resourcekey="lblSearch" Visible="false"></asp:Label>
<asp:DropDownList ID="ddlFilterColumn" runat="server" CssClass="NormalTextBox" style="vertical-align: middle;">
</asp:DropDownList><asp:TextBox ID="txtFilterValue" runat="server" CssClass="NormalTextBox" Width="100" style="vertical-align: middle;"></asp:TextBox><asp:ImageButton ID="cmdSearch" Runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton"
CausesValidation="false" style="vertical-align: middle;"/>
</asp:Panel>
<table>
<tr>
<td>
<asp:DropDownList ClientIDMode="Static" ID="ddlFilterColumn" runat="server" CssClass="NormalTextBox" resourcekey="ddlFilterColumn">
</asp:DropDownList>
</td>
<td>
<table cellpadding="0" cellspacing="0" align="right">
<tr>
<td align="left" class="SearchQuery">
<div class="ui-widget">
<asp:TextBox
ID="tbSearch"
ClientIDMode="Static"
runat="server"
CssClass="NormalTextBox"
Width="120px"
style="vertical-align: middle; z-index: 100;"
>
</asp:TextBox>
<asp:TextBox
ID="tbSearchFullType"
ClientIDMode="Static"
runat="server"
type="hidden"
>
</asp:TextBox>
<asp:TextBox
ID="tbSearchText"
ClientIDMode="Static"
runat="server"
type="hidden"
>
</asp:TextBox>
<asp:ImageButton
ID="cmdSearch"
runat="server"
SkinID="SearchButton"
CausesValidation="false"
OnClick="cmdSearch_Click"
style="vertical-align: middle;"
/>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Panel>

View file

@ -60,13 +60,23 @@ namespace WebsitePanel.Portal
{
get
{
string val = txtFilterValue.Text.Trim();
string val = tbSearchText.Text.Trim();
string valText = tbSearch.Text.Trim();
if (valText.Length == 0)
val = valText;
if (val.Length == 0)
val = tbSearch.Text.Trim();
val = val.Replace("%", "");
return "%" + val + "%";
}
set
{
txtFilterValue.Text = value;
if (value != null)
{
value = value.Replace("%", "");
tbSearch.Text = value;
tbSearchText.Text = value;
}
}
}
@ -83,7 +93,15 @@ namespace WebsitePanel.Portal
public override void Focus()
{
base.Focus();
txtFilterValue.Focus();
tbSearch.Focus();
}
protected void cmdSearch_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect(NavigatePageURL(PortalUtils.GetUserCustomersPageId(),
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
"FilterColumn=" + ddlFilterColumn.SelectedValue,
"FilterValue=" + Server.UrlEncode(FilterValue)));
}
}
}

View file

@ -1,38 +1,9 @@
// Copyright (c) 2015, 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>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3053
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ -69,13 +40,31 @@ namespace WebsitePanel.Portal {
protected global::System.Web.UI.WebControls.DropDownList ddlFilterColumn;
/// <summary>
/// txtFilterValue control.
/// tbSearch 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 txtFilterValue;
protected global::System.Web.UI.WebControls.TextBox tbSearch;
/// <summary>
/// tbSearchFullType 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 tbSearchFullType;
/// <summary>
/// tbSearchText 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 tbSearchText;
/// <summary>
/// cmdSearch control.

View file

@ -1,31 +1,3 @@
// Copyright (c) 2015, 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>
// This code was generated by a tool.

View file

@ -1,5 +1,7 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserCustomersSummary.ascx.cs" Inherits="WebsitePanel.Portal.UserCustomersSummary" %>
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="UserControls/CollapsiblePanel.ascx" %>
<%@ Register Src="UserControls/SearchBox.ascx" TagName="SearchBox" TagPrefix="uc1" %>
<%@ Import Namespace="WebsitePanel.Portal" %>
<div class="FormButtonsBar">
<div class="Left">
@ -7,14 +9,8 @@
runat="server" CssClass="Button1"></asp:Button>
</div>
<div class="Right">
<asp:Panel ID="tblSearch" runat="server" DefaultButton="cmdSearch" CssClass="NormalBold">
<asp:DropDownList ID="ddlFilterColumn" runat="server" resourcekey="ddlFilterColumn" CssClass="NormalTextBox" style="vertical-align: middle;">
<asp:ListItem Value="Username">Username</asp:ListItem>
<asp:ListItem Value="Email">E-mail</asp:ListItem>
<asp:ListItem Value="FullName">FullName</asp:ListItem>
<asp:ListItem Value="CompanyName">CompanyName</asp:ListItem>
</asp:DropDownList><asp:TextBox ID="txtFilterValue" runat="server" CssClass="NormalTextBox" Width="100" style="vertical-align: middle;"></asp:TextBox><asp:ImageButton ID="cmdSearch" Runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton"
CausesValidation="false" OnClick="cmdSearch_Click" style="vertical-align: middle;"/>
<asp:Panel ID="tblSearch" runat="server" CssClass="NormalBold">
<uc1:SearchBox ID="searchBox" runat="server" />
</asp:Panel>
</div>
</div>

View file

@ -46,7 +46,13 @@ namespace WebsitePanel.Portal
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString());
if (!IsPostBack)
txtFilterValue.Focus();
{
searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username"));
searchBox.AddCriteria("FullName", GetLocalizedString("SearchField.Name"));
searchBox.AddCriteria("Email", GetLocalizedString("SearchField.EMail"));
searchBox.AddCriteria("CompanyName", GetLocalizedString("SearchField.CompanyName"));
searchBox.Focus();
}
}
private void BindGroupings()
@ -73,14 +79,6 @@ namespace WebsitePanel.Portal
parameterName + "=" + parameterValue);
}
protected void cmdSearch_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect(NavigatePageURL(PortalUtils.GetUserCustomersPageId(),
PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(),
"FilterColumn=" + ddlFilterColumn.SelectedValue,
"FilterValue=" + Server.UrlEncode(txtFilterValue.Text)));
}
protected void btnCreate_Click(object sender, EventArgs e)
{
Response.Redirect(EditUrl(PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString(), "create_user"));

View file

@ -1,31 +1,3 @@
// Copyright (c) 2015, 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>
// This code was generated by a tool.
@ -59,31 +31,13 @@ namespace WebsitePanel.Portal {
protected global::System.Web.UI.WebControls.Panel tblSearch;
/// <summary>
/// ddlFilterColumn control.
/// searchBox 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 ddlFilterColumn;
/// <summary>
/// txtFilterValue 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 txtFilterValue;
/// <summary>
/// cmdSearch 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.ImageButton cmdSearch;
protected global::WebsitePanel.Portal.SearchBox searchBox;
/// <summary>
/// allCustomers control.

View file

@ -5,7 +5,6 @@
<%@ Register Src="UserOrganization.ascx" TagName="UserOrganization" TagPrefix="wsp" %>
<%@ Import Namespace="WebsitePanel.Portal" %>
<script src="/JavaScript/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="/JavaScript/chosen.min.js" type="text/javascript"></script>
<script type="text/javascript">

View file

@ -53,7 +53,8 @@ namespace WebsitePanel.Portal
protected void Page_Load(object sender, EventArgs e)
{
ClientScriptManager cs = Page.ClientScript;
cs.RegisterClientScriptInclude("jquery", ResolveUrl("~/JavaScript/jquery-1.4.4.min.js"));
// check for user
bool isUser = PanelSecurity.SelectedUser.Role == UserRole.User;

Some files were not shown because too many files have changed in this diff Show more