#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Disco.Web.Areas.Config.Views.SystemConfig
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Net;
    using System.Text;
    using System.Web;
    using System.Web.Helpers;
    using System.Web.Mvc;
    using System.Web.Mvc.Ajax;
    using System.Web.Mvc.Html;
    using System.Web.Routing;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.WebPages;
    using Disco;
    using Disco.Models.Repository;
    using Disco.Services;
    using Disco.Services.Authorization;
    
    #line 2 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
    using Disco.Services.Interop.DiscoServices;
    
    #line default
    #line hidden
    using Disco.Services.Web;
    using Disco.Web;
    using Disco.Web.Extensions;
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
    [System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/SystemConfig/Index.cshtml")]
    public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.SystemConfig.IndexModel>
    {
        public Index()
        {
        }
        public override void Execute()
        {
            
            #line 3 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
  
    Authorization.Require(Claims.Config.System.Show);

    var canConfigProxy = Authorization.Has(Claims.Config.System.ConfigureProxy);
    var canConfigEmail = Authorization.Has(Claims.Config.System.ConfigureEmail);
    var canConfigAD = Authorization.Has(Claims.Config.System.ConfigureActiveDirectory);

    ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "System");

    if (canConfigAD)
    {
        Html.BundleDeferred("~/Style/Fancytree");
        Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Fancytree");
        Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
    }

            
            #line default
            #line hidden
WriteLiteral("\r\n<div");

WriteLiteral(" class=\"form\"");

WriteLiteral(" style=\"width: 450px\"");

WriteLiteral(">\r\n    <table>\r\n        <tr>\r\n            <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                Disco ICT Version:\r\n            </th>\r\n            <td>\r\n     " +
"           <div>\r\n                    <code>");

            
            #line 27 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                     Write(Model.DiscoVersion.ToString(4));

            
            #line default
            #line hidden
WriteLiteral("</code>\r\n                </div>\r\n                <div");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">\r\n                    Built ");

            
            #line 30 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                     Write(CommonHelpers.FriendlyDate(Model.DiscoVersionBuilt, "Unknown"));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </div>\r\n            </td>\r\n        </tr>\r\n        <tr>\r\n       " +
"     <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                Database Connection:\r\n            </th>\r\n            <td>\r\n   " +
"             <table");

WriteLiteral(" class=\"sub\"");

WriteLiteral(">\r\n                    <tr>\r\n                        <th>Server:</th>\r\n          " +
"              <td><span");

WriteLiteral(" class=\"code\"");

WriteLiteral(">");

            
            #line 42 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                          Write(Model.DatabaseServer);

            
            #line default
            #line hidden
WriteLiteral("</span></td>\r\n                    </tr>\r\n                    <tr>\r\n              " +
"          <th>Database:</th>\r\n                        <td><span");

WriteLiteral(" class=\"code\"");

WriteLiteral(">");

            
            #line 46 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                          Write(Model.DatabaseName);

            
            #line default
            #line hidden
WriteLiteral("</span></td>\r\n                    </tr>\r\n                    <tr>\r\n              " +
"          <th>Authentication:</th>\r\n                        <td>");

            
            #line 50 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                       Write(Model.DatabaseAuthentication);

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                    </tr>\r\n");

            
            #line 52 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 52 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                      if (Model.DatabaseSqlAuthUsername != null)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <tr>\r\n                                <th>SQL&nbsp;Us" +
"er:</th>\r\n                                <td><span");

WriteLiteral(" class=\"code\"");

WriteLiteral(">");

            
            #line 56 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                  Write(Model.DatabaseSqlAuthUsername);

            
            #line default
            #line hidden
WriteLiteral("</span></td>\r\n                            </tr>\r\n");

            
            #line 58 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                        }
                    
            
            #line default
            #line hidden
WriteLiteral("\r\n                </table>\r\n            </td>\r\n        </tr>\r\n        <tr>\r\n     " +
"       <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                Data Store Location:\r\n            </th>\r\n            <td>\r\n   " +
"             <span");

WriteLiteral(" class=\"code\"");

WriteLiteral(">");

            
            #line 68 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                              Write(Model.DataStoreLocation);

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n            </td>\r\n        </tr>\r\n    </table>\r\n</div>\r\n<div");

WriteLiteral(" class=\"form\"");

WriteLiteral(" style=\"width: 450px; margin-top: 15px;\"");

WriteLiteral(">\r\n    <h2>Activation &amp; License</h2>\r\n    <table>\r\n        <tr>\r\n            " +
"<th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                Activation:\r\n            </th>\r\n            <td>\r\n");

            
            #line 81 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                
            
            #line default
            #line hidden
            
            #line 81 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                 if (Model.IsActivated)
                {
                    
            
            #line default
            #line hidden
            
            #line 83 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(CommonHelpers.FriendlyDate(Model.ActivatedOn));

            
            #line default
            #line hidden
WriteLiteral(" <span>by ");

            
            #line 83 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                       Write(Model.ActivatedBy);

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n");

            
            #line 84 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"

                    switch (Model.OnlineServicesState)
                    {
                        case OnlineServicesConnect.ConnectionState.Disconnected:

            
            #line default
            #line hidden
WriteLiteral("                            <div");

WriteLiteral(" class=\"info-box error\"");

WriteLiteral(">\r\n                                <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral("><i");

WriteLiteral(" class=\"fa fa-globe\"");

WriteLiteral("></i> Disconnected from Online Services</p>\r\n");

            
            #line 90 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                
            
            #line default
            #line hidden
            
            #line 90 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                 using (Html.BeginForm(MVC.API.System.OnlineServicesConnectStart()))
                                {
                                    
            
            #line default
            #line hidden
            
            #line 92 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                               Write(Html.AntiForgeryToken());

            
            #line default
            #line hidden
            
            #line 92 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                            

            
            #line default
            #line hidden
WriteLiteral("                                    <button");

WriteLiteral(" type=\"submit\"");

WriteLiteral(" class=\"button small\"");

WriteLiteral(">Connect</button>\r\n");

            
            #line 94 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </div>\r\n");

            
            #line 96 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                            break;
                        case OnlineServicesConnect.ConnectionState.Connected:

            
            #line default
            #line hidden
WriteLiteral("                            <div");

WriteLiteral(" class=\"info-box success\"");

WriteLiteral(">\r\n                                <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral("><i");

WriteLiteral(" class=\"fa fa-globe\"");

WriteLiteral("></i> Connected to Online Services</p>\r\n                            </div>\r\n");

            
            #line 101 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                            break;
                        case OnlineServicesConnect.ConnectionState.Connecting:
                        case OnlineServicesConnect.ConnectionState.Reconnecting:

            
            #line default
            #line hidden
WriteLiteral("                            <div");

WriteLiteral(" class=\"info-box warning\"");

WriteLiteral(">\r\n                                <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral("><i");

WriteLiteral(" class=\"fa fa-globe\"");

WriteLiteral("></i> ");

            
            #line 105 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                       Write(Model.OnlineServicesState);

            
            #line default
            #line hidden
WriteLiteral(" to Online Services</p>\r\n                            </div>\r\n");

            
            #line 107 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                            break;
                    }
                }
                else
                {
                    using (Html.BeginForm(MVC.Config.SystemConfig.Activate(), FormMethod.Post))
                    {
                        
            
            #line default
            #line hidden
            
            #line 114 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                   Write(Html.AntiForgeryToken());

            
            #line default
            #line hidden
            
            #line 114 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                ;

            
            #line default
            #line hidden
WriteLiteral("                        <button");

WriteLiteral(" type=\"submit\"");

WriteLiteral(" class=\"button small\"");

WriteLiteral(">Activate Now</button>\r\n");

            
            #line 116 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                    <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                        <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                            <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral("></i>Activating Disco ICT with Online Services unlocks additional functionality.\r" +
"\n                        </p>\r\n                    </div>\r\n");

            
            #line 122 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </td>\r\n        </tr>\r\n        <tr>\r\n            <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                License:\r\n            </th>\r\n            <td>\r\n");

            
            #line 130 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                
            
            #line default
            #line hidden
            
            #line 130 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                 using (Html.BeginForm(MVC.API.System.LicenseCheck(), FormMethod.Post))
                {
                    
            
            #line default
            #line hidden
            
            #line 132 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.AntiForgeryToken());

            
            #line default
            #line hidden
            
            #line 132 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                            ;

            
            #line default
            #line hidden
WriteLiteral("                    <input");

WriteLiteral(" id=\"license\"");

WriteLiteral(" type=\"text\"");

WriteLiteral(" name=\"license\"");

WriteAttribute("value", Tuple.Create(" value=\"", 5534), Tuple.Create("\"", 5556)
            
            #line 133 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
, Tuple.Create(Tuple.Create("", 5542), Tuple.Create<System.Object, System.Int32>(Model.License
            
            #line default
            #line hidden
, 5542), false)
);

WriteLiteral(" />\r\n");

WriteLiteral("                    <button");

WriteLiteral(" type=\"submit\"");

WriteLiteral(" class=\"button small\"");

WriteLiteral(">Activate</button>\r\n");

            
            #line 135 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("                <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
                    $(function () {
                        const $element = $('#license');
                        const original = $element.val();
                        $element.on('keyup', function (e) {
                            const $button = $element.next('button');
                            const value = $element.val();
                            if (!original) {
                                $element.prop('required', true);
                                $button.text('Activate');
                            } else {
                                if (original === value) {
                                    $button.text('Validate');
                                } else {
                                    if (!value) {
                                        $button.text('Clear');
                                    } else {
                                        $button.text('Activate');
                                    }
                                }
                            }
                        }).trigger('keyup');
                    });
                </script>
            </td>
        </tr>
");

            
            #line 162 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
        
            
            #line default
            #line hidden
            
            #line 162 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
         if (Model.License != null)
        {

            
            #line default
            #line hidden
WriteLiteral("            <tr>\r\n                <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Status:\r\n                </th>\r\n                <td>\r\n");

            
            #line 169 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 169 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                     if (Model.LicenseError != null)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <div");

WriteLiteral(" class=\"error\"");

WriteLiteral("><i");

WriteLiteral(" class=\"fa fa-exclamation-circle fa-lg\"");

WriteLiteral("></i> ");

            
            #line 171 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                     Write(Model.LicenseError);

            
            #line default
            #line hidden
WriteLiteral("</div>\r\n");

            
            #line 172 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                    }
                    else
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <span>Expires ");

            
            #line 175 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                 Write(CommonHelpers.FriendlyDate(Model.LicenseExpires));

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n");

            
            #line 176 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </td>\r\n            </tr>\r\n");

            
            #line 179 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
        }
        else
        {

            
            #line default
            #line hidden
WriteLiteral("            <tr>\r\n                <td");

WriteLiteral(" colspan=\"2\"");

WriteLiteral(@">
                    <strong>Official support is available</strong>
                    <ul>
                        <li>Initial implementation assistance.</li>
                        <li>Commitment to maintaining Disco ICT functionality and associated plugins.</li>
                        <li>Direct support.</li>
                        <li>Access to additional functionality.</li>
                        <li>Ability to suggest additional functionality, with a voice in feature prioritisation.</li>
                    </ul>
                    <div");

WriteLiteral(" style=\"text-align: right; margin-top: 4px;\"");

WriteLiteral(">\r\n                        <a");

WriteLiteral(" href=\"https://discoict.com.au/support.aspx\"");

WriteLiteral(" target=\"_blank\"");

WriteLiteral(" class=\"button small\"");

WriteLiteral(">Request More Information</a>\r\n                    </div>\r\n                </td>\r" +
"\n            </tr>\r\n");

            
            #line 197 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("    </table>\r\n</div>\r\n<div");

WriteLiteral(" class=\"form\"");

WriteLiteral(" style=\"width: 450px; margin-top: 15px;\"");

WriteLiteral(">\r\n    <h2>Updates</h2>\r\n    <table>\r\n");

            
            #line 203 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
        
            
            #line default
            #line hidden
            
            #line 203 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
          
            if (Model.UpdateLatestResponse == null)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr>\r\n                    <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                        Last Check:\r\n                    </th>\r\n              " +
"      <td>\r\n                        <div");

WriteLiteral(" class=\"error\"");

WriteLiteral("><i");

WriteLiteral(" class=\"fa fa-exclamation-circle fa-lg\"");

WriteLiteral("></i>&nbsp;Never</div>\r\n                    </td>\r\n                </tr>\r\n");

            
            #line 214 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
            }
            else
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr>\r\n                    <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                        Last Run:\r\n                    </th>\r\n                " +
"    <td>\r\n                        <span>");

            
            #line 222 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                         Write(CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.UpdateResponseDate.ToLocalTime()));

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n                    </td>\r\n                </tr>\r\n");

            
            #line 225 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                if (Model.UpdateAvailable)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr>\r\n                        <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                            Update Available:\r\n                        </th>\r\n" +
"                        <td>\r\n                            <div>\r\n               " +
"                 <i");

WriteLiteral(" class=\"fa fa-info-circle fa-lg information\"");

WriteLiteral("></i>&nbsp;Version ");

            
            #line 233 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                             Write(Model.UpdateLatestResponse.LatestVersion);

            
            #line default
            #line hidden
WriteLiteral(" is available\r\n                            </div>\r\n                            <d" +
"iv");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">\r\n                                [Released ");

            
            #line 236 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                      Write(CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.ReleasedDate));

            
            #line default
            #line hidden
WriteLiteral("]\r\n                            </div>\r\n                            <div");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">");

            
            #line 238 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                  Write(new HtmlString(Model.UpdateLatestResponse.Description));

            
            #line default
            #line hidden
WriteLiteral("</div>\r\n                            <a");

WriteAttribute("href", Tuple.Create(" href=\"", 10143), Tuple.Create("\"", 10187)
            
            #line 239 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
, Tuple.Create(Tuple.Create("", 10150), Tuple.Create<System.Object, System.Int32>(Model.UpdateLatestResponse.UrlLink
            
            #line default
            #line hidden
, 10150), false)
);

WriteLiteral(" target=\"_blank\"");

WriteLiteral(">Download Now</a>\r\n                        </td>\r\n                    </tr>\r\n");

            
            #line 242 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                }
                else
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr>\r\n                        <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                            Status:\r\n                        </th>\r\n          " +
"              <td>\r\n                            <i");

WriteLiteral(" class=\"fa fa-check-square fa-lg success\"");

WriteLiteral("></i>&nbsp;<span>The latest version is installed</span>\r\n                        " +
"</td>\r\n                    </tr>\r\n");

            
            #line 253 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                }
            }
        
            
            #line default
            #line hidden
WriteLiteral("\r\n        <tr>\r\n            <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">Check for Update:</th>\r\n            <td>\r\n");

            
            #line 259 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                
            
            #line default
            #line hidden
            
            #line 259 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                  
                    if (Model.UpdateRunningStatus == null)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <span>");

            
            #line 262 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                         Write(Html.ActionLinkSmallButton("Check Now", MVC.API.System.UpdateCheck()));

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n");

WriteLiteral("                        <span");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">[Will run automatically <strong>");

            
            #line 263 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                              Write(CommonHelpers.FriendlyDate(Model.UpdateNextScheduled, "Unknown"));

            
            #line default
            #line hidden
WriteLiteral("</strong>]</span>\r\n");

            
            #line 264 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                    }
                    else
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <span>");

            
            #line 267 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                         Write(Html.ActionLink("View Status", MVC.Config.Logging.TaskStatus(Model.UpdateRunningStatus.SessionId)));

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n");

WriteLiteral("                        <span");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">[Running Now]</span>\r\n");

            
            #line 269 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                    }
                
            
            #line default
            #line hidden
WriteLiteral("\r\n");

            
            #line 271 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                
            
            #line default
            #line hidden
            
            #line 271 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                 if (Model.UpdateBetaDeployment)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <hr />\r\n");

WriteLiteral("                    <span");

WriteLiteral(" class=\"alert\"");

WriteLiteral("><i");

WriteLiteral(" class=\"fa fa-info-circle fa-lg\"");

WriteLiteral("></i>&nbsp;Beta Deployment</span>\r\n");

            
            #line 275 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </td>\r\n        </tr>\r\n    </table>\r\n</div>\r\n<div");

WriteLiteral(" class=\"form\"");

WriteLiteral(" style=\"width: 450px; margin-top: 15px;\"");

WriteLiteral(">\r\n    <h2>Active Directory</h2>\r\n    <table>\r\n        <tr>\r\n            <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                Primary Domain:\r\n            </th>\r\n            <td>\r\n        " +
"        <code><strong>");

            
            #line 288 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                         Write(Model.ADPrimaryDomain.Name);

            
            #line default
            #line hidden
WriteLiteral("</strong> <span>[");

            
            #line 288 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                     Write(Model.ADPrimaryDomain.NetBiosName);

            
            #line default
            #line hidden
WriteLiteral("]</span></code>\r\n            </td>\r\n        </tr>\r\n        <tr>\r\n            <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                Additional Domains:\r\n            </th>\r\n            <td>\r\n");

            
            #line 296 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                
            
            #line default
            #line hidden
            
            #line 296 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                 if (Model.ADDomains.Count > 1)
                {
                    var adAdditionalDomains = Model.ADDomains.Where(d => d != Model.ADPrimaryDomain).OrderBy(d => d.Name).ToList();
                    var adDomainFirst = adAdditionalDomains.First();

            
            #line default
            #line hidden
WriteLiteral("                    <code>");

            
            #line 300 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                     Write(adDomainFirst.Name);

            
            #line default
            #line hidden
WriteLiteral(" <span>[");

            
            #line 300 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                Write(adDomainFirst.NetBiosName);

            
            #line default
            #line hidden
WriteLiteral("]</span></code>\r\n");

            
            #line 301 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                    foreach (var adDomain in adAdditionalDomains.Skip(1))
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <hr />\r\n");

WriteLiteral("                        <div>\r\n                            <code>");

            
            #line 305 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                             Write(adDomain.Name);

            
            #line default
            #line hidden
WriteLiteral(" <span>[");

            
            #line 305 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                   Write(adDomain.NetBiosName);

            
            #line default
            #line hidden
WriteLiteral("]</span></code>\r\n                        </div>\r\n");

            
            #line 307 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                    }
                }
                else
                {

            
            #line default
            #line hidden
WriteLiteral("                    <span");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">&lt;None&gt;</span>\r\n");

            
            #line 312 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </td>\r\n        </tr>\r\n        <tr>\r\n            <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                Site:\r\n            </th>\r\n            <td>\r\n                <c" +
"ode><strong>");

            
            #line 320 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                         Write(Model.ADSite.Name);

            
            #line default
            #line hidden
WriteLiteral("</strong></code>\r\n            </td>\r\n        </tr>\r\n        <tr>\r\n            <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                Servers:\r\n            </th>\r\n            <td>\r\n               " +
" <div>\r\n");

            
            #line 329 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 329 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                     if (Model.ADServers.Count > 0)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <ul");

WriteLiteral(" class=\"none\"");

WriteLiteral(">\r\n");

            
            #line 332 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 332 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                             foreach (var server in Model.ADServers)
                            {
                                var serverDescription = string.Format("{0} [{1}]", server.Name.EndsWith(server.Domain.Name, StringComparison.OrdinalIgnoreCase) ? server.Name.Substring(0, server.Name.Length - server.Domain.Name.Length - 1) : server.Name, server.Domain.NetBiosName);
                                var reachable = server.IsAvailable;

            
            #line default
            #line hidden
WriteLiteral("                                <li>\r\n");

            
            #line 337 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 337 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                     if (server.IsAvailable)
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <i");

WriteLiteral(" class=\"fa fa-check success fa-fw fa-lg\"");

WriteLiteral(" title=\"Available\"");

WriteLiteral("></i>\r\n");

            
            #line 340 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                    }
                                    else
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <i");

WriteLiteral(" class=\"fa fa-exclamation warning fa-fw fa-lg\"");

WriteAttribute("title", Tuple.Create(" title=\"", 14574), Tuple.Create("\"", 14657)
, Tuple.Create(Tuple.Create("", 14582), Tuple.Create("Unavailable,", 14582), true)
, Tuple.Create(Tuple.Create(" ", 14594), Tuple.Create("will", 14595), true)
, Tuple.Create(Tuple.Create(" ", 14599), Tuple.Create("retry", 14600), true)
, Tuple.Create(Tuple.Create(" ", 14605), Tuple.Create("at", 14606), true)
            
            #line 343 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                          , Tuple.Create(Tuple.Create(" ", 14608), Tuple.Create<System.Object, System.Int32>(server.AvailableWhen.Value.ToLongTimeString()
            
            #line default
            #line hidden
, 14609), false)
);

WriteLiteral("></i>\r\n");

            
            #line 344 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                    <code>");

            
            #line 345 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                      Write(serverDescription);

            
            #line default
            #line hidden
WriteLiteral("</code>\r\n");

            
            #line 346 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 346 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                     if (server.IsSiteServer)
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <i");

WriteLiteral(" class=\"fa fa-building-o information fa-fw\"");

WriteLiteral(" title=\"Site Server\"");

WriteLiteral("></i>\r\n");

            
            #line 349 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                    }
                                    else
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <i");

WriteLiteral(" class=\"fa fa-globe warning fa-fw\"");

WriteLiteral(" title=\"Not a Site Server\"");

WriteLiteral("></i>\r\n");

            
            #line 353 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                    ");

            
            #line 354 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                     if (server.IsWritable)
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <i");

WriteLiteral(" class=\"fa fa-pencil information fa-fw\"");

WriteLiteral(" title=\"Writable Domain Controller\"");

WriteLiteral("></i>\r\n");

            
            #line 357 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                </li>\r\n");

            
            #line 359 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </ul>\r\n");

            
            #line 361 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                    }
                    else
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <div");

WriteLiteral(" class=\"error\"");

WriteLiteral(">\r\n                            <i");

WriteLiteral(" class=\"fa fa-exclamation-circle fa-lg\"");

WriteLiteral("></i>&nbsp;<span>None Found</span>\r\n                        </div>\r\n");

            
            #line 367 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </div>\r\n            </td>\r\n        </tr>\r\n        <tr>\r\n         " +
"   <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                Directory:\r\n            </th>\r\n            <td>\r\n");

            
            #line 376 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                
            
            #line default
            #line hidden
            
            #line 376 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                 if (Model.ADAllServers == null)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div>\r\n");

WriteLiteral("                        ");

            
            #line 379 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                   Write(Html.CheckBoxFor(m => m.ADSearchAllServers, new { disabled = "disabled" }));

            
            #line default
            #line hidden
WriteLiteral(" ");

            
            #line 379 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                               Write(Html.LabelFor(m => m.ADSearchAllServers));

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </div>\r\n");

WriteLiteral("                    <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                        <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                            <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral("></i>Directory servers are currently being retrieved.<br />\r\n                    " +
"        Try refreshing this page in a moment.\r\n                        </p>\r\n   " +
"                 </div>\r\n");

            
            #line 387 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                }
                else
                {
                    if (canConfigAD)
                    {
                        var canSearchEntireDirectory = (Model.ADAllServers.Count <= Disco.Services.Interop.ActiveDirectory.ActiveDirectory.MaxAllServerSearch);

            
            #line default
            #line hidden
WriteLiteral("                        <div>\r\n");

            
            #line 394 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 394 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                             if (!canSearchEntireDirectory)
                            {
                                
            
            #line default
            #line hidden
            
            #line 396 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                           Write(Html.CheckBoxFor(m => m.ADSearchAllServers, new { disabled = "disabled" }));

            
            #line default
            #line hidden
            
            #line 396 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                                            
            
            #line default
            #line hidden
            
            #line 396 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                                       Write(Html.LabelFor(m => m.ADSearchAllServers));

            
            #line default
            #line hidden
            
            #line 396 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                                                                                     

            
            #line default
            #line hidden
WriteLiteral("                                <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                                    <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                                        <i");

WriteLiteral(" class=\"fa fa-exclamation-circle warning\"");

WriteLiteral("></i>Disco ICT will not search the entire directory which consists of more than ");

            
            #line 399 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                                                                                               Write(Disco.Services.Interop.ActiveDirectory.ActiveDirectory.MaxAllServerSearch);

            
            #line default
            #line hidden
WriteLiteral(" servers. Only servers within this site will be searched.\r\n                      " +
"              </p>\r\n                                </div>\r\n");

            
            #line 402 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                            }
                            else
                            {
                                
            
            #line default
            #line hidden
            
            #line 405 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                           Write(Html.CheckBoxFor(m => m.ADSearchAllServers));

            
            #line default
            #line hidden
            
            #line 405 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                             
            
            #line default
            #line hidden
            
            #line 405 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                        Write(Html.LabelFor(m => m.ADSearchAllServers));

            
            #line default
            #line hidden
            
            #line 405 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                                                       
            
            #line default
            #line hidden
            
            #line 405 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                                                  Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
            
            #line 405 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                                                                                

            
            #line default
            #line hidden
WriteLiteral("                                <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                                    <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                                        <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral("></i>If this setting is enabled, Disco ICT will query all servers within the dire" +
"ctory rather than only servers within this site.\r\n                              " +
"      </p>\r\n                                </div>\r\n");

WriteLiteral("                                <script>\r\n                                    $(f" +
"unction () {\r\n                                        document.DiscoFunctions.Pr" +
"opertyChangeHelper($(\'#ADSearchAllServers\'), null, \'");

            
            #line 413 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                                                  Write(Url.Action(MVC.API.System.UpdateActiveDirectorySearchAllServers()));

            
            #line default
            #line hidden
WriteLiteral("\', \'SearchAllServers\');\r\n                                    });\r\n               " +
"                 </script>\r\n");

            
            #line 416 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </div>\r\n");

            
            #line 418 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                    }
                    else
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <div>\r\n");

WriteLiteral("                            ");

            
            #line 422 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                       Write(Html.CheckBoxFor(m => m.ADSearchAllServers, new { disabled = "disabled" }));

            
            #line default
            #line hidden
WriteLiteral(" ");

            
            #line 422 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                                   Write(Html.LabelFor(m => m.ADSearchAllServers));

            
            #line default
            #line hidden
WriteLiteral("\r\n                            <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                                <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                                    <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral("></i>If this setting is enabled, Disco ICT will query all servers within the dire" +
"ctory rather than only servers within this site.\r\n                              " +
"  </p>\r\n                            </div>\r\n                        </div>\r\n");

            
            #line 429 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                    <div>\r\n                        <hr />\r\n                      " +
"  <span>All Servers:</span>\r\n                        <ul");

WriteLiteral(" id=\"Config_System_AD_AllServers\"");

WriteLiteral(" class=\"none\"");

WriteLiteral(">\r\n");

            
            #line 434 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 434 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                              
                                var domainIndex = Model.ADDomains.ToDictionary(d => d.Name, StringComparer.OrdinalIgnoreCase);
                                var siteServers = Model.ADServers.Where(s => s.IsSiteServer).ToDictionary(s => s.Name, StringComparer.OrdinalIgnoreCase);
                                foreach (var server in Model.ADAllServers.OrderBy(s => s))
                                {
                                    var serverDescription = server;
                                    if (server.Contains('.'))
                                    {
                                        Disco.Services.Interop.ActiveDirectory.ADDomain serverDomain;
                                        if (domainIndex.TryGetValue(server.Substring(server.IndexOf('.') + 1), out serverDomain))
                                        {
                                            serverDescription = string.Format("{0} [{1}]", server.Substring(0, server.IndexOf('.')), serverDomain.NetBiosName);
                                        }
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                    <li>\r\n                                       " +
" <code>");

            
            #line 449 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                         Write(serverDescription);

            
            #line default
            #line hidden
WriteLiteral("</code>");

            
            #line 449 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                        if (siteServers.ContainsKey(server))
                                        {
            
            #line default
            #line hidden
WriteLiteral("<i");

WriteLiteral(" class=\"fa fa-building-o information fa-fw\"");

WriteLiteral(" title=\"Site Server\"");

WriteLiteral("></i>");

            
            #line 450 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                                               }

            
            #line default
            #line hidden
WriteLiteral("                                    </li>\r\n");

            
            #line 452 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                }
                            
            
            #line default
            #line hidden
WriteLiteral(@"
                        </ul>
                        <script>
                            $(function () {
                                var toManyServers = 5;
                                var ul = $('#Config_System_AD_AllServers');
                                var ulLi = ul.find('li');
                                if (ulLi.length > toManyServers) {
                                    var liMore = $('<li>').append(
                                        $('<a>').attr('href', '#')
                                            .text('Show All Servers (' + (ulLi.length - toManyServers) + ' more)')
                                            .click(function () {
                                                $(this).closest('li').remove();
                                                ul.find('li').show();
                                                return false;
                                            }))
                                        .insertAfter(ulLi[(toManyServers - 1)]);
                                    ulLi.each(function (i) {
                                        if (i > (toManyServers - 1))
                                            $(this).hide();
                                    });
                                }
                            });
                        </script>
                    </div>
");

            
            #line 478 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </td>\r\n\r\n        </tr>\r\n        <tr>\r\n            <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                Searching:\r\n            </th>\r\n            <td>\r\n");

            
            #line 487 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                
            
            #line default
            #line hidden
            
            #line 487 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                  
                    object ADSearchWildcardSuffixOnlyAttributes = null;
                    if (!canConfigAD)
                    {
                        ADSearchWildcardSuffixOnlyAttributes = new
                        {
                            disabled = "disabled"
                        };
                    }
                
            
            #line default
            #line hidden
WriteLiteral("\r\n");

WriteLiteral("                ");

            
            #line 497 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
           Write(Html.CheckBoxFor(m => m.ADSearchWildcardSuffixOnly, ADSearchWildcardSuffixOnlyAttributes));

            
            #line default
            #line hidden
WriteLiteral(" ");

            
            #line 497 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                                      Write(Html.LabelFor(m => m.ADSearchWildcardSuffixOnly));

            
            #line default
            #line hidden
WriteLiteral(" ");

            
            #line 497 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                                                                                        Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
WriteLiteral("\r\n                <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                    <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                        <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral(@"></i>If this setting is enabled, Disco ICT will utilize Active Directory indexes to greatly improve search performance.
                        If disabled, more results may be returned however performance will be reduced especially in large Active Directory domains.
                    </p>
                </div>
");

            
            #line 504 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                
            
            #line default
            #line hidden
            
            #line 504 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                 if (canConfigAD)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <script>\r\n                        $(function () {\r\n          " +
"                  document.DiscoFunctions.PropertyChangeHelper($(\'#ADSearchWildc" +
"ardSuffixOnly\'), null, \'");

            
            #line 508 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                                              Write(Url.Action(MVC.API.System.UpdateActiveDirectorySearchWildcardSuffixOnly()));

            
            #line default
            #line hidden
WriteLiteral("\', \'SearchWildcardSuffixOnly\');\r\n                        });\r\n                   " +
" </script>\r\n");

            
            #line 511 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </td>\r\n        </tr>\r\n        <tr>\r\n            <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                Search Scope:\r\n            </th>\r\n            <td>\r\n");

            
            #line 519 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                
            
            #line default
            #line hidden
            
            #line 519 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                 if (Model.ADSearchContainers != null && Model.ADSearchContainers.Count > 0)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div>Searching is restricted to the following Organisational&" +
"nbsp;Unit containers</div>\r\n");

WriteLiteral("                    <ul");

WriteLiteral(" id=\"Config_System_AD_SearchScope_DistinguishedNames\"");

WriteLiteral(">\r\n");

            
            #line 523 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 523 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                         foreach (var adContainer in Model.ADSearchContainers)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <li");

WriteLiteral(" data-distinguishedname=\"");

            
            #line 525 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                   Write(adContainer.Item1);

            
            #line default
            #line hidden
WriteLiteral("\"");

WriteLiteral("><code>");

            
            #line 525 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                             Write(adContainer.Item3);

            
            #line default
            #line hidden
WriteLiteral("</code></li>\r\n");

            
            #line 526 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </ul>\r\n");

            
            #line 528 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                }
                else
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div>No Organisational&nbsp;Unit restrictions are in effect.<" +
"/div>\r\n");

WriteLiteral("                    <div");

WriteLiteral(" class=\"info-box\"");

WriteLiteral(">\r\n                        <p");

WriteLiteral(" class=\"fa-p\"");

WriteLiteral(">\r\n                            <i");

WriteLiteral(" class=\"fa fa-info-circle\"");

WriteLiteral("></i>When searching, the entire domain will be queried. This is suitable for most" +
" single-domain deployments.\r\n                        </p>\r\n                    <" +
"/div>\r\n");

            
            #line 537 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("                ");

            
            #line 538 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                 if (canConfigAD)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <div>\r\n                        <hr />\r\n                      " +
"  <a");

WriteLiteral(" id=\"Config_System_AD_SearchScope_Update\"");

WriteLiteral(" href=\"#\"");

WriteLiteral(" class=\"button small\"");

WriteLiteral(">Update</a>\r\n                    </div>\r\n");

WriteLiteral("                    <div");

WriteLiteral(" id=\"Config_System_AD_SearchScope_Dialog\"");

WriteLiteral(" class=\"dialog\"");

WriteLiteral(" title=\"Search Scope\"");

WriteLiteral(">\r\n                        <div");

WriteLiteral(" id=\"Config_System_AD_SearchScope_Dialog_Loading\"");

WriteLiteral(">\r\n");

WriteLiteral("                            ");

            
            #line 546 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                       Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
WriteLiteral(" Loading Organisational Units\r\n                        </div>\r\n                  " +
"      <div");

WriteLiteral(" id=\"Config_System_AD_SearchScope_Tree\"");

WriteLiteral(" class=\"organisationalUnitTree\"");

WriteLiteral(">\r\n                        </div>\r\n");

            
            #line 550 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 550 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                         using (Html.BeginForm(MVC.API.System.UpdateActiveDirectorySearchScope(null, redirect: true)))
                        {
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </div>\r\n");

WriteLiteral("                    <script>\r\n                        $(function () {\r\n          " +
"                  var $dialog, $tree, tree, distinguishedNames;\r\n\r\n             " +
"               function expandNodeTree(node) {\r\n                                " +
"var parent = node.parent;\r\n                                if (parent) {\r\n      " +
"                              expandNodeTree(parent);\r\n                         " +
"           if (!parent.isExpanded())\r\n                                        pa" +
"rent.setExpanded(true, { noAnimation: true, noEvents: false });\r\n               " +
"                 }\r\n                            }\r\n                            f" +
"unction selectDistinguishedNames() {\r\n                                if (!disti" +
"nguishedNames) {\r\n                                    distinguishedNames = $(\'#C" +
"onfig_System_AD_SearchScope_DistinguishedNames\')\r\n                              " +
"          .find(\'li\')\r\n                                        .map(function () " +
"{ return $(this).attr(\'data-distinguishedname\'); }).get();\r\n                    " +
"            }\r\n\r\n                                if (tree) {\r\n                  " +
"                  tree.visit(function (node) {\r\n                                " +
"        if ($.inArray(node.key, distinguishedNames) >= 0) {\r\n                   " +
"                         node.setSelected(true);\r\n                              " +
"              expandNodeTree(node);\r\n                                        } e" +
"lse if (node.isSelected()) {\r\n                                            node.s" +
"etSelected(false);\r\n                                        }\r\n                 " +
"                   });\r\n                                }\r\n                     " +
"       }\r\n\r\n                            function update() {\r\n\r\n                 " +
"               if (!$dialog) {\r\n                                    $dialog = $(" +
"\'#Config_System_AD_SearchScope_Dialog\').dialog({\r\n                              " +
"          autoOpen: false,\r\n                                        buttons: nul" +
"l,\r\n                                        draggable: false,\r\n                 " +
"                       modal: true,\r\n                                        res" +
"izable: false,\r\n                                        width: 500,\r\n           " +
"                             height: 500\r\n                                    })" +
";\r\n                                    $loading = $(\'#Config_System_AD_SearchSco" +
"pe_Dialog_Loading\');\r\n                                    $loading.find(\'i.ajaxL" +
"oading\').show();\r\n\r\n                                    $tree = $(\'#Config_Syste" +
"m_AD_SearchScope_Tree\');\r\n                                    $dialog.css(\'overf" +
"low\', \'visible\');\r\n                                    $tree.css(\'height\', \'100%" +
"\');\r\n\r\n                                    $.getJSON(\'");

            
            #line 604 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                           Write(Url.Action(MVC.API.System.DomainOrganisationalUnits()));

            
            #line default
            #line hidden
WriteLiteral("\', null, function (data) {\r\n                                        $loading.hide" +
"();\r\n\r\n                                        tree = $tree.fancytree({\r\n       " +
"                                     source: data,\r\n                            " +
"                checkbox: true,\r\n                                            sel" +
"ectMode: 2,\r\n                                            keyboard: false,\r\n     " +
"                                       fx: null\r\n                               " +
"         }).fancytree(\'getTree\');\r\n\r\n                                        tre" +
"e.$container.css(\'position\', \'relative\');\r\n\r\n                                   " +
"     // Set Buttons\r\n                                        $dialog.dialog(\'opt" +
"ion\', \'buttons\', {\r\n                                            \'Search Entire D" +
"irectory\': function () {\r\n                                                var $t" +
"his = $(this);\r\n                                                $this.css(\'overf" +
"low\', \'hidden\');\r\n                                                $this.dialog(\"" +
"disable\");\r\n                                                $this.dialog(\"option" +
"\", \"buttons\", null);\r\n\r\n                                                var $for" +
"m = $dialog.find(\'form\');\r\n                                                $form" +
".submit();\r\n                                            },\r\n                    " +
"                        \'Save\': function () {\r\n                                 " +
"               var $this = $(this);\r\n                                           " +
"     $this.css(\'overflow\', \'hidden\');\r\n                                         " +
"       $this.dialog(\"disable\");\r\n                                               " +
" $this.dialog(\"option\", \"buttons\", null);\r\n\r\n                                   " +
"             var nodes = tree.getSelectedNodes();\r\n                             " +
"                   var $form = $dialog.find(\'form\');\r\n                          " +
"                      $.each(nodes, function (i, node) {\r\n                      " +
"                              $(\'<input>\').attr({ \'type\': \'hidden\', \'name\': \'Con" +
"tainers\', \'value\': node.key }).appendTo($form);\r\n                               " +
"                 });\r\n                                                $form.subm" +
"it();\r\n                                            }\r\n                          " +
"              });\r\n\r\n                                        // Select & Expand\r" +
"\n                                        selectDistinguishedNames();\r\n\r\n        " +
"                                tree.options.fx = { height: \"toggle\", duration: " +
"200 };\r\n                                    });\r\n\r\n                             " +
"   }\r\n\r\n                                selectDistinguishedNames();\r\n\r\n         " +
"                       $dialog.dialog(\'open\');\r\n\r\n                              " +
"  return false;\r\n                            }\r\n\r\n                            $(" +
"\'#Config_System_AD_SearchScope_Update\').click(update);\r\n                        " +
"});\r\n                    </script>\r\n");

            
            #line 661 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </td>\r\n\r\n\r\n\r\n        </tr>\r\n    </table>\r\n</div>\r\n");

            
            #line 669 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
 if (canConfigProxy)
{
    using (Html.BeginForm(MVC.API.System.UpdateProxySettings()))
    {

            
            #line default
            #line hidden
WriteLiteral("        <div");

WriteLiteral(" class=\"form\"");

WriteLiteral(" style=\"width: 450px; margin-top: 15px;\"");

WriteLiteral(">\r\n            <h2>Proxy Settings</h2>\r\n            <table>\r\n                <tr>" +
"\r\n                    <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                        Address:\r\n                    </th>\r\n                 " +
"   <td>\r\n");

WriteLiteral("                        ");

            
            #line 681 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                   Write(Html.EditorFor(m => m.ProxyAddress));

            
            #line default
            #line hidden
WriteLiteral("<br />\r\n");

WriteLiteral("                        ");

            
            #line 682 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                   Write(Html.ValidationMessageFor(m => m.ProxyAddress));

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </td>\r\n                </tr>\r\n                <tr>\r\n       " +
"             <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                        Port:\r\n                    </th>\r\n                    " +
"<td>\r\n");

WriteLiteral("                        ");

            
            #line 690 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                   Write(Html.EditorFor(m => m.ProxyPort));

            
            #line default
            #line hidden
WriteLiteral("<br />\r\n");

WriteLiteral("                        ");

            
            #line 691 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                   Write(Html.ValidationMessageFor(m => m.ProxyPort));

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </td>\r\n                </tr>\r\n                <tr>\r\n       " +
"             <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                        Username:\r\n                    </th>\r\n                " +
"    <td>\r\n");

WriteLiteral("                        ");

            
            #line 699 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                   Write(Html.EditorFor(m => m.ProxyUsername));

            
            #line default
            #line hidden
WriteLiteral("<br />\r\n");

WriteLiteral("                        ");

            
            #line 700 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                   Write(Html.ValidationMessageFor(m => m.ProxyUsername));

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </td>\r\n                </tr>\r\n                <tr>\r\n       " +
"             <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                        Password:\r\n                    </th>\r\n                " +
"    <td>\r\n");

WriteLiteral("                        ");

            
            #line 708 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                   Write(Html.EditorFor(m => m.ProxyPassword));

            
            #line default
            #line hidden
WriteLiteral("<br />\r\n");

WriteLiteral("                        ");

            
            #line 709 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                   Write(Html.ValidationMessageFor(m => m.ProxyPassword));

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </td>\r\n                </tr>\r\n                <tr>\r\n       " +
"             <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                        &nbsp;\r\n                    </th>\r\n                   " +
" <td>\r\n                        <button");

WriteLiteral(" id=\"Config_System_Proxy_Save\"");

WriteLiteral(" type=\"button\"");

WriteLiteral(" class=\"button small\"");

WriteLiteral(">Save Proxy Settings</button>");

            
            #line 717 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                                                        Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
WriteLiteral(@"
                        <script>
                            $(function () {
                                var button = $('#Config_System_Proxy_Save');

                                button.click(function () {
                                    var url = '");

            
            #line 723 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                           Write(Url.Action(MVC.API.System.UpdateProxySettings()));

            
            #line default
            #line hidden
WriteLiteral("\';\r\n                                    var data = {\r\n                           " +
"             ProxyAddress: $(\'#ProxyAddress\').val(),\r\n                          " +
"              ProxyPort: $(\'#ProxyPort\').val(),\r\n                               " +
"         ProxyUsername: $(\'#ProxyUsername\').val(),\r\n                            " +
"            ProxyPassword: $(\'#ProxyPassword\').val()\r\n                          " +
"          }\r\n                                    var ajaxLoading = button.next(\'" +
".ajaxLoading\').first().show();\r\n\r\n                                    $.ajax({\r\n" +
"                                        type: \'POST\',\r\n                         " +
"               dataType: \'json\',\r\n                                        url: u" +
"rl,\r\n                                        data: data,\r\n                      " +
"                  complete: function (response, result) {\r\n                     " +
"                       if (result != \'success\' || response.responseJSON != \'OK\')" +
" {\r\n                                                alert(\'Unable to change prox" +
"y settings:\\nCheck logs for more information\');\r\n                               " +
"                 ajaxLoading.hide();\r\n                                          " +
"  } else {\r\n                                                ajaxLoading.hide().n" +
"ext(\'.ajaxOk\').show().delay(\'fast\').fadeOut(\'slow\');\r\n                          " +
"                  }\r\n                                        }\r\n                " +
"                    });\r\n                                });\r\n                  " +
"          });\r\n                        </script>\r\n                    </td>\r\n   " +
"             </tr>\r\n            </table>\r\n        </div>\r\n");

            
            #line 753 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
    }
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div");

WriteLiteral(" class=\"form\"");

WriteLiteral(" style=\"width: 450px; margin-top: 15px;\"");

WriteLiteral(">\r\n        <h2>Proxy Settings</h2>\r\n        <table>\r\n            <tr>\r\n          " +
"      <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Address:\r\n                </th>\r\n                <td>\r\n");

WriteLiteral("                    ");

            
            #line 765 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.DisplayFor(m => m.ProxyAddress));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Port:\r\n                </th>\r\n                <td>\r\n");

WriteLiteral("                    ");

            
            #line 773 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.DisplayFor(m => m.ProxyPort));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Username:\r\n                </th>\r\n                <td>\r\n");

WriteLiteral("                    ");

            
            #line 781 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.DisplayFor(m => m.ProxyUsername));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Password:\r\n                </th>\r\n                <td>\r\n  " +
"                  ********\r\n                </td>\r\n            </tr>\r\n        </" +
"table>\r\n    </div>\r\n");

            
            #line 794 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}

            
            #line default
            #line hidden
            
            #line 795 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
 if (canConfigEmail)
{

            
            #line default
            #line hidden
WriteLiteral("    <div");

WriteLiteral(" class=\"form\"");

WriteLiteral(" style=\"width: 450px; margin-top: 15px;\"");

WriteLiteral(">\r\n        <h2>Email Settings</h2>\r\n        <table>\r\n            <tr>\r\n          " +
"      <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    SMTP Server:\r\n                </th>\r\n                <td>\r" +
"\n");

WriteLiteral("                    ");

            
            #line 805 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.EditorFor(m => m.EmailSmtpServer));

            
            #line default
            #line hidden
WriteLiteral("<br />\r\n");

WriteLiteral("                    ");

            
            #line 806 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.ValidationMessageFor(m => m.EmailSmtpServer));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Port:\r\n                </th>\r\n                <td>\r\n");

WriteLiteral("                    ");

            
            #line 814 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.EditorFor(m => m.EmailSmtpPort));

            
            #line default
            #line hidden
WriteLiteral("<br />\r\n");

WriteLiteral("                    ");

            
            #line 815 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.ValidationMessageFor(m => m.EmailSmtpPort));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Default From Address:\r\n                </th>\r\n            " +
"    <td>\r\n");

WriteLiteral("                    ");

            
            #line 823 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.EditorFor(m => m.EmailFromAddress));

            
            #line default
            #line hidden
WriteLiteral("<br />\r\n");

WriteLiteral("                    ");

            
            #line 824 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.ValidationMessageFor(m => m.EmailFromAddress));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Reply To Address:\r\n                </th>\r\n                " +
"<td>\r\n");

WriteLiteral("                    ");

            
            #line 832 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.EditorFor(m => m.EmailReplyToAddress));

            
            #line default
            #line hidden
WriteLiteral("<br />\r\n");

WriteLiteral("                    ");

            
            #line 833 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.ValidationMessageFor(m => m.EmailReplyToAddress));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    &nbsp;\r\n                </th>\r\n                <td>\r\n");

WriteLiteral("                    ");

            
            #line 841 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.CheckBoxFor(m => m.EmailEnableSsl));

            
            #line default
            #line hidden
WriteLiteral(" ");

            
            #line 841 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                        Write(Html.LabelFor(m => m.EmailEnableSsl));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Username:\r\n                </th>\r\n                <td>\r\n");

WriteLiteral("                    ");

            
            #line 849 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.EditorFor(m => m.EmailUsername));

            
            #line default
            #line hidden
WriteLiteral("<br />\r\n");

WriteLiteral("                    ");

            
            #line 850 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.ValidationMessageFor(m => m.EmailUsername));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Password:\r\n                </th>\r\n                <td>\r\n");

WriteLiteral("                    ");

            
            #line 858 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.EditorFor(m => m.EmailPassword));

            
            #line default
            #line hidden
WriteLiteral("<br />\r\n");

WriteLiteral("                    ");

            
            #line 859 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.ValidationMessageFor(m => m.EmailPassword));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    &nbsp;\r\n                </th>\r\n                <td>\r\n");

WriteLiteral("                    ");

            
            #line 867 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.AntiForgeryToken());

            
            #line default
            #line hidden
WriteLiteral("\r\n                    <button");

WriteLiteral(" id=\"Config_System_Email_Test\"");

WriteLiteral(" type=\"button\"");

WriteLiteral(" class=\"button small\"");

WriteLiteral(" ");

            
            #line 868 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                         Write(Model.EmailIsConfigured ? null : "disabled");

            
            #line default
            #line hidden
WriteLiteral(">Send Test Email</button>\r\n                    <button");

WriteLiteral(" id=\"Config_System_Email_Save\"");

WriteLiteral(" type=\"button\"");

WriteLiteral(" class=\"button small\"");

WriteLiteral(">Save Email Settings</button>");

            
            #line 869 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                                                    Write(AjaxHelpers.AjaxLoader());

            
            #line default
            #line hidden
WriteLiteral("\r\n                    <div");

WriteLiteral(" id=\"Config_System_Email_Test_Dialog\"");

WriteLiteral(" class=\"dialog\"");

WriteLiteral(" title=\"Send Test Email\"");

WriteLiteral(">\r\n                        <h4><i");

WriteLiteral(" class=\"fa fa-envelope information\"");

WriteLiteral("></i>&nbsp;Recipient Email Address:</h4>\r\n                        <br />\r\n");

            
            #line 873 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                        
            
            #line default
            #line hidden
            
            #line 873 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                         using (Html.BeginForm(MVC.API.System.SendTestEmail(), FormMethod.Post))
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <input");

WriteLiteral(" type=\"hidden\"");

WriteLiteral(" name=\"redirect\"");

WriteLiteral(" value=\"true\"");

WriteLiteral(" />\r\n");

WriteLiteral("                            <input");

WriteLiteral(" id=\"Config_System_Email_Test_Recipient\"");

WriteLiteral(" name=\"Recipient\"");

WriteLiteral(" type=\"text\"");

WriteAttribute("value", Tuple.Create(" value=\"", 40539), Tuple.Create("\"", 40572)
            
            #line 876 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                              , Tuple.Create(Tuple.Create("", 40547), Tuple.Create<System.Object, System.Int32>(CurrentUser.EmailAddress
            
            #line default
            #line hidden
, 40547), false)
);

WriteLiteral(" />\r\n");

            
            #line 877 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 877 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                       Write(Html.AntiForgeryToken());

            
            #line default
            #line hidden
            
            #line 877 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                    
                        }

            
            #line default
            #line hidden
WriteLiteral(@"                    </div>
                    <script>
                        $(function () {
                            var button = $('#Config_System_Email_Save');
                            var testButton = $('#Config_System_Email_Test');
                            var testDialog = null;

                            button.click(function () {
                                var url = '");

            
            #line 887 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                       Write(Url.Action(MVC.API.System.UpdateEmailSettings()));

            
            #line default
            #line hidden
WriteLiteral("\';\r\n                                var data = {\r\n                               " +
"     SmtpServer: $(\'#EmailSmtpServer\').val(),\r\n                                 " +
"   SmtpPort: $(\'#EmailSmtpPort\').val(),\r\n                                    Fro" +
"mAddress: $(\'#EmailFromAddress\').val(),\r\n                                    Rep" +
"lyToAddress: $(\'#EmailReplyToAddress\').val(),\r\n                                 " +
"   EnableSsl: $(\'#EmailEnableSsl\').is(\':checked\'),\r\n                            " +
"        Username: $(\'#EmailUsername\').val(),\r\n                                  " +
"  Password: $(\'#EmailPassword\').val(),\r\n                                    \'__R" +
"equestVerificationToken\': button.parent().find(\'input[name=\"__RequestVerificatio" +
"nToken\"]\').first().val()\r\n                                }\r\n                   " +
"             var ajaxLoading = button.next(\'.ajaxLoading\').first().show();\r\n\r\n  " +
"                              $.ajax({\r\n                                    type" +
": \'POST\',\r\n                                    dataType: \'json\',\r\n              " +
"                      url: url,\r\n                                    data: data," +
"\r\n                                    complete: function (response, result) {\r\n " +
"                                       if (result != \'success\' || response.respo" +
"nseJSON != \'OK\') {\r\n                                            alert(\'Unable to" +
" change email settings:\\nCheck logs for more information\');\r\n                   " +
"                         ajaxLoading.hide();\r\n                                  " +
"      } else {\r\n                                            ajaxLoading.hide().n" +
"ext(\'.ajaxOk\').show().delay(\'fast\').fadeOut(\'slow\');\r\n                          " +
"                  if (!!$(\'#EmailSmtpServer\').val()) {\r\n                        " +
"                        testButton.removeAttr(\'disabled\');\r\n                    " +
"                        } else {\r\n                                              " +
"  testButton.attr(\'disabled\', \'disabled\');\r\n                                    " +
"        }\r\n                                        }\r\n                          " +
"          }\r\n                                });\r\n                            })" +
";\r\n\r\n                            testButton.closest(\'table\').find(\'td>input\').ch" +
"ange(function () {\r\n                                testButton.attr(\'disabled\', " +
"\'disabled\');\r\n                            });\r\n                            testB" +
"utton.click(function () {\r\n                                if (!testDialog) {\r\n " +
"                                   testDialog = $(\'#Config_System_Email_Test_Dia" +
"log\')\r\n                                        .dialog({\r\n                      " +
"                      resizable: false,\r\n                                       " +
"     height: 180,\r\n                                            modal: true,\r\n   " +
"                                         autoOpen: false,\r\n                     " +
"                       buttons: {\r\n                                             " +
"   Send: function () {\r\n                                                    var " +
"$this = $(this);\r\n                                                    var recipi" +
"entInput = $(\'#Config_System_Email_Test_Recipient\');\r\n                          " +
"                          if (!!recipientInput.val()) {\r\n                       " +
"                                 $this.dialog(\"disable\");\r\n                     " +
"                                   $this.dialog(\"option\", \"buttons\", null);\r\n   " +
"                                                     recipientInput.closest(\'for" +
"m\').submit()\r\n                                                    } else {\r\n    " +
"                                                    alert(\'Enter the recipient a" +
"ddress for the test email\');\r\n                                                  " +
"  }\r\n                                                },\r\n                       " +
"                         Cancel: function () {\r\n                                " +
"                    $(this).dialog(\"close\");\r\n                                  " +
"              }\r\n                                            }\r\n                " +
"                        });\r\n                                }\r\n                " +
"                testDialog.dialog(\'open\');\r\n                            });\r\n\r\n " +
"                       });\r\n                    </script>\r\n                </td>" +
"\r\n            </tr>\r\n        </table>\r\n    </div>\r\n");

            
            #line 959 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div");

WriteLiteral(" class=\"form\"");

WriteLiteral(" style=\"width: 450px; margin-top: 15px;\"");

WriteLiteral(">\r\n        <h2>Email Settings</h2>\r\n        <table>\r\n            <tr>\r\n          " +
"      <th");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    SMTP Server:\r\n                </th>\r\n                <td>\r" +
"\n");

WriteLiteral("                    ");

            
            #line 970 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.DisplayFor(m => m.EmailSmtpServer));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Port:\r\n                </th>\r\n                <td>\r\n");

WriteLiteral("                    ");

            
            #line 978 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.DisplayFor(m => m.EmailSmtpPort));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Default From Address:\r\n                </th>\r\n            " +
"    <td>\r\n");

WriteLiteral("                    ");

            
            #line 986 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.DisplayFor(m => m.EmailFromAddress));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Reply To Address:\r\n                </th>\r\n                " +
"<td>\r\n");

WriteLiteral("                    ");

            
            #line 994 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.DisplayFor(m => m.EmailReplyToAddress));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Enable SSL:\r\n                </th>\r\n                <td>\r\n" +
"");

WriteLiteral("                    ");

            
            #line 1002 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.CheckBoxFor(m => m.EmailEnableSsl, new { disabled = "disabled" }));

            
            #line default
            #line hidden
WriteLiteral(" ");

            
            #line 1002 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
                                                                                       Write(Html.LabelFor(m => m.EmailEnableSsl));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Username:\r\n                </th>\r\n                <td>\r\n");

WriteLiteral("                    ");

            
            #line 1010 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
               Write(Html.DisplayFor(m => m.EmailUsername));

            
            #line default
            #line hidden
WriteLiteral("\r\n                </td>\r\n            </tr>\r\n            <tr>\r\n                <th" +
"");

WriteLiteral(" style=\"width: 135px\"");

WriteLiteral(">\r\n                    Password:\r\n                </th>\r\n                <td>\r\n  " +
"                  ********\r\n                </td>\r\n            </tr>\r\n        </" +
"table>\r\n    </div>\r\n");

            
            #line 1023 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}

            
            #line default
            #line hidden
WriteLiteral("<div");

WriteLiteral(" class=\"actionBar\"");

WriteLiteral(">\r\n");

WriteLiteral("    ");

            
            #line 1025 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ActionLinkButton("Update Device Last Network Logons", MVC.API.System.UpdateLastNetworkLogonDates()));

            
            #line default
            #line hidden
WriteLiteral("\r\n</div>\r\n");

        }
    }
}
#pragma warning restore 1591
