Browse Source

Updated Nuget Packages.

Optimized Blacklist module to not use locks.
pull/111/head
Teknikode 4 years ago
parent
commit
3b17dd9e76
  1. 9
      ServerMaint/ServerMaint.csproj
  2. 8
      ServerMaint/app.config
  3. 4
      ServerMaint/packages.config
  4. 53
      Teknik/Modules/BlacklistModule.cs
  5. BIN
      Teknik/Scripts/_references.js
  6. 4
      Teknik/Scripts/jquery-3.1.1.min.js
  7. 1
      Teknik/Scripts/jquery-3.1.1.min.map
  8. 4
      Teknik/Scripts/jquery-3.1.1.slim.min.js
  9. 1
      Teknik/Scripts/jquery-3.1.1.slim.min.map
  10. 2670
      Teknik/Scripts/jquery-3.3.1.intellisense.js
  11. 1058
      Teknik/Scripts/jquery-3.3.1.js
  12. 2
      Teknik/Scripts/jquery-3.3.1.min.js
  13. 1
      Teknik/Scripts/jquery-3.3.1.min.map
  14. 966
      Teknik/Scripts/jquery-3.3.1.slim.js
  15. 2
      Teknik/Scripts/jquery-3.3.1.slim.min.js
  16. 1
      Teknik/Scripts/jquery-3.3.1.slim.min.map
  17. 9
      Teknik/Scripts/jquery.signalR-2.2.1.min.js
  18. 11
      Teknik/Scripts/jquery.signalR-2.2.2.js
  19. 9
      Teknik/Scripts/jquery.signalR-2.2.2.min.js
  20. 4
      Teknik/Scripts/jquery.validate-vsdoc.js
  21. 151
      Teknik/Scripts/jquery.validate.js
  22. 8
      Teknik/Scripts/jquery.validate.min.js
  23. 91
      Teknik/Teknik.csproj
  24. 26
      Teknik/Web.config
  25. 934
      Teknik/docs/MySqlCommand.xml
  26. 321
      Teknik/docs/MySqlCommandBuilder.xml
  27. 1248
      Teknik/docs/MySqlConnection.xml
  28. 55
      Teknik/docs/MySqlConnectionStringBuilder.xml
  29. 801
      Teknik/docs/MySqlDataAdapter.xml
  30. 452
      Teknik/docs/MySqlDataReader.xml
  31. 53
      Teknik/docs/MySqlException.xml
  32. 53
      Teknik/docs/MySqlHelper.xml
  33. 45
      Teknik/docs/MySqlParameter.xml
  34. 45
      Teknik/docs/MySqlParameterCollection.xml
  35. 329
      Teknik/docs/MySqlTransaction.xml
  36. 30
      Teknik/packages.config
  37. 8
      TeknikStreaming/App.config
  38. 6
      TeknikStreaming/TeknikStreaming.csproj
  39. 2
      TeknikStreaming/packages.config
  40. 34
      TeknikTests/TeknikTests.csproj
  41. 17
      TeknikTests/packages.config
  42. 3
      Utilities/Configuration/Configuration.csproj
  43. 2
      Utilities/Configuration/packages.config
  44. 5
      Utilities/Piwik/Piwik.csproj
  45. 45
      Utilities/Piwik/Tracking.cs
  46. 2
      Utilities/Piwik/packages.config
  47. 29
      Utilities/Utilities/Utilities.csproj
  48. 2
      Utilities/Utilities/app.config
  49. 934
      Utilities/Utilities/docs/MySqlCommand.xml
  50. 321
      Utilities/Utilities/docs/MySqlCommandBuilder.xml
  51. 1248
      Utilities/Utilities/docs/MySqlConnection.xml
  52. 55
      Utilities/Utilities/docs/MySqlConnectionStringBuilder.xml
  53. 801
      Utilities/Utilities/docs/MySqlDataAdapter.xml
  54. 452
      Utilities/Utilities/docs/MySqlDataReader.xml
  55. 53
      Utilities/Utilities/docs/MySqlException.xml
  56. 53
      Utilities/Utilities/docs/MySqlHelper.xml
  57. 45
      Utilities/Utilities/docs/MySqlParameter.xml
  58. 45
      Utilities/Utilities/docs/MySqlParameterCollection.xml
  59. 329
      Utilities/Utilities/docs/MySqlTransaction.xml
  60. 4
      Utilities/Utilities/packages.config
  61. 34
      UtilitiesTests/UtilitiesTests.csproj
  62. 17
      UtilitiesTests/packages.config

9
ServerMaint/ServerMaint.csproj

@ -57,12 +57,10 @@ @@ -57,12 +57,10 @@
<Private>True</Private>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNet.Identity.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll</HintPath>
@ -77,8 +75,7 @@ @@ -77,8 +75,7 @@
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />

8
ServerMaint/app.config

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<connectionStrings configSource="ConnectionStrings.config" />
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
@ -30,11 +30,11 @@ @@ -30,11 +30,11 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

4
ServerMaint/packages.config

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommandLineParser" version="1.9.71" targetFramework="net452" />
<package id="EntityFramework" version="6.1.3" targetFramework="net452" />
<package id="EntityFramework" version="6.2.0" targetFramework="net462" />
<package id="GitVersionTask" version="3.6.5" targetFramework="net462" developmentDependency="true" />
<package id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net452" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="2.2.1" targetFramework="net452" />
<package id="nClam" version="2.0.6.0" targetFramework="net462" />
<package id="Newtonsoft.Json" version="10.0.1" targetFramework="net462" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net462" />
</packages>

53
Teknik/Modules/BlacklistModule.cs

@ -33,56 +33,11 @@ namespace Teknik.Modules @@ -33,56 +33,11 @@ namespace Teknik.Modules
context.BeginRequest += onBeginRequest;
}
#region Referrer Info
private const string BLOCKEDREFERRERKEY = "BlockedReferrer";
private static string referrerFileName = null;
private static object referrerFileNameObj = new object();
public static string GetReferrerFilePath()
{
if (referrerFileName != null)
return referrerFileName;
lock (referrerFileNameObj)
{
if (referrerFileName == null)
{
Config config = Config.Load();
referrerFileName = config.ReferrerBlacklistFile;
}
}
return referrerFileName;
}
#endregion
#region IP Info
private const string BLOCKEDIPKEY = "BlockedIP";
private static string ipFileName = null;
private static object ipFileNameObj = new object();
public static string GetIPFilePath()
{
if (ipFileName != null)
return ipFileName;
lock (ipFileNameObj)
{
if (ipFileName == null)
{
Config config = Config.Load();
ipFileName = config.IPBlacklistFile;
}
}
return ipFileName;
}
#endregion
public static StringDictionary GetFileData(HttpContext context, string key, Func<string> fn)
public static StringDictionary GetFileData(HttpContext context, string key, string filePath)
{
StringDictionary data = (StringDictionary)context.Cache[key];
if (data == null)
{
string filePath = fn();
data = GetFileLines(filePath);
context.Cache.Insert(key, data, new CacheDependency(filePath));
}
@ -118,6 +73,8 @@ namespace Teknik.Modules @@ -118,6 +73,8 @@ namespace Teknik.Modules
if (app != null)
{
Config config = Config.Load();
bool blocked = false;
string blockReason = string.Empty;
@ -127,7 +84,7 @@ namespace Teknik.Modules @@ -127,7 +84,7 @@ namespace Teknik.Modules
string IPAddr = app.Context.Request.ServerVariables["REMOTE_ADDR"];
if (!string.IsNullOrEmpty(IPAddr))
{
StringDictionary badIPs = GetFileData(app.Context, BLOCKEDIPKEY, GetIPFilePath);
StringDictionary badIPs = GetFileData(app.Context, "BlockedIPs", config.IPBlacklistFile);
blocked |= (badIPs != null && badIPs.ContainsKey(IPAddr));
blockReason = $"This IP address ({IPAddr}) has been blacklisted. If you feel this is in error, please contact support@teknik.io for assistance.";
@ -141,7 +98,7 @@ namespace Teknik.Modules @@ -141,7 +98,7 @@ namespace Teknik.Modules
string referrer = app.Context.Request.UrlReferrer?.Host;
if (!string.IsNullOrEmpty(referrer))
{
StringDictionary badReferrers = GetFileData(app.Context, BLOCKEDREFERRERKEY, GetReferrerFilePath);
StringDictionary badReferrers = GetFileData(app.Context, "BlockedReferrers", config.ReferrerBlacklistFile);
blocked |= (badReferrers != null && badReferrers.ContainsKey(referrer));
blockReason = $"This referrer ({referrer}) has been blacklisted. If you feel this is in error, please contact support@teknik.io for assistance.";

BIN
Teknik/Scripts/_references.js

Binary file not shown.

4
Teknik/Scripts/jquery-3.1.1.min.js vendored

File diff suppressed because one or more lines are too long

1
Teknik/Scripts/jquery-3.1.1.min.map

File diff suppressed because one or more lines are too long

4
Teknik/Scripts/jquery-3.1.1.slim.min.js vendored

File diff suppressed because one or more lines are too long

1
Teknik/Scripts/jquery-3.1.1.slim.min.map

File diff suppressed because one or more lines are too long

2670
Teknik/Scripts/jquery-3.3.1.intellisense.js vendored

File diff suppressed because it is too large Load Diff

1058
Teknik/Scripts/jquery-3.1.1.js → Teknik/Scripts/jquery-3.3.1.js vendored

File diff suppressed because it is too large Load Diff

2
Teknik/Scripts/jquery-3.3.1.min.js vendored

File diff suppressed because one or more lines are too long

1
Teknik/Scripts/jquery-3.3.1.min.map

File diff suppressed because one or more lines are too long

966
Teknik/Scripts/jquery-3.1.1.slim.js → Teknik/Scripts/jquery-3.3.1.slim.js

File diff suppressed because it is too large Load Diff

2
Teknik/Scripts/jquery-3.3.1.slim.min.js vendored

File diff suppressed because one or more lines are too long

1
Teknik/Scripts/jquery-3.3.1.slim.min.map

File diff suppressed because one or more lines are too long

9
Teknik/Scripts/jquery.signalR-2.2.1.min.js vendored

File diff suppressed because one or more lines are too long

11
Teknik/Scripts/jquery.signalR-2.2.1.js → Teknik/Scripts/jquery.signalR-2.2.2.js

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
/* jquery.signalR.core.js */
/*global window:false */
/*!
* ASP.NET SignalR JavaScript Library v2.2.1
* ASP.NET SignalR JavaScript Library v2.2.2
* http://signalr.net/
*
* Copyright (c) .NET Foundation. All rights reserved.
@ -950,6 +950,9 @@ @@ -950,6 +950,9 @@
// Clear out our message buffer
connection._.connectingMessageBuffer.clear();
// Clean up this event
$(connection).unbind(events.onStart);
// Trigger the disconnect event
changeState(connection, connection.state, signalR.connectionState.disconnected);
@ -2227,8 +2230,8 @@ @@ -2227,8 +2230,8 @@
}
// Ensure the iframe is where we left it
if (connection.frame.parentNode === window.document.body) {
window.document.body.removeChild(connection.frame);
if (connection.frame.parentNode === window.document.documentElement) {
window.document.documentElement.removeChild(connection.frame);
}
delete transportLogic.foreverFrame.connections[connection.frameId];
@ -2951,5 +2954,5 @@ @@ -2951,5 +2954,5 @@
/*global window:false */
/// <reference path="jquery.signalR.core.js" />
(function ($, undefined) {
$.signalR.version = "2.2.1";
$.signalR.version = "2.2.2";
}(window.jQuery));

9
Teknik/Scripts/jquery.signalR-2.2.2.min.js vendored

File diff suppressed because one or more lines are too long

4
Teknik/Scripts/jquery.validate-vsdoc.js vendored

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
* intended to be used only for design-time IntelliSense. Please use the
* standard jQuery library for all production use.
*
* Comment version: 1.16.0
* Comment version: 1.17.0
*/
/*
@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
* for informational purposes only and are not the license terms under
* which Microsoft distributed this file.
*
* jQuery Validation Plugin - v1.16.0 - 12/5/2016
* jQuery Validation Plugin - v1.17.0 - 12/5/2016
* https://github.com/jzaefferer/jquery-validation
* Copyright (c) 2013 Jörn Zaefferer; Licensed MIT
*

151
Teknik/Scripts/jquery.validate.js vendored

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
/*!
* jQuery Validation Plugin v1.16.0
* jQuery Validation Plugin v1.17.0
*
* http://jqueryvalidation.org/
* https://jqueryvalidation.org/
*
* Copyright (c) 2016 Jörn Zaefferer
* Copyright (c) 2017 Jörn Zaefferer
* Released under the MIT license
*/
(function( factory ) {
@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
$.extend( $.fn, {
// http://jqueryvalidation.org/validate/
// https://jqueryvalidation.org/validate/
validate: function( options ) {
// If nothing is selected, return nothing; can't chain anyway
@ -44,9 +44,10 @@ $.extend( $.fn, { @@ -44,9 +44,10 @@ $.extend( $.fn, {
if ( validator.settings.onsubmit ) {
this.on( "click.validate", ":submit", function( event ) {
if ( validator.settings.submitHandler ) {
validator.submitButton = event.target;
}
// Track the used submit button to properly handle scripted
// submits later.
validator.submitButton = event.currentTarget;
// Allow suppressing validation by adding a cancel class to the submit button
if ( $( this ).hasClass( "cancel" ) ) {
@ -68,17 +69,22 @@ $.extend( $.fn, { @@ -68,17 +69,22 @@ $.extend( $.fn, {
}
function handle() {
var hidden, result;
if ( validator.settings.submitHandler ) {
if ( validator.submitButton ) {
// Insert a hidden input as a replacement for the missing submit button
hidden = $( "<input type='hidden'/>" )
.attr( "name", validator.submitButton.name )
.val( $( validator.submitButton ).val() )
.appendTo( validator.currentForm );
}
// Insert a hidden input as a replacement for the missing submit button
// The hidden input is inserted in two cases:
// - A user defined a `submitHandler`
// - There was a pending request due to `remote` method and `stopRequest()`
// was called to submit the form in case it's valid
if ( validator.submitButton && ( validator.settings.submitHandler || validator.formSubmitted ) ) {
hidden = $( "<input type='hidden'/>" )
.attr( "name", validator.submitButton.name )
.val( $( validator.submitButton ).val() )
.appendTo( validator.currentForm );
}
if ( validator.settings.submitHandler ) {
result = validator.settings.submitHandler.call( validator, validator.currentForm, event );
if ( validator.submitButton ) {
if ( hidden ) {
// And clean up afterwards; thanks to no-block-scope, hidden can be referenced
hidden.remove();
@ -112,7 +118,7 @@ $.extend( $.fn, { @@ -112,7 +118,7 @@ $.extend( $.fn, {
return validator;
},
// http://jqueryvalidation.org/valid/
// https://jqueryvalidation.org/valid/
valid: function() {
var valid, validator, errorList;
@ -133,13 +139,22 @@ $.extend( $.fn, { @@ -133,13 +139,22 @@ $.extend( $.fn, {
return valid;
},
// http://jqueryvalidation.org/rules/
// https://jqueryvalidation.org/rules/
rules: function( command, argument ) {
var element = this[ 0 ],
settings, staticRules, existingRules, data, param, filtered;
// If nothing is selected, return empty object; can't chain anyway
if ( element == null || element.form == null ) {
if ( element == null ) {
return;
}
if ( !element.form && element.hasAttribute( "contenteditable" ) ) {
element.form = this.closest( "form" )[ 0 ];
element.name = this.attr( "name" );
}
if ( element.form == null ) {
return;
}
@ -167,9 +182,6 @@ $.extend( $.fn, { @@ -167,9 +182,6 @@ $.extend( $.fn, {
$.each( argument.split( /\s/ ), function( index, method ) {
filtered[ method ] = existingRules[ method ];
delete existingRules[ method ];
if ( method === "required" ) {
$( element ).removeAttr( "aria-required" );
}
} );
return filtered;
}
@ -189,7 +201,6 @@ $.extend( $.fn, { @@ -189,7 +201,6 @@ $.extend( $.fn, {
param = data.required;
delete data.required;
data = $.extend( { required: param }, data );
$( element ).attr( "aria-required", "true" );
}
// Make sure remote is at back
@ -206,18 +217,18 @@ $.extend( $.fn, { @@ -206,18 +217,18 @@ $.extend( $.fn, {
// Custom selectors
$.extend( $.expr.pseudos || $.expr[ ":" ], { // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support
// http://jqueryvalidation.org/blank-selector/
// https://jqueryvalidation.org/blank-selector/
blank: function( a ) {
return !$.trim( "" + $( a ).val() );
},
// http://jqueryvalidation.org/filled-selector/
// https://jqueryvalidation.org/filled-selector/
filled: function( a ) {
var val = $( a ).val();
return val !== null && !!$.trim( "" + val );
},
// http://jqueryvalidation.org/unchecked-selector/
// https://jqueryvalidation.org/unchecked-selector/
unchecked: function( a ) {
return !$( a ).prop( "checked" );
}
@ -230,7 +241,7 @@ $.validator = function( options, form ) { @@ -230,7 +241,7 @@ $.validator = function( options, form ) {
this.init();
};
// http://jqueryvalidation.org/jQuery.validator.format/
// https://jqueryvalidation.org/jQuery.validator.format/
$.validator.format = function( source, params ) {
if ( arguments.length === 1 ) {
return function() {
@ -343,7 +354,7 @@ $.extend( $.validator, { @@ -343,7 +354,7 @@ $.extend( $.validator, {
}
},
// http://jqueryvalidation.org/jQuery.validator.setDefaults/
// https://jqueryvalidation.org/jQuery.validator.setDefaults/
setDefaults: function( settings ) {
$.extend( $.validator.defaults, settings );
},
@ -402,6 +413,7 @@ $.extend( $.validator, { @@ -402,6 +413,7 @@ $.extend( $.validator, {
// Set form expando on contenteditable
if ( !this.form && this.hasAttribute( "contenteditable" ) ) {
this.form = $( this ).closest( "form" )[ 0 ];
this.name = $( this ).attr( "name" );
}
var validator = $.data( this.form, "validator" ),
@ -426,13 +438,9 @@ $.extend( $.validator, { @@ -426,13 +438,9 @@ $.extend( $.validator, {
if ( this.settings.invalidHandler ) {
$( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler );
}
// Add aria-required to any Static/Data/Class required fields before first validation
// Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html
$( this.currentForm ).find( "[required], [data-rule-required], .required" ).attr( "aria-required", "true" );
},
// http://jqueryvalidation.org/Validator.form/
// https://jqueryvalidation.org/Validator.form/
form: function() {
this.checkForm();
$.extend( this.submitted, this.errorMap );
@ -452,7 +460,7 @@ $.extend( $.validator, { @@ -452,7 +460,7 @@ $.extend( $.validator, {
return this.valid();
},
// http://jqueryvalidation.org/Validator.element/
// https://jqueryvalidation.org/Validator.element/
element: function( element ) {
var cleanElement = this.clean( element ),
checkElement = this.validationTargetFor( cleanElement ),
@ -503,7 +511,7 @@ $.extend( $.validator, { @@ -503,7 +511,7 @@ $.extend( $.validator, {
return result;
},
// http://jqueryvalidation.org/Validator.showErrors/
// https://jqueryvalidation.org/Validator.showErrors/
showErrors: function( errors ) {
if ( errors ) {
var validator = this;
@ -529,7 +537,7 @@ $.extend( $.validator, { @@ -529,7 +537,7 @@ $.extend( $.validator, {
}
},
// http://jqueryvalidation.org/Validator.resetForm/
// https://jqueryvalidation.org/Validator.resetForm/
resetForm: function() {
if ( $.fn.resetForm ) {
$( this.currentForm ).resetForm();
@ -570,7 +578,10 @@ $.extend( $.validator, { @@ -570,7 +578,10 @@ $.extend( $.validator, {
var count = 0,
i;
for ( i in obj ) {
if ( obj[ i ] ) {
// This check allows counting elements with empty error
// message as invalid elements
if ( obj[ i ] !== undefined && obj[ i ] !== null && obj[ i ] !== false ) {
count++;
}
}
@ -635,6 +646,7 @@ $.extend( $.validator, { @@ -635,6 +646,7 @@ $.extend( $.validator, {
// Set form expando on contenteditable
if ( this.hasAttribute( "contenteditable" ) ) {
this.form = $( this ).closest( "form" )[ 0 ];
this.name = name;
}
// Select only the first element for each name, and only those with rules specified
@ -735,21 +747,27 @@ $.extend( $.validator, { @@ -735,21 +747,27 @@ $.extend( $.validator, {
} ).length,
dependencyMismatch = false,
val = this.elementValue( element ),
result, method, rule;
result, method, rule, normalizer;
// If a normalizer is defined for this element, then
// call it to retreive the changed value instead
// Prioritize the local normalizer defined for this element over the global one
// if the former exists, otherwise user the global one in case it exists.
if ( typeof rules.normalizer === "function" ) {
normalizer = rules.normalizer;
} else if ( typeof this.settings.normalizer === "function" ) {
normalizer = this.settings.normalizer;
}
// If normalizer is defined, then call it to retreive the changed value instead
// of using the real one.
// Note that `this` in the normalizer is `element`.
if ( typeof rules.normalizer === "function" ) {
val = rules.normalizer.call( element, val );
if ( normalizer ) {
val = normalizer.call( element, val );
if ( typeof val !== "string" ) {
throw new TypeError( "The normalizer should return a string value." );
}
// Delete the normalizer from rules to avoid treating
// it as a pre-defined method.
// Delete the normalizer from rules to avoid treating it as a pre-defined method.
delete rules.normalizer;
}
@ -1089,6 +1107,15 @@ $.extend( $.validator, { @@ -1089,6 +1107,15 @@ $.extend( $.validator, {
$( element ).removeClass( this.settings.pendingClass );
if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) {
$( this.currentForm ).submit();
// Remove the hidden input that was used as a replacement for the
// missing submit button. The hidden input is added by `handle()`
// to ensure that the value of the used submit button is passed on
// for scripted submits triggered by this method
if ( this.submitButton ) {
$( "input:hidden[name='" + this.submitButton.name + "']", this.currentForm ).remove();
}
this.formSubmitted = false;
} else if ( !valid && this.pendingRequest === 0 && this.formSubmitted ) {
$( this.currentForm ).triggerHandler( "invalid-form", [ this ] );
@ -1316,7 +1343,7 @@ $.extend( $.validator, { @@ -1316,7 +1343,7 @@ $.extend( $.validator, {
return data;
},
// http://jqueryvalidation.org/jQuery.validator.addMethod/
// https://jqueryvalidation.org/jQuery.validator.addMethod/
addMethod: function( name, method, message ) {
$.validator.methods[ name ] = method;
$.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ];
@ -1325,10 +1352,10 @@ $.extend( $.validator, { @@ -1325,10 +1352,10 @@ $.extend( $.validator, {
}
},
// http://jqueryvalidation.org/jQuery.validator.methods/
// https://jqueryvalidation.org/jQuery.validator.methods/
methods: {
// http://jqueryvalidation.org/required-method/
// https://jqueryvalidation.org/required-method/
required: function( value, element, param ) {
// Check if dependency is met
@ -1347,7 +1374,7 @@ $.extend( $.validator, { @@ -1347,7 +1374,7 @@ $.extend( $.validator, {
return value.length > 0;
},
// http://jqueryvalidation.org/email-method/
// https://jqueryvalidation.org/email-method/
email: function( value, element ) {
// From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address
@ -1357,7 +1384,7 @@ $.extend( $.validator, { @@ -1357,7 +1384,7 @@ $.extend( $.validator, {
return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value );
},
// http://jqueryvalidation.org/url-method/
// https://jqueryvalidation.org/url-method/
url: function( value, element ) {
// Copyright (c) 2010-2013 Diego Perini, MIT licensed
@ -1367,60 +1394,60 @@ $.extend( $.validator, { @@ -1367,60 +1394,60 @@ $.extend( $.validator, {
return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value );
},
// http://jqueryvalidation.org/date-method/
// https://jqueryvalidation.org/date-method/
date: function( value, element ) {
return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() );
},
// http://jqueryvalidation.org/dateISO-method/
// https://jqueryvalidation.org/dateISO-method/
dateISO: function( value, element ) {
return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value );
},
// http://jqueryvalidation.org/number-method/
// https://jqueryvalidation.org/number-method/
number: function( value, element ) {
return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value );
},
// http://jqueryvalidation.org/digits-method/
// https://jqueryvalidation.org/digits-method/
digits: function( value, element ) {
return this.optional( element ) || /^\d+$/.test( value );
},
// http://jqueryvalidation.org/minlength-method/
// https://jqueryvalidation.org/minlength-method/
minlength: function( value, element, param ) {
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
return this.optional( element ) || length >= param;
},
// http://jqueryvalidation.org/maxlength-method/
// https://jqueryvalidation.org/maxlength-method/
maxlength: function( value, element, param ) {
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
return this.optional( element ) || length <= param;
},
// http://jqueryvalidation.org/rangelength-method/
// https://jqueryvalidation.org/rangelength-method/
rangelength: function( value, element, param ) {
var length = $.isArray( value ) ? value.length : this.getLength( value, element );
return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] );
},
// http://jqueryvalidation.org/min-method/
// https://jqueryvalidation.org/min-method/
min: function( value, element, param ) {
return this.optional( element ) || value >= param;
},
// http://jqueryvalidation.org/max-method/
// https://jqueryvalidation.org/max-method/
max: function( value, element, param ) {
return this.optional( element ) || value <= param;
},
// http://jqueryvalidation.org/range-method/
// https://jqueryvalidation.org/range-method/
range: function( value, element, param ) {
return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] );
},
// http://jqueryvalidation.org/step-method/
// https://jqueryvalidation.org/step-method/
step: function( value, element, param ) {
var type = $( element ).attr( "type" ),
errorMessage = "Step attribute on input type " + type + " is not supported.",
@ -1458,7 +1485,7 @@ $.extend( $.validator, { @@ -1458,7 +1485,7 @@ $.extend( $.validator, {
return this.optional( element ) || valid;
},
// http://jqueryvalidation.org/equalTo-method/
// https://jqueryvalidation.org/equalTo-method/
equalTo: function( value, element, param ) {
// Bind to the blur event of the target in order to revalidate whenever the target field is updated
@ -1471,7 +1498,7 @@ $.extend( $.validator, { @@ -1471,7 +1498,7 @@ $.extend( $.validator, {
return value === target.val();
},
// http://jqueryvalidation.org/remote-method/
// https://jqueryvalidation.org/remote-method/
remote: function( value, element, param, method ) {
if ( this.optional( element ) ) {
return "dependency-mismatch";

8
Teknik/Scripts/jquery.validate.min.js vendored

File diff suppressed because one or more lines are too long

91
Teknik/Teknik.csproj

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
<Import Project="..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" />
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
<Import Project="..\packages\Microsoft.Net.Compilers.2.6.1\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.2.6.1\build\Microsoft.Net.Compilers.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -53,12 +53,10 @@ @@ -53,12 +53,10 @@
<Private>True</Private>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="IRCSharp, Version=1.0.0.1, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\IRCSharp.1.0.0.1\lib\net462\IRCSharp.dll</HintPath>
@ -76,41 +74,34 @@ @@ -76,41 +74,34 @@
<HintPath>..\packages\Microsoft.AspNet.Identity.EntityFramework.2.2.1\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.AspNet.SignalR.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.SignalR.Core.2.2.1\lib\net45\Microsoft.AspNet.SignalR.Core.dll</HintPath>
<Private>True</Private>
<Reference Include="Microsoft.AspNet.SignalR.Core, Version=2.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.SignalR.Core.2.2.2\lib\net45\Microsoft.AspNet.SignalR.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNet.SignalR.SystemWeb, Version=2.2.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.SignalR.SystemWeb.2.2.1\lib\net45\Microsoft.AspNet.SignalR.SystemWeb.dll</HintPath>
<Private>True</Private>
<Reference Include="Microsoft.AspNet.SignalR.SystemWeb, Version=2.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.SignalR.SystemWeb.2.2.2\lib\net45\Microsoft.AspNet.SignalR.SystemWeb.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.KeyVault.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.KeyVault.Core.2.0.4\lib\net45\Microsoft.Azure.KeyVault.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
<Private>True</Private>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
<Private>True</Private>
<Reference Include="Microsoft.Owin, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Host.SystemWeb, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
<Private>True</Private>
<Reference Include="Microsoft.Owin.Host.SystemWeb, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Host.SystemWeb.3.1.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin.Security, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll</HintPath>
<Private>True</Private>
<Reference Include="Microsoft.Owin.Security, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Security.3.1.0\lib\net45\Microsoft.Owin.Security.dll</HintPath>
</Reference>
<Reference Include="Mime-Detective, Version=0.0.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Mime-Detective.0.0.5\lib\net45\Mime-Detective.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.9.9\lib\net45\MySql.Data.dll</HintPath>
<Private>True</Private>
<Reference Include="MySql.Data, Version=6.10.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.10.6\lib\net452\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="NBitcoin, Version=3.0.2.10, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NBitcoin.3.0.2.10\lib\net45\NBitcoin.dll</HintPath>
@ -121,16 +112,14 @@ @@ -121,16 +112,14 @@
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Piwik.Tracker, Version=2.16.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Piwik.Tracker.2.16.0.0\lib\net40\Piwik.Tracker.dll</HintPath>
<Private>True</Private>
<Reference Include="Piwik.Tracker, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Piwik.Tracker.3.0.0\lib\net40\Piwik.Tracker.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="QRCoder, Version=1.2.3.0, Culture=neutral, processorArchitecture=MSIL">
@ -138,12 +127,18 @@ @@ -138,12 +127,18 @@
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Design" />
<Reference Include="System.Management" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
@ -523,6 +518,17 @@ @@ -523,6 +518,17 @@
<Content Include="Content\Highlight\xcode.css" />
<Content Include="Content\Highlight\zenburn.css" />
<Content Include="Content\jquery.tocify.css" />
<Content Include="docs\MySqlCommand.xml" />
<Content Include="docs\MySqlCommandBuilder.xml" />
<Content Include="docs\MySqlConnection.xml" />
<Content Include="docs\MySqlConnectionStringBuilder.xml" />
<Content Include="docs\MySqlDataAdapter.xml" />
<Content Include="docs\MySqlDataReader.xml" />
<Content Include="docs\MySqlException.xml" />
<Content Include="docs\MySqlHelper.xml" />
<Content Include="docs\MySqlParameter.xml" />
<Content Include="docs\MySqlParameterCollection.xml" />
<Content Include="docs\MySqlTransaction.xml" />
<Content Include="Fonts\fontawesome-webfont.svg" />
<Content Include="Fonts\glyphicons-halflings-regular.svg" />
<Content Include="Images\redbubble_icon.png" />
@ -716,16 +722,17 @@ @@ -716,16 +722,17 @@
<Content Include="Scripts\Highcharts\highcharts.js" />
<Content Include="Scripts\Highlight\highlight.pack.js" />
<None Include="Scripts\jquery-3.1.1.intellisense.js" />
<Content Include="Scripts\jquery-3.1.1.js" />
<Content Include="Scripts\jquery-3.1.1.min.js" />
<Content Include="Scripts\jquery-3.1.1.slim.js" />
<Content Include="Scripts\jquery-3.1.1.slim.min.js" />
<None Include="Scripts\jquery-3.3.1.intellisense.js" />
<Content Include="Scripts\jquery-3.3.1.js" />
<Content Include="Scripts\jquery-3.3.1.min.js" />
<Content Include="Scripts\jquery-3.3.1.slim.js" />
<Content Include="Scripts\jquery-3.3.1.slim.min.js" />
<Content Include="Scripts\jquery-ui.widgets.js" />
<Content Include="Scripts\jquery.blockUI.js" />
<Content Include="Scripts\jquery.fileupload.js" />
<Content Include="Scripts\jquery.iframe-transport.js" />
<Content Include="Scripts\jquery.signalR-2.2.1.js" />
<Content Include="Scripts\jquery.signalR-2.2.1.min.js" />
<Content Include="Scripts\jquery.signalR-2.2.2.js" />
<Content Include="Scripts\jquery.signalR-2.2.2.min.js" />
<Content Include="Scripts\jquery.tocify.min.js" />
<None Include="Scripts\jquery.validate-vsdoc.js" />
<Content Include="Scripts\jquery.validate.js" />
@ -769,8 +776,8 @@ @@ -769,8 +776,8 @@
<Content Include="Areas\User\Views\User\Register.cshtml" />
<Content Include="Areas\Dev\Views\Dev\Index.cshtml" />
<Content Include="Areas\User\Views\User\_LoginModalPartial.cshtml" />
<Content Include="Scripts\jquery-3.1.1.slim.min.map" />
<Content Include="Scripts\jquery-3.1.1.min.map" />
<Content Include="Scripts\jquery-3.3.1.slim.min.map" />
<Content Include="Scripts\jquery-3.3.1.min.map" />
</ItemGroup>
<ItemGroup>
<Folder Include="Areas\About\Models\" />
@ -899,8 +906,8 @@ @@ -899,8 +906,8 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\GitVersionTask.3.6.5\build\dotnet\GitVersionTask.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\GitVersionTask.3.6.5\build\dotnet\GitVersionTask.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.2.6.1\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.2.6.1\build\Microsoft.Net.Compilers.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

26
Teknik/Web.config

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<connectionStrings configSource="App_Data\ConnectionStrings.config" />
<!-- Create ConnectionStrings.config and add your connection string node-->
<!--
@ -135,7 +135,7 @@ @@ -135,7 +135,7 @@
<add name="Access-Control-Allow-Headers" value="Authorization, Accept, Origin, Content-Type, X-Requested-With, Connection, Transfer-Encoding" />
<add name="strict-transport-security" value="max-age=31536000; includeSubdomains; preload" />
<add name="X-XSS-Protection" value="1; mode=block" />
<add name="Vary" value="Origin"/>
<add name="Vary" value="Origin" />
</customHeaders>
</httpProtocol>
<httpErrors errorMode="Detailed" />
@ -172,11 +172,11 @@ @@ -172,11 +172,11 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
@ -190,16 +190,16 @@ @@ -190,16 +190,16 @@
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<system.data>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
<add description=".Net Framework Data Provider for MySQL" invariant="MySql.Data.MySqlClient" name="MySQL Data Provider" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.10.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers>
</system.codedom>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers>
</system.codedom>
</configuration>

934
Teknik/docs/MySqlCommand.xml

@ -0,0 +1,934 @@ @@ -0,0 +1,934 @@
<docs>
<ClassSummary>
<summary>Represents a SQL statement to execute against a MySQL database. This class cannot be inherited.</summary>
<remarks>
<B>MySqlCommand</B> features the following methods for executing commands at a MySQL database:
<list type="table">
<listheader>
<term>Item</term>
<term>Description</term>
</listheader>
<item>
<term>
<a href="MySql.Data.MySqlClient.MySqlCommand.ExecuteReader_overloads.html">ExecuteReader</a>
</term>
<description>Executes commands that return rows.</description>
</item>
<item>
<term>
<a href="MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery.html">ExecuteNonQuery</a>
</term>
<description>Executes commands such as SQL INSERT, DELETE, and UPDATE statements.</description>
</item>
<item>
<term>
<a href="MySql.Data.MySqlClient.MySqlCommand.ExecuteScalar.html">ExecuteScalar</a>
</term>
<description>Retrieves a single value (for example, an aggregate value) from a database.</description>
</item>
</list>
You can reset the <B>CommandText</B> property and reuse the <B>MySqlCommand</B>
object. However, you must close the <A
href="MySql.Data.MySqlClient.MySqlDataReader.html">MySqlDataReader</A>
before you can execute a new or previous command.
If a <A href="MySql.Data.MySqlClient.MySqlException.html">MySqlException</A> is
generated by the method executing a <B>MySqlCommand</B>, the <A
href="MySql.Data.MySqlClient.MySqlConnection.html">MySqlConnection</A>
remains open. It is the responsibility of the programmer to close the connection.
<note>
Using the '@' symbol for paramters is now the preferred approach although the old pattern of using
'?' is still supported. Please be aware though that using '@' can cause conflicts when user variables
are also used. To help with this situation please see the documentation on the 'allow user variables'
connection string option. The 'old syntax' connection string option has now been deprecated.
</note>
</remarks>
<example>
The following example creates a <A href="frlrfsystemdatasqlclientsqlcommandclasstopic.htm">MySqlCommand</A> and
a <B>MySqlConnection</B>. The <B>MySqlConnection</B> is opened and set as the <A
href="frlrfsystemdatasqlclientsqlcommandclassconnectiontopic.htm">Connection</A>
for the <B>MySqlCommand</B>. The example then calls <A
href="frlrfsystemdatasqlclientsqlcommandclassexecutenonquerytopic.htm">ExecuteNonQuery</A>,
and closes the connection. To accomplish this, the <B>ExecuteNonQuery</B> is
passed a connection string and a query string that is a SQL INSERT
statement.
<code lang="vbnet">
Public Sub InsertRow(myConnectionString As String)
&quot; If the connection string is null, use a default.
If myConnectionString = "" Then
myConnectionString = "Database=Test;Data Source=localhost;User Id=username;Password=pass"
End If
Dim myConnection As New MySqlConnection(myConnectionString)
Dim myInsertQuery As String = "INSERT INTO Orders (id, customerId, amount) Values(1001, 23, 30.66)"
Dim myCommand As New MySqlCommand(myInsertQuery)
myCommand.Connection = myConnection
myConnection.Open()
myCommand.ExecuteNonQuery()
myCommand.Connection.Close()
End Sub
</code>
<code lang="C#">
public void InsertRow(string myConnectionString)
{
// If the connection string is null, use a default.
if(myConnectionString == "")
{
myConnectionString = "Database=Test;Data Source=localhost;User Id=username;Password=pass";
}
MySqlConnection myConnection = new MySqlConnection(myConnectionString);
string myInsertQuery = "INSERT INTO Orders (id, customerId, amount) Values(1001, 23, 30.66)";
MySqlCommand myCommand = new MySqlCommand(myInsertQuery);
myCommand.Connection = myConnection;
myConnection.Open();
myCommand.ExecuteNonQuery();
myCommand.Connection.Close();
}
</code>
</example>
</ClassSummary>
<ctor1>
<overloads>
<summary>
Initializes a new instance of the MySqlCommand class.
</summary>
<example>
The following example creates a MySqlCommand and sets some of its properties.
<para></para>
<note>
This example shows how to use one of the overloaded
versions of the MySqlCommand constructor. For other examples that might be available,
see the individual overload topics.
</note>
<code lang="vbnet">
Public Sub CreateMySqlCommand()
Dim myConnection As New MySqlConnection _
("Persist Security Info=False;database=test;server=myServer")
myConnection.Open()
Dim myTrans As MySqlTransaction = myConnection.BeginTransaction()
Dim mySelectQuery As String = "SELECT * FROM MyTable"
Dim myCommand As New MySqlCommand(mySelectQuery, myConnection, myTrans)
myCommand.CommandTimeout = 20
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand()
{
MySqlConnection myConnection = new MySqlConnection("Persist Security Info=False;
database=test;server=myServer");
myConnection.Open();
MySqlTransaction myTrans = myConnection.BeginTransaction();
string mySelectQuery = "SELECT * FROM myTable";
MySqlCommand myCommand = new MySqlCommand(mySelectQuery, myConnection,myTrans);
myCommand.CommandTimeout = 20;
}
</code>
<code lang="C++">
public:
void CreateMySqlCommand()
{
MySqlConnection* myConnection = new MySqlConnection(S"Persist Security Info=False;
database=test;server=myServer");
myConnection->Open();
MySqlTransaction* myTrans = myConnection->BeginTransaction();
String* mySelectQuery = S"SELECT * FROM myTable";
MySqlCommand* myCommand = new MySqlCommand(mySelectQuery, myConnection, myTrans);
myCommand->CommandTimeout = 20;
};
</code>
</example>
</overloads>
<summary>
Initializes a new instance of the MySqlCommand class.
</summary>
<remarks>
The base constructor initializes all fields to their default values. The
following table shows initial property values for an instance of <see cref="MySqlCommand"/>.
<list type="table">
<listheader>
<term>Properties</term>
<term>Initial Value</term>
</listheader>
<item>
<term>
<see cref="CommandText"/>
</term>
<term>empty string ("")</term>
</item>
<item>
<term>
<see cref="CommandTimeout"/>
</term>
<term>0</term>
</item>
<item>
<term>
<see cref="CommandType"/>
</term>
<term>CommandType.Text</term>
</item>
<item>
<term>
<see cref="Connection"/>
</term>
<term>Null</term>
</item>
</list>
<para>
You can change the value for any of these properties through a separate call to
the property.
</para>
</remarks>
<example>
The following example creates a <see cref="MySqlCommand"/> and
sets some of its properties.
<code lang="vbnet">
Public Sub CreateMySqlCommand()
Dim myCommand As New MySqlCommand()
myCommand.CommandType = CommandType.Text
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand()
{
MySqlCommand myCommand = new MySqlCommand();
myCommand.CommandType = CommandType.Text;
}
</code>
</example>
</ctor1>
<ctor2>
<summary>
Initializes a new instance of the <see cref="MySqlCommand"/> class with the text of the query.
</summary>
<param name="cmdText">The text of the query.</param>
<remarks>
When an instance of <see cref="MySqlCommand"/> is created,
the following read/write properties are set to initial values.
<list type="table">
<listheader>
<term>Properties</term>
<term>Initial Value</term>
</listheader>
<item>
<term>
<see cref="CommandText"/>
</term>
<term>
<i>cmdText</i>
</term>
</item>
<item>
<term>
<see cref="CommandTimeout"/>
</term>
<term>0</term>
</item>
<item>
<term>
<see cref="CommandType"/>
</term>
<term>CommandType.Text</term>
</item>
<item>
<term>
<see cref="Connection"/>
</term>
<term>Null</term>
</item>
</list>
<para>
You can change the value for any of these properties through a separate call to
the property.
</para>
</remarks>
<example>
The following example creates a <see cref="MySqlCommand"/> and
sets some of its properties.
<code lang="vbnet">
Public Sub CreateMySqlCommand()
Dim sql as String = "SELECT * FROM mytable"
Dim myCommand As New MySqlCommand(sql)
myCommand.CommandType = CommandType.Text
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand()
{
string sql = "SELECT * FROM mytable";
MySqlCommand myCommand = new MySqlCommand(sql);
myCommand.CommandType = CommandType.Text;
}
</code>
</example>
</ctor2>
<ctor3>
<summary>
Initializes a new instance of the <see cref="MySqlCommand"/> class
with the text of the query and a <see cref="MySqlConnection"/>.
</summary>
<param name="cmdText">The text of the query.</param>
<param name="connection">
A <see cref="MySqlConnection"/> that represents the
connection to an instance of SQL Server.
</param>
<remarks>
When an instance of <see cref="MySqlCommand"/> is created,
the following read/write properties are set to initial values.
<list type="table">
<listheader>
<term>Properties</term>
<term>Initial Value</term>
</listheader>
<item>
<term>
<see cref="CommandText"/>
</term>
<term>
<i>cmdText</i>
</term>
</item>
<item>
<term>
<see cref="CommandTimeout"/>
</term>
<term>0</term>
</item>
<item>
<term>
<see cref="CommandType"/>
</term>
<term>CommandType.Text</term>
</item>
<item>
<term>
<see cref="Connection"/>
</term>
<term>
<i>connection</i>
</term>
</item>
</list>
<para>
You can change the value for any of these properties through a separate call to
the property.
</para>
</remarks>
<example>
The following example creates a <see cref="MySqlCommand"/> and
sets some of its properties.
<code lang="vbnet">
Public Sub CreateMySqlCommand()
Dim conn as new MySqlConnection("server=myServer")
Dim sql as String = "SELECT * FROM mytable"
Dim myCommand As New MySqlCommand(sql, conn)
myCommand.CommandType = CommandType.Text
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand()
{
MySqlConnection conn = new MySqlConnection("server=myserver")
string sql = "SELECT * FROM mytable";
MySqlCommand myCommand = new MySqlCommand(sql, conn);
myCommand.CommandType = CommandType.Text;
}
</code>
</example>
</ctor3>
<ctor4>
<summary>
Initializes a new instance of the <see cref="MySqlCommand"/> class
with the text of the query, a <see cref="MySqlConnection"/>, and the
<see cref="MySqlTransaction"/>.
</summary>
<param name="cmdText">The text of the query.</param>
<param name="connection">
A <see cref="MySqlConnection"/> that represents the
connection to an instance of SQL Server.
</param>
<param name="transaction">
The <see cref="MySqlTransaction"/> in which the <see cref="MySqlCommand"/> executes.
</param>
<remarks>
When an instance of <see cref="MySqlCommand"/> is created,
the following read/write properties are set to initial values.
<list type="table">
<listheader>
<term>Properties</term>
<term>Initial Value</term>
</listheader>
<item>
<term>
<see cref="CommandText"/>
</term>
<term>
<i>cmdText</i>
</term>
</item>
<item>
<term>
<see cref="CommandTimeout"/>
</term>
<term>0</term>
</item>
<item>
<term>
<see cref="CommandType"/>
</term>
<term>CommandType.Text</term>
</item>
<item>
<term>
<see cref="Connection"/>
</term>
<term>
<i>connection</i>
</term>
</item>
</list>
<para>
You can change the value for any of these properties through a separate call to
the property.
</para>
</remarks>
<example>
The following example creates a <see cref="MySqlCommand"/> and
sets some of its properties.
<code lang="vbnet">
Public Sub CreateMySqlCommand()
Dim conn as new MySqlConnection("server=myServer")
conn.Open();
Dim txn as MySqlTransaction = conn.BeginTransaction()
Dim sql as String = "SELECT * FROM mytable"
Dim myCommand As New MySqlCommand(sql, conn, txn)
myCommand.CommandType = CommandType.Text
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand()
{
MySqlConnection conn = new MySqlConnection("server=myserver")
conn.Open();
MySqlTransaction txn = conn.BeginTransaction();
string sql = "SELECT * FROM mytable";
MySqlCommand myCommand = new MySqlCommand(sql, conn, txn);
myCommand.CommandType = CommandType.Text;
}
</code>
</example>
</ctor4>
<ExecuteNonQuery>
<summary>
Executes a SQL statement against the connection and returns the number of rows affected.
</summary>
<returns>Number of rows affected</returns>
<remarks>
You can use ExecuteNonQuery to perform any type of database operation,
however any resultsets returned will not be available. Any output parameters
used in calling a stored procedure will be populated with data and can be
retrieved after execution is complete.
For UPDATE, INSERT, and DELETE statements, the return value is the number
of rows affected by the command. For all other types of statements, the return
value is -1.
</remarks>
<example>
The following example creates a MySqlCommand and then
executes it using ExecuteNonQuery. The example is passed a string that is a
SQL statement (such as UPDATE, INSERT, or DELETE) and a string to use to
connect to the data source.
<code lang="vbnet">
Public Sub CreateMySqlCommand(myExecuteQuery As String, myConnection As MySqlConnection)
Dim myCommand As New MySqlCommand(myExecuteQuery, myConnection)
myCommand.Connection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()
End Sub
</code>
<code lang="C#">
public void CreateMySqlCommand(string myExecuteQuery, MySqlConnection myConnection)
{
MySqlCommand myCommand = new MySqlCommand(myExecuteQuery, myConnection);
myCommand.Connection.Open();
myCommand.ExecuteNonQuery();
myConnection.Close();
}
</code>
</example>
</ExecuteNonQuery>
<ExecuteReader1>
<summary>
Sends the <see cref="CommandText"/> to the <see cref="MySqlConnection">Connection</see>,
and builds a <see cref="MySqlDataReader"/> using one of the <see cref="CommandBehavior"/> values.
</summary>
<param name="behavior">
One of the <see cref="CommandBehavior"/> values.
</param>