Skip to content

Commit

Permalink
new check version functionality and profile changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jackb-dropbox committed Jul 25, 2016
1 parent 5227be6 commit b9aae19
Show file tree
Hide file tree
Showing 27 changed files with 657 additions and 179 deletions.
Binary file modified Installer/DBAdminToolkit.Setup.zip
Binary file not shown.
61 changes: 48 additions & 13 deletions Source/DBAdminToolkit.Setup/DBAdminToolkit.Setup.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -118,25 +118,25 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_A99E7A04B00765E2070FB5BF24A04FB7"
"OwnerKey" = "8:_F562EA9C65D909792E7726D1536FB7A5"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_46E181879CF66A17AA94C4B1B7B7B344"
"OwnerKey" = "8:_74EFF0EBFB64946734DBD3C45B1D0999"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_AE0E8CF0DD5958BE751B7D3CC6A0C140"
"OwnerKey" = "8:_4E9A860DA81545F1813735FD6365884C"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_2ACBF5DE6300121435EF695C05177AB6"
"OwnerKey" = "8:_BEC6DA59794123F937E6DB1C4BB41961"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand All @@ -148,25 +148,25 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_BEC6DA59794123F937E6DB1C4BB41961"
"OwnerKey" = "8:_2ACBF5DE6300121435EF695C05177AB6"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_4E9A860DA81545F1813735FD6365884C"
"OwnerKey" = "8:_AE0E8CF0DD5958BE751B7D3CC6A0C140"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_74EFF0EBFB64946734DBD3C45B1D0999"
"OwnerKey" = "8:_46E181879CF66A17AA94C4B1B7B7B344"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_F562EA9C65D909792E7726D1536FB7A5"
"OwnerKey" = "8:_A99E7A04B00765E2070FB5BF24A04FB7"
"MsmSig" = "8:_UNDEFINED"
}
}
Expand Down Expand Up @@ -271,6 +271,11 @@
"AssemblyAsmDisplayName" = "8:RestSharp, Version=105.2.3.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_2ACBF5DE6300121435EF695C05177AB6"
{
"Name" = "8:RestSharp.DLL"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:RestSharp.DLL"
"TargetName" = "8:"
Expand All @@ -297,6 +302,11 @@
"AssemblyAsmDisplayName" = "8:CustomTabControl, Version=1.0.1.7, Culture=neutral, PublicKeyToken=53c237210c7e462d, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_46E181879CF66A17AA94C4B1B7B7B344"
{
"Name" = "8:CustomTabControl.DLL"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:CustomTabControl.DLL"
"TargetName" = "8:"
Expand All @@ -320,7 +330,7 @@
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:DfBAdminToolkit, Version=3.2.0.0, Culture=neutral, processorArchitecture=MSIL"
"AssemblyAsmDisplayName" = "8:DfBAdminToolkit, Version=3.4.0.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_4A6B6FBF12AC43BB83F88A643D56B1CE"
Expand Down Expand Up @@ -351,9 +361,14 @@
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:DfBAdminToolkit.Common, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL"
"AssemblyAsmDisplayName" = "8:DfBAdminToolkit.Common, Version=3.4.0.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_4E9A860DA81545F1813735FD6365884C"
{
"Name" = "8:DfBAdminToolkit.Common.DLL"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:DfBAdminToolkit.Common.DLL"
"TargetName" = "8:"
Expand All @@ -380,6 +395,11 @@
"AssemblyAsmDisplayName" = "8:MRG.Controls.UI, Version=1.0.2601.14400, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_74EFF0EBFB64946734DBD3C45B1D0999"
{
"Name" = "8:MRG.Controls.UI.DLL"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:MRG.Controls.UI.DLL"
"TargetName" = "8:"
Expand Down Expand Up @@ -497,6 +517,11 @@
"AssemblyAsmDisplayName" = "8:CsvHelper, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_A99E7A04B00765E2070FB5BF24A04FB7"
{
"Name" = "8:CsvHelper.DLL"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:CsvHelper.DLL"
"TargetName" = "8:"
Expand All @@ -523,6 +548,11 @@
"AssemblyAsmDisplayName" = "8:Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_AE0E8CF0DD5958BE751B7D3CC6A0C140"
{
"Name" = "8:Newtonsoft.Json.DLL"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:Newtonsoft.Json.DLL"
"TargetName" = "8:"
Expand Down Expand Up @@ -600,6 +630,11 @@
"AssemblyAsmDisplayName" = "8:ObjectListView, Version=2.9.0.25611, Culture=neutral, PublicKeyToken=b1c5bf581481bcd4, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_F562EA9C65D909792E7726D1536FB7A5"
{
"Name" = "8:ObjectListView.DLL"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:ObjectListView.DLL"
"TargetName" = "8:"
Expand Down Expand Up @@ -675,15 +710,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Dropbox Business Admin Toolkit"
"ProductCode" = "8:{D9EAED56-01B9-487F-8B58-7C7A914DB161}"
"PackageCode" = "8:{30F69650-B72D-46A1-93AE-BD7ED161EA32}"
"ProductCode" = "8:{1D397077-2786-4CCD-BF3E-029C6938FA3A}"
"PackageCode" = "8:{6C9FE7A3-9700-408F-B2C3-49B0C6B4DBE8}"
"UpgradeCode" = "8:{F6F4214B-C1CB-4F20-B1B3-35E1B7262F93}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:3.3.0"
"ProductVersion" = "8:3.5.0"
"Manufacturer" = "8:Dropbox Enterprise Services"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
Expand Down
4 changes: 0 additions & 4 deletions Source/DfBAdminToolkit.Common/DfBAdminToolkit.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
<AssemblyName>DfBAdminToolkit.Common</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down
4 changes: 2 additions & 2 deletions Source/DfBAdminToolkit.Common/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3.0.0")]
[assembly: AssemblyFileVersion("3.3.0.0")]
[assembly: AssemblyVersion("3.5.0.0")]
[assembly: AssemblyFileVersion("3.5.0.0")]
4 changes: 4 additions & 0 deletions Source/DfBAdminToolkit.Common/Services/IMemberData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public interface IMemberData

bool KeepAccount { get; set; }

string NewEmail { get; set; }

string NewExternalId { get; set; }

#endregion Provision

#region Groups
Expand Down
4 changes: 4 additions & 0 deletions Source/DfBAdminToolkit.Common/Services/IMemberServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public interface IMemberServices {

string GetInfoUrl { get; set; }

string SetProfileUrl { get; set; }

string UserAgentVersion { get; set; }

#endregion Endpoint urls
Expand All @@ -59,6 +61,8 @@ public interface IMemberServices {

IDataResponse GetInfo(string authToken);

IServiceResponse SetProfile(IMemberData data, string authToken);

IDataResponse GetGroups(IMemberData data, string authToken);

IServiceResponse CreateGroup(string groupName, string authToken);
Expand Down
4 changes: 4 additions & 0 deletions Source/DfBAdminToolkit.Common/Services/MemberData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ public class MemberData

public bool KeepAccount { get; set; }

public string NewEmail { get; set; }

public string NewExternalId { get; set; }

#endregion Provision

#region Search Text
Expand Down
62 changes: 62 additions & 0 deletions Source/DfBAdminToolkit.Common/Services/MemberServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public class MemberServices

public string GetInfoUrl { get; set; }

public string SetProfileUrl { get; set; }

public string GetGroupsUrl { get; set; }

public string CreateGroupUrl { get; set; }
Expand Down Expand Up @@ -621,6 +623,66 @@ public IDataResponse GetInfo(string authToken)
return dataResponse;
}

public IServiceResponse SetProfile(IMemberData data, string authToken)
{
IServiceResponse serviceResponse = null;
try
{
if (!string.IsNullOrEmpty(SetProfileUrl))
{
RestClient client = new RestClient(
string.Format("{0}/{1}/", _baseUrl, _apiVersion)
);
RestRequest request = new RestRequest(SetProfileUrl, Method.POST);
request.AddHeader("Authorization", "Bearer " + authToken);
request.AddHeader("Content-Type", "application/json");

//if we are updating external id also
if (!string.IsNullOrEmpty(data.NewExternalId))
{
JObject jsonProv = new JObject(
new JProperty("user",
new JObject(
new JProperty(".tag", "email"),
new JProperty("email", data.Email)
)
),
new JProperty("new_email", data.NewEmail),
new JProperty("new_external_id", data.NewExternalId)
);
request.AddParameter("application/json", jsonProv, ParameterType.RequestBody);
}
//if we are not updating external id
if (string.IsNullOrEmpty(data.NewExternalId))
{
JObject jsonProv = new JObject(
new JProperty("user",
new JObject(
new JProperty(".tag", "email"),
new JProperty("email", data.Email)
)
),
new JProperty("new_email", data.NewEmail)
);
request.AddParameter("application/json", jsonProv, ParameterType.RequestBody);
}
request.RequestFormat = DataFormat.Json;
client.UserAgent = UserAgentVersion;
IRestResponse response = client.Execute(request);
serviceResponse = new ServiceResponse(response.StatusCode, response.ErrorMessage);
}
else
{
throw new ArgumentNullException("Missing service url");
}
}
catch (Exception e)
{
serviceResponse = new ServiceResponse(HttpStatusCode.InternalServerError, e.Message);
}
return serviceResponse;
}

public IDataResponse DumpFile(IMemberData data, string outputFolder, string authToken)
{
IDataResponse dataResponse = null;
Expand Down
17 changes: 1 addition & 16 deletions Source/DfBAdminToolkit.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
Expand Down Expand Up @@ -29,19 +29,4 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 4
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = https://dropbox-services.visualstudio.com/defaultcollection
SccLocalPath0 = .
SccProjectUniqueName1 = DBAdminToolkit.Setup\\DBAdminToolkit.Setup.vdproj
SccProjectName1 = DBAdminToolkit.Setup
SccLocalPath1 = DBAdminToolkit.Setup
SccProjectUniqueName2 = DfBAdminToolkit\\DfBAdminToolkit.csproj
SccProjectName2 = DfBAdminToolkit
SccLocalPath2 = DfBAdminToolkit
SccProjectUniqueName3 = DfBAdminToolkit.Common\\DfBAdminToolkit.Common.csproj
SccProjectName3 = DfBAdminToolkit.Common
SccLocalPath3 = DfBAdminToolkit.Common
EndGlobalSection
EndGlobal
1 change: 1 addition & 0 deletions Source/DfBAdminToolkit/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<add key="ActionDumpDevices" value="team/devices/revoke_device_session" />
<add key="ActionGetUsage" value="users/get_space_usage" />
<add key="ActionGetInfo" value="team/get_info" />
<add key="ActionSetProfile" value="team/members/set_profile" />

<!-- registry handling -->
<add key="RegistryEntryPoint" value="SOFTWARE\Dropbox Business Toolkit" />
Expand Down
5 changes: 5 additions & 0 deletions Source/DfBAdminToolkit/ApplicationResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public static string ActionGetInfo
get { return ConfigurationManager.AppSettings.Get("ActionGetInfo"); }
}

public static string ActionSetProfile
{
get { return ConfigurationManager.AppSettings.Get("ActionSetProfile"); }
}

public static int SearchDefaultLimit {
get {
int limit = 1000;
Expand Down
16 changes: 6 additions & 10 deletions Source/DfBAdminToolkit/DfBAdminToolkit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -158,12 +154,6 @@
<Compile Include="View\DumpUserContentView.Designer.cs">
<DependentUpon>DumpUserContentView.cs</DependentUpon>
</Compile>
<Compile Include="View\VersionWindow.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="View\VersionWindow.Designer.cs">
<DependentUpon>VersionWindow.cs</DependentUpon>
</Compile>
<Compile Include="View\GroupsView.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -213,6 +203,12 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="View\VersionWindow.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="View\VersionWindow.designer.cs">
<DependentUpon>VersionWindow.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="View\DataMigrationView.resx">
<DependentUpon>DataMigrationView.cs</DependentUpon>
</EmbeddedResource>
Expand Down
Loading

0 comments on commit b9aae19

Please sign in to comment.