aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Web/Tango.MachineService
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2025-01-27 10:17:36 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2025-01-27 10:17:36 +0200
commita712332e02b8346de626e267b3cba3f819fd3743 (patch)
tree4d613806740b6fce84054b51fc8690bebea972ec /Software/Visual_Studio/Web/Tango.MachineService
parente204e6ac5d04114778b5b836a3e3707e819ad349 (diff)
downloadTango-a712332e02b8346de626e267b3cba3f819fd3743.tar.gz
Tango-a712332e02b8346de626e267b3cba3f819fd3743.zip
Allow SMS notifications.
Diffstat (limited to 'Software/Visual_Studio/Web/Tango.MachineService')
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs15
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj6
3 files changed, 17 insertions, 6 deletions
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs
index 57bdc2fbf..d1a56138e 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/PPCController.cs
@@ -842,6 +842,21 @@ namespace Tango.MachineService.Controllers
{
var response = new SendSMSResponse();
+ using (ObservablesContext db = ObservablesWebContext.CreateContext())
+ {
+ var machine = db.Machines.SingleOrDefault(x => x.Guid == RequestToken.Object.MachineGuid);
+
+ if (machine == null)
+ {
+ throw new AuthenticationException("The specified machine could not be found.");
+ }
+
+ if (!machine.AllowSmsNotifications)
+ {
+ throw new Exception("This machine is not allowed to send text messages. Please contact your administrator.");
+ }
+ }
+
if (MachineServiceConfig.TWILIO_ENABLE_SMS)
{
if (MachineServiceConfig.TWILIO_ENABLE_ALPHA_SENDER)
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Web/Tango.MachineService/Properties/AssemblyInfo.cs
index 63cc1a253..7eb0e1e90 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Properties/AssemblyInfo.cs
@@ -24,4 +24,4 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
-[assembly: AssemblyVersion("3.0.24.0")]
+[assembly: AssemblyVersion("3.0.25.0")]
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj b/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj
index e011cf63c..a027b9f53 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj
@@ -454,10 +454,6 @@
<Project>{e4927038-348d-4295-aaf4-861c58cb3943}</Project>
<Name>Tango.PMR</Name>
</ProjectReference>
- <ProjectReference Include="..\..\Tango.Synchronization\Tango.Synchronization.csproj">
- <Project>{7ada4e86-cad7-4968-a210-3a8a9e5153ab}</Project>
- <Name>Tango.Synchronization</Name>
- </ProjectReference>
<ProjectReference Include="..\..\Tango.Transport\Tango.Transport.csproj">
<Project>{74e700b0-1156-4126-be40-ee450d3c3026}</Project>
<Name>Tango.Transport</Name>
@@ -510,7 +506,7 @@
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">