Compare commits

...
Author SHA1 Message Date
Martin Baulig f42420784a [BoringTls]: Merge the work branch.
* Mono.Security.Interface.ICertificateValidator2:
  new internal interface, deriving from ICertificateValidator.

* Mono.Security.Interface.CertificateValidationHelper:
  the internal GetValidator() now returns ICertificateValidator2.

* Mono.Security.Interface.MonoTlsProvider:
  make HasCustomSystemCertificateValidator and InvokeSystemCertificateValidator()
  internal and use ICertificateValidator2.

* Mono.Net.Security.ChainValidator:
  implement ICertificateValidator2; we may now be called with a
  fully-built X509Chain.

* corlib, System, Mono.Security:
  add [assembly: InternalsVisibleTo].

(cherry picked from commit 8527bb09ec)
2016-04-07 16:45:24 +02:00
Zoltan Varga 197645cab3 [llvmonly] Fix a few issues passing and returning vtypes smaller than one machine word. 2016-04-06 22:27:58 -04:00
Aleksey Kliger (λgeek) b36eb0de89 Merge pull request #2843 from lambdageek/backport/bug-40060
[4.4.0][corlib] Type.GetType parser and resolver improvements
2016-04-06 21:20:39 -04:00
Ankit Jain 149a844478 [xbuild] Fix #40094, part 2/2: AssignProjectConfiguration - Fallback to
.. project path for lookup, if lookup by guid fails.

Fixes bxc #40094 .
2016-04-06 15:11:40 -04:00
Ankit Jain 1f2c8fb449 [xbuild] Fix #40094, part 1/2: SolutionParser: Emit AbsolutePath="..."
.. attribute for CurrentSolutionConfigurationContents .

   <CurrentSolutionConfigurationContents>
         <SolutionConfiguration xmlns="">
	   <ProjectConfiguration Project="{82323650-6C2A-4FAC-91C6-A715C2FE9CB2}" AbsolutePath="/Users/ankit/test/msbuild/bug40094/App1/App1\App1\App1.csproj">
		   Release|AnyCPU
	   </ProjectConfiguration>
	   ...

Related to fix for bxc #40094
2016-04-06 15:11:35 -04:00
Aleksey Kliger faf8187a89 [corlib] Test Type.GetType(string,null,null) and anonymous type parsing 2016-04-06 14:19:42 -04:00
Aleksey Kliger 19278d187a [corlib] TypeSpec.Parse for non-assembly qualified names.
Previously for types like "Foo[P,Q]" the recursive call of the parser
would incorrectly consume the delimiter after a type argument (ie the
',' or ']') which would leave the caller potentially past the end of the
string which would signal a failed parse.  New behavior is to peek at
the delimiter but leave it up to the caller to consume.

Also `Type.GetType(name, null, null)` should behave like
`Type.GetType(name)` (previously it dropped generic type arguments).
2016-04-06 14:19:41 -04:00
Aleksey Kliger 17a827d08c [runtime] type_from_parsed_name can be called from System or System.Reflection
type_from_parsed_name is a helper for
ves_icall_System_Type_internal_from_name which is called directly from
System.Type as well as indirectly by System.TypeNameParse.  We should
skip over all those classes to find the managed caller.

This fixes the remainder of [40060](https://bugzilla.xamarin.com/show_bug.cgi?id=40060)
2016-04-06 14:19:41 -04:00
Aleksey Kliger a408043594 [runtime] Fix bug in get_caller_no_reflection
In order to find the user code that called some corlib API
that calls an icall, we write:
	dest = m = mono_method_get_last_managed ();
	mono_stack_walk_no_il (get_caller_no_reflection, &dest);
	if (!dest) dest = m;

The get_caller_no_reflection walk works in two stages: in the first
stage we look for the target method (the initial value of dest) when we
find the target we set dest to NULL and then the second stage continues
walking upward past the reflection APIs.

However if the target method is itself in System.Reflection, the
old implementation would skip over it even in the first stage and we'd
never find the target method and exhaust the whole stack.

The fix is to move the check for the target method before the check for
the Reflection API methods.
2016-04-06 14:19:40 -04:00
Aleksey Kliger d567e15089 [runtime] Add a rootimage arg to mono_reflection_get_type_checked
And in type_from_parsed_name pass the calling image as the metadata
context even if the initial class we're looking for is in corlib.

This lets calls like
	Type.GetType ("System.Collections.Generic.Dictionary<int, MyClass<int>>")
succeed.  (Previously we would firs try to find
System.Collections.Generic.Dictionary in the calling assembly,
which would fail outside of corlib, and then we'd retry with the
rootimage as corlib which would find Dictionary, but fail to find
MyClass.  Note that this was only broken if the outermost type was in
corlib.  It always worked deeper in generic type arguments provided
we startd in the calling assmebly:
	Type.GetType ("MyClass<System.Collections.Generic.Dictionary<int, MyClass<int>>>")

This fixes part of [40060](https://bugzilla.xamarin.com/show_bug.cgi?id=40060)
2016-04-06 14:19:40 -04:00
Ankit Jain 4b6aa76c2b AL: Use IKVM.Reflection to get custom attributes from the template assembly,
.. instead of System.Reflection. This allows AL to work even if the
dependent assemblies of the template are not available.

Cherry-picked e4f1b8c13d.

And updated the Makefile since it still uses LOCAL_MCS_FLAGS .
2016-04-06 12:26:44 -04:00
Rodrigo Kumpera 043401d353 [sgen] Mark togglerefs before processing ephemerons. Fixes #40108.
Strong Togglerefs must be considered as roots for the purpose of Ephemeron processing.

Otherwise you make it not possible to use a toggleref object as key.
2016-04-06 11:47:09 -04:00
Andi McClure 9d6315a87f Merge pull request #2829 from xmcclure/march-leaks
Cherry-pick alexanderkyte PRs #2781 #2783 #2785 #2786
2016-04-06 10:28:27 -04:00
Zoltan Varga ab383f7658 [tests] Increase the timeout in the test runner so running tests with llvm doesn't time out.
(cherry picked from commit 1ee0c21019)
2016-04-05 23:50:29 +02:00
Marcos Henrich aea10b3386 Merge pull request #2787 from esdrubal/endpointaddress10
[System.ServiceModel] Fixes reflection call to undefined method
2016-04-05 15:59:41 -04:00
Zoltan Varga 25329653b9 Remove some debug printfs. 2016-04-04 20:12:27 -04:00
Zoltan Varga 5f97d76229 [runtime] Allow the options in MONO_DEBUG to be passed as a command line option too. 2016-04-04 19:13:53 -04:00
Zoltan Varga 699a63f9bf [llvm] Enable pinvoke call using the C calling conv in llvm-only mode. 2016-04-04 19:03:16 -04:00
Zoltan Varga 766153c15d [corlib] Make some ExceptionDispatchInfo tests with BitcodeNotWorking because we don't truncate stack traces of exceptions at the catch site when running with bitcode. 2016-04-04 18:21:31 -04:00
Rolf Bjarne Kvinge febc509ab9 [process] Initialize exit code before calling GetExitCodeProcess.
GetExitCodeProcess may fail (if getting the exit code of an exited process
we only have the pid for) and not write anything to the *code
parameter.

In that case GetExitCodeProcess would return random memory.

If that random memory happened to be 0x103 (259), then Process.HasExited
would return false, even though the process had actually exited.

Due to the reference import of Process in master, this code is
completely different there, and this bug probably only occurs on
the mono-4.4.0-branch.
2016-03-31 15:28:42 +02:00
Vincent Povirk d38c887328 [threadpool-ms] Fix incorrect use of mono_rand.
This takes a pointer to an RNG handle, not the handle itself.
2016-03-30 15:14:27 -04:00
Rolf Bjarne Kvinge 0800486b6d [corlib] Remove local variables inadvertently overriding class variables. 2016-03-29 19:05:00 +02:00
Rolf Bjarne Kvinge 7d2fc45070 [corlib] Add Console.[Input|Output]Encoding to the mobile profiles. 2016-03-29 18:26:47 +02:00
Marek Safar 1025cb852b Bump referencesource 2016-03-29 13:22:52 +02:00
Marek Safar abb1427039 Bump referencesource (#39954) 2016-03-29 13:18:02 +02:00
Zoltan Varga 7c92aebbec [bcl] Avoid printing debug messages to stdout in the default trace listener when a debugger is connected. Fixes #13538. 2016-03-28 21:46:50 -04:00
Zoltan Varga 767e1b4a83 [jit] Pass the type token index instead of the full type token to the throw corlib exceptions functions on most platforms to reduce the size of the generated code. 2016-03-28 18:34:15 -04:00
Zoltan Varga 61372e1283 [arm] In the llvm throw corlib exception trampoline, use the normal caller ip instead of the argument passed in by the caller since that might not point directly to the call instruction. Fixes #39420. 2016-03-28 15:51:11 -04:00
Zoltan Varga ef4b263b8e [aot] Fix a memory leak. 2016-03-27 18:50:23 -04:00
Zoltan Varga 00a5ce9362 [runtime] Fix a memory leak in ves_icall_Type_GetNestedTypes (). 2016-03-27 18:43:59 -04:00
Alexander Köplinger dce7214228 [System.Net.Http] Make HttpClientTest.RequestUriAfterRedirect test more reliable
It was the only test in the class that required network access (for looking up xamarin.com in the redirect).
Replacing the redirect target with a second local HttpListener should be more resilient to network/DNS issues.

(cherry picked from commit 074266c4c7)
2016-03-27 17:32:22 +02:00
Zoltan Varga 532820651d [aot] Emit a .subsections_via_symbols directive on arm. 2016-03-25 18:35:16 -04:00
Ankit Jain 597dad255c [mcs] Accept and ignore command line args supported by csc that we don't
support:

	/analyzer
	/appconfig
	/baseaddress
	/deterministic
	/errorendlocation
	/errorlog
	/features
	/link
	/moduleassemblyname
	/pathmap
	/pdb
	/preferreduilang
	/publicsign
	/reportanalyzer
	/ruleset
	/sqmsessionguid

(cherry picked from commit 22a512306a)
2016-03-25 12:30:35 -04:00
Zoltan Varga eab950e955 [arm] Fix support for soft breakpoints. 2016-03-24 16:04:02 -04:00
Chris Hamons bd983aed5a Create xammac_net_4_5 variant of System.Runtime.Remoting 2016-03-24 08:48:17 -05:00
Martin Baulig 9c69dbaeb2 [Mono.Security]: MonoTlsProvider.InvokeSystemCertificateValidator() now takes 'ref X509Chain'.
(cherry picked from commit 2b3bd83a8a)
2016-03-23 20:10:28 -04:00
Martin Baulig d06fd24062 [System]: Add private 'X500DistinguishedName' API to store the canonical encoding and use it for fast comparison.
(cherry picked from commit 204435045c)
2016-03-23 20:10:21 -04:00
Martin Baulig a98a751d23 [System]: SystemCertificateValidator.CheckUsage(): lazily convert to X509Certificate2 if needed.
(cherry picked from commit 2ff8515937)
2016-03-23 20:10:15 -04:00
Martin Baulig 777f61d1fe [System]: Make 'X509Certificate2' and 'X509Chain' lazily-initialized.
Add new internal 'X509Certificate2Impl' and 'X509ChainImpl' classes similar to
'X509CertificateImpl' in corlib and only initialize them when actually needed.

(cherry picked from commit e75c32654e)
2016-03-23 20:09:59 -04:00
Martin Baulig f77bbba68c [corlib]: Cleanup the internal 'X509CertificateImpl' API.
(cherry picked from commit a9fc9c628e)
2016-03-23 20:07:16 -04:00
Aleksey Kliger f152fde507 Bump referencesource 2016-03-23 10:47:47 -04:00
Alexander Kyte 804f059189 [runtime] Free leaked short-lived MonoType 2016-03-21 18:15:00 -04:00
Alexander Kyte edc762986f [runtime] Free cached_info tables on cleanup 2016-03-21 19:46:56 -04:00
Alexander Kyte b5eb38be7a [runtime] Remove string memory leak related to basename 2016-03-21 17:52:04 -04:00
Alexander Kyte 8059415416 [runtime] Fix reassignment over string-pointing var without freeing 2016-03-21 17:49:06 -04:00
Alexander Kyte 10967e4276 [runtime] Make memory allocation for method headers consistent, stop leaking 2016-03-21 19:05:31 -04:00
Alexander Kyte 5114bdc17e [runtime] Prevent leaking inflated headers by marking them transient, only free in one place. 2016-03-21 17:28:25 -04:00
Andi McClure 1115e1bdb7 [runtime] restore mono_error_init in mono_basic_block_split
Follow-up on PR #2781 which removed a mono_error_init. Ensure use in
helper functions for consistency. Fixes a potential crasher.
2016-04-05 14:32:18 -04:00
Alexander Kyte 4cb70c0114 [runtime] Make mono_basic_block_split take the header it uses 2016-03-21 15:11:07 -04:00
Zoltan Varga 36d3a24bac [gsharedvt] Add a test for #39528. 2016-03-19 23:19:45 +01:00
Marek Safar a580b027f0 [mcs] Allow local variables and parameters on lhs of nameof expression. Fixes #39455 2016-03-17 17:00:32 +01:00
Zoltan Varga 9ee06a4e7b [runtime] Cleanup the debug info module before the images module since ppdb debug info depends on images. Fixes #39715. 2016-03-17 12:06:27 +01:00
Zoltan Varga ec2614a0c0 [ppdb] Avoid an assert if the ppdb image has an empty guid heap, it can happen if the assembly has no types thus no document guids. Fixes #39644. 2016-03-17 11:34:14 +01:00
Zoltan Varga 58d7c76937 [arm] Avoid storing fp arguments below the stack pointer if the param area has size 0. Fixes #38161. 2016-03-17 11:34:09 +01:00
Marek Safar a27b9b7616 [corlib] RuntimeEnvironment from referencesource 2016-03-17 11:01:18 +01:00
Marek Safar 8f1f7fa935 Bump referencesource 2016-03-17 10:52:33 +01:00
Alexander Köplinger f652accb19 [tests] Don't use AppDomain.AppendPrivateBinPath for assembly-load-remap.exe
It's not supposed to contain a full path to a directory, but rather a relative path
to a subdirectory of the ApplicationBase. However, this isn't enforced in all cases
by Mono so setting a full path worked when the path doesn't contain a '.' because then
the code in [1] doesn't clear the variable and the path is added to the domain->search_path.

This caused the test to fail on Wrench on the mono-4.4.0 lane because the path contains
a dot while confusingly it worked fine on master.

Fixing this by appending the xbuild_14 path via an alternative (albeit slightly hacky)
method related to the standard MONO_PATH env var. Because the variable is only read
once at app startup we need to call into the runtime to explicitly set the new path
before trying to load the MSBuild 14 assemblies. This is fine since we only
want to test that the correct assembly version is loaded and nothing else.

[1] https://github.com/mono/mono/blob/37b2b9fbc25a2199aba1d794117924d4828360a7/mono/metadata/appdomain.c#L1319-L1337

(cherry picked from commit ef407901f8)
2016-03-16 03:41:44 +01:00
Martin Baulig 04eb667e1b [System]: Fix certificate validation on Linux. Bug #39307.
(cherry picked from commit 37b2b9fbc2)
2016-03-15 19:13:10 -04:00
Ankit Jain c0c7e755cd [xbuild] TaskLoggingHelper: Implement support for correctly using task resources
- make task resources available to TaskLoggingHelper
- verify TaskLoggingHelper method args
- tests
2016-03-15 16:28:38 -04:00
Ankit Jain 6745aefb04 [xbuild] Remove ErrorTest.TestExecute1()
This was an incorrect test. Tasks can't really be used like this
especially this once since it tries to Log an error, but it hasn't been
assigned a BuildEngine yet!

Other fixes in TaskLoggingHelper expose this issue.
2016-03-15 16:28:37 -04:00
Miguel de Icaza 053e71392f [getline] Fix condition where Console.WriteLi<TAB><ENTER> completed to Console.WriteLinene 2016-03-15 10:26:11 -04:00
Miguel de Icaza 4dc622c3e3 [repl] Further fine tuning; Show newlines as actual newlines in strings, plus fix quoting of chars < 32 2016-03-15 10:22:31 -04:00
Miguel de Icaza 225b0d6a42 [repl] Do not escape space when pretty printing strings 2016-03-15 10:13:12 -04:00
monojenkins 285bc6027f Merge pull request #2754 from markusbeth/fix-mono-config
fixed replacement of $mono_libdir in config file

strncpy does not NUL-terminate the destination string in this case so one cannot use strcat to append

This fixes the error "malloc: top chunk is corrupt" as reported on mono-devel-list back in 2015-10-20 (subject: "malloc error executing OBS-built mono") at least for me.
2016-03-14 20:11:09 -04:00
Marek Safar 04f446f887 [mcs] Better check for automatically implemented property inside a type with an explicit StructLayout. Fixes #39574 2016-03-14 13:37:56 +01:00
Marek Safar a40a2996ac [system.net.http] The backslash character may be used as a single-character quoting mechanism within quoted-string. Fixes #39569 2016-03-14 12:36:35 +01:00
Alexander Köplinger 848b95d5ee [runtime] Stop remapping higher versions of Microsoft.Build.Framework/Engine and remap Microsoft.Build.Utilities/Tasks (.v3.5)
The previous remapping was added in 725ed3f824, but it didn't actually
fix the bug in https://bugzilla.xamarin.com/show_bug.cgi?id=32561.

The underlying cause of the bug is that in Mono 4.0 we removed the 2.0/3.5 profiles.
This meant that Microsoft.Build.Utilities.dll and Microsoft.Build.Utilities.v3.5.dll weren't installed
in the GAC anymore, because MSBuild 4.0 uses Microsoft.Build.Utilities.v4.0.dll, so the app failed
to load the 2.0 version of the assembly. The same applies for the .Tasks variants.

We remap earlier versions of the Microsoft.Build.Utilities/Tasks assemblies to the v4.0 version.
I've introduced another item in the AssemblyVersionMap struct which allows remapping to target a different
assembly name, because MSBuild made the questionable decision to put the version number in the assembly name.
While strictly speaking this is not what .NET is doing (it just fails there if .NET 2.0 isn't installed)
on Mono there's no way to install those older profiles anymore, so we remap them to v4.0 to keep apps working.

Newer versions of Microsoft.Build.Framework/Engine (like 12.0, 14.0) however have the same name, so we need to be
more careful here and only do a remapping to the 4.0 version if it's an earlier version (e.g. 2.0 -> 4.0).
This avoids issues with accidentally remapping 14.0 -> 4.0.

I tested the app from the bug report and it now works fine.

(cherry-picked from commit 5d4ab58d38)
2016-03-11 17:37:25 +01:00
Marek Safar f8474c4350 [mcs] Codegen update for specialized struct initialization with awaited element initializer. Fixes #39459 2016-03-10 18:08:53 +01:00
Marek Safar d29212628e [xbuild] Remove explicit warning level set when csproj does not have it and leave the default to compiler 2016-03-09 23:24:58 +01:00
Ankit Jain 8e0a3f2b9d [mcs] Accept and ignore command line args supported by csc that we don't
support:

	/win32manifest
	/nowin32manifest
2016-03-09 15:52:06 -05:00
Ankit Jain 35b63892f6 [mcs] Accept and ignore command line args supported by csc ..
.. that we don't support:

	/utf8output
	/subsystemversion
	/highentropyva
	/highentropyva+
	/highentropyva-
2016-03-09 15:52:05 -05:00
Marek Safar 3600f6c99a [mcs] nameof operator can use static member. Fixes #39455 2016-03-09 18:00:35 +01:00
Zoltan Varga 0b3658594d [aot] Fix a buffer overflow in the statistics code. 2016-03-09 16:23:47 +01:00
Marek Safar 2b68c67254 [mcs] Fixes codegen for lifted null bitwise operators with constant left side of null value 2016-03-08 13:42:09 +01:00
Marek Safar 3cd9bafe5b [mcs] Null conditional operator is never suppose to work with await according to current C# standard. Fixes #39266 2016-03-07 21:03:36 +01:00
Marek Safar eb307e9c56 [mcs] All returns with values from async block with finally need to be captured. Fixes #39153 2016-03-05 11:32:20 +01:00
Alex Rønne Petersen d9b657c187 [sgen] Use regular, non-safe LLS foreach macro.
As it turns out, all these uses of FOREACH_THREAD_SAFE were inside regions
where the suspend lock is held. This effectively meant that no modifications
to the thread list could actually happen while the foreach was executing. Since
the guarantees provided by FOREACH_THREAD_SAFE are not needed in any of these
cases, switch to FOREACH_THREAD. The latter macro also happens to be much more
lightweight, so this should result in an overall (small) performance gain.
2016-03-03 18:58:55 +01:00
Alex Rønne Petersen 64f303b629 [utils/lls] Make the node free function support more flexible.
The caller of mono_lls_init () can now specify whether the free function can or
cannot lock, rather than the LLS assuming that it can't. The only reason this
limitation existed was because the LLS wasn't extended to allow specifying this
information in/after 56a6ae2bd0.

In addition, all LLS functions are now callable from both safe and async
context; the caller must specify the context as an additional argument. If a
free function is in use and it may lock, we'll simply enqueue it for execution
at a later point if an LLS function is invoked in async context.
2016-03-03 18:58:54 +01:00
Alex Rønne Petersen 77dc1371ed [utils/hp] Improve the mono_thread_hazardous_free_or_queue () API.
1. The function suffered from the "too many bools" problem. Pass enum values
   instead so that call sites are clearer.
2. Don't restrict the combination of arguments. This makes it easier to use
   the function as part of data structures where the arguments aren't known
   ahead of time (e.g. the LLS).
2016-03-03 18:58:43 +01:00
Alex Rønne Petersen 05d3baf3ac [utils/lls] Fix the safe foreach macro.
This fixes a bug that would manifest when running the profiler on a program
that rapidly spawns/joins threads.

The problem was this: Given T1 which is joining on T2, T2 which is returning
and removing itself from the thread list, and T3 which is currently in the
SIGPROF signal handler, it was possible for T3 to encounter a pointer to T2's
freed thread info structure in the thread list. This can happen because the
SIGPROF handler doesn't actually acquire the suspend lock (it can't) while
iterating the thread list.

The MONO_LLS_FOREACH_SAFE macro was supposed to protect against this case
specifically and, as a result, only provide a snapshot of the thread list.
However, it was missing some very important bits of the mono_lls_find ()
algorithm. The gory details can be found in the paper that the LLS is based on:

    http://www.research.ibm.com/people/m/michael/spaa-2002.pdf

In particular, refer to the "Using Other Memory Management Methods" section
on page 6. It describes why lines E1-2 and E3-4 are necessary in order to
safely iterate the list in an implementation using hazard pointers (such as
ours). Basically, the iteration of the list has to be restarted if any sort of
modification to the list is detected during iteration. Otherwise, it's possible
to read and follow removed/freed memory, leading to all sorts of Bad Things™
happening.

Now, obviously we can't just restart a foreach loop without further thought;
that would cause all sorts of breakage due to the loop body being executed on
the same elements multiple times. As it happens, the LLS is an ordered data
structure: Elements are arranged in ascending order by key. We can exploit
this fact when iterating the list and restarting the loop. By simply storing
the last key we successfully processed, when restarting the loop, we can just
skip all keys that are not greater than the last key we successfully processed.

In addition to this, the MONO_LLS_FOREACH_SAFE macro now assists in freeing
removed elements that it encounters, just like mono_lls_find ().

The end result is that MONO_LLS_FOREACH_SAFE is now truly safe to use at any
point. It does have the potential to be ever so slightly slower, however, since
it does do significantly more work than it used to, and might even have to
restart the loop multiple times if lots of threads are modifying the thread
list at the same time. This doesn't seem to be a problem in practice, though.

Finally, to reduce the maintenance burden, the non-filtered versions of the
macros are now implemented in terms of the filtered versions, using a static
inline filter function that always returns true. When using the non-filtered
macros, the compiler will just eliminate the check entirely through its usual
optimization passes.
2016-03-03 18:58:11 +01:00
Vlad Brezae e6a85f0e37 [aot] Set null uw_info for tramps without unwind info
We don't register jit infos for tramps that don't have unwind info because we can't unwind from them. Explicitly set uw_info to NULL, instead of pointing to a zero length array in the aot image, to not confuse the runtime when registering the tramp.

Likely to fix #38267
2016-03-02 16:28:46 +02:00
monojenkins bd8f4c9322 Merge pull request #2697 from ludovic-henry/4.4.0-fix-process-waitforexit-objectdisposedexception
[Process] Fix ObjectDisposedException in WaitForExit

We would observe the following exception when running unit tests in the ios sim using `MonoTouch.NUnitLite`:

```
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Threading.ManualResetEvent'.
  at System.Threading.WaitHandle.CheckDisposed () [0x00016] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Threading/WaitHandle.cs:426
  at System.Threading.WaitHandle.WaitOne () [0x00000] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Threading/WaitHandle.cs:349
  at System.Diagnostics.AsyncStreamReader.WaitUtilEOF () [0x0000b] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/System/services/monitoring/system/diagnosticts/AsyncStreamReader.cs:295
  at System.Diagnostics.Process.WaitForExit (Int32 milliseconds) [0x0008f] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System/System.Diagnostics/Process.cs:1400
  at System.Diagnostics.Process.WaitForExit () [0x00000] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System/System.Diagnostics/Process.cs:1373
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:WaitForExit ()
  at SimpleListener+<Main>c__AnonStorey1.<>m__1 (System.Object v) [0x00317] in /Users/alan/Projects/md-addins/Xamarin.Designer.iOS/external/Touch.Unit/Touch.Server/Main.cs:342
  at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x0000e] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/threadpool.cs:1307
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x0008d] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/executioncontext.cs:957
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x00000] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/executioncontext.cs:904
  at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x0002a] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/threadpool.cs:1284
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/threadpool.cs:857
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/threadpool.cs:1212
```

This is the simplest solution we could come to, as changing the behaviour of WaitForExit could involve more changes at the different places where `Process.WaitForExit (timeout)` is used.

The behaviour of Process imported from referencesources (as in master) is to not wait on the StandardOutput and StandardError to finish when passing a timeout to WaitForExit.

@monojenkins merge
2016-03-02 13:45:24 +00:00
Miguel de Icaza 7770133d8b [Mainsoft] Remove deprecated code: the Mainsoft code has not been maintained in years 2016-03-01 15:46:16 -05:00
Dean Ellis 5b47a3181a [msbuild] Getting build error "Error initializing task XmlPeek: Not registered task XmlPeek".
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38638

Removes the uses of LogXXXFromResources from XmlPeek because
we do not use string resources in xbuild.
2016-03-01 11:05:43 +00:00
Ludovic Henry 089c47f1c0 [threads] Fix mono_thread_info_sleep overflow
This overflow would happen of the machine was up for more than 29 days, leading to an overflow in the value returned by mono_100ms_ticks.

The simplest solution is simply to resort to mono_100ns_ticks which would only overflow after more than 29247 years. So even the platform implement this value as the time since 0000-00-00 00:00:00, we still have more than 27000 years if front of us. It's also highly unlikely that we would overflow the `end' value when adding `ms', as that would mean we are in the last 29 days of that 29247 years.
2016-03-01 11:03:50 +00:00
Alexander Köplinger ef8ee28490 [System.Security] Fix CryptographicException from ProtectedData.Protect with multiple threads
The code in ManagedProtection.GetKey() instantiated a new RSACryptoServiceProvider singleton without proper
locking to avoid multiple threads running the initialization concurrently.
Since RSACryptoServiceProvider (or rather KeyPairPersistence underneath) uses an XML file with a name derived
from the parameters to store the data there could be a case where one thread writes while another tries to read
and gets garbage. This results in a CryptographicException later on.

Added locking to prevent this.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38933

(cherry picked from commit 70cb5fdd9f)
2016-03-01 11:18:01 +01:00
Arturo Espinosa 3c7a0203ee Don't trim TimeZone names ending in parenthesys.
Such as "Central Standard Time (Mexico)"

(cherry picked from commit 33332daa00)
2016-03-01 11:18:01 +01:00
Rolf Bjarne Kvinge 3f5bd28dbc [corlib] Fix tests to compile when Thread.Suspend/Resume is not supported. 2016-02-29 19:02:33 +01:00
Ludovic Henry 4a7437e006 [Process] Fix ObjectDisposedException in WaitForExit
We would observe the following exception when running unit tests in the ios sim using `MonoTouch.NUnitLite`:

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Threading.ManualResetEvent'.
  at System.Threading.WaitHandle.CheckDisposed () [0x00016] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Threading/WaitHandle.cs:426
  at System.Threading.WaitHandle.WaitOne () [0x00000] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Threading/WaitHandle.cs:349
  at System.Diagnostics.AsyncStreamReader.WaitUtilEOF () [0x0000b] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/System/services/monitoring/system/diagnosticts/AsyncStreamReader.cs:295
  at System.Diagnostics.Process.WaitForExit (Int32 milliseconds) [0x0008f] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System/System.Diagnostics/Process.cs:1400
  at System.Diagnostics.Process.WaitForExit () [0x00000] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System/System.Diagnostics/Process.cs:1373
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:WaitForExit ()
  at SimpleListener+<Main>c__AnonStorey1.<>m__1 (System.Object v) [0x00317] in /Users/alan/Projects/md-addins/Xamarin.Designer.iOS/external/Touch.Unit/Touch.Server/Main.cs:342
  at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x0000e] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/threadpool.cs:1307
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x0008d] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/executioncontext.cs:957
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x00000] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/executioncontext.cs:904
  at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x0002a] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/threadpool.cs:1284
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/threadpool.cs:857
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/threadpool.cs:1212

This is the simplest solution we could come to, as changing the behaviour of WaitForExit could involve more changes at the different places where `Process.WaitForExit (timeout)` is used.

The behaviour of Process imported from referencesources (as in master) is to not wait on the StandardOutput and StandardError to finish when passing a timeout to WaitForExit.
2016-02-29 16:50:20 +00:00
Martin Baulig a7ab399d09 [System]: Properly propagate exceptions in 'MonoTlsStream'. 2016-02-28 21:27:47 -05:00
Steffen Kieß 5feb19a2af Fix typo in JsonValue which broke the conversion to uint and add test case
(cherry picked from commit 314568184c)
2016-02-29 00:08:04 +01:00
Zoltan Varga 9a8067719c Fix the build. 2016-02-28 15:34:51 +01:00
Martin Baulig 76e0f64862 [System]: Copy 'ServicePoint.Certificate' and 'ClientCertificate' from the referencesource. 2016-02-27 22:16:33 -05:00
Ludovic Henry a26371d320 Merge pull request #2669 from ludovic-henry/4.4.0-fix-process-39046
[4.4.0][Process] Avoid process native handle use-after-dispose in Exited callback
2016-02-26 15:07:34 +00:00
Alexander Köplinger 7ba6a80cf2 [scripts] Point scripts like nunit-console2/mono-service2 to the 4.5 directory
The 2.0 profile doesn't ship with Mono anymore. To avoid breaking existing scripts we just point to the 4.5 version instead.

(cherry picked from commit cae295aca4)
2016-02-26 15:47:29 +01:00
Mikhail Filippov 5bf53f02df Add generation WepApplication.targets for v12.0 and v14.0 xbuild.
(cherry picked from commit 6b257ea753)
2016-02-26 01:24:24 +01:00
Martin Baulig 8c1ffe78cc [jit]: Correctly restore callee saved registers in mono_arch_get_call_filter() on amd64. 2016-02-25 15:47:40 -05:00
João Matos 6b50adcad2 Fixed the build. 2016-02-25 18:30:08 +00:00
João Matos 618c040e4f [support/zlib] Added API exports to exported calls from zlib-helper.c.
This is so we can re-use this code from libmonodroid, which currently has its own duplicated copy.
2016-02-25 17:42:53 +00:00
João Matos 96e2977281 [support/zlib] Remove eglib link dependencies from zlib-helper.c.
This is so we can re-use this code from libmonodroid, which currently has its own duplicated copy.
2016-02-25 17:42:52 +00:00
Ludovic Henry 8f159df5f5 [WaitHandle] Fix Wait(One|Any|All) and SignalAndWait with timeout
In the case where we would call for example WaitHandle.WaitOne with a timeout, we could run in the case where we would wait way longer than the timeout would allow it (240s instead of 90s for example). This would be due to spurious wake, which would not be considered to be an error, but which would lead calling the `mono_os_cond_timedwait` function with the same timeout every time. That would mean that `mono_os_cond_timedwait` would return that it timedout, if and only if, it would timed out after N milliseconds, with N the millisecondsTimeout parameter to WaitOne in this example. That mean that any spurious wake would effectively lead to rewaiting with a full timeout every time.

That could lead to the following scenario:
 - T1 calls waitHandle.WaitOne(timeout = 1000ms) at T=0ms
 - T1 calls mono_os_cond_timedwait(timeout = 1000) at T=0ms
 - GC suspend T1 at T=500ms <- here it's not necessarily the GC, it can be anything suspending/signaling the thread
 - T1 spurious wake, and call mono_os_cond_timedwait(timeout = 1000) at T=500ms
 - GC interrupt T1 at T=1250ms
 - T1 spurious wake, and call mono_os_cond_timedwait(timeout = 1000) at T=1250ms
 - etc.

As you can see, T1 should have returned from waitHandle.WaitOne before the second spurious wake, but as it recalled mono_os_cond_timedwait with a timeout of 1000ms again, it didn't.

The fix consists in keeping track of when the call is supposed to finish, and pass an adaptable timeout to mono_os_cond_timedwait, which decreases as time goes on, to enventually reach 0, and return in a timely manner.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38382
2016-02-25 16:29:09 +00:00
Marek Safar 3eb84b0b77 [mcs] escaped quoted interpolated format specifier has no restrictions. Fixes #38992 2016-02-23 13:50:01 -08:00
Ludovic Henry e7c6678b27 [Process] Avoid process native handle use-after-dispose in Exited callback
There is a race condition between the call to Dispose, and the background thread launched for the Exited event. It can lead to the following SIGABRT:

```
Bad call to pthread_cond_broadcast result 22 for handle 0x4c2
* Assertion at ../../mono/io-layer/handles-private.h:154, condition `thr_ret == 0' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Diagnostics.Process.WaitForExit_internal (System.Diagnostics.Process,intptr,int) <IL 0x00015, 0x00074>
  at System.Diagnostics.Process/<StartBackgroundWaitForExit>c__AnonStorey0.<>m__0 (object) [0x00000] in /private/tmp/source-mono-4.3.2/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System/System.Diagnostics/Process.cs:1587
  at System.Threading.ThreadHelper.ThreadStart_Context (object) [0x0002c] in /private/tmp/source-mono-4.3.2/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/thread.cs:72
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x0008d] in /private/tmp/source-mono-4.3.2/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/executioncontext.cs:957
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /private/tmp/source-mono-4.3.2/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/executioncontext.cs:904
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x00031] in /private/tmp/source-mono-4.3.2/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/executioncontext.cs:893
  at System.Threading.ThreadHelper.ThreadStart (object) [0x00012] in /private/tmp/source-mono-4.3.2/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/thread.cs:87
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <IL 0x00053, 0x000ed>

Native stacktrace:

	   0   mono64                              0x000000010080a2ba mono_handle_native_sigsegv + 282
   	   1   libsystem_platform.dylib            0x00007fff91219f1a _sigtramp + 26
   	   2   mono64                              0x0000000100ae5619 tmp_dir + 3017
   	   3   libsystem_c.dylib                   0x00007fff980669b3 abort + 129
   	   4   mono64                              0x00000001009b2efd monoeg_log_default_handler + 125
   	   5   mono64                              0x00000001009b30c0 monoeg_assertion_message + 192
   	   6   mono64                              0x000000010098e2f9 process_wait + 1769
   	   7   mono64                              0x0000000100996eda wapi_WaitForSingleObjectEx + 186
   	   8   mono64                              0x00000001008eafad ves_icall_System_Diagnostics_Process_WaitForExit_internal + 61
  	   9   ???                                 0x00000001053f7b45 0x0 + 4383013701
	   10  mscorlib.dll.dylib                  0x00000001029410b1 System_Threading_ExecutionContext_Run_System_Threading_ExecutionContext_System_Threading_ContextCallback_object_bool + 33
	   11  mono64                              0x0000000100761520 mono_jit_runtime_invoke + 1776
   	   12  mono64                              0x0000000100920c62 mono_runtime_invoke + 130
   	   13  mono64                              0x00000001008f9ff3 start_wrapper + 659
   	   14  mono64                              0x00000001009aba08 inner_start_thread + 312
   	   15  libsystem_pthread.dylib             0x00007fff8cbc805a _pthread_body + 131
   	   16  libsystem_pthread.dylib             0x00007fff8cbc7fd7 _pthread_body + 0
  	   17  libsystem_pthread.dylib             0x00007fff8cbc53ed thread_start + 13
```

The race happens as follow:
 1. T1 : process.EnabledRaisingEvents = true
 2. T1 : process.Start ()
 3. T1 :  process.StartBackgroundWaitForExit () -> launch T2
 4. T1 : process.Dispose ()
 5. T2 : WaitForExit_internal (process_handle)

At step 4, Dispose called Process_free_internal which destroys the handle, and thus its io-layer signal condition variable. Then at step 5, it tries to wait on that previously destroyed handle's io-layer signal condition variable.

By using a SafeProcessHandle, we guarantee that at all time of use, the handle is still a valid one, and has not been destroyed.
2016-02-23 17:55:40 +00:00
Alexander Köplinger 7613767496 [System] Fix error in new BeginConnectToIPV4EndPointUsingDualModelSocket test
It was added with 78c758494a. The test fails on Jenkins:

```
Test Case Failures:
1) MonoTests.System.Net.Sockets.SocketTest.BeginConnectToIPV4EndPointUsingDualModelSocket : System.InvalidOperationException : EndConnect can only be called once per asynchronous operation
at System.Net.Sockets.Socket.ValidateEndIAsyncResult (IAsyncResult ares, System.String methodName, System.String argName) [0x0004a] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System/System.Net.Sockets/Socket.cs:3412
at System.Net.Sockets.Socket.EndConnect (IAsyncResult result) [0x00006] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System/System.Net.Sockets/Socket.cs:1584
at MonoTests.System.Net.Sockets.SocketTest.BeginConnectToIPV4EndPointUsingDualModelSocket () [0x0005d] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs:4365
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
```

The reason is that BCCallback already calls EndConnect() so we need to remove it and just wait for the callback in the test itself.
2016-02-23 16:26:09 +00:00
Stefan Sedich 135ea40d49 handle automatically mapping IPv4 addresses to IPV6 for dual mode sockets 2016-02-23 16:26:09 +00:00
João Matos 5300a4c305 [System.IO.Compression.DeflateStream] Fixed end condition in decompression loop.
Keep track of total bytes read from input stream and break from the loop if it matches the number of bytes inflated by zlib.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=34916.
2016-02-23 16:11:15 +00:00
Alexander Köplinger c8da3a8c2a [msvc] %PATH% is sometimes empty in Jenkins, so "powershell" doesn't run
Try using a system-standard default variable which points to the required folder instead.

(cherry picked from commit 22cc7b350e)
2016-02-23 17:06:28 +01:00
Alexis Christoforides 7452477db3 Bump Mono version -> 4.4.0 2016-02-23 09:15:31 -05:00
Joao Matos 3a985d6538 [System.IO.Compression] Fixed re-opening of disposed Zip entry streams.
Fixes System.IO.Compression to work against Microsoft Office OpenXML SDK which depends on this behavior.

Also partial fix for https://bugzilla.xamarin.com/show_bug.cgi?id=33553.
2016-02-22 16:04:16 +00:00
Joao Matos 121e7d9298 [System.IO.Compression] Lower minimum version in ZIP headers for compatibility.
This fixes compatibility with tools like MS Excel, file tool, and others that do not know how to recognize newer ZIP version formats.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=33553.
2016-02-22 16:04:06 +00:00
Zoltan Varga 9331ebc256 [llvm] Allow the llvm backend to work with a new version of the mono llvm fork based on llvm 3.9.
This version is at:
https://github.com/mono/llvm/tree/llvm-master
It has a mono api version starting from 100. Currently, using LLVM in JIT mode is not supported, only AOT.
2016-02-21 23:04:11 -05:00
Aleksey Kliger (λgeek) 82863f05bf Merge pull request #2658 from lambdageek/dev-4.3.2/bug-38600
[4.3.2][mkbundle] Support spaces, strange symbols in assembly names
2016-02-19 17:50:35 -05:00
Aleksey Kliger 9d61150526 [mkbundle] Support spaces, strange symbols in assembly names
In the asm stubs, replace everything that isn't a-zA-Z0-9_ by an underscore.

Sprinkle quotes in commandline args when running the linker.

Fixes [Bugzilla #38600](https://bugzilla.xamarin.com/show_bug.cgi?id=38600)
2016-02-19 17:46:41 -05:00
Marek Safar 5ff8055fa8 [bcl] Add workaround for csc bug 2016-02-19 16:12:07 +01:00
Zoltan Varga af811230fc [runtime] Avoid a crash when trying to load a non-assembly file as an assembly. Fixes #38825. 2016-02-18 23:33:55 -05:00
Martin Baulig dd9d66a7c2 [System]: In 'WebConnection.EndWrite()': always call EndWrite() on the underlying socket. 2016-02-18 17:44:55 -05:00
Jo Shields d8eb381e0f Use X509 serial number in Mono cert store filename
The Mono cert store traditionally uses the SKI for the filename of a certificate, but this does not handle cases where a cert has been reissued with the same SKI but different serial (seen in the wild with StartCom certs). This patch appends the serial to all new imported certs, and attempts to interoperate cleanly with existing serial-less certificate stores to avoid duplication.

Closes: #30902
(cherry picked from commit 1c621b0e33)
2016-02-18 12:11:14 +00:00
Martin Baulig 905088bb90 Bump Makefile to trigger full build. 2016-02-17 20:35:10 -05:00
Martin Baulig e69e878405 [System]: 'ServicePointManager.CertificatePolicy': lazily initialize.
The internal GetLegacyCertificatePolicy() now returns null unless this
property has explicitly been assigned to, so the legacy handler will not
be used in ChainValidationHelper.
2016-02-17 20:32:56 -05:00
Martin Baulig c871ff63ff [Mono.Security]: Make 'MonoTlsSettings.UseServicePointManagerCallback' a 'bool?'.
The default value is 'true' when using HttpWebRequest, but false when using SslStream
directly.
2016-02-17 20:32:56 -05:00
Martin Baulig 08e3a4120c [System]: 'HttpWebRequest.Proxy' - update ServicePoint on assignment. 2016-02-17 18:36:30 -05:00
Martin Baulig acf6c4bd37 [System]: Properly propage exceptions in HttpWebRequest.BeginGetResponse(). 2016-02-17 18:36:30 -05:00
Martin Baulig e734cd8b59 [System]: Disallow "https" proxies in ServicePointManager.FindServicePoint(). 2016-02-17 18:36:30 -05:00
Chris Hamons ef974eba6a Prepare XM for Http additions 2016-02-17 14:21:10 -06:00
João Matos 2e2e56cb39 [man] Updated Mono man page with AOT gen-seq-points-file option. 2016-02-17 17:41:48 +00:00
João Matos ba2e5e42f3 [aot] Remove debugging print. 2016-02-17 17:18:06 +00:00
João Matos d47dfa8b51 [aot] Reworked sequence points file AOT option to allow an explicit path passed.
This will be used to fix msym files being overwritten per ABI compilation in AOT compilation driven by Monodroid.
2016-02-17 16:06:05 +00:00
Radek Doulik dd8adb39c3 [linker] do not set scope of non-marked typerefs
- fixes #38818

 - setting the *unchanged* scope to non-marked types is harmful,
   because in case the type has declaring type, the scope of declaring
   type is set as well. see
   https://github.com/mono/cecil/blob/master/Mono.Cecil/TypeReference.cs#L132

   public virtual IMetadataScope Scope {
      get ...
      set {
          var declaring_type = this.DeclaringType;
          if (declaring_type != null) {
              declaring_type.Scope = value;
              return;
          }
          scope = value;
      }
   }

   so in our case, we first set correctly scope of
   System.Collections.Generic.Dictionary`2 to mscorlib, then (re)set
   scope of System.Collections.Generic.Dictionary`2/ValueCollection
   and
   System.Collections.Generic.Dictionary`2/ValueCollection/Enumerator
   to System.Collection (note that these types are not marked and are
   swept away by linker), which sets scope of its declaring type
   System.Collections.Generic.Dictionary`2 back to System.Collection

   and because the System.Collection is linked-out, the typeref is
   incorrectly written with the scope set to System later
2016-02-16 22:43:27 +01:00
Martin Baulig ddf47829d9 [System]: Use correct default value for ServicePointManager.SecurityProtocol. 2016-02-16 15:50:56 -05:00
Marek Safar db51ade40a [mcs] Add more known sdk paths redirections 2016-02-16 17:40:24 +01:00
Alexander Köplinger 7fb11e54c7 [perfcounters] Fix calculation of free memory in mono_determine_physical_ram_available_size ()
The implementation added in b5d0ffe7dd forgot to multiply vmstat.free_count (== number of free pages)
by the page size in the __APPLE__ case, making the reported number much smaller than the reality.

(cherry picked from commit 335ad88ff5)
2016-02-16 17:07:03 +01:00
Marcos Henrich 8681a9efc5 Merge pull request #2617 from esdrubal/mono-4.3.2-branch
[System.ServiceModel] Fixes missing xsi xsd attributes
2016-02-15 17:47:29 +00:00
Alexander Köplinger f7b1a38f7d [msvc] Update order.xml, csproj files and .def files 2016-02-15 18:42:54 +01:00
Marcos Henrich 96e0145891 Merge pull request #2618 from esdrubal/headfix-4.3.2
[System] Fix extra head in config bug.
2016-02-15 16:47:19 +00:00
Alexander Köplinger 61f5d4c10a [io-layer] Add Get/SetThreadPriority to wapi-remap.h
The new functions were added in d5768a7f14 but not remapped.

(cherry picked from commit 6c355350fc)
2016-02-15 15:24:07 +01:00
Jo Shields 939377b20a Don't remap all versions of Npgsql to 4.0.0.0
Mono has a list of assemblies considered "internal", whose versions are automatically remapped to the distro default version.

Since we no longer bundle Npgsql, it is up to individual distributions to package their own Npgsql - but Mono cannot load any version other than 4.0.0.0 from the GAC, due to this remapping:

Mono: Assembly Ref addref npghello[0x17e2fd0] -> mscorlib[0x1789c00]: 2
Mono: The request to load the assembly Npgsql v2.2.7.0 was remapped to v4.0.0.0
Mono: Assembly Loader probing location: '/usr/lib/mono/gac/Npgsql/4.0.0.0__5d8b90d52f46fda7/Npgsql.dll'.

Npgsql, Version=2.2.7.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7

(cherry picked from commit ffa6818b96)
2016-02-15 15:24:02 +01:00
Alexander Köplinger 7a53204f66 [genproj] Fix bashism in library.make
This was added in 2687866e99, but on systems where /bin/sh (which make uses by default) isn't bash this doesn't work.

Fix is to use a standard switch-case which works in all shells.

(cherry picked from commit 4b041deaba)
2016-02-15 15:07:28 +01:00
Marcos Henrich d642444ee6 Bumping reference source to correct branch.
referencesource/mono contains some changes that are not compatible with
mono-4.3.2-branch. Bumping to referencesource/mono-4.3.2-branch.
2016-02-15 14:02:59 +00:00
Marcos Henrich 1eb169d3f6 Bumps reference source for fixes. 2016-02-15 12:44:50 +00:00
Marcos Henrich 959c6de742 [System] Removed dead code. 2016-02-15 12:27:46 +00:00
ArsenShnurkov 61edf782f9 [System] Fix extra xml header in configs.
Fixes #36388.
2016-02-15 12:27:46 +00:00
Marcos Henrich 125c0e99e1 [System] Test configuration extra xml headers bug
Covers #36388
2016-02-15 12:27:45 +00:00
Marcos Henrich ef7f3975c5 [System.Configuration] Fix exception on bad xml.
When XmlException is thrown while loading the configuration file,
the XmlException should be encapsulated into a ConfigurationErrorsException.
2016-02-15 12:27:45 +00:00
Marcos Henrich 7055704ed9 [System.Configuration] Test bad xml loading.
When ConfigurationManager.OpenMappedMachineConfiguration loads broken
xml ConfigurationErrorsException should be trown instead of
XmlException.
2016-02-15 12:27:44 +00:00
Marcos Henrich c8e9b18fc7 [System.ServiceModel] Test XmlAttributes
Tests that ClientBase is handling XML attributes correctly.

Covers #34413.
2016-02-15 12:13:49 +00:00
Marcos Henrich 67986bd306 [ServiceModel] Fixes missing xsi xsd attributes
While serializing operations with XmlSerializerFormatAttribute,
attributes xmlns:xsi and xmlns:xsd were not added to the message body.

XmlBodyWriter now adds the missing attributes.

Fixes #34413.
2016-02-15 12:13:48 +00:00
Alexander Köplinger 625e60e0b4 [corlib] Add missing semicolon in StringTest
(cherry picked from commit cd36778d5e)
2016-02-14 02:43:01 +01:00
monojenkins 6d5c1dd966 Merge pull request #2614 from xmcclure/largestring-4.3.2
Backport PR#2612 to 4.3.2

#2612 
This bug is interfering with testing of the 4.3.2 branch.
2016-02-13 06:20:29 +00:00
Aleksey Kliger (λgeek) 18ef7d9a0b Merge pull request #2601 from lambdageek/dev-4.3.2/bug-38222
[4.3.2][reflection] Set pending loader exception in mono_reflection_get_custom_attrs_data
2016-02-12 14:53:41 -05:00
monojenkins 619f48b58b Merge pull request #2607 from lambdageek/dev-4.3.2/bug-38408
[4.3.2][io] Release Pipe and Console shared handles

(Backport #2605 to mono-4.3.2-branch)

Fixes [Bugzilla #38408](https://bugzilla.xamarin.com/show_bug.cgi?id=38408)

Allows opening a character device or named fifo more than once with code like:

```csharp
    using (var f = new FileStream ("/dev/zero", FileMode.Open))
    {
       ...
    }
    using (var f = new FileStream ("/dev/zero", FileMode.Open))
    {
       ...
    }
```
2016-02-12 19:36:05 +00:00
Martin Baulig 65afb9f640 [System]: Clone the X509Certificate instance that's stored in ServicePoint. 2016-02-12 14:30:43 -05:00
Andi McClure 5b8bdc44b6 Use Assert.Ignore for insufficient-memory test skips 2016-02-12 14:26:50 -05:00
Andi McClure 2f39e259f3 Do not run 4GB string tests on low memory systems (fixes #38392)
"Low memory" here is defined as 32-bit, less than 6GB of physical RAM,
or mobile (since mobile lacks the class for querying physical RAM).
2016-02-12 13:56:20 -05:00
Aleksey Kliger 35043d00e4 [io] Don't leak Pipe filename
Named FIFOs do indeed have names, but pipe_close doesn't free
it.  (Because CreatePipe doesn't set a filename).
2016-02-12 10:15:15 -05:00
Aleksey Kliger f4d981cf03 [io] Release Pipe and Console shared handles
Allows opening a character device or named fifo more than once with code like:

  using (var f = new FileStream ("/dev/zero", FileMode.Open))
  {
    ...
  }
  using (var f = new FileStream ("/dev/zero", FileMode.Open))
  {
    ...
  }
2016-02-12 10:15:09 -05:00
Aleksey Kliger fcdc920ddc [io] Test repeatedly opening a character device
Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=38408
2016-02-12 10:14:57 -05:00
Zoltan Varga 78ca023824 [jit] Fix the bblock linking in c5512c0d3e. 2016-02-11 23:06:03 -05:00
Martin Baulig 2026a0b408 [Mono.Security]: Make 'Mono.Security.Protocol.Ntlm' public and include in System.dll on mobile. 2016-02-11 17:51:07 -05:00
Aleksey Kliger ed2eeebef1 [reflection] Set pending loader exception in mono_reflection_get_custom_attrs_data
Fixes [Bugzilla 38222](https://bugzilla.xamarin.com/show_bug.cgi?id=38222)

While we're at it, convert mono_reflection_get_custom_attrs_data to use
MonoError, runtime should use
mono_reflection_get_custom_attrs_data_checked
2016-02-11 11:08:31 -05:00
Dean Ellis 17fda960fe [msbuild] Registered the XmlPeek Build Task in the Microsoft.Common.tasks
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=36183
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38638

The previous commit () was incomplete, while it added the source
file for XmlPeek it did not register them in the appropriate
MSBuild tasks files. As a result the XmlPeek task cannot be used.
2016-02-11 15:27:33 +00:00
Zoltan Varga b473fbf965 [aot] Fix the check in mono_aot_get_plt_entry () for thumb code, use 'code-4' instead of 'code', since the latter points to after a call, so it could point outside the range of llvm code. Fixes #36723. 2016-02-11 01:14:38 -05:00
Zoltan Varga 9f44a62acf [jit] Add a fastpath to Monitor.Enter () which doesn't have a wrapper, and add a slowpath which has a wrapper, so async stack traces work for threads blocked on monitors. Fixes #38525. 2016-02-10 21:28:19 -05:00
Zoltan Varga 19f5183be3 [jit] Fix the peephole optimization added by 9fc7c1de3a, compare_imm+cond_exc_imm can only be eliminated if the comparison is false. 2016-02-10 20:09:36 -05:00
Martin Baulig 7f965e8220 [Mono.Security]: MonoTlsProviderFactory.GetProvider(string) now returns null on error. 2016-02-10 18:14:07 -05:00
Alexander Köplinger e34fe7182c [metadata] Fix Facades lookup in assembly.c when MONO_PATH is set
When MONO_PATH is set, the corlib lookup returns early on in mono_assembly_load_corlib (),
without adding the Facades dir to default_path.

This causes any app/library that relies on the facades to fail at runtime.

Fixing this by always doing the Facades lookup when returning the found corlib image.

(cherry picked from commit 6e81edfa24)
2016-02-10 23:55:50 +01:00
Alex Rønne Petersen 21cd9994e7 [profiler] Remove perf_event.h from EXTRA_DIST, too. 2016-02-10 23:09:02 +01:00
Alex Rønne Petersen d220cbd99b [profiler] Only include perf_event.h when actually needed, and use the system header. 2016-02-10 22:34:36 +01:00
Alex Rønne Petersen 8c6f3ca593 [profiler] Remove the bundled perf_event.h header.
Bundling this in Mono is technically a GPL violation. We need to switch to the
system <linux/perf_event.h> header.
2016-02-10 22:27:16 +01:00
Marek Safar 664c608478 [swf] Flow SynchronizationContext through ExecutionContext. Fixes #38599 2016-02-10 20:28:42 +01:00
Marek Safar ba95f00ec5 [corlib] Use correct max/min value for DateTime overflows. Fixes #35876 2016-02-10 03:24:15 -06:00
Zoltan Varga 3cde89c4da [jit] Add a peephole optimization to remove the ldaddr+compare_imm 0+cond_exc checks inserted when using explicit null checks. 2016-02-10 01:59:41 -05:00
Zoltan Varga 5905ff2618 [llvmonly] Disable the 'overriding the module target triple with' clang warning when compiling the bitcode files. 2016-02-10 01:11:02 -05:00
Alex Rønne Petersen 90e2692d69 [runtime] Add SA_RESTART to SIG{CONT,INT,PROF,QUIT,USR2,WINCH}.
We need this as these signals can be delivered at any point and can interrupt
system calls that external (non-Mono) code is executing, which such code may
not be written to handle gracefully.
2016-02-10 06:57:51 +01:00
Alex Rønne Petersen 1fb554d7ed [profiler] Fix a rare crash when sending SIGPROF to a starting thread.
When sample profiling is enabled and we send a SIGPROF signal to a thread that
hasn't yet transitioned to a running state (e.g. STATE_RUNNING), the signal can
sometimes be delivered at such an early point that libc has not even finished
initializing TLS for that thread yet. This is problematic because we then go
right on to crash in the SIGPROF signal handler when we try to save errno. We
then further crash in the SIGSEGV handler because we can't access the jit_tls
variable either.

The fix is fairly simple: Only send SIGPROF to threads that have transitioned
to a running state. Technically, TLS is initialized 'much' earlier than when
this state transition happens, but since the worst thing that can happen is
that we miss one sampling event (i.e. ~1sec by default) right at the beginning
of the thread's lifetime, this simple fix is good enough.

This crash seemingly only happened on OS X.
2016-02-10 06:57:46 +01:00
Zoltan Varga a02ad3af61 [llvm] When storing valuetypes received in registers to the stack, store only the value parts of the register, the upper bits might container garbage. 2016-02-09 22:41:46 -05:00
Zoltan Varga 8205e22ba8 [llvmonly] Fix the locking in the gsharedvt wrapper creation functions. 2016-02-09 21:56:01 -05:00
monojenkins 198028586b Merge pull request #2581 from ludovic-henry/4.3.2-fix-asyncresult-unhandledexception
[4.3.2][AsyncResult] Fix unhandled exception behaviour in AsyncCallback

The AsyncCallback is called after the BeginInvoke has completed. In all cases, this AsyncCallback is called on the ThreadPool, meaning that an unhandled exception would lead to a process crash.

The correct behaviour, after verification on .NET, is to not swallow the exception, and to properly crash the process.

@monojenkins merge
2016-02-10 01:00:32 +00:00
Martin Baulig 024241f424 [Mono.Security]: Add 'MonoTlsProviderFactory.GetProvider(string)'.
Similar to 'SetDefaultProvider(string)', but return the provider instead
of installing it.
2016-02-09 19:38:09 -05:00
monojenkins d979cff046 Merge pull request #2583 from ludovic-henry/4.3.2-fix-threadpool-starvation
[4.3.2][threadpool] Improve the monitor thread heuristic

Because the ThreadPool heuristic is optimized for short lived work item, it has more difficulty when executing long lived work item. That case can lead to a starvation of the worker threads: they are all doing work, while there is outstanding request, and these requests are not satisfied because we reached the max number of working thread.

To fix that issue, we have the monitor thread, whose sole job is to unstuck this kind of starvation cases. Unfortunately, it only works when all the worker threads are in the ThreadState.WaitSleepJoin state, which excludes the case of calling an IO operation in a Task. That includes the case of FileStream.BeginRead/Write/... which implementation can be simplified as follows: FileStream.BeginRead(...) -> Task.Run(() => FileStream.Read(...)).

The way we implement it in this commit is: every MONITOR_INTERVAL (500ms here), we check if there is any outstanding request, and if so, we assume that we are in the starvation case, and we simply increase the max number of working thread. Also to reduce the number of false positives, we do that only if there has been no completed work item for more than at least MONITOR_INTERVAL (in case of low CPU usage, more otherwise, see monitor_sufficient_delay_since_last_dequeue). This case is typically the case where we have all working thread stuck in long running work items.

Finally we increase the monitor interval from 100ms to 500ms so we guarantee we do not create more than 2 threads per second in the monitor thread. That is the value used by the old threadpool.
2016-02-09 23:00:27 +00:00
Ludovic Henry f1cfd85041 [threadpool] Improve the monitor thread heuristic
Because the ThreadPool heuristic is optimized for short lived work item, it has more difficulty when executing long lived work item. That case can lead to a starvation of the worker threads: they are all doing work, while there is outstanding request, and these requests are not satisfied because we reached the max number of working thread.

To fix that issue, we have the monitor thread, whose sole job is to unstuck this kind of starvation cases. Unfortunately, it only works when all the worker threads are in the ThreadState.WaitSleepJoin state, which excludes the case of calling an IO operation in a Task. That includes the case of FileStream.BeginRead/Write/... which implementation can be simplified as follows: FileStream.BeginRead(...) -> Task.Run(() => FileStream.Read(...)).

The way we implement it in this commit is: every MONITOR_INTERVAL (500ms here), we check if there is any outstanding request, and if so, we assume that we are in the starvation case, and we simply increase the max number of working thread. Also to reduce the number of false positives, we do that only if there has been no completed work item for more than at least MONITOR_INTERVAL (in case of low CPU usage, more otherwise, see monitor_sufficient_delay_since_last_dequeue). This case is typically the case where we have all working thread stuck in long running work items.

Finally we increase the monitor interval from 100ms to 500ms so we guarantee we do not create more than 2 threads per second in the monitor thread. That is the value used by the old threadpool.
2016-02-09 19:56:12 +00:00
Ludovic Henry f774f96e05 [AsyncResult] Fix unhandled exception behaviour in AsyncCallback
The AsyncCallback is called after the BeginInvoke has completed. In all cases, this AsyncCallback is called on the ThreadPool, meaning that an unhandled exception would lead to a process crash.

The correct behaviour, after verification on .NET, is to not swallow the exception, and to properly crash the process.
2016-02-09 11:04:53 +00:00
Alexander Köplinger c4a03267f4 [metadata] Fix hardcoded mono/2.0 path in assembly.c
The performance team discovered this on their bots using the Jenkins snapshot packages. Mono would fail to start with a message like:

```
The assembly mscorlib.dll was not found or could not be loaded.
It should have been installed in the `/opt/mono-2016.02.08+15.25.39/lib/mono/4.5/mscorlib.dll' directory.
```

The one odd thing is that they are using Mono installed in a path which is different from the prefix used during compilation.

It turns out that the runtime has a hardcoded check for lib/mono/2.0 in https://github.com/mono/mono/blob/7d5a7ea7ac324bb4ee63094ddcf8e20ae9ba4322/mono/metadata/assembly.c#L633-L637.
Since we recently stopped shipping 2.0 in the packages (we moved to 2.0-api for the reference assemblies) this directory wasn't there,
so the code in fallback() called into mono_config_get_assemblies_dir() which just returns the MONO_ASSEMBLIES preprocessor symbol.

That preprocessor symbol is defined to the value of --prefix during compilation, so Mono couldn't find corlib there as well since it's installed in another path which ultimately results in the above error message.

The fix is to change the hardcoded value to 4.5, which is what we established as the directory with the "latest" assemblies now.
Ideally we should find a way to stop hardcoding those paths in the runtime.

PS: I grepped through the runtime source to make sure we don't hardcode 2.0/3.5/4.0 elsewhere and only found one instance in a test.
I fixed it there as well, though the test looks suspicious since it hardcodes /usr ...

(cherry picked from commit 769037d8b1)
2016-02-09 02:33:40 +01:00
Zoltan Varga f48bb4bfb5 [llvmonly] Compile the bitcode files using -O2. 2016-02-08 20:02:26 -05:00
Zoltan Varga b564c16226 [llvmonly] Add unbox wrappers when invoking vtype instance methods through a delegate. 2016-02-08 20:02:19 -05:00
Rolf Bjarne Kvinge 9b0491d2b3 [System] Fix test build on tvOS/watchOS. 2016-02-08 10:24:47 +01:00
Zoltan Varga b5a3a169df [llvmonly] Disable tail calls as they break stack traces. 2016-02-08 03:08:26 -05:00
Zoltan Varga c0a692eb5c [llvm] Make the stack walk code return. 2016-02-08 03:08:19 -05:00
Zoltan Varga fbb984af9b [llvmonly] Compile the bitcode files using -O2 (only in desktop llvmonly mode). 2016-02-08 03:08:11 -05:00
Zoltan Varga bf3cd4557d [llvmonly] Remove the mono_llvmonly_get_calling_assembly () workaround since stack walks work in llvmonly mode now. 2016-02-06 02:01:04 -05:00
João Matos f0298e5a2c [aot] Fixed compiler to wrap paths with embedded spaces when calling external tools.
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=34498.
2016-02-05 17:13:41 +00:00
Rolf Bjarne Kvinge 6f89034001 [corlib] Disable ThreadLocalTests.DisposeOnThreadExit on MonoTouch, it's randomly failing. 2016-02-05 15:34:34 +01:00
Zoltan Varga 82822106d8 [llvmonly] Various small fixes. Make mono_llvm_throw_exception etc. directly callable in static mode. Add support for directly calling pinvoke methods. Fix an assertion during EH. 2016-02-05 02:08:11 -05:00
Zoltan Varga 2612ccb64d [llvmonly] Do a stack walk from mono_llvmonly_get_calling_assembly (), the runtime might support stack walks on some platforms. 2016-02-04 22:45:59 -05:00
Zoltan Varga 40dffe542e [llvmonly] Don't set the invariant.load flag on loads from the GOT, they are initialized by a call to init_method () so they are not completely invariant. 2016-02-04 22:41:02 -05:00
Marek Safar bf6cd183cc [System] Remove explicit sdk target from CSharpCodeCompiler 2016-02-04 16:03:59 +01:00
Ludovic Henry b248963021 [Process] Fix possible double call to Begin(Output|Error)ReadLine
This is not allowed in .NET, as it could lead to unexpected results.
2016-02-04 14:33:17 +00:00
Ludovic Henry 2b81318351 [io-layer] Print from which pipe we just read 2016-02-04 14:33:17 +00:00
Marek Safar 730b4c7fde [mcs] Update sdk profile paths after 88b287f065 2016-02-04 14:10:44 +01:00
Zoltan Varga 162dd58515 [llvm] Zero extend unsigned enum arguments. Fixes #38379. 2016-02-03 18:16:32 -05:00
Ludovic Henry 44b9eff431 [SocketResponder] Use Task instead of Thread
This allow us catching and rethrowing the exception on the main thread, as well as making sure we wait for the Listen thread to finish in a timely manner.
2016-02-03 20:18:30 +00:00
Ludovic Henry 01603cf37b [SocketResponder] Start in constructor and Stop on Dispose
In conjuction with `using` we ensure that we Start and Stop the SocketResponder correctly, and everytime
2016-02-03 20:18:30 +00:00
Ludovic Henry 627772db1c [Tests] Use explicit delegate so it appears in stacktraces
In case of exception in this callback, the name of the test method will appear in the stacktrace, making debugging way easier.
2016-02-03 20:18:30 +00:00
Alexander Köplinger 736c747fdf [binary-reference-assemblies] Add a symlink from 4.0/mscorlib.dll to 4.0-api/mscorlib.dll
Some programs like NUnit check if a file exists there and break otherwise.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38331

(cherry picked from commit a44d3c650c)
2016-02-03 20:17:38 +01:00
Ludovic Henry 7a150f7c84 [test] Use using for TimerTest 2016-02-03 13:54:24 +00:00
Ludovic Henry a900ef987b [tests] Use explicit delegates to get more information from stacktrace 2016-02-03 13:22:28 +00:00
Ludovic Henry cc10f1a009 [coop] Add support for entering/exiting GC safe/unsafe region for products 2016-02-03 12:44:42 +00:00
Ludovic Henry 9dd8285992 [coop] Ensure we exit blocking mode when invoking managed code
mono_runtime_invoke might be called by P/Invoked code, which is in blocking mode. Not switching back to running can lead to a crash when hitting a safepoint.
2016-02-03 12:44:28 +00:00
Zoltan Varga 0df254ddae [llvmonly] Implement support for stack walks if _Unwind_Backtrace () is available. 2016-02-02 19:35:59 -05:00
Zoltan Varga 272336b6a3 [llvmonly] Implement limited support for stack walks so new StackTrace () works. 2016-02-02 19:35:46 -05:00
Marek Safar 20d7b6a558 [corlib] Fixes Environment version for .net 4.6 2016-02-02 22:31:02 +01:00
Alexander Köplinger 02f59bac0c [binary-reference-assemblies] Make sure only .dll files are included in the wildcard
The wildcard `$(wildcard ../../../external/binary-reference-assemblies/v4.5/*)` would include the directory entry `../../../external/binary-reference-assemblies/v4.5/Facades/` which returns an error during "make dist".

Fixing this by including only the .dll files in the wildcards.

(cherry picked from commit f1dad87178)
2016-02-02 14:33:31 +01:00
Alexander Köplinger b11dfd2aff [binary-reference-assemblies] Include 4.5 Facades in tarball
(cherry picked from commit c896d003e5)
2016-02-02 13:59:34 +01:00
Martin Baulig f379b7df51 [Mono.Security.Providers.OldTls]: Don't build on mobile. 2016-02-02 00:45:13 +01:00
Martin Baulig 3e9f79184b Revert "[System]: Include 'OldTlsProvider' on mobile."
This reverts commit eb89783365.
2016-02-02 00:45:13 +01:00
Zoltan Varga 84c32c0c67 [jit] Avoid merging some bblocks which are not after each other when inlining since it can cause the bblock between them to be ignored later. Fixes #38250. 2016-02-01 17:45:39 -05:00
Martin Baulig eb89783365 [System]: Include 'OldTlsProvider' on mobile. 2016-02-01 22:10:00 +01:00
Zoltan Varga b25f5d16ce [arm] Fix a code generation problem when a virtual call is made with a large offset, the offset generation code would overwrite a source register. Fixes #27303. 2016-02-01 14:51:56 -05:00
Zoltan Varga 053f1415ba [aot] Emit gsharedvt wrappers only in llvmonly mode. 2016-02-01 14:28:58 -05:00
monojenkins fd213a6d19 Merge pull request #2539 from ludovic-henry/4.3.2-fix-sgen-38012
[4.3.2][sgen] Fix register scanning on ARM

This bug would trigger a use after sweep in System.Threading.Tasks.Task.FinishContinuations:3621.

The issue would arise on ARM, as `MonoContext` and `ARCH_NUM_REGS` are defined as followed :

```
typedef struct {
  mgreg_t pc;
  mgreg_t regs [16];
  double fregs [16];
  mgreg_t cpsr;
} MonoContext;

\#define ARCH_NUM_REGS 14
```

As you can see, the MonoContext structure is bigger than 14 words, and it does not even covers the last 3 values of `regs`. By using pointer arithmetic, we ensure that we do not miss some parts of the `MonoContext` structure.

The observed behaviour in System.Threading.Tasks.Task.FinishContinuations would be that `continuationObject` would not be marked, and thus freed; `continuationObject` would still contains the pointer to the old location, meaning it wouldn't be null. We would then try to check its type via a call to the `as` operator. This would call the `isinst` IL opcode which would load `continuationObject->vtable->klass->supertypes [...]`, which would trigger a segfault, as `supertypes` would be null.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38012
2016-02-01 17:37:30 +00:00
Marek Safar 6e927b4ce3 [binary-reference-assemblies] Install 4.5 api facades 2016-02-01 12:57:24 +01:00
Martin Baulig 77fa9812f0 [System]: Fix X509Certificate2.Export().
We need to add a 'PKCS9.localKeyId' attribute to both the
certificate and the private key or else SecImportExport.ImportPkcs12()
won't work on iOS.
2016-02-01 01:32:08 +01:00
Zoltan Varga db654d24db [llvmonly] Fix stack trace calculation. 2016-01-29 17:15:25 -05:00
Zoltan Varga db847470a0 [llvmonly] Catch all exceptions in mono_jit_exec () to avoid terminating the runtime with an unhelpful libc++ assertion. 2016-01-29 17:15:18 -05:00
Ludovic Henry 1f3421e78d [sgen] Fix register scanning on ARM
This bug would trigger a use after sweep in System.Threading.Tasks.Task.FinishContinuations:3621.

The issue would arise on ARM, as `MonoContext` and `ARCH_NUM_REGS` are defined as followed :

```
typedef struct {
  mgreg_t pc;
  mgreg_t regs [16];
  double fregs [16];
  mgreg_t cpsr;
} MonoContext;

\#define ARCH_NUM_REGS 14
```

As you can see, the MonoContext structure is bigger than 14 words, and it does not even covers the last 3 values of `regs`. By using pointer arithmetic, we ensure that we do not miss some parts of the `MonoContext` structure.

The observed behaviour in System.Threading.Tasks.Task.FinishContinuations would be that `continuationObject` would not be marked, and thus freed; `continuationObject` would still contains the pointer to the old location, meaning it wouldn't be null. We would then try to check its type via a call to the `as` operator. This would call the `isinst` IL opcode which would load `continuationObject->vtable->klass->supertypes [...]`, which would trigger a segfault, as `supertypes` would be null.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38012
2016-01-29 18:39:04 +00:00
Rolf Bjarne Kvinge 04ac046007 [System.ServiceModel.Internals] Add a missing .sources file for watchOS. Fixes #38145.
https://bugzilla.xamarin.com/show_bug.cgi?id=38145
2016-01-29 12:22:41 +01:00
Marcos Henrich 98f0a7b39a [System.Web] HeadersCollection read only exception
In reference source HttpHeaderCollection [1] when Add, Set or Remove is
called and the collection is readonly a PlatformNotSupportedException is
thrown.

Mono HeadersCollection was throwing NotSupportedException and
Microsoft.Owin.Host.SystemWeb.OwinCallContext.RemoveAcceptEncoding was
not catching the exception because it was expecting
PlatformNotSupportedException.

Fixes #33809

[1] http://referencesource.microsoft.com/#System.Web/HttpHeaderCollection.cs,73
2016-01-29 09:41:09 +00:00
Marcos Henrich 6723b79e3c [System.Web] Test HttpRequest.Headers Add/Set/Remove
In .NET while calling Add, Set or Remove of a HttpRequest read only
collection a PlatformNotSupportedException is thrown.

Covers #33809
2016-01-29 09:41:08 +00:00
Marcos Henrich 03f2ff096a [System.Xml] Fix sub class serialization on lists
Fixes failure, where XmlSerializer would crash while serializing
a list with multiple XmlElement when a sub class of the XmlElement is
used.

Fixes #36829.
2016-01-28 18:02:00 +00:00
Marcos Henrich 6e819dea67 [System.Xml] Test sub class serialization on lists
Covers #36829
2016-01-28 18:02:00 +00:00
Alexander Köplinger cec0f68cb8 [xbuild] Use -api folder for 2.0/3.5/4.0 profiles as well
Similar to e2a79ed888. Those profiles are only contract/reference assemblies since Mono 4.0.
2016-01-28 16:34:20 +01:00
Rolf Bjarne Kvinge b6a4dad872 [mono-api-html] New interface members are only breaking if the interface existed. 2016-01-28 15:55:33 +01:00
Rolf Bjarne Kvinge 373031252e [mono-api-html] Fix compiler warning. 2016-01-28 15:33:32 +01:00
Rolf Bjarne Kvinge 5defe6f35c [mono-api-html] Make it possible to hide/show non-breaking changes in the html output.
We now add data-is-[non-]breaking attributes to the generated
html elements, and then use some javascript logic to show/hide
non-breaking elements (and the javascript also looks in the
container elements show/hide containers that have only
non-breaking descendants).

Also use css classes/styles to colorize.
2016-01-28 15:31:23 +01:00
Rolf Bjarne Kvinge ef9543e288 [mono-api-info] Add an is-override attribute to determine if a method is overriding another method. 2016-01-28 15:31:22 +01:00
Rolf Bjarne Kvinge 5260e942a3 Merge branch 'mono-api-info-improvements-4-3-2' into mono-4.3.2-branch 2016-01-28 14:46:12 +01:00
Rolf Bjarne Kvinge 8d19114895 [mono-api-info] CreateAttributeMapping: don't create dictionaries unless there is something to put in them. 2016-01-28 14:45:57 +01:00
Rolf Bjarne Kvinge dc60579386 [mono-api-info] Rework AttributeData to use a static method instead of creating an instance every time. 2016-01-28 14:45:57 +01:00
Rolf Bjarne Kvinge dc89b23ded [mono-api-info] Improve CleanupTypeName to not create 3 strings every time somethings needs to change. 2016-01-28 14:45:57 +01:00
Rolf Bjarne Kvinge dc3a252a52 [mono-api-info] First filter, then order, and use ordinal comparison. 2016-01-28 14:45:57 +01:00
Rolf Bjarne Kvinge 0fce7d666b [mono-api-info] Rework SkipAttribute to use ordinal string comparison, and no string comparison unless needed. 2016-01-28 14:45:57 +01:00
Rolf Bjarne Kvinge 0884bca59e [mono-api-info] Use ordinal string comparison. It's much faster. 2016-01-28 14:45:57 +01:00
Rolf Bjarne Kvinge a201572042 [mono-api-info] Remove unused method. 2016-01-28 14:45:57 +01:00
Rolf Bjarne Kvinge fad223adb8 [mono-api-info] Use XmlWriter instead of XmlDocument to make this faster.
Generating all the API references (in parallel) for Xamarin.iOS goes from
5.5s to 4.5s.
2016-01-28 14:45:39 +01:00
Marek Safar 382dd87b48 [xbuild] Set .net 4.5 target to 4.5 restricted api 2016-01-28 14:21:01 +01:00
Rolf Bjarne Kvinge b700aeb026 [mono-api-info] Add support for writing output to a file specified using a command line argument. 2016-01-28 13:15:50 +01:00
Marek Safar 3aa52dca53 [mcs] Implements null operator for dynamic expressions. Fixes #37801, #37824 2016-01-28 13:10:23 +01:00
Sebastien Pouliot f9eae9f4bc [System] Move HttpListenerResponse.GetStatusDescription to ease linking
The use of HttpResponseMessage.ReasonPhrase means:

* marking the HttpListenerResponse.GetStatusDescription method;
* marking the HttpListenerResponse type;
* which implements IDisposable, so it's Dispose method is marked
* marking the Close method...

from there a metric ton of code gets recursively marked to the point
where the whole SSL/TLS server code gets inside the app.

To avoid this we move the GetStatusDescription to a different
type that won't bring the end of the civilized world so fast.
2016-01-27 22:13:13 -05:00
Marek Safar 50343d3d2e [mcs] Reset null operator barrier in parenthesis expression 2016-01-27 17:01:04 +01:00
Alex Rønne Petersen 2d707b5dc1 [TPL] Add support for the <ThrowUnobservedTaskExceptions /> config element.
Improves the situation wrt: https://bugzilla.xamarin.com/show_bug.cgi?id=36560
2016-01-27 15:57:49 +01:00
Alex Rønne Petersen 216b11bd8d [runtime] Make VolatileRead/VolatileWrite semantics compatible with MS.NET.
We previously followed the spec semantics for these which meant weaker memory
barriers than MS.NET. However, since we've been importing large amounts of
code from the reference sources, it makes sense to switch these methods to
the MS.NET semantics as we don't generally audit the reference source code for
compatibility with our (spec-compliant) memory model. It's safe to assume that
most MS.NET code is written with the assumption of strong memory barriers in
these methods.
2016-01-27 15:57:49 +01:00
Alex Rønne Petersen 091f2cade1 [bcl] Deduplicate the SocketResponder test helper class.
A number of fixes were made to the version in System but these fixes were never
applied to the System.Web.Services version. Merge the two and place the class
in the test-helpers directory to avoid this sort of maintenance problem.
2016-01-27 15:57:48 +01:00
Alex Rønne Petersen edf70859d7 Revert "[System] Tweak tests to work with Thread.Interrupt as well."
This reverts commit bb50c3f3c9.
2016-01-27 15:57:48 +01:00
Alex Rønne Petersen 35a840a78c Revert "[bcl] Fix System.Net.HttpWebRequestTest.GetRequestStream hang"
This reverts commit b3fa096e5e.

The Abort () call is problematic on many platforms and is no longer necessary
as we properly close the listening socket since 1103abf383.

Conflicts:

	mcs/class/System.Web.Services/Test/System.Web.Services.Protocols/SocketResponder.cs
	mcs/class/System/Test/System.Net/SocketResponder.cs
2016-01-27 15:57:48 +01:00
Chris Hamons 2a3ec28bff Fix serialization under XM 4.5 Target Framework
- System.Configuration.ConfigurationErrorsException: Failed to load configuration section for dataContractSerializer
- Fixes #36401 #38064
2016-01-27 08:51:24 -06:00
Zoltan Varga f87e37159d [runtime] Fix the computation of StackFrame.native_offset for managed-to-native wrappers. 2016-01-26 15:08:58 -05:00
Zoltan Varga 822ee730f3 Remove libgc/depcomp and libgc/missing, newer automake versions seem to overwrite them. 2016-01-26 15:08:47 -05:00
Sebastien Pouliot 1585459e2e [System] Make SmtpClient fallback to it's old behaviour if the hostname cannot be resolved. Fix #37246
Warning: System.Net.Mail is broken by design and sends incorrect emails.

This is not to fix SmtpClient itself but to ensure it remains compatible
(even if incorrect/broken) with older Mono releases.

The commit associated with bug# 33551 [1] can cause issues on computer
and devices that cannot resolve their hostname using the Dns API (which
have their own issues).

This commit catch the exception that occurs when resolution fails and
continue to send an email without a fully qualified domain name - just
like earlier Mono versions did in the past.

This solve bug #32746 [2] where some, but not all, AppleTV devices fails
to execute some of the System.dll unit tests.

Note: Whenever possible stay clear of SmtpClient (and friends) and use
something else like MimeKit/MailKit for your email needs

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=33551
[2] https://bugzilla.xamarin.com/show_bug.cgi?id=37246
2016-01-26 13:13:50 -05:00
Jonathan Pryor 89baf6d449 [runtime] Allow getting thread name, managed id from embedding API
When tracing multi-threaded program execution, it is useful to have a
way of separating which events happen on which thread. The
System.Threading.Thread.Name and Thread.ManagedThreadId properties are
useful proxies for tracking program execution.

However, if program execution spans both managed and embedded mono
native code, there is no existing mechanism to read the Thread.Name or
Thread.ManagedThreadId properties from native code without using
delegates, and delegates may not be usable in all circumstances (e.g.
within a mono_gc_register_bridge_callbacks() callback).

Add the following APIs to the embedding API to permit reading the
Thread.Name and Thread.ManagedThreadId properties:

	char   *mono_thread_get_name_utf8 (MonoThread *thread);
	gint32  mono_thread_get_managed_id (MonoThread *thread);

mono_thread_get_name_utf8() returns the Thread.Name value as a UTF-8
string in newly allocated memory; the caller must g_free() this value.

mono_thread_get_managed_id() returns the Thread.ManagedThreadId value.
2016-01-26 12:31:23 -05:00
monojenkins 37bae7f34a Merge pull request #2515 from ludovic-henry/mono-4.3.2-branch
[Process] Fix NullReferenceException in AsyncStreamReader.ReadBuffer after disposing the Process

The following exception would arise if we dispose the Process before making sure the AsyncStreamReader finished its work:

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at System.Diagnostics.AsyncStreamReader.ReadBuffer (IAsyncResult ar) [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/System/services/monitoring/system/diagnosticts/AsyncStreamReader.cs:158
  at System.IO.Stream+ReadWriteTask.InvokeAsyncCallback (System.Object completedTask) [0x00015] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/io/stream.cs:670
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x0008d] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/executioncontext.cs:957
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/executioncontext.cs:904
  at System.IO.Stream+ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke (System.Threading.Tasks.Task completingTask) [0x0005e] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/io/stream.cs:696
  at System.Threading.Tasks.Task.FinishContinuations () [0x0009a] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:3633
  at System.Threading.Tasks.Task.FinishStageThree () [0x00045] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2366
  at System.Threading.Tasks.Task.FinishStageTwo () [0x000f8] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2339
  at System.Threading.Tasks.Task.Finish (Boolean bUserDelegateExecuted) [0x00049] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2239
  at System.Threading.Tasks.Task.ExecuteWithThreadLocal (System.Threading.Tasks.Task& currentTaskSlot) [0x00079] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2834
  at System.Threading.Tasks.Task.ExecuteEntry (Boolean bPreventDoubleExecution) [0x0006f] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2760
  at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2707
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/threadpool.cs:857
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/threadpool.cs:1212

This would arise in test-runner.cs when one of the test would timeout, leading to the Process being disposed. This would then dispose the AsyncStreamReader, setting its `stream` value to null. The callback to ReadBuffer would then try to access `stream`, but would throw a NullReferenceException. By not disposing the AsyncStreamReader explicitely, we close the stream first, which will trigger a call to ReadBuffer, thus not triggering the NullReferenceException.
2016-01-26 16:50:18 +00:00
Ludovic Henry 47cc449895 [Process] Fix NullReferenceException in AsyncStreamReader.ReadBuffer after disposing the Process
The following exception would arise if we dispose the Process before making sure the AsyncStreamReader finished its work:

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at System.Diagnostics.AsyncStreamReader.ReadBuffer (IAsyncResult ar) [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/System/services/monitoring/system/diagnosticts/AsyncStreamReader.cs:158
  at System.IO.Stream+ReadWriteTask.InvokeAsyncCallback (System.Object completedTask) [0x00015] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/io/stream.cs:670
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x0008d] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/executioncontext.cs:957
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/executioncontext.cs:904
  at System.IO.Stream+ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke (System.Threading.Tasks.Task completingTask) [0x0005e] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/io/stream.cs:696
  at System.Threading.Tasks.Task.FinishContinuations () [0x0009a] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:3633
  at System.Threading.Tasks.Task.FinishStageThree () [0x00045] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2366
  at System.Threading.Tasks.Task.FinishStageTwo () [0x000f8] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2339
  at System.Threading.Tasks.Task.Finish (Boolean bUserDelegateExecuted) [0x00049] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2239
  at System.Threading.Tasks.Task.ExecuteWithThreadLocal (System.Threading.Tasks.Task& currentTaskSlot) [0x00079] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2834
  at System.Threading.Tasks.Task.ExecuteEntry (Boolean bPreventDoubleExecution) [0x0006f] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2760
  at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2707
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/threadpool.cs:857
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armhf/external/referencesource/mscorlib/system/threading/threadpool.cs:1212

This would arise in test-runner.cs when one of the test would timeout, leading to the Process being disposed. This would then dispose the AsyncStreamReader, setting its `stream` value to null. The callback to ReadBuffer would then try to access `stream`, but would throw a NullReferenceException. By not disposing the AsyncStreamReader explicitely, we close the stream first, which will trigger a call to ReadBuffer, thus not triggering the NullReferenceException.
2016-01-26 15:16:01 +00:00
Zoltan Varga ae0dad98ae [llvmonly] Call 'opt' when running with --aot=asmonly too. No optimizations enabled yet. 2016-01-25 19:38:13 -05:00
Zoltan Varga 87e93a0d58 [llvmonly] Reenable running 'opt', it was disabled by mistake. 2016-01-25 18:53:43 -05:00
Zoltan Varga b44b21ccf9 [llvmonly] Avoid inlining the original method into unbox trampolines. 2016-01-25 18:53:38 -05:00
Zoltan Varga a727206659 [llvmonly] Rename MonoDelegate.rgctx to 'extra_arg' to better reflect its purpose. 2016-01-25 14:22:06 -05:00
Sebastien Pouliot c90e3b760f [tests][System][ios] Avoid reflection usage when testing for Xamarin.iOS. Fixes #34133
When the linker is enabled (default for device builds) unused methods
are removed and cannot be reflected.

In this case we do not need reflection as the answer to port reuse is
always true.

https://bugzilla.xamarin.com/show_bug.cgi?id=34133
2016-01-25 13:46:09 -05:00
Zoltan Varga 19ef659344 [llvmonly] Optimize delegate invocation. 2016-01-24 18:41:39 -05:00
Zoltan Varga 2ea7decb7b [llvmonly] Fix the invocation of generic array helpers, they need an rgctx arg. 2016-01-23 22:15:11 -05:00
Rolf Bjarne Kvinge 08198a547b [linker] Add API to notify subclasses of removed attributes. 2016-01-23 03:09:58 +01:00
Zoltan Varga 76078f9670 [arm] Emit more complete unwind info for generic trampolines. 2016-01-22 18:21:05 -05:00
Sebastien Pouliot bf134e25ff [system] Avoid reflection use to create NtlmSession. Fixes #37732
commit d2325f1483 (only since 4.3.2, not
4.3.1) caused the failure when an application is linked.

The use of `GetOrCreateValue` uses reflection to create an `NtlmSession`
instance so the linker won't see it as used anymore (and removes it).

Fixed by avoiding reflection (which will also perform better).

https://bugzilla.xamarin.com/show_bug.cgi?id=37732
2016-01-22 14:21:40 -05:00
Marek Safar af3310bbd3 [mcs] String interpolating of dynamic arguments does not behave like normal dynamic operation but assumes all arguments are object only (not dynamic). Fixes #37886 2016-01-22 18:24:07 +01:00
Zoltan Varga ccbe5f6a68 [bcl] Fix a System.Core test failure caused by a method linked away. 2016-01-21 17:24:41 -05:00
Zoltan Varga ad8807f137 [llvmonly] Make sure the signature of unbox trampolines matches the method they are calling. 2016-01-21 16:47:20 -05:00
Zoltan Varga d80a218532 [llvmonly] Fix the addition of gsharedvt out wrappers on calls from gsharedvt to normal code. 2016-01-21 16:30:11 -05:00
Martin Baulig adef97107b [Mono.Security]: Add 'MonoTlsSettings.EnabledCiphers'.
(cherry picked from commit 79c7c38cc6)
2016-01-21 21:48:14 +01:00
Zoltan Varga 6ed62014fd [jit] Fix the reference type detection for Volatile:Read/Write (). Fixes part of #37846. 2016-01-21 14:32:28 -05:00
Zoltan Varga 79e6db69e0 [llvmonly] Fix runtime invoke calls to gsharedvt methods without variable signatures. Add gsharedvt out wrappers and in wrappers for delegate invoke wrappers. 2016-01-20 15:52:22 -05:00
Zoltan Varga 80efb7ab7a [runtime] Add a new helper function mono_method_get_full_name (), which is similar to mono_method_full_name (), but the result includes the return type as well. 2016-01-20 15:52:16 -05:00
Zoltan Varga 3e2a9e30af [llvmonly] Fix the type of the vret_addr argument. 2016-01-19 21:41:12 -05:00
Martin Baulig d1d6b05324 [System]: Change namespace for some internal classes.
(cherry picked from commit 997513da02)
(cherry picked from commit 8a38b0f7fa)
2016-01-20 01:53:00 +01:00
Martin Baulig 292ee11f1f [System]: Remove unpredictable pluggable setup and cleanup APIs.
(cherry picked from commit 2d945d75bb)
2016-01-20 01:47:29 +01:00
Zoltan Varga 027c82b32c [llvmonly] Set the del->rgctx field for delegates created using reflection as well. 2016-01-19 15:57:57 -05:00
Alexander Köplinger a356639122 [io-layer] Fix tarball broken by 39393f118d
A new file io-trace.h was added but not listed in any Makefile sources anywhere so it didn't end up in the tarball.
2016-01-19 18:01:49 +01:00
Marek Habersack f06366e31d Replace DEBUG messages with calls to mono_trace
The messages contain useful debugging information which is unavailable
unless the mono runtime is recompiled. The debugging information is
particularly useful on mobile platforms and in test runs on bots.

The I/O layer trace messages can be disabled on compile time by
defining the DISABLE_IO_LAYER_TRACE preprocessor symbol.
2016-01-19 17:59:21 +01:00
Marek Habersack 18668a1fa4 Move mono_trace to header file
This commit moves mono_trace to a header file so that all the
calls are inlined, avoiding one function call at the small expense
of binary size.
2016-01-19 17:59:06 +01:00
Zoltan Varga c3145582fc [llvmonly] Avoid inlining methods which call MethodBase:GetCurrentMethod (). 2016-01-18 19:15:43 -05:00
Zoltan Varga ec5ef1e9c2 [llvmonly] Fix the passing of byref arguments in runtime invoke. 2016-01-18 18:41:34 -05:00
Zoltan Varga 14f32d68f1 [llvmonly] Fix the MethodBase.GetCurrentMethod () intrinsic so it works with generic methods. 2016-01-18 18:26:05 -05:00
Zoltan Varga 1cd2c3fa5a [llvm] Fix some type imcompatibility problems which happen when a vreg holding an objref is made global and stored into its location which has a different type (IntPtrType () vs ObjRefType ()). 2016-01-18 16:29:22 -05:00
Zoltan Varga 20482680ae [llvmonly] Fix the catching of exceptions of open types in shared methods by passing mrgctx/this to the mono_llvm_match_exception () function. 2016-01-18 14:03:10 -05:00
Zoltan Varga 09c26bf8c7 [llvm] Add some missing opcodes. 2016-01-18 12:02:37 -05:00
Zoltan Varga ebc5130e31 [runtime] Fix native-to-managed calls to delegates which wrap a virtual method. Fixes #37695. 2016-01-18 11:47:38 -05:00
Zoltan Varga ed3e121299 [llvmonly] Add an instrinsics for MethodBase.GetCurrentMethod () so it works on platforms without stack walks. 2016-01-17 18:25:41 -05:00
Marek Safar 46f7140123 [corlib] Improve CancellationTokenSource test 2016-01-16 08:00:24 +01:00
Zoltan Varga a49236e879 [llvmonly] Share more wrapper types. Avoid adding out wrappers for calls from gsharedvt code to gsharedvt code with a normal signature. Fix the handling of pointer types in runtime invoke. Fix the passing of the same fixed gsharedvt argument in multiple calls. 2016-01-15 18:03:15 -05:00
Zoltan Varga e4426cbcdb [llvmonly] Avoid a crash in ves_icall_GetCurrentMethod () if the stack walk fails. 2016-01-15 18:03:10 -05:00
Zoltan Varga 59b84d7a76 [llvm] Split long bblocks instead of disabling llvm for methods with them. 2016-01-15 10:18:19 -05:00
Zoltan Varga 572ab4dcbb [llvm] Fix a type conversion problem when calling the same method with two different signatures. 2016-01-15 10:18:17 -05:00
Marek Safar bd5b3ca14b Bump reference source for recent fixes 2016-01-15 15:35:33 +01:00
Rolf Bjarne Kvinge 74de7595ac [System] Fix the mobile build after 4e0ae8c. 2016-01-15 11:23:44 +01:00
Zoltan Varga bd4c8b9074 [llvmonly] Fix mono_patch_info_equal () for MONO_PATCH_INFO_GSHAREDVT_IN_WRAPPER. 2016-01-14 19:55:16 -05:00
Zoltan Varga 9186521479 [llvmonly] Fix the addition of gsharedvt in wrappers around unbox wrappers. 2016-01-14 18:44:20 -05:00
Zoltan Varga fded4957dd [llvmonly] Fix the gsharedvt parameter passing code so it emits valid llvm il. 2016-01-14 18:01:03 -05:00
Zoltan Varga e0b65ae93d [llvmonly] Add unwind info for unbox wrappers, not the get_unbox_tramp () generated function. 2016-01-14 17:05:10 -05:00
Zoltan Varga f85fd107c7 [llvmonly] Fix initialization of static gshared methods, they receive a vtable as the rgctx argument, not a MonoMethodRuntimeGenericContext. Emit unwind info for unbox wrappers. Fix calls to gsharedvt methods from non-shared delegate invoke wrappers. 2016-01-14 16:48:14 -05:00
monojenkins 61c088a932 Merge pull request #2437 from ludovic-henry/4.3.2-fix-process-missed-output
[4.3.2][Process] Use ReferenceSource process async output/error reader
2016-01-14 17:22:57 +00:00
Zoltan Varga 37ad1431c9 [llvmonly] Implement Assembly.GetCallingAssembly () in llvmonly mode by saving the current assembly in the calling method. Enable it for Activator.CreateInstance () for now. 2016-01-14 11:26:42 -05:00
Marek Safar 88fce13184 [mono] Update predefined Hebrew negative sign. Fixes #37681 2016-01-14 16:38:12 +01:00
Ludovic Henry 4e0ae8c578 [Process] Use ReferenceSource process async output/error reader
By using the referencesource one, we remove a buggy part of the Process class. It will now simply use Stream.{Begin/End}Read, and not a custom implementation that introduces its own bugs.
2016-01-14 15:37:28 +00:00
Zoltan Varga 5499b3ecc6 [runtime] Make sure ptr-to-structure and structure-and-ptr wrappers are unique, this is needed by full aot. Fixes #20186. 2016-01-14 10:12:47 -05:00
Zoltan Varga 6f92ae31be [llvm] Add a missing r4 opcodes. 2016-01-13 16:48:09 -05:00
Zoltan Varga 92a593c17d [llvmonly] Create empty stacktraces if backtraces are not supported by the platform. 2016-01-13 16:48:03 -05:00
Zoltan Varga 8bb9bb703b [runtime] Disable a test which fails with bitcode. 2016-01-13 16:47:58 -05:00
Zoltan Varga 39389be976 [aot] Avoid overwriting entries in domain->seq_points if decode_exception_debug_info () is called more than once. Fixes #37582. 2016-01-13 12:11:09 -05:00
Rolf Bjarne Kvinge 6f50c368f1 [System] xamarin_start_wwan is not available for tvOS and watchOS. 2016-01-13 17:55:24 +01:00
Zoltan Varga 9d96fb5a76 [llvmonly] Avoid disabling llvm for the Selector.GetHandle () intrinsics. 2016-01-12 14:40:14 -05:00
Zoltan Varga 1a77ad3fa7 [llvmonly] Fix support for variant interface methods, they work similarly to generic virtual methods. 2016-01-12 14:23:50 -05:00
Zoltan Varga 1ba53e055a [llvm] Ignore OP_IL_SEQ_POINT. 2016-01-12 12:27:01 -05:00
Rolf Bjarne Kvinge 83e015740a [mscorlib] Add support for intercepting threadpool work, and use it for Xamarin.iOS/Mac.
This is used to Xamarin.iOS/Mac to wrap threadpool work in an NSAutoreleasePool.

Also open up corlib's internals to Xamarin.iOS/Mac so that the linker
doesn't have to be involved when accessing internal API.
2016-01-11 12:21:50 -05:00
488 changed files with 12599 additions and 21444 deletions

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@
[submodule "external/referencesource"]
path = external/referencesource
url = git://github.com/mono/referencesource
branch = mono
branch = mono-4.4.0-branch
[submodule "external/reference-assemblies"]
path = external/binary-reference-assemblies
url = git://github.com/mono/reference-assemblies.git
+37 -19
View File
@@ -1,7 +1,7 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
AC_INIT(mono, [4.3.2],
AC_INIT(mono, [4.4.0],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_CONFIG_SRCDIR([README.md])
@@ -2598,21 +2598,54 @@ if test "x$enable_llvm" = "xyes"; then
if test "x$host_win32" = "xno"; then
# Should be something like '2.6' or '2.7svn'
llvm_version=`$LLVM_CONFIG --version`
llvm_api_version=`$LLVM_CONFIG --mono-api-version 2>/dev/null`
AC_MSG_CHECKING(LLVM version)
AC_MSG_RESULT($llvm_version $llvm_api_version)
if echo $llvm_version | grep -q 'mono'; then
if test "x$enable_llvm_version_check" == "xyes"; then
if test "$llvm_version" != "$expected_llvm_version"; then
AC_MSG_ERROR([Expected llvm version $expected_llvm_version, but llvm-config --version returned $llvm_version"])
fi
fi
else
AC_MSG_ERROR([Compiling with stock LLVM is not supported, please use the Mono LLVM repo at https://github.com/mono/llvm, with the GIT branch which matches this version of mono, i.e. 'mono-2-10' for Mono 2.10.])
fi
# The output of --cflags seems to include optimizations flags too
LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
if test $llvm_api_version -gt 100; then
# The --cflags argument includes all kinds of warnings -pendantic etc.
LLVM_CFLAGS="-I$with_llvm/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
LLVM_CXXFLAGS="-I$with_llvm/include -std=c++11 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
else
LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
fi
# LLVM is compiled with -fno-rtti, so we need this too, since our classes inherit
# from LLVM classes.
LLVM_CXXFLAGS="$LLVM_CXXFLAGS -fno-rtti -fexceptions"
LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
# This might include empty lines
LLVM_SYSTEM_LIBS=`$LLVM_CONFIG --system-libs 2>/dev/null | grep -- -`
if test "x$host" != "x$target"; then
llvm_jit_supported=yes
if test $llvm_api_version -gt 100; then
# Based on llvm 3.9, only aot is currently supported
llvm_jit_supported=no
elif test "x$host" != "x$target"; then
# No need for jit libs
llvm_jit_supported=no
fi
if test $llvm_jit_supported = no; then
# No need for jit libs
LLVM_LIBS=`$LLVM_CONFIG --libs analysis core bitwriter`
else
LLVM_LIBS=`$LLVM_CONFIG --libs analysis core bitwriter jit mcjit $llvm_codegen`
fi
if test "x$LLVM_LIBS" == "x"; then
echo "$LLVM_CONFIG --libs failed."
exit 1
fi
LLVM_LIBS="$LLVM_LIBS $LLVM_LDFLAGS $LLVM_SYSTEM_LIBS"
# The c++ standard library used by llvm doesn't show up in $LLVM_SYSTEM_LIBS so add it manually
if echo $LLVM_CXXFLAGS | grep -q -- '-stdlib=libc++'; then
@@ -2623,21 +2656,6 @@ if test "x$enable_llvm" = "xyes"; then
expected_llvm_version="3.4svn-mono-mono/e656cac"
# Should be something like '2.6' or '2.7svn'
llvm_version=`$LLVM_CONFIG --version`
llvm_api_version=`$LLVM_CONFIG --mono-api-version 2>/dev/null`
AC_MSG_CHECKING(LLVM version)
AC_MSG_RESULT($llvm_version)
if echo $llvm_version | grep -q 'mono'; then
if test "x$enable_llvm_version_check" == "xyes"; then
if test "$llvm_version" != "$expected_llvm_version"; then
AC_MSG_ERROR([Expected llvm version $expected_llvm_version, but llvm-config --version returned $llvm_version"])
fi
fi
else
AC_MSG_ERROR([Compiling with stock LLVM is not supported, please use the Mono LLVM repo at https://github.com/mono/llvm, with the GIT branch which matches this version of mono, i.e. 'mono-2-10' for Mono 2.10.])
fi
else
LLVM_CFLAGS="-I$with_llvm/include -DNDEBUG -D__NO_CTYPE_INLINE -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
LLVM_CXXFLAGS="$LLVM_CFLAGS -std=gnu++11 -fvisibility-inlines-hidden -fno-rtti -Woverloaded-virtual -Wcast-qual"
+2
View File
@@ -750,6 +750,8 @@ mono_thread_current
mono_thread_detach
mono_thread_exit
mono_thread_get_main
mono_thread_get_managed_id
mono_thread_get_name_utf8
mono_thread_get_undeniable_exception
mono_thread_hazardous_free_or_queue
mono_thread_hazardous_try_free_all
-436
View File
@@ -1,436 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
# Copyright 1999, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <[email protected]>.
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# `libtool' can also be set to `yes' or `no'.
if test -z "$depfile"; then
base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
dir=`echo "$object" | sed 's,/.*$,/,'`
if test "$dir" = "$object"; then
dir=
fi
# FIXME: should be _deps on DOS.
depfile="$dir.deps/$base"
fi
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. This file always lives in the current directory.
# Also, the AIX compiler puts `$object:' at the start of each line;
# $object doesn't have directory information.
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
outname="$stripped.o"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
base=`echo "$object" | sed -e 's/\.o$//' -e 's/\.lo$//'`
tmpdepfile1="$base.o.d"
tmpdepfile2="$base.d"
if test "$libtool" = yes; then
"$@" -Wc,-MD
else
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
if test -f "$tmpdepfile1"; then
tmpdepfile="$tmpdepfile1"
else
tmpdepfile="$tmpdepfile2"
fi
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a space and a tab in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
test -z "$dashmflag" && dashmflag=-M
( IFS=" "
case " $* " in
*" --mode=compile "*) # this is libtool, let us make it quiet
for arg
do # cycle over the arguments
case "$arg" in
"--mode=compile")
# insert --quiet before "--mode=compile"
set fnord "$@" --quiet
shift # fnord
;;
esac
set fnord "$@" "$arg"
shift # fnord
shift # "$arg"
done
;;
esac
"$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
# X makedepend
(
shift
cleared=no
for arg in "$@"; do
case $cleared in no)
set ""; shift
cleared=yes
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift;;
-*)
;;
*)
set fnord "$@" "$arg"; shift;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
( IFS=" "
case " $* " in
*" --mode=compile "*)
for arg
do # cycle over the arguments
case $arg in
"--mode=compile")
# insert --quiet before "--mode=compile"
set fnord "$@" --quiet
shift # fnord
;;
esac
set fnord "$@" "$arg"
shift # fnord
shift # "$arg"
done
;;
esac
"$@" -E |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
( IFS=" "
case " $* " in
*" --mode=compile "*)
for arg
do # cycle over the arguments
case $arg in
"--mode=compile")
# insert --quiet before "--mode=compile"
set fnord "$@" --quiet
shift # fnord
;;
esac
set fnord "$@" "$arg"
shift # fnord
shift # "$arg"
done
;;
esac
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
-336
View File
@@ -1,336 +0,0 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <[email protected]>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing 0.4 - GNU automake"
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
aclocal*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them.
You can get \`$1Help2man' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
# We have makeinfo, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
tar)
shift
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
fi
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar ${1+"$@"} && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar ${1+"$@"} && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" ${1+"$@"} && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" ${1+"$@"} && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequirements for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
+8 -1
View File
@@ -142,6 +142,11 @@ instead of going through the operating system symbol lookup operation.
.I llvm-path=<PREFIX>
Same for the llvm tools 'opt' and 'llc'.
.TP
.I gen-seq-points-file=FILE.msym
Instructs the AOT compiler to generate offline sequence points .msym files.
The path is optional, if none is passed then a .msym file will be generated
next to the input assembly.
.TP
.I mtriple=<TRIPLE>
Use the GNU style target triple <TRIPLE> to determine some code generation options, i.e.
--mtriple=armv7-linux-gnueabi will generate code that targets ARMv7. This is currently
@@ -889,7 +894,9 @@ environment variable to limit the extent of the messages you get:
If set, the log mask is changed to the set value. Possible values are
"asm" (assembly loader), "type", "dll" (native library loader), "gc"
(garbage collector), "cfg" (config file loader), "aot" (precompiler),
"security" (e.g. Moonlight CoreCLR support) and "all".
"security" (e.g. Moonlight CoreCLR support), "threadpool" (thread pool generic),
"io-threadpool" (thread pool I/O), "io-layer" (I/O layer - sockets, handles, shared memory etc)
and "all".
The default value is "all". Changing the mask value allows you to display only
messages for a certain component. You can use multiple masks by comma
separating them. For example to see config file messages and assembly loader
+6 -2
View File
@@ -44,17 +44,21 @@ static class Consts
public const string FxVersion = "2.0.5.0";
public const string VsVersion = "9.0.0.0"; // unused, but needed for compilation
public const string FxFileVersion = "4.0.50524.0";
public const string EnvironmentVersion = FxFileVersion;
public const string VsFileVersion = "9.0.50727.42"; // unused, but needed for compilation
#elif NET_4_6
public const string FxVersion = "4.0.0.0";
public const string FxFileVersion = "4.6.57.0";
public const string EnvironmentVersion = "4.0.30319.42000";
public const string VsVersion = "0.0.0.0"; // Useless ?
public const string VsFileVersion = "11.0.0.0"; // TODO:
#elif NET_4_5
public const string FxVersion = "4.0.0.0";
public const string FxFileVersion = "4.0.30319.17020";
public const string EnvironmentVersion = FxFileVersion;
public const string VsVersion = "0.0.0.0"; // Useless ?
public const string VsFileVersion = "11.0.0.0"; // TODO:
#elif NET_4_0
+1 -1
View File
@@ -141,7 +141,7 @@ csproj-local: csproj-library csproj-test
intermediate_clean=$(subst /,-,$(intermediate))
csproj-library:
config_file=`basename $(LIBRARY) .dll`-$(intermediate_clean)$(PROFILE).input; \
[[ $(thisdir) == *"Facades"* ]] && config_file=Facades_$$config_file; \
case "$(thisdir)" in *"Facades"*) config_file=Facades_$$config_file;; esac; \
echo $(thisdir):$$config_file >> $(topdir)/../msvc/scripts/order; \
(echo $(is_boot); \
echo $(USE_MCS_FLAGS) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS); \
@@ -27,6 +27,7 @@ PROFILE_MCS_FLAGS = \
-d:MONOTOUCH \
-d:DISABLE_REMOTING \
-d:DISABLE_COM \
-d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
-nowarn:1699 \
-nostdlib \
-lib:$(topdir)/class/lib/$(PROFILE) \
+2
View File
@@ -23,6 +23,8 @@ PROFILE_MCS_FLAGS = \
-d:MOBILE \
-d:MOBILE_DYNAMIC \
-d:XAMMAC \
-d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
-d:XAMARIN_MODERN \
-nowarn:1699 \
-nostdlib \
-lib:$(topdir)/class/lib/$(PROFILE) \
+7 -1
View File
@@ -1,5 +1,11 @@
include $(topdir)/build/profiles/net_4_x.make
PROFILE_MCS_FLAGS += -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5
PROFILE_MCS_FLAGS += \
-d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
-d:NO_SYSTEM_DRAWING_DEPENDENCY \
-d:NO_WINFORMS_DEPENDENCY \
-d:NO_SYSTEM_WEB_DEPENDENCY \
-d:XAMMAC_4_5 \
-d:XAMARIN_MODERN
XAMMAC_4_5=1
NO_WINDOWS_BASE=1
NO_SYSTEM_WEB_DEPENDENCY=1
-1
View File
@@ -1 +0,0 @@
/makefile.build -crlf
@@ -1,3 +0,0 @@
/Web.config -crlf
/Web.config.bak -crlf
/makefile.build -crlf
@@ -1 +0,0 @@
/GlobalResource.resx -crlf
@@ -1,127 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="SearchMessage" xml:space="preserve">
<value>Wildcard characters * and ? are permitted.</value>
</data>
<data name="WelcomeMessage" xml:space="preserve">
<value>Welcome to the Web Site Administration Tool
</value>
</data>
</root>
@@ -1,7 +0,0 @@
/CreateRole.aspx.resx -crlf
/CreateUser.aspx.resx -crlf
/Default.aspx.resx -crlf
/EditUser.aspx.resx -crlf
/ManageRole.aspx.resx -crlf
/ManageUser.aspx.resx -crlf
/Util.Master.resx -crlf
@@ -1,129 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="CreateRoleText" xml:space="preserve">
<value>You can optionally add roles, or groups, that enable you to allow or deny groups of users access to specific folders in your Web site. For example, you might create roles such as "managers," "sales," or "members," each with different access to specific folders. </value>
</data>
<data name="newrolelabel" xml:space="preserve">
<value>Create New Role</value>
</data>
<data name="rolenamelabel" xml:space="preserve">
<value>New role name: </value>
</data>
</root>
@@ -1,126 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ActiveUserLabel" xml:space="preserve">
<value>Active User</value>
</data>
<data name="CreateUserText" xml:space="preserve">
<value>Add a user by entering a user name, password, and e-mail address on this page.</value>
</data>
</root>
@@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="EnterText" xml:space="preserve">
<value>You can use the Web Site Administration Tool to manage all the security settings for your application. You can set up users and passwords (authentication), create roles (groups of users), and create permissions (rules for controlling access to parts of your application).</value>
</data>
</root>
@@ -1,135 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="editUserText" xml:space="preserve">
<value>Use this page to edit user information and to specify what roles a user belongs in. </value>
</data>
<data name="Rolelbl" xml:space="preserve">
<value>Roles</value>
</data>
<data name="Successlbl" xml:space="preserve">
<value>You have successfully updated the user</value>
</data>
<data name="successUpdatelbl" xml:space="preserve">
<value>You have successfully updated the user </value>
</data>
<data name="Userlbl" xml:space="preserve">
<value>User</value>
</data>
</root>
@@ -1,132 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="menageRoleText" xml:space="preserve">
<value>Use this page to manage the members in the specified role. To add a user to the role, search for the user name and then select the User Is In Role check box for that user. </value>
</data>
<data name="roleNameLabel" xml:space="preserve">
<value>Role:</value>
</data>
<data name="searchBylbl" xml:space="preserve">
<value>Search by :</value>
</data>
<data name="searchUserlbl" xml:space="preserve">
<value>Search for Users</value>
</data>
</root>
@@ -1,133 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="manageUserText" xml:space="preserve">
<value>Click Edit User to view or change the user's password or other properties. To assign roles to the selected user, select the appropriate check boxes on the right. To prevent users from logging in to your application while retaining their information in your database, set the status to inactive by clearing the check box.
</value>
</data>
<data name="roleslbl" xml:space="preserve">
<value>Roles</value>
</data>
<data name="searchBylbl" xml:space="preserve">
<value>Search by :</value>
</data>
<data name="searchUserlbl" xml:space="preserve">
<value>Search for Users</value>
</data>
</root>
@@ -1,5 +0,0 @@
/Searcher.ascx -crlf
/Searcher.ascx.cs -crlf
/Searcher.ascx.cs.bak -crlf
/Searcher.ascx.designer.cs -crlf
/Searcher.ascx.designer.cs.bak -crlf
@@ -1,34 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" EnableTheming="false" CodeBehind="Searcher.ascx.cs" Inherits="Mainsoft.Web.AspnetConfig.Searcher" %>
<%@ Register tagprefix="custom" namespace="Mainsoft.Web.AspnetConfig" Assembly="Mainsoft.Web.AspnetConfig" %>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="controlheader">
Edit roles:
</td>
</tr>
<tr>
<td width= "100%" >
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
ForeColor="#333333" GridLines="None" Width="100%">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:TemplateField HeaderText="Edit roles">
<ItemTemplate>
<asp:CheckBox ID="CheckBox2" runat="server" AutoPostBack="True" Checked='<%# Bind("IsInRole") %>'
OnCheckedChanged="Roles_Changed" Text='<%# Bind("Role") %>' />
</ItemTemplate>
<HeaderTemplate>
Edit roles for user : <%# User %>
</HeaderTemplate>
</asp:TemplateField>
</Columns>
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
</td>
</tr>
</table>
@@ -1,61 +0,0 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Mainsoft.Web.AspnetConfig
{
public partial class Searcher : System.Web.UI.UserControl
{
public string User
{
get { return ViewState["User"] == null ? String.Empty : (string)ViewState["User"];}
set { ViewState["User"] = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
}
protected override void OnPreRender(EventArgs e)
{
if (User == String.Empty || (Membership.GetUser(User)==null))
{
GridView1.DataSource = null;
}
else
{
GridView1.DataSource = RolesDS.SelectUsersRole(User);
}
GridView1.DataBind();
base.OnPreRender(e);
}
protected void Roles_Changed(object sender, EventArgs e)
{
String user_name = (string)ViewState["User"];
if (((CheckBox)sender).Checked)
{
try {
Roles.AddUserToRole (user_name, ((CheckBox) sender).Text);
}
catch {
}
}
else
{
try {
Roles.RemoveUserFromRole (user_name, ((CheckBox) sender).Text);
}
catch {
}
}
}
}
}
@@ -1,61 +0,0 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Mainsoft.Web.Administration
{
public partial class Searcher : System.Web.UI.UserControl
{
public string User
{
get { return ViewState["User"] == null ? String.Empty : (string)ViewState["User"];}
set { ViewState["User"] = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
}
protected override void OnPreRender(EventArgs e)
{
if (User == String.Empty || (Membership.GetUser(User)==null))
{
GridView1.DataSource = null;
}
else
{
GridView1.DataSource = RolesDS.SelectUsersRole(User);
}
GridView1.DataBind();
base.OnPreRender(e);
}
protected void Roles_Changed(object sender, EventArgs e)
{
String user_name = (string)ViewState["User"];
if (((CheckBox)sender).Checked)
{
try {
Roles.AddUserToRole (user_name, ((CheckBox) sender).Text);
}
catch {
}
}
else
{
try {
Roles.RemoveUserFromRole (user_name, ((CheckBox) sender).Text);
}
catch {
}
}
}
}
}
@@ -1,16 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Mainsoft.Web.AspnetConfig {
public partial class Searcher {
protected System.Web.UI.WebControls.GridView GridView1;
}
}
@@ -1,16 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Mainsoft.Web.Administration {
public partial class Searcher {
protected System.Web.UI.WebControls.GridView GridView1;
}
}
@@ -1,202 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{724CABEB-39E5-47A7-9F72-4B81FFC56760}</ProjectGuid>
<ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AssemblyName>Mainsoft.Web.AspnetConfig</AssemblyName>
<JDKName>1.6.0</JDKName>
<GHProjectType>3</GHProjectType>
<GHProjectKind>runtime</GHProjectKind>
<Version>2.0</Version>
<RootNamespace>Mainsoft.Web.AspnetConfig</RootNamespace>
<jarserver>ipa</jarserver>
<ApplicationServerType>tomcat</ApplicationServerType>
<FlatWebApp>true</FlatWebApp>
<DeployOnBuild>true</DeployOnBuild>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE;DEBUG;JAVA;TARGET_JVM</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<BaseAddress>285212672</BaseAddress>
<SkipValidation>True</SkipValidation>
<KeepIntermediate>False</KeepIntermediate>
<TargetPlatform>0</TargetPlatform>
<AdditionalClassPath>
</AdditionalClassPath>
<PreCompile>True</PreCompile>
<CompressionLevel>1</CompressionLevel>
<DeploymentMethod>1</DeploymentMethod>
<UseTestingPage>True</UseTestingPage>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE;JAVA;TARGET_JVM</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<BaseAddress>285212672</BaseAddress>
<SkipValidation>True</SkipValidation>
<KeepIntermediate>False</KeepIntermediate>
<TargetPlatform>0</TargetPlatform>
<AdditionalClassPath>
</AdditionalClassPath>
<PreCompile>true</PreCompile>
<CompressionLevel>1</CompressionLevel>
<DeploymentMethod>1</DeploymentMethod>
<UseTestingPage>True</UseTestingPage>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />
<Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>2274</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>
</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
</WebProjectProperties>
</FlavorProperties>
<UserProperties REFS-JarPath-mscorlib="..\..\..\..\..\..\lib\mscorlib.jar" REFS-JarPath-system="..\..\..\..\..\..\lib\System.jar" REFS-JarPath-system-data="..\..\..\..\..\..\lib\System.Data.jar" REFS-JarPath-system-web="..\..\..\..\..\..\lib\System.Web.jar" REFS-JarPath-system-xml="..\..\..\..\..\..\lib\System.Xml.jar" REFS-JarPath-system-configuration="..\..\..\..\..\lib\System.Configuration.jar" REFS-JarPath-system-drawing="..\..\..\..\..\lib\System.Drawing.jar;..\..\..\..\..\lib\jai_imageio.jar;..\..\..\..\..\lib\jai_core.jar;..\..\..\..\..\lib\jai_codec.jar;..\..\..\..\..\lib\clibwrapper_jiio.jar;..\..\..\..\..\lib\mlibwrapper_jai.jar" REFS-JarPath-myfaces="" REFS-RefInfo-myfaces="repository:vmw:framework:2.0" />
</VisualStudio>
</ProjectExtensions>
<ItemGroup>
<Content Include="WEB-INF\web.xml" />
</ItemGroup>
<ItemGroup>
<Reference Include="myfaces" />
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="J2SE.Helpers">
<Private>False</Private>
<HintPath>..\..\lib\J2SE.Helpers.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="aspnetconfig\CreateRole.aspx.cs">
<DependentUpon>CreateRole.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="aspnetconfig\CreateRole.aspx.designer.cs">
<DependentUpon>CreateRole.aspx</DependentUpon>
</Compile>
<Compile Include="aspnetconfig\CreateUser.aspx.cs">
<DependentUpon>CreateUser.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="aspnetconfig\CreateUser.aspx.designer.cs">
<DependentUpon>CreateUser.aspx</DependentUpon>
</Compile>
<Compile Include="aspnetconfig\Default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="aspnetconfig\Default.aspx.designer.cs">
<DependentUpon>Default.aspx</DependentUpon>
</Compile>
<Compile Include="aspnetconfig\EditUser.aspx.cs">
<DependentUpon>EditUser.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="aspnetconfig\EditUser.aspx.designer.cs">
<DependentUpon>EditUser.aspx</DependentUpon>
</Compile>
<Compile Include="aspnetconfig\Error.aspx.cs">
<DependentUpon>Error.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="aspnetconfig\Error.aspx.designer.cs">
<DependentUpon>Error.aspx</DependentUpon>
</Compile>
<Compile Include="aspnetconfig\GridButton.cs" />
<Compile Include="aspnetconfig\GridCheckBox.cs" />
<Compile Include="aspnetconfig\HttpHandlersSectionHandler.cs" />
<Compile Include="aspnetconfig\ManageRole.aspx.cs">
<DependentUpon>ManageRole.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="aspnetconfig\ManageRole.aspx.designer.cs">
<DependentUpon>ManageRole.aspx</DependentUpon>
</Compile>
<Compile Include="aspnetconfig\ManageUser.aspx.cs">
<DependentUpon>ManageUser.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="aspnetconfig\ManageUser.aspx.designer.cs">
<DependentUpon>ManageUser.aspx</DependentUpon>
</Compile>
<Compile Include="aspnetconfig\RolesDS.cs" />
<Compile Include="aspnetconfig\SecurError.aspx.cs">
<DependentUpon>SecurError.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="aspnetconfig\SecurError.aspx.designer.cs">
<DependentUpon>SecurError.aspx</DependentUpon>
</Compile>
<Compile Include="aspnetconfig\StrUtils.cs" />
<Compile Include="aspnetconfig\UrlUtils.cs" />
<Compile Include="aspnetconfig\Util.Master.cs">
<DependentUpon>Util.Master</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="aspnetconfig\Util.Master.designer.cs">
<DependentUpon>Util.Master</DependentUpon>
</Compile>
<Compile Include="Controls\Searcher.ascx.cs">
<DependentUpon>Searcher.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Controls\Searcher.ascx.designer.cs">
<DependentUpon>Searcher.ascx</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="aspnetconfig\CreateRole.aspx" />
<None Include="aspnetconfig\CreateUser.aspx" />
<None Include="aspnetconfig\Default.aspx" />
<None Include="aspnetconfig\EditUser.aspx" />
<None Include="aspnetconfig\Error.aspx" />
<EmbeddedResource Include="aspnetconfig\Mainsoft.Web.AspnetConfig.css" />
<None Include="aspnetconfig\ManageRole.aspx" />
<None Include="aspnetconfig\ManageUser.aspx" />
</ItemGroup>
<ItemGroup>
<None Include="aspnetconfig\SecurError.aspx" />
<Content Include="aspnetconfig\Util.Master" />
<Content Include="WEB-INF\faces-config.xml" />
<None Include="Controls\Searcher.ascx" />
<None Include="nomd5" />
<EmbeddedResource Include="resources\mainsoft.jpg" />
<EmbeddedResource Include="resources\untitled.bmp" />
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
@@ -1,2 +0,0 @@
/AssemblyInfo.cs -crlf
/AssemblyInfo.cs.bak -crlf
@@ -1,43 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Web.UI;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Mainsoft.Web.AspnetConfig")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Mainsoft.Web.AspnetConfig")]
[assembly: AssemblyCopyright("Copyright © 2006")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: WebResource ("Mainsoft.Web.AspnetConfig.resources.mainsoft.jpg", "image/jpeg")]
[assembly: WebResource ("Mainsoft.Web.AspnetConfig.resources.untitled.bmp", "image/jpeg")]
[assembly: WebResource ("Mainsoft.Web.AspnetConfig.aspnetconfig.Mainsoft.Web.AspnetConfig.css", "text/css")]
@@ -1,43 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Web.UI;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Mainsoft.Web.Administration")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Mainsoft.Web.Administration")]
[assembly: AssemblyCopyright("Copyright © 2006")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: WebResource ("Mainsoft.Web.Administration.resources.mainsoft.jpg", "image/jpeg")]
[assembly: WebResource ("Mainsoft.Web.Administration.resources.untitled.bmp", "image/jpeg")]
[assembly: WebResource ("Mainsoft.Web.Administration.aspnetconfig.Mainsoft.Web.Administration.css", "text/css")]
@@ -1,2 +0,0 @@
/faces-config.xml -crlf
/web.xml -crlf
@@ -1,14 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<application>
<state-manager>Mainsoft.Web.Hosting.ServletFacesStateManager</state-manager>
<view-handler>Mainsoft.Web.Hosting.ServletFacesViewHandler</view-handler>
</application>
</faces-config>
@@ -1,134 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"[]>
<web-app>
<display-name>Visual MainWin application</display-name>
<description>Visual MainWin application.</description>
<context-param>
<param-name>EnableSessionPersistency</param-name>
<param-value>False</param-value>
</context-param>
<context-param>
<param-name>WebFileSystemAccess</param-name>
<param-value>Virtual</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.faces.application.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.aspx</param-value>
</context-param>
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
<listener>
<listener-class>system.Web.GH.SessionListener</listener-class>
</listener>
<servlet>
<servlet-name>VmwIncludeHelperServlet</servlet-name>
<servlet-class>system.Web.GH.IncludeHelperServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>VmwDynamicServlet</servlet-name>
<servlet-class>GhDynamicHttpServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>VmwStaticServlet</servlet-name>
<servlet-class>GhStaticHttpServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>VmwDynamicServlet</servlet-name>
<url-pattern>*.aspx</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwDynamicServlet</servlet-name>
<url-pattern>*.asmx</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwDynamicServlet</servlet-name>
<url-pattern>*.ashx</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwDynamicServlet</servlet-name>
<url-pattern>*.invoke</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwDynamicServlet</servlet-name>
<url-pattern>*.soap</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwDynamicServlet</servlet-name>
<url-pattern>*.rem</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwDynamicServlet</servlet-name>
<url-pattern>*.axd</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwIncludeHelperServlet</servlet-name>
<url-pattern>/servletincludehelper</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwStaticServlet</servlet-name>
<url-pattern>*.gif</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwStaticServlet</servlet-name>
<url-pattern>*.jpeg</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwStaticServlet</servlet-name>
<url-pattern>*.jpg</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwStaticServlet</servlet-name>
<url-pattern>*.png</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwStaticServlet</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwStaticServlet</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwStaticServlet</servlet-name>
<url-pattern>*.bmp</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwStaticServlet</servlet-name>
<url-pattern>*.css</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwStaticServlet</servlet-name>
<url-pattern>*.js</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwStaticServlet</servlet-name>
<url-pattern>*.vbs</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwStaticServlet</servlet-name>
<url-pattern>*.inc</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwStaticServlet</servlet-name>
<url-pattern>*.swf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>VmwStaticServlet</servlet-name>
<url-pattern>*.htc</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>20</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>Default.aspx</welcome-file>
</welcome-file-list>
</web-app>
@@ -1,41 +0,0 @@
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<!--
***** Defaulf is False *****
<add key="allowRemoteConfiguration" value="False" />-->
</appSettings>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<roleManager enabled="true" />
<compilation defaultLanguage="c#" debug="true"/>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Forms" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>
@@ -1,49 +0,0 @@
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<!--
***** Defaulf is False *****
<add key="allowRemoteConfiguration" value="False" />-->
</appSettings>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<roleManager enabled="true" />
<compilation defaultLanguage="c#" debug="true"/>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Forms" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<siteMap>
<providers>
<add siteMapFile="web.sitemap" name="AspNetConfigXmlSiteMapProvider"
type="Mainsoft.Web.Administration.CustomXmlSiteMapProvider" />
</providers>
</siteMap>
</system.web>
</configuration>
@@ -1,32 +0,0 @@
/CreateRole.aspx -crlf
/CreateRole.aspx.cs -crlf
/CreateRole.aspx.designer.cs -crlf
/CreateUser.aspx -crlf
/CreateUser.aspx.cs -crlf
/CreateUser.aspx.designer.cs -crlf
/Default.aspx -crlf
/Default.aspx.cs -crlf
/Default.aspx.designer.cs -crlf
/EditUser.aspx -crlf
/EditUser.aspx.cs -crlf
/EditUser.aspx.designer.cs -crlf
/Error.aspx -crlf
/Error.aspx.cs -crlf
/Error.aspx.designer.cs -crlf
/GridButton.cs -crlf
/GridCheckBox.cs -crlf
/Mainsoft.Web.AspnetConfig.css -crlf
/ManageRole.aspx -crlf
/ManageRole.aspx.cs -crlf
/ManageRole.aspx.designer.cs -crlf
/ManageUser.aspx -crlf
/ManageUser.aspx.cs -crlf
/ManageUser.aspx.designer.cs -crlf
/RolesDS.cs -crlf
/SecurError.aspx -crlf
/SecurError.aspx.cs -crlf
/SecurError.aspx.designer.cs -crlf
/StrUtils.cs -crlf
/Util.Master -crlf
/Util.Master.cs -crlf
/Util.Master.designer.cs -crlf
@@ -1,125 +0,0 @@
<%--
// Mainsoft.Web.AspnetConfig - Site administration utility
// Authors:
// Klain Yoni <[email protected]>
//
// Mainsoft.Web.AspnetConfig - Site administration utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>
<%@ Page Language="C#" AutoEventWireup="true" EnableTheming="false" MasterPageFile="~/aspnetconfig/Util.Master" CodeBehind="CreateRole.aspx.cs" Inherits="Mainsoft.Web.AspnetConfig.CreateRole" %>
<%@ Register TagPrefix="custom" Assembly="Mainsoft.Web.AspnetConfig" Namespace="Mainsoft.Web.AspnetConfig" %>
<asp:Content ID="Content1" ContentPlaceHolderID="SiteMapLinks" runat="server">
<td><a class="SiteMap" href="Default.aspx" title="Home page" runat="server">Home</a></td>
<td> >> </td>
<td style="color: #333333">Create\Manage roles</td>
</asp:Content>
<asp:Content ID="Main" ContentPlaceHolderID="Main" runat="server">
<asp:MultiView runat="server" ID="mv" ActiveViewIndex="0">
<asp:View runat="server" id="grid">
<table class="maintable">
<tr>
<td colspan="2" width="100%" style="height: 21px">
You can optionally add roles, or groups, that enable you to allow or deny groups of users access to specific folders in your Web site. For example, you might create roles such as "managers," "sales," or "members," each with different access to specific folders. <br /> <br />
</td>
</tr>
<tr>
<td width= "100%" valign="top">
<table width="100%" class="innertable" >
<tr>
<td width="100%" class="controlheader">
Create New Role
</td>
</tr>
<tr>
<td>
New role name: &nbsp; &nbsp;
<asp:TextBox ID="roleName_txb" runat="server" /> &nbsp; &nbsp;
<asp:Button ID="roleName_bt" runat="server" Text="Add role" OnClick="roleName_bt_Click" />
</td>
</tr>
<tr>
<td>
<asp:Label ID="error_lb" runat="server" ForeColor="Red" />
<br /> <br />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width= "100%" valign="top" datakeynames="Role;">
<asp:GridView ID="Roles_gv" runat="server" CellPadding="4" DataSourceID="ObjectDataSource1" ForeColor="#333333" GridLines="None" Width="100%" AutoGenerateColumns="False" DataKeyNames="Role">
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:BoundField DataField="Role" HeaderText="Role Name" >
<HeaderStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField HeaderText="Add\Remove Role">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" NavigateUrl='<%# string.Format("ManageRole.aspx?Role={0}", HttpUtility.UrlEncode((string)Eval("Role"))) %>'
Text="Manage" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<custom:GridButton ID="grid_btn" runat="server" User='<%# Bind("Role") %>' OnClick="gridbtn_click" >Delete</custom:GridButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" Font-Size="0.9em"
ForeColor="White" HorizontalAlign="Center" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete"
SelectMethod="Select" TypeName="Mainsoft.Web.AspnetConfig.RolesDS">
<DeleteParameters>
<asp:Parameter Name="Role" Type="String" />
</DeleteParameters>
</asp:ObjectDataSource>
</td>
</tr>
</table>
</asp:View>
<asp:View runat="server" ID="yesno" >
<table class="innertable" width="60%">
<tr>
<td style="height: 80px" valign="top">
<br />
<asp:Image runat="server" id="Img" /> &nbsp;
Are you sure you want to delete the role: "<%= Role %>"?
<br />
</td>
</tr>
<tr>
<td align="right" style="background-color:inactivecaptiontext" >
<asp:Button ID="yes" runat="server" Text="Yes" style="width:50px" OnClick="Click_Yes" />
<asp:Button ID="no" runat="server" Text="No" style="width:50px" OnClick="Click_No" />
</td>
</tr>
</table>
</asp:View>
</asp:MultiView>
</asp:Content>
@@ -1,107 +0,0 @@
// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Threading;
using System.Text;
namespace Mainsoft.Web.AspnetConfig
{
public partial class CreateRole : System.Web.UI.Page
{
public string Role
{
get { return ViewState["Role"] == null ? String.Empty : (string) ViewState["Role"]; }
set { ViewState["Role"] = value; }
}
protected override void OnPreRender (EventArgs e)
{
if (mv.ActiveViewIndex == 1) {
((Button) Master.FindControl ("Back")).Visible = false;
}
else {
((Button) Master.FindControl ("Back")).Visible = true;
}
base.OnPreRender (e);
Roles_gv.DataBind ();
}
protected override void OnInit (EventArgs e)
{
Img.ImageUrl = this.Page.ClientScript.GetWebResourceUrl (typeof (CreateRole), "Mainsoft.Web.AspnetConfig.resources.untitled.bmp");
base.OnInit (e);
}
protected void Page_Load (object sender, EventArgs e)
{
Button bt = Master.FindControl ("Back") as Button;
if (bt != null) {
bt.PostBackUrl = "Default.aspx";
}
}
protected void gridbtn_click (object sender, EventArgs e)
{
Role = ((GridButton) sender).User;
mv.ActiveViewIndex = 1;
}
protected void roleName_bt_Click (object sender, EventArgs e)
{
if (roleName_txb.Text != "") {
try {
Roles.CreateRole (roleName_txb.Text);
error_lb.Text = "";
}
catch (Exception ex) {
error_lb.Text = ex.Message;
}
finally {
}
}
else {
error_lb.Text = "Role name cannot be empty!";
}
}
protected void Click_No (object sender, EventArgs e)
{
mv.ActiveViewIndex = 0;
}
protected void Click_Yes (object sender, EventArgs e)
{
RolesDS.Delete (Role);
mv.ActiveViewIndex = 0;
}
}
}
@@ -1,26 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Mainsoft.Web.AspnetConfig {
public partial class CreateRole {
protected System.Web.UI.WebControls.MultiView mv;
protected System.Web.UI.WebControls.View grid;
protected System.Web.UI.WebControls.TextBox roleName_txb;
protected System.Web.UI.WebControls.Button roleName_bt;
protected System.Web.UI.WebControls.Label error_lb;
protected System.Web.UI.WebControls.GridView Roles_gv;
protected System.Web.UI.WebControls.ObjectDataSource ObjectDataSource1;
protected System.Web.UI.WebControls.View yesno;
protected System.Web.UI.WebControls.Image Img;
protected System.Web.UI.WebControls.Button yes;
protected System.Web.UI.WebControls.Button no;
}
}
@@ -1,195 +0,0 @@
<%--
// Mainsoft.Web.AspnetConfig - Site administration utility
// Authors:
// Klain Yoni <[email protected]>
//
// Mainsoft.Web.AspnetConfig - Site administration utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>
<%@ Page Language="C#" AutoEventWireup="true" EnableTheming="false" MasterPageFile="~/aspnetconfig/Util.Master" CodeBehind="CreateUser.aspx.cs" Inherits="Mainsoft.Web.AspnetConfig.CreateUser" %>
<asp:Content ContentPlaceHolderID="SiteMapLinks" runat="server">
<td><a class="SiteMap" href="Default.aspx" title="Home page" runat="server">Home</a></td>
<td> >> </td>
<td style="color: #333333">Create user</td>
</asp:Content>
<asp:Content runat="server" ID="main" ContentPlaceHolderID="Main">
<table style="border-right: thin solid; padding-right: 2px; border-top: thin solid; padding-left: 2px; padding-bottom: 2px; border-left: thin solid; padding-top: 2px; border-bottom: thin solid">
<tr>
<td colspan="2" width="100%" style="height: 21px">
<asp:Label ID="text_lbl" runat="server" Text="Add a user by entering a user name, password, and e-mail address on this page." />
</td>
</tr>
<tr>
<td width= "60%" valign="top">
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" BackColor="#F7F6F3"
BorderColor="#E6E2D8" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" LoginCreatedUser="false"
Font-Size="0.8em" Width="353px" ContinueDestinationPageUrl="CreateUser.aspx" FinishDestinationPageUrl="CreateUser.aspx" EmailRegularExpression="\S+@\S+\.\S+">
<WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
<ContentTemplate>
<table border="0" style="font-size: 100%; width: 353px; font-family: Verdana">
<tr>
<td align="center" colspan="2" style="font-weight: bold; color: white; background-color: #5d7b9d;
text-align: left">
Sign Up for Your New Account</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label></td>
<td>
<asp:TextBox ID="UserName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label></td>
<td>
<asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label></td>
<td>
<asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"
ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required."
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label></td>
<td>
<asp:TextBox ID="Email" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security Question:</asp:Label></td>
<td>
<asp:TextBox ID="Question" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question"
ErrorMessage="Security question is required." ToolTip="Security question is required."
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security Answer:</asp:Label></td>
<td>
<asp:TextBox ID="Answer" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer"
ErrorMessage="Security answer is required." ToolTip="Security answer is required."
ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:RegularExpressionValidator ID="EmailRegExp" runat="server" ControlToValidate="Email"
Display="Dynamic" ErrorMessage="Please enter a different e-mail." ValidationExpression="\S+@\S+\.\S+"
ValidationGroup="CreateUserWizard1"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2" style="color: red">
<asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
</td>
</tr>
</table>
</ContentTemplate>
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
<ContentTemplate>
<table border="0" style="font-size: 100%; width: 353px; font-family: Verdana">
<tr>
<td align="center" colspan="2" style="font-weight: bold; color: white; background-color: #5d7b9d;
text-align: left">
Create User</td>
</tr>
<tr>
<td>
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
<br />
&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;&nbsp; Complete.<br />
&nbsp; &nbsp; &nbsp;Your account has been successfully created.</td>
</tr>
<tr>
<td align="right" colspan="2">
<asp:Button ID="ContinueButton" runat="server" BackColor="#FFFBFF" BorderColor="#CCCCCC"
BorderStyle="Solid" BorderWidth="1px" CausesValidation="False" CommandName="Continue"
Font-Names="Verdana" ForeColor="#284775" Text="Continue" ValidationGroup="CreateUserWizard1" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:CompleteWizardStep>
</WizardSteps>
<SideBarStyle BackColor="#5D7B9D" BorderWidth="0px" Font-Size="0.9em" VerticalAlign="Top" />
<TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<SideBarButtonStyle BorderWidth="0px" Font-Names="Verdana" ForeColor="White" />
<NavigationButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" />
<HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" Font-Size="0.9em"
ForeColor="White" HorizontalAlign="Center" />
<CreateUserButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" />
<ContinueButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" />
<StepStyle BorderWidth="0px" />
</asp:CreateUserWizard>
</td>
<td width= "60%" valign="top">
<table width="100%" style="background-color: #f7f6f3; border-right: #e6e2d8 1px solid; border-top: #e6e2d8 1px solid; border-left: #e6e2d8 1px solid; border-bottom: #e6e2d8 1px solid;" >
<tr>
<td width="100%" style="text-align: center; background-color: #5D7B9D; font-weight:bold; font-size:0.9em; color:White;text-align:center; height: 19px;">
Roles
</td>
</tr>
<tr>
<td valign="top">
&nbsp;<asp:CheckBoxList ID="roles_lst" runat="server">
</asp:CheckBoxList></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
Active User
<asp:CheckBox ID="active_chb" runat="server" Checked="true" Enabled="true" />
</td>
</tr>
</table>
</asp:Content>
@@ -1,85 +0,0 @@
// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Mainsoft.Web.AspnetConfig
{
public partial class CreateUser : System.Web.UI.Page
{
protected override void OnPreRender (EventArgs e)
{
roles_lst.DataBind ();
base.OnPreRender (e);
if (CreateUserWizard1.ActiveStepIndex != 0) {
text_lbl.Visible = false;
((Button) Master.FindControl ("Back")).Visible = false;
active_chb.Enabled = false;
}
}
protected void Page_Load (object sender, EventArgs e)
{
if (!IsPostBack) {
roles_lst.DataValueField = "Role";
roles_lst.DataSource = RolesDS.Select ();
}
CreateUserWizard1.CreatingUser += new LoginCancelEventHandler (CreateUserWizard1_CreatingUser);
CreateUserWizard1.CreatedUser += new EventHandler (CreateUserWizard1_CreatedUser);
Button bt = Master.FindControl ("Back") as Button;
if (bt != null) {
bt.PostBackUrl = "Default.aspx";
}
}
public void CreateUserWizard1_CreatedUser (object sender, EventArgs e)
{
MembershipUser user = Membership.GetUser (((CreateUserWizard) sender).UserName);
roles_lst.Enabled = false;
int i = 0;
while (i < roles_lst.Items.Count) {
if (roles_lst.Items[i].Selected) {
try {
Roles.AddUserToRole (((CreateUserWizard) sender).UserName, roles_lst.Items[i].Text);
}
catch (Exception ex) {
((CreateUserWizard) sender).UnknownErrorMessage = ex.Message;
}
}
i++;
}
}
public void CreateUserWizard1_CreatingUser (object sender, LoginCancelEventArgs e)
{
((CreateUserWizard) sender).DisableCreatedUser = !active_chb.Checked;
}
}
}
@@ -1,21 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Mainsoft.Web.AspnetConfig {
public partial class CreateUser {
protected System.Web.UI.WebControls.Label text_lbl;
protected System.Web.UI.WebControls.CreateUserWizard CreateUserWizard1;
protected System.Web.UI.WebControls.CreateUserWizardStep CreateUserWizardStep1;
protected System.Web.UI.WebControls.CompleteWizardStep CompleteWizardStep1;
protected System.Web.UI.WebControls.CheckBoxList roles_lst;
protected System.Web.UI.WebControls.CheckBox active_chb;
}
}
@@ -1,88 +0,0 @@
<%--
// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility
// Authors:
// Klain Yoni <[email protected]>
//
// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>
<%@ Page Language="C#" AutoEventWireup="true" EnableTheming="false" MasterPageFile="~/aspnetconfig/Util.Master" CodeBehind="Default.aspx.cs" Inherits="Mainsoft.Web.AspnetConfig.Default" %>
<asp:Content ContentPlaceHolderID="SiteMapLinks" runat="server">
<td style="color: #333333">Home</td>
</asp:Content>
<asp:Content runat="server" ContentPlaceHolderID="Main">
<table>
<tr>
<td>
You can use the Web Site Administration Tool to manage all the security settings for your application. You can set up users and passwords (authentication), and create roles (groups of users). By default, user information is stored in a Cloudscape database in the Data folder of your Web project. If you want to store user information in a different database, you may configure a different provider in the web.config file.
<br /><br /><br />
</td>
</tr>
<tr>
<td>
<table class="innertable" width="70%" >
<tr>
<td class="controlheader">
Users
</td>
</tr>
<tr>
<td>
<%= User_count %>
</td>
</tr>
<tr>
<td>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="CreateUser.aspx" OnLoad="UsersLinks_Load">Create user</asp:HyperLink>
</td>
</tr>
<tr>
<td>
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="ManageUser.aspx" OnLoad="UsersLinks_Load">Manage users</asp:HyperLink>
</td>
</tr>
</table>
<br /><br /><br />
</td>
</tr>
<tr>
<td>
<table class="innertable" width="70%">
<tr>
<td class="controlheader">
Roles
</td>
</tr>
<tr>
<td>
<%= Roles_count %>
</td>
</tr>
<tr>
<td>
<asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="CreateRole.aspx" OnLoad="HyperLink1_Load" >Create or manage roles</asp:HyperLink>
</td>
</tr>
</table>
<br /><br /><br />
</td>
</tr>
</table>
</asp:Content>
@@ -1,109 +0,0 @@
// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility
// Authors:
// Klain Yoni <[email protected]>
//
// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Mainsoft.Web.AspnetConfig
{
public partial class Default : System.Web.UI.Page
{
private bool IsPortalRoleProvider;
private bool IsPortalMembershipProvider;
protected override void OnInit (EventArgs e)
{
try {
IsPortalRoleProvider = (Roles.Provider).GetType ().ToString () == "Mainsoft.Web.Security.WPGroupsRoleProvider";
}
catch{
}
IsPortalMembershipProvider = (Membership.Provider).GetType().ToString () == "Mainsoft.Web.Security.WPMembershipProvider";
}
protected void Page_Load (object sender, EventArgs e)
{
Button bt = Master.FindControl ("Back") as Button;
if (bt != null) {
bt.Enabled = false;
}
}
public string User_count
{
get
{
if (IsPortalMembershipProvider) {
return "You cannot create or manage users when WPMembershipProvider is configured as the default provider.";
}
else {
MembershipUserCollection user_collection = Membership.GetAllUsers ();
return "Created users :" + user_collection.Count.ToString ();
}
}
}
public string Roles_count
{
get
{
if (IsPortalRoleProvider) {
return @"You cannot create or manage roles when WPGroupsRoleProvider is configured as the default provider.";
}
else if (Roles.Enabled) {
string[] list = Roles.GetAllRoles ();
return "Existing roles :" + list.Length.ToString ();
}
else
return @"In order to create or manage roles, the roleManger key must be enabled. To enable roleManager, please modify your Web.config file as follows: <br />
&nbsp; &lt;configuration xmlns=""http://schemas.microsoft.com/.NetConfiguration/v2.0""&gt; <br />
&nbsp;&nbsp; &lt;system.web&gt; <br />
&nbsp;&nbsp;&nbsp; &lt;roleManager enabled=""true"" /&gt; <br />
&nbsp;&nbsp; &lt/system.web&gt; <br />
&nbsp; &lt;/configuration&gt;";
}
}
protected void HyperLink1_Load (object sender, EventArgs e)
{
if (!Roles.Enabled || IsPortalRoleProvider)
((HyperLink) sender).Visible = false;
}
protected void UsersLinks_Load (object sender, EventArgs e)
{
if (IsPortalMembershipProvider) {
((HyperLink) sender).Visible = false;
}
}
}
}
@@ -1,18 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Mainsoft.Web.AspnetConfig {
public partial class Default {
protected System.Web.UI.WebControls.HyperLink HyperLink1;
protected System.Web.UI.WebControls.HyperLink HyperLink2;
protected System.Web.UI.WebControls.HyperLink HyperLink3;
}
}
@@ -1,126 +0,0 @@
<%--
// Mainsoft.Web.AspnetConfig - Site administration utility
// Authors:
// Klain Yoni <[email protected]>
//
// Mainsoft.Web.AspnetConfig - Site administration utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>
<%@ Page Language="C#" AutoEventWireup="true" EnableTheming="false" MasterPageFile="~/aspnetconfig/Util.Master" CodeBehind="EditUser.aspx.cs" Inherits="Mainsoft.Web.AspnetConfig.EditUser" %>
<%@ Register TagPrefix="custom" TagName="searcher" Src="~/Controls/Searcher.ascx" %>
<asp:Content ContentPlaceHolderID="SiteMapLinks" runat="server">
<td><a class="SiteMap" href="Default.aspx" title="Home page" runat="server">Home</a></td>
<td> >> </td>
<td style="color: #284E98"><a class="SiteMap" href="ManageUser.aspx" title="Manage user" runat="server">Manage user</a></td>
<td> >> </td>
<td style="color: #333333">Edit user</td>
</asp:Content>
<asp:Content runat="server" ID="main" ContentPlaceHolderID="Main">
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<asp:View ID="updateUser" runat="server" >
<div>
<table width="100%" class="maintable">
<tr>
<td colspan="2" width="100%" style="height: 21px">
Use this page to edit user information and to specify what roles a user belongs in.
<br /> <br /> <br />
</td>
</tr>
<tr>
<td width="70%" class="innertable" align="left" valign="top">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="controlheader" colspan="3">
User
</td>
</tr>
<tr>
<td>
User ID:
</td>
<td>
<asp:TextBox ID="userid_txb" runat="server" Enabled="false" />
</td>
<td>
&nbsp;
</td>
</tr>
<tr>
<td>
<span style="font-size: 20px; color: red">*</span> E-mail address:
</td>
<td>
<asp:TextBox ID="email_txb" runat="server"></asp:TextBox>
</td>
<td>
<asp:CheckBox ID="active_chb" runat="server" /> Active user
</td>
</tr>
<tr>
<td>
Description:
</td>
<td>
<asp:TextBox ID="desc_txb" runat="server">[not set]</asp:TextBox>
</td>
<td>
<asp:Button ID="save_bt" runat="server" Text="Save" OnClick="save_bt_Click" />
</td>
</tr>
</table>
</td>
<td class="innertable" valign="top" style="width: 82%" >
<custom:searcher ID="srch" runat="server" />
</td>
</tr>
<tr>
<td colspan="2">
(<span style="font-size: 20px; color: red">*</span>)Required field <br /><br />
<asp:RequiredFieldValidator ID="required_email_validator" runat="server" ControlToValidate="email_txb" ErrorMessage="Email required" />
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" ControlToValidate="email_txb" ValidationExpression="\S+@\S+\.\S+" runat="server" ErrorMessage="Email format is invalid"></asp:RegularExpressionValidator>
</td>
</tr>
</table>
</div>
</asp:View>
<asp:View ID="successupdate" runat="server">
<div>
<table width="100%" class="maintable">
<tr>
<td width="100%" class="controlheader">
User Management
</td>
</tr>
<tr>
<td width="100%" style="height: 100px" valign="top" align="left">
You have successfully updated the user
<asp:Label ID="name_lbl" runat="server" /> <br /> <br /> <br />
</td>
</tr>
<tr>
<td width="100%" align="right">
<asp:Button ID="success_btn" runat="server" Text="OK" OnClick="success_btn_Click" />
</td>
</tr>
</table>
</div>
</asp:View>
</asp:MultiView>
</asp:Content>
@@ -1,96 +0,0 @@
// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Mainsoft.Web.AspnetConfig
{
public partial class EditUser : System.Web.UI.Page
{
String user_name;
protected void Page_Load (object sender, EventArgs e)
{
user_name = Request.QueryString["User"];
srch.User = user_name;
if (!IsPostBack) {
FillUserData (user_name);
name_lbl.Text = user_name;
}
Button bt = Master.FindControl ("Back") as Button;
if (bt != null) {
bt.PostBackUrl = "ManageUser.aspx";
}
}
protected override void OnPreRender (EventArgs e)
{
if (IsPostBack) {
if (MultiView1.ActiveViewIndex == 1) {
((Button) Master.FindControl ("Back")).Visible = false;
}
else {
((Button) Master.FindControl ("Back")).Visible = true;
}
}
base.OnPreRender (e);
}
void FillUserData (string user_name)
{
MembershipUser user = Membership.GetUser (user_name);
userid_txb.Text = user.UserName;
email_txb.Text = user.Email;
active_chb.Checked = user.IsApproved;
desc_txb.Text = user.Comment;
}
protected void roles_lst_DataBound (object sender, EventArgs e)
{
foreach (ListItem item in ((CheckBoxList) sender).Items) {
item.Selected = Boolean.Parse (item.Value);
}
}
protected void save_bt_Click (object sender, EventArgs e)
{
MembershipUser user = Membership.GetUser (user_name);
user.IsApproved = active_chb.Checked;
user.Email = email_txb.Text;
user.Comment = desc_txb.Text;
Membership.UpdateUser (user);
MultiView1.ActiveViewIndex = 1;
}
protected void success_btn_Click (object sender, EventArgs e)
{
Server.Transfer ("ManageUser.aspx");
}
}
}
@@ -1,28 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Mainsoft.Web.AspnetConfig {
public partial class EditUser {
protected System.Web.UI.WebControls.MultiView MultiView1;
protected System.Web.UI.WebControls.View updateUser;
protected System.Web.UI.WebControls.TextBox userid_txb;
protected System.Web.UI.WebControls.TextBox email_txb;
protected System.Web.UI.WebControls.CheckBox active_chb;
protected System.Web.UI.WebControls.TextBox desc_txb;
protected System.Web.UI.WebControls.Button save_bt;
protected Mainsoft.Web.AspnetConfig.Searcher srch;
protected System.Web.UI.WebControls.RequiredFieldValidator required_email_validator;
protected System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator1;
protected System.Web.UI.WebControls.View successupdate;
protected System.Web.UI.WebControls.Label name_lbl;
protected System.Web.UI.WebControls.Button success_btn;
}
}
@@ -1,44 +0,0 @@
<%--
// Mainsoft.Web.AspnetConfig - Site administration utility
// Authors:
// Klain Yoni <[email protected]>
//
// Mainsoft.Web.AspnetConfig - Site administration utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Error.aspx.cs" Theme="" StylesheetTheme="" Inherits="Mainsoft.Web.AspnetConfig.Error" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ASP.Net Web Application Administration</title>
</head>
<body>
<form id="form1" runat="server">
<div style="font-weight: bold; font-size: 20pt; color: red">
Error occured on this request ! Please try again !
</div>
<div>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="Default.aspx">Administration utility home page</asp:HyperLink>
</div>
</form>
</body>
</html>
@@ -1,21 +0,0 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace Mainsoft.Web.AspnetConfig
{
public partial class Error : System.Web.UI.Page
{
protected void Page_Load (object sender, EventArgs e)
{
}
}
}
@@ -1,17 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Mainsoft.Web.AspnetConfig {
public partial class Error {
protected System.Web.UI.HtmlControls.HtmlForm form1;
protected System.Web.UI.WebControls.HyperLink HyperLink1;
}
}
@@ -1,43 +0,0 @@
// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.ComponentModel;
namespace Mainsoft.Web.AspnetConfig
{
public class GridButton : LinkButton
{
[Bindable (true)]
public string User
{
get { return ViewState["User"] == null ? String.Empty : (string) ViewState["User"]; }
set { ViewState["User"] = value; }
}
}
}
@@ -1,247 +0,0 @@
//
// System.Web.Configuration.HandlerFactoryConfiguration.cs
//
//
// Authors:
// Miguel de Icaza ([email protected])
// Gonzalo Paniagua Javier ([email protected])
//
// (C) 2005 Novell, Inc (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.Web.Util;
using System.Text.RegularExpressions;
namespace System.Web.Configuration {
class FileMatchingInfo {
public string MatchExact;
public string MatchExpr;
// If set, we can fast-path the patch with string.EndsWith (FMI.EndsWith)
public string EndsWith;
public Regex RegExp;
public FileMatchingInfo (string s)
{
MatchExpr = s;
if (s[0] == '*' && (s.IndexOf ('*', 1) == -1))
EndsWith = s.Substring (1);
if (s.IndexOf ('*') == -1)
MatchExact = "/" + s;
if (MatchExpr != "*") {
string expr = MatchExpr.Replace(".", "\\.").Replace("?", "\\?").Replace("*", ".*");
if (expr.Length > 0 && expr [0] =='/')
expr = expr.Substring (1);
expr += "\\z";
RegExp = new Regex (expr);
}
}
}
class HttpHandler {
// If `null', we are the "*" match
public string OriginalVerb;
public string OriginalPath;
public string [] Verbs;
public FileMatchingInfo [] files;
// To support lazy loading we keep the name around.
public string TypeName;
Type type;
object instance;
public HttpHandler (string verb, string path, string typename, Type t)
{
OriginalVerb = verb;
OriginalPath = path;
if (verb != "*")
Verbs = verb.Split (',');
string [] paths = path.Split (',');
files = new FileMatchingInfo [paths.Length];
int i = 0;
foreach (string s in paths)
files [i++] = new FileMatchingInfo (s);
this.TypeName = typename;
type = t;
}
//
// Loads the a type by name and verifies that it implements
// IHttpHandler or IHttpHandlerFactory
//
public static Type LoadType (string type_name)
{
Type t;
try {
t = Type.GetType (type_name, true);
} catch (Exception e) {
throw new HttpException (String.Format ("Failed to load httpHandler type `{0}'", type_name));
}
if (typeof (IHttpHandler).IsAssignableFrom (t) ||
typeof (IHttpHandlerFactory).IsAssignableFrom (t))
return t;
throw new HttpException (String.Format ("Type {0} does not implement IHttpHandler or IHttpHandlerFactory", type_name));
}
public bool PathMatches (string p)
{
int slash = p.LastIndexOf ('/');
string orig = p;
if (slash != -1)
p = p.Substring (slash);
for (int j = files.Length; j > 0; ){
j--;
FileMatchingInfo fm = files [j];
if (fm.MatchExact != null)
return fm.MatchExact.Length == p.Length && StrUtils.EndsWith (p, fm.MatchExact);
if (fm.EndsWith != null)
return StrUtils.EndsWith (p, fm.EndsWith);
if (fm.MatchExpr == "*")
return true;
/* convert to regexp */
return fm.RegExp.IsMatch (orig);
}
return false;
}
// Loads the handler, possibly delay-loaded.
public object GetHandlerInstance ()
{
IHttpHandler ihh = instance as IHttpHandler;
if (instance == null || (ihh != null && !ihh.IsReusable)){
if (type == null)
type = LoadType (TypeName);
instance = Activator.CreateInstance (type);
}
return instance;
}
}
class HandlerFactoryConfiguration {
ArrayList handlers;
HandlerFactoryConfiguration parent;
int parent_items;
public HandlerFactoryConfiguration (HandlerFactoryConfiguration parent)
{
this.parent = parent;
if (parent != null) {
handlers = new ArrayList (parent.handlers);
parent_items = handlers.Count;
} else {
handlers = new ArrayList ();
}
}
public void Clear ()
{
handlers.Clear ();
}
public void Add (string verb, string path, string type_name, bool validate)
{
Type type;
if (validate){
type = HttpHandler.LoadType (type_name);
if (type == null)
throw new HttpException (String.Format ("Can not load {0}", type_name));
} else
type = null;
handlers.Add (new HttpHandler (verb, path, type_name, type));
}
public bool Remove (string verb, string path)
{
for (int i = handlers.Count - 1; i >= 0; i--) {
HttpHandler handler = (HttpHandler) handlers [i];
if (verb == handler.OriginalVerb && path == handler.OriginalPath){
handlers.RemoveAt (i);
return true;
}
}
return false;
}
public object LocateHandler (string verb, string filepath)
{
int start, end;
int count = handlers.Count;
for (int k = 0; k < 2; k++) {
// First iteration searches for the mapping in the items added to this
// instance. The second one searches through the parent items if any.
start = (k == 0) ? parent_items : 0;
end = (k == 0) ? count : parent_items;
for (int i = start; i < end; i++) {
HttpHandler handler = (HttpHandler) handlers [i];
if (handler.Verbs == null){
if (handler.PathMatches (filepath))
return handler.GetHandlerInstance ();
continue;
}
string [] verbs = handler.Verbs;
for (int j = verbs.Length; j > 0; ){
j--;
if (verbs [j] != verb)
continue;
if (handler.PathMatches (filepath))
return handler.GetHandlerInstance ();
}
}
}
return null;
}
}
}
@@ -1,91 +0,0 @@
//
// System.Web.Configuration.HttpHandlersSectionHandler
//
// Authors:
// Gonzalo Paniagua Javier ([email protected])
//
// (C) 2002 Ximian, Inc (http://www.ximian.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections;
using System.Configuration;
using System.Xml;
using System.Globalization;
using System;
namespace Mainsoft.Web.Configuration
{
internal class HandlersUtil
{
private HandlersUtil ()
{
}
static internal string ExtractAttributeValue (string attKey, XmlNode node)
{
return ExtractAttributeValue (attKey, node, false);
}
static internal string ExtractAttributeValue (string attKey, XmlNode node, bool optional)
{
return ExtractAttributeValue (attKey, node, optional, false);
}
static internal string ExtractAttributeValue (string attKey, XmlNode node, bool optional,
bool allowEmpty)
{
if (node.Attributes == null) {
if (optional)
return null;
ThrowException ("Required attribute not found: " + attKey, node);
}
XmlNode att = node.Attributes.RemoveNamedItem (attKey);
if (att == null) {
if (optional)
return null;
ThrowException ("Required attribute not found: " + attKey, node);
}
string value = att.Value;
if (!allowEmpty && value == String.Empty) {
string opt = optional ? "Optional" : "Required";
ThrowException (opt + " attribute is empty: " + attKey, node);
}
return value;
}
static internal void ThrowException (string msg, XmlNode node)
{
if (node != null && node.Name != String.Empty)
msg = msg + " (node name: " + node.Name + ") ";
throw new ConfigurationException (msg, node);
}
}
}
@@ -1,72 +0,0 @@
.appHeader
{
background-image: url(Images/mainsoft.jpg);
background-repeat :no-repeat;
height: 139px;
width: 100%;
border-bottom: 1 solid #7daad4;
background-color:White;
width: 100%;
height: 133px;
}
.controlheader {
text-align: center;
background-color: #5D7B9D;
font-weight:bold;
font-size:0.9em;
color:White;
text-align:center;
height: 25px;
}
.maintable {
border-right: thin solid;
padding-right: 2px;
border-top: thin solid;
padding-left: 2px;
padding-bottom: 2px;
border-left: thin solid;
padding-top: 2px;
border-bottom: thin solid;
width: 100%;
}
.innertable
{
background-color: #f7f6f3;
border-right: #e6e2d8 1px solid;
border-top: #e6e2d8 1px solid;
border-left: #e6e2d8 1px solid;
border-bottom: #e6e2d8 1px solid;
}
.h1{
font-size: 25px;
vertical-align: middle;
color: #6699ff;
text-align: center;
}
.bordredtable
{
border-right: #6699ff 5px solid;
padding-right: 40px;
border-top: #6699ff 5px solid;
padding-left: 40px;
padding-bottom: 40px;
border-left: #6699ff 5px solid;
padding-top: 40px;
border-bottom: #6699ff 5px solid;
width: 90%;
height: 500px;
margin:5%;
}
BODY,TABLE,TR,TD
{
font-family: Arial;
font-size: 11pt;
}
@@ -1,106 +0,0 @@
<%--
// Mainsoft.Web.AspnetConfig - Site administration utility
// Authors:
// Klain Yoni <[email protected]>
//
// Mainsoft.Web.AspnetConfig - Site administration utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>
<%@ Page Language="C#" AutoEventWireup="true" EnableTheming="false" MasterPageFile="~/aspnetconfig/Util.Master" CodeBehind="ManageRole.aspx.cs" Inherits="Mainsoft.Web.AspnetConfig.MenageRole" %>
<%@ Register tagprefix="custom" namespace="Mainsoft.Web.AspnetConfig" Assembly="Mainsoft.Web.AspnetConfig" %>
<asp:Content ID="Content1" ContentPlaceHolderID="SiteMapLinks" runat="server">
<td><a class="SiteMap" href="Default.aspx" title="Home page" runat="server">Home</a></td>
<td> >> </td>
<td style="color: #284E98;"><a class="SiteMap" href="CreateRole.aspx" title="Create\Manage roles" runat="server">Create\Manage roles</a></td>
<td> >> </td>
<td style="color: #333333">Manage roles</td>
</asp:Content>
<asp:Content runat="server" ID="main" ContentPlaceHolderID="Main">
<table class="maintable">
<tr>
<td colspan="2" width="100%" style="height: 21px">
Use this page to manage the members in the specified role. To add a user to the role, search for the user name and then select the User Is In Role check box for that user.
<br />
Role:
<asp:Label ID="role_lbl" runat="server" /> <br />
</td>
</tr>
<tr>
<td width= "100%" valign="top">
<table width="100%" class="innertable" >
<tr>
<td width="100%" class="controlheader">
Search for Users
</td>
</tr>
<tr>
<td>
Search for Users &nbsp; &nbsp;
<asp:DropDownList ID="searchBy_dl" runat="server">
<asp:ListItem Selected="True" Value="Name">User Name</asp:ListItem>
<asp:ListItem Value="Mail">E-Mail</asp:ListItem>
</asp:DropDownList> &nbsp; &nbsp;<asp:TextBox ID="user_txt" runat="server"></asp:TextBox>
&nbsp;
<asp:Button ID="searchUser_bt" runat="server" Text="Search" /> <br />
Wildcard characters * and ? are permitted. <br /><br />
</td>
</tr>
<tr>
<td width= "100%" valign="top" datakeynames="Role;">
<asp:GridView ID="Roles_gv" runat="server" CellPadding="4" DataSourceID="ObjectDataSource1" ForeColor="#333333" GridLines="None" Width="100%" AutoGenerateColumns="False" AllowPaging="True" PageSize="5">
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:BoundField DataField="User" HeaderText="User Name" />
<asp:TemplateField HeaderText="User Is In Role">
<ItemTemplate>
<custom:GridCheckBox ID="Check" runat="server" AutoPostBack="true" Checked='<%# Bind("InRole") %>'
User='<%# Bind("User") %>' OnCheckedChanged="CheckBox_CheckedChanged" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" Font-Size="0.9em"
ForeColor="White" HorizontalAlign="Left" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete"
SelectMethod="CreateManageRoleTable" TypeName="Mainsoft.Web.AspnetConfig.RolesDS">
<DeleteParameters>
<asp:Parameter Name="Role" Type="String" />
</DeleteParameters>
<SelectParameters>
<asp:QueryStringParameter Name="role" QueryStringField="Role" Type="String" />
<asp:ControlParameter ControlID="user_txt" Name="searchtag" PropertyName="Text"
Type="String" DefaultValue="&quot;&quot;" />
<asp:ControlParameter ControlID="searchBy_dl" Name="searchby" PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Content>
@@ -1,76 +0,0 @@
// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -->
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Mainsoft.Web.AspnetConfig
{
public partial class MenageRole : System.Web.UI.Page
{
String role;
protected void Page_Load (object sender, EventArgs e)
{
role = Request.QueryString["Role"];
if (!Roles.RoleExists (role)) {
Server.Transfer ("Error.aspx");
}
role_lbl.Text = role;
Button bt = Master.FindControl ("Back") as Button;
if (bt != null) {
bt.PostBackUrl = "CreateRole.aspx";
}
}
protected override void OnPreRender (EventArgs e)
{
Roles_gv.DataBind ();
base.OnPreRender (e);
}
public void CheckBox_CheckedChanged (object sender, EventArgs e)
{
string user = ((GridCheckBox) sender).User;
if (((GridCheckBox) sender).Checked) {
try {
Roles.AddUserToRole (user, role);
}
catch {
}
}
else {
try {
Roles.RemoveUserFromRole (user, role);
}
catch {
}
}
}
}
}
@@ -1,21 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Mainsoft.Web.AspnetConfig {
public partial class MenageRole {
protected System.Web.UI.WebControls.Label role_lbl;
protected System.Web.UI.WebControls.DropDownList searchBy_dl;
protected System.Web.UI.WebControls.TextBox user_txt;
protected System.Web.UI.WebControls.Button searchUser_bt;
protected System.Web.UI.WebControls.GridView Roles_gv;
protected System.Web.UI.WebControls.ObjectDataSource ObjectDataSource1;
}
}
@@ -1,153 +0,0 @@
<%--
// Mainsoft.Web.AspnetConfig - Site administration utility
// Authors:
// Klain Yoni <[email protected]>
//
// Mainsoft.Web.AspnetConfig - Site administration utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>
<%@ Page Language="C#" AutoEventWireup="true" EnableTheming="false" MasterPageFile="~/aspnetconfig/Util.Master" CodeBehind="ManageUser.aspx.cs" Inherits="Mainsoft.Web.AspnetConfig.ManageUser" %>
<%@ Register tagprefix="custom" namespace="Mainsoft.Web.AspnetConfig" Assembly="Mainsoft.Web.AspnetConfig" %>
<%@ Register TagPrefix="custom" TagName="searcher" Src="~/Controls/Searcher.ascx" %>
<asp:Content ContentPlaceHolderID="SiteMapLinks" runat="server">
<td><a class="SiteMap" href="Default.aspx" title="Home page" runat="server">Home</a></td>
<td> >> </td>
<td style="color: #333333">Manage user</td>
</asp:Content>
<asp:Content runat="server" ID="main" ContentPlaceHolderID="Main">
<asp:MultiView ID="mv" ActiveViewIndex="0" runat="server">
<asp:View ID="manage" runat="server" >
<table class="maintable">
<tr>
<td colspan="2" width="100%" style="height: 21px">
Click Edit User to view or change the user's password or other properties. To assign roles to the selected user, select the appropriate check boxes on the right. To prevent users from logging in to your application while retaining their information in your database, set the status to inactive by clearing the check box.
<br /> <br /> <br />
</td>
</tr>
<tr>
<td width= "100%" valign="top" style="height: 360px">
<table width="100%" class="innertable" >
<tr>
<td width="100%" colspan="2" class="controlheader">
Search for Users
</td>
</tr>
<tr>
<td colspan="2">
Search by : &nbsp; &nbsp;
<asp:DropDownList ID="searchBy_lbx" runat="server">
<asp:ListItem Selected="True" Value="Name">User Name</asp:ListItem>
<asp:ListItem Value="Mail">E-Mail</asp:ListItem>
</asp:DropDownList> &nbsp; &nbsp;<asp:TextBox ID="user_txt" runat="server"></asp:TextBox>
&nbsp;
<asp:Button ID="searchUser_bt" runat="server" Text="Search" /> <br />
Wildcard characters * and ? are permitted. <br /><br />
</td>
</tr>
<tr>
<td width= "70%" valign="top" >
<asp:GridView ID="Roles_gv" runat="server" CellPadding="4" DataSourceID="ObjectDataSource1" ForeColor="#333333" GridLines="None" Width="100%" AutoGenerateColumns="False" AllowPaging="True" PageSize="5" DataKeyNames="User" >
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:TemplateField HeaderText="Active">
<ItemTemplate>
<custom:GridCheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Active") %>' AutoPostBack="true"
OnCheckedChanged="CheckBox_CheckedChanged" User='<%# Bind("User") %>' />
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:BoundField DataField="User" HeaderText="User Name" >
<HeaderStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink NavigateUrl='<%# string.Format("EditUser.aspx?User={0}", HttpUtility.UrlEncode((string)Eval("User"))) %>'
Text="Edit User" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<custom:GridButton ID="GridButton1" runat="server" User='<%# Bind("User") %>' OnClick="Delete_Click" >Delete User</custom:GridButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<custom:GridButton ID="grid_btn" runat="server" User='<%# Bind("User") %>' OnClick="gridbtn_click" OnLoad="gridbtn_load">Edit roles</custom:GridButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" Font-Size="0.9em"
ForeColor="White" HorizontalAlign="Center" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="DeleteUser"
SelectMethod="SelectUser" TypeName="Mainsoft.Web.AspnetConfig.RolesDS">
<DeleteParameters>
<asp:Parameter Name="User" Type="String" />
</DeleteParameters>
<SelectParameters>
<asp:ControlParameter ControlID="user_txt" DefaultValue="&quot;&quot;" Name="searchtag"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="searchBy_lbx" DefaultValue="" Name="searchby" PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
</td>
<td width="30%" valign="top">
<custom:Searcher ID="srch" runat="server" />
</td>
</tr>
</table>
<br /><br />
</td>
</tr>
<tr>
<td colspan="2">
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="CreateUser.aspx">Create new user</asp:HyperLink>
</td>
</tr>
</table>
</asp:View>
<asp:View ID="quest" runat="server">
<table class="innertable" width="60%">
<tr>
<td style="height: 80px" valign="top">
<br />
<asp:Image runat="server" ID="Img" /> &nbsp;
Are you sure you want to delete the user: "<%= User_name %>"? <br />
All information for this user will be deleted, including the user name, the user's membership in roles, and any profile property values associated with this user.
<br /><br /><br />
</td>
</tr>
<tr>
<td align="right" style="background-color:inactivecaptiontext" >
<asp:Button ID="yes" runat="server" Text="Yes" style="width:50px" OnClick="Click_Yes" />
<asp:Button ID="no" runat="server" Text="No" style="width:50px" OnClick="Click_No" />
</td>
</tr>
</table>
</asp:View>
</asp:MultiView>
</asp:Content>
@@ -1,138 +0,0 @@
// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility
// Authors:
// Klain Yoni <[email protected]>
//
// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Mainsoft.Web.AspnetConfig
{
public partial class ManageUser : System.Web.UI.Page
{
public string User_name
{
get { return ViewState["User"] == null ? String.Empty : (string) ViewState["User"]; }
set { ViewState["User"] = value; }
}
protected void Page_Load (object sender, EventArgs e)
{
Button bt = Master.FindControl ("Back") as Button;
if (bt != null) {
bt.PostBackUrl = "Default.aspx";
}
}
protected override void OnInit (EventArgs e)
{
Img.ImageUrl = this.Page.ClientScript.GetWebResourceUrl (typeof (ManageUser), "Mainsoft.Web.AspnetConfig.resources.untitled.bmp");
base.OnInit (e);
}
protected override void OnPreRender (EventArgs e)
{
if (IsPostBack) {
Roles_gv.DataBind ();
if (mv.ActiveViewIndex == 1) {
((Button) Master.FindControl ("Back")).Visible = false;
}
else {
((Button) Master.FindControl ("Back")).Visible = true;
}
}
base.OnPreRender (e);
}
public void CheckBox_CheckedChanged (object sender, EventArgs e)
{
string user_name = ((GridCheckBox) sender).User;
MembershipUser user = Membership.GetUser (user_name);
if (((GridCheckBox) sender).Checked) {
user.IsApproved = true;
Membership.UpdateUser (user);
}
else {
user.IsApproved = false;
Membership.UpdateUser (user);
}
}
protected void gridbtn_click (object sender, EventArgs e)
{
srch.User = ((GridButton) sender).User;
}
protected void Roles_Changed (object sender, EventArgs e)
{
String user_name = (string) ViewState["User_name"];
if (((CheckBox) sender).Checked) {
try {
Roles.AddUserToRole (user_name, ((CheckBox) sender).Text);
}
catch {
}
}
else {
try {
Roles.RemoveUserFromRole (user_name, ((CheckBox) sender).Text);
}
catch {
}
}
}
protected void Click_No (object sender, EventArgs e)
{
mv.ActiveViewIndex = 0;
}
protected void Click_Yes (object sender, EventArgs e)
{
RolesDS.DeleteUser (User_name);
//Roles_gv.DataBind ();
mv.ActiveViewIndex = 0;
}
protected void Delete_Click (object sender, EventArgs e)
{
User_name = ((GridButton) sender).User;
mv.ActiveViewIndex = 1;
}
protected void gridbtn_load (object sender, EventArgs e)
{
if (!Roles.Enabled) {
((GridButton)sender).Enabled = false;
}
}
}
}
@@ -1,28 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Mainsoft.Web.AspnetConfig {
public partial class ManageUser {
protected System.Web.UI.WebControls.MultiView mv;
protected System.Web.UI.WebControls.View manage;
protected System.Web.UI.WebControls.DropDownList searchBy_lbx;
protected System.Web.UI.WebControls.TextBox user_txt;
protected System.Web.UI.WebControls.Button searchUser_bt;
protected System.Web.UI.WebControls.GridView Roles_gv;
protected System.Web.UI.WebControls.ObjectDataSource ObjectDataSource1;
protected Mainsoft.Web.AspnetConfig.Searcher srch;
protected System.Web.UI.WebControls.HyperLink HyperLink1;
protected System.Web.UI.WebControls.View quest;
protected System.Web.UI.WebControls.Image Img;
protected System.Web.UI.WebControls.Button yes;
protected System.Web.UI.WebControls.Button no;
}
}
@@ -1,301 +0,0 @@
// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Text.RegularExpressions;
namespace Mainsoft.Web.AspnetConfig
{
public class RolesDS
{
public static DataTable Select()
{
return CreateDataTable();
}
public static DataTable SelectUser()
{
return CreateUserDataTable();
}
public static DataTable SelectUser(string searchtag, string searchby)
{
return CreateUserDataTable(searchtag, searchby);
}
public static DataTable SelectUsersRole(string user)
{
return CreateUsersRoles(user);
}
public static DataTable CreateUsersRoles(string user)
{
DataTable aTable = new DataTable("A");
DataColumn dtCol;
DataColumn dtCol1;
DataRow dtRow;
// Create User Name column and add to the table
dtCol = new DataColumn();
dtCol.DataType = Type.GetType("System.String");
dtCol.ColumnName = "Role";
dtCol.AutoIncrement = false;
dtCol.ReadOnly = false;
dtCol.Unique = true;
aTable.Columns.Add(dtCol);
dtCol1 = new DataColumn();
dtCol1.DataType = Type.GetType("System.Boolean");
dtCol1.ColumnName = "IsInRole";
dtCol1.AutoIncrement = false;
dtCol1.ReadOnly = false;
dtCol1.Unique = false;
aTable.Columns.Add(dtCol1);
if (Roles.Enabled) {
// Create rows to the table
foreach (String role in Roles.GetAllRoles ()) {
dtRow = aTable.NewRow ();
dtRow["Role"] = role;
dtRow["IsInRole"] = Roles.IsUserInRole (user, role);
aTable.Rows.Add (dtRow);
}
}
aTable.PrimaryKey = new DataColumn[] { aTable.Columns["Role"] };
return aTable;
}
public static DataTable Delete(string Role)
{
if (Roles.RoleExists(Role))
{
Roles.DeleteRole(Role,false);
}
return Select();
}
public static DataTable DeleteUser(string User)
{
Membership.DeleteUser(User, true);
return SelectUser();
}
public static DataTable CreateUserDataTable()
{
DataTable aTable = new DataTable("A");
DataColumn dtCol;
DataColumn dtCol1;
DataRow dtRow;
// Create User Name column and add to the table
dtCol = new DataColumn();
dtCol.DataType = Type.GetType("System.String");
dtCol.ColumnName = "User";
dtCol.AutoIncrement = false;
dtCol.ReadOnly = false;
dtCol.Unique = true;
aTable.Columns.Add(dtCol);
dtCol1 = new DataColumn();
dtCol1.DataType = Type.GetType("System.Boolean");
dtCol1.ColumnName = "Active";
dtCol1.AutoIncrement = false;
dtCol1.ReadOnly = false;
dtCol1.Unique = false;
aTable.Columns.Add(dtCol1);
// Create rows to the table
foreach (MembershipUser user in Membership.GetAllUsers())
{
dtRow = aTable.NewRow();
dtRow["User"] = user.UserName;
dtRow["Active"] = user.IsApproved;
aTable.Rows.Add(dtRow);
}
aTable.PrimaryKey = new DataColumn[] { aTable.Columns["User"] };
return aTable;
}
public static DataTable CreateUserDataTable(string searchtag, string searchby)
{
DataTable aTable = new DataTable("A");
DataColumn dtCol;
DataColumn dtCol1;
DataRow dtRow;
dtCol = new DataColumn();
dtCol.DataType = Type.GetType("System.String");
dtCol.ColumnName = "User";
dtCol.AutoIncrement = false;
dtCol.ReadOnly = false;
dtCol.Unique = true;
aTable.Columns.Add(dtCol);
dtCol1 = new DataColumn();
dtCol1.DataType = Type.GetType("System.Boolean");
dtCol1.ColumnName = "Active";
dtCol1.AutoIncrement = false;
dtCol1.ReadOnly = false;
dtCol1.Unique = false;
aTable.Columns.Add(dtCol1);
string text = searchtag;
text = text.Replace("*", "%");
text = text.Replace("?", "_");
if (text.Trim() == "\"\"")
text = "%";
if (searchby == "Name")
{
foreach (MembershipUser user in Membership.FindUsersByName(text))
{
dtRow = aTable.NewRow();
dtRow["User"] = user.UserName;
dtRow["Active"] = user.IsApproved;
aTable.Rows.Add(dtRow);
}
}
else // Mail
{
foreach (MembershipUser user in Membership.FindUsersByEmail(text))
{
dtRow = aTable.NewRow();
dtRow["User"] = user.UserName;
dtRow["Active"] = user.IsApproved;
aTable.Rows.Add(dtRow);
}
}
aTable.PrimaryKey = new DataColumn[] { aTable.Columns["User"] };
return aTable;
}
public static DataTable CreateDataTable()
{
DataTable aTable = new DataTable("A");
DataColumn dtCol;
DataRow dtRow;
// Create Name column and add to the table
dtCol = new DataColumn();
dtCol.DataType = Type.GetType("System.String");
dtCol.ColumnName = "Role";
dtCol.AutoIncrement = false;
dtCol.Caption = "Role Name";
dtCol.ReadOnly = false;
dtCol.Unique = false;
aTable.Columns.Add(dtCol);
if (Roles.Enabled) {
// Create rows to the table
foreach (string str in Roles.GetAllRoles ()) {
dtRow = aTable.NewRow ();
dtRow["Role"] = str;
aTable.Rows.Add (dtRow);
}
}
aTable.PrimaryKey = new DataColumn[] { aTable.Columns["Role"] };
return aTable;
}
public static DataTable CreateManageRoleTable(string role, string searchtag, string searchby)
{
DataTable aTable = new DataTable("A");
DataColumn dtCol;
DataColumn dtCol1;
DataRow dtRow;
// Create UserName column and add to the table
dtCol = new DataColumn();
dtCol.DataType = Type.GetType("System.String");
dtCol.ColumnName = "User";
dtCol.AutoIncrement = false;
dtCol.Caption = "User Name";
dtCol.ReadOnly = false;
dtCol.Unique = true;
aTable.Columns.Add(dtCol);
// Create User in role bool column and add to the table
dtCol1 = new DataColumn();
dtCol1.DataType = Type.GetType("System.Boolean");
dtCol1.ColumnName = "InRole";
dtCol1.AutoIncrement = false;
dtCol1.Caption = "User Is In Role";
dtCol1.ReadOnly = false;
dtCol1.Unique = false;
aTable.Columns.Add(dtCol1);
string text = searchtag;
text = text.Replace("*", "%");
text = text.Replace("?", "_");
if (text.Trim() == "\"\"")
text = "%";
if (searchby == "Name")
{
foreach (MembershipUser user in Membership.FindUsersByName(text))
{
dtRow = aTable.NewRow();
dtRow["User"] = user.UserName;
if (Roles.Enabled) {
dtRow["InRole"] = Roles.IsUserInRole (user.UserName, role);
}
else {
dtRow["InRole"] = false;
}
aTable.Rows.Add(dtRow);
}
}
else // Mail
{
foreach (MembershipUser user in Membership.FindUsersByEmail(text))
{
dtRow = aTable.NewRow();
dtRow["User"] = user.UserName;
if (Roles.Enabled) {
dtRow["InRole"] = Roles.IsUserInRole (user.UserName, role);
}
else {
dtRow["InRole"] = false;
}
aTable.Rows.Add(dtRow);
}
}
aTable.PrimaryKey = new DataColumn[] { aTable.Columns["User"] };
return aTable;
}
}
}
@@ -1,47 +0,0 @@
<%--
// Mainsoft.Web.AspnetConfig - Site administration utility
// Authors:
// Klain Yoni <[email protected]>
//
// Mainsoft.Web.AspnetConfig - Site administration utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>
<%@ Page Language="C#" AutoEventWireup="true" Theme="" StylesheetTheme="" CodeBehind="SecurError.aspx.cs" Inherits="Mainsoft.Web.AspnetConfig.SecurError" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ASP.Net Web Application Administration</title>
</head>
<body>
<form id="form1" runat="server">
<div style="font-weight: bold; font-size: 11pt;">
By default, the Web Site Administration Tool may only be accessed locally.
To enable accessing it from a remote computer, open the Web.config file, add the key <br />
allowRemoteConfiguration to the appSettings section, and set its value to true: <br />
<pre>
&lt appSettings &gt
&lt/ add key="allowRemoteConfiguration" value="True" /&gt
&lt/ appSettings &gt
</pre>
</div>
</form>
</body>
</html>
@@ -1,21 +0,0 @@
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace Mainsoft.Web.AspnetConfig
{
public partial class SecurError : System.Web.UI.Page
{
protected void Page_Load (object sender, EventArgs e)
{
}
}
}
@@ -1,16 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Mainsoft.Web.AspnetConfig {
public partial class SecurError {
protected System.Web.UI.HtmlControls.HtmlForm form1;
}
}
@@ -1,101 +0,0 @@
//
// System.Web.Util.StrUtils
//
// Author(s):
// Gonzalo Paniagua Javier ([email protected])
//
// (C) 2005 Novell, Inc, (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Globalization;
using System.Text;
namespace Mainsoft.Web.Util
{
internal sealed class StrUtils {
static CultureInfo invariant = CultureInfo.InvariantCulture;
private StrUtils () { }
public static bool StartsWith (string str1, string str2)
{
return StartsWith (str1, str2, false);
}
public static bool StartsWith (string str1, string str2, bool ignore_case)
{
int l2 = str2.Length;
if (l2 == 0)
return true;
int l1 = str1.Length;
if (l2 > l1)
return false;
return (0 == String.Compare (str1, 0, str2, 0, l2, ignore_case, invariant));
}
public static bool EndsWith (string str1, string str2)
{
return EndsWith (str1, str2, false);
}
public static bool EndsWith (string str1, string str2, bool ignore_case)
{
int l2 = str2.Length;
if (l2 == 0)
return true;
int l1 = str1.Length;
if (l2 > l1)
return false;
return (0 == String.Compare (str1, l1 - l2, str2, 0, l2, ignore_case, invariant));
}
public static string EscapeQuotesAndBackslashes (string attributeValue)
{
StringBuilder sb = null;
for (int i = 0; i < attributeValue.Length; i++) {
char ch = attributeValue [i];
if (ch == '\'' || ch == '"' || ch == '\\') {
if (sb == null) {
sb = new StringBuilder ();
sb.Append (attributeValue.Substring (0, i));
}
sb.Append ('\\');
sb.Append (ch);
}
else {
if (sb != null)
sb.Append (ch);
}
}
if (sb != null)
return sb.ToString ();
return attributeValue;
}
}
}
@@ -1,265 +0,0 @@
//
// System.Web.UrlUtils.cs
//
// Authors:
// Gonzalo Paniagua ([email protected])
// Jackson Harper ([email protected])
//
//
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Web.SessionState;
using System.Web;
using System;
namespace Mainsoft.Web.Util {
internal class UrlUtils {
// appRoot + SessionID + vpath
internal static string InsertSessionId (string id, string path)
{
string dir = GetDirectory (path);
if (!dir.EndsWith ("/"))
dir += "/";
string appvpath = HttpRuntime.AppDomainAppVirtualPath;
if (!appvpath.EndsWith ("/"))
appvpath += "/";
if (path.StartsWith (appvpath))
path = path.Substring (appvpath.Length);
if (path [0] == '/')
path = path.Length > 1 ? path.Substring (1) : "";
return Canonic (appvpath + "(" + id + ")/" + path);
}
#if false
internal static string GetSessionId (string path)
{
string appvpath = HttpRuntime.AppDomainAppVirtualPath;
if (path.Length <= appvpath.Length)
return null;
path = path.Substring (appvpath.Length);
if (path.Length == 0 || path [0] != '/')
path = '/' + path;
int len = path.Length;
if ((len < SessionId.IdLength + 3) || (path [1] != '(') ||
(path [SessionId.IdLength + 2] != ')'))
return null;
return path.Substring (2, SessionId.IdLength);
}
#endif
internal static string RemoveSessionId (string base_path, string file_path)
{
// Caller did a GetSessionId first
int idx = base_path.IndexOf ("/(");
string dir = base_path.Substring (0, idx + 1);
if (!dir.EndsWith ("/"))
dir += "/";
idx = base_path.IndexOf (")/");
if (idx != -1 && base_path.Length > idx + 2) {
string dir2 = base_path.Substring (idx + 2);
if (!dir2.EndsWith ("/"))
dir2 += "/";
dir += dir2;
}
return Canonic (dir + GetFile (file_path));
}
public static string Combine (string basePath, string relPath)
{
if (relPath == null)
throw new ArgumentNullException ("relPath");
int rlength = relPath.Length;
if (rlength == 0)
return "";
relPath = relPath.Replace ("\\", "/");
if (IsRooted (relPath))
return Canonic (relPath);
char first = relPath [0];
if (rlength < 3 || first == '~' || first == '/' || first == '\\') {
if (basePath == null || (basePath.Length == 1 && basePath [0] == '/'))
basePath = String.Empty;
string slash = (first == '/') ? "" : "/";
if (first == '~') {
if (rlength == 1) {
relPath = "";
} else if (rlength > 1 && relPath [1] == '/') {
relPath = relPath.Substring (2);
slash = "/";
}
string appvpath = HttpRuntime.AppDomainAppVirtualPath;
if (appvpath.EndsWith ("/"))
slash = "";
return Canonic (appvpath + slash + relPath);
}
return Canonic (basePath + slash + relPath);
}
if (basePath == null || basePath == "" || basePath [0] == '~')
basePath = HttpRuntime.AppDomainAppVirtualPath;
if (basePath.Length <= 1)
basePath = String.Empty;
return Canonic (basePath + "/" + relPath);
}
static char [] path_sep = {'\\', '/'};
internal static string Canonic (string path)
{
string [] parts = path.Split (path_sep);
int end = parts.Length;
int dest = 0;
for (int i = 0; i < end; i++) {
string current = parts [i];
if (current == "." )
continue;
if (current == "..") {
if (dest == 0) {
if (i == 1) // see bug 52599
continue;
throw new HttpException ("Invalid path.");
}
dest --;
continue;
}
parts [dest++] = current;
}
if (dest == 0)
return "/";
return String.Join ("/", parts, 0, dest);
}
internal static string GetDirectory (string url)
{
url = url.Replace('\\','/');
int last = url.LastIndexOf ('/');
if (last > 0) {
return RemoveDoubleSlashes (url.Substring (0, last));
}
return "/";
}
internal static string RemoveDoubleSlashes (string input)
{
// MS VirtualPathUtility removes duplicate '/'
string str = input;
string x;
while ((x = str.Replace ("//", "/")) != str) {
str = x;
}
return str;
}
internal static string GetFile (string url)
{
url = url.Replace('\\','/');
int last = url.LastIndexOf ('/');
if (last >= 0) {
if (url.Length == 1) // Empty file name instead of ArgumentOutOfRange
return "";
return url.Substring (last+1);
}
throw new Exception (String.Format ("GetFile: `{0}' does not contain a /", url));
}
internal static bool IsRooted (string path)
{
if (path == null || path == "")
return true;
char c = path [0];
if (c == '/' || c == '\\')
return true;
return false;
}
internal static bool IsRelativeUrl (string path)
{
return (path [0] != '/' && path.IndexOf (':') == -1);
}
public static string ResolveVirtualPathFromAppAbsolute (string path)
{
if (path [0] != '~') return path;
if (path.Length == 1)
return HttpRuntime.AppDomainAppVirtualPath;
if (path [1] == '/' || path [1] == '\\') {
string appPath = HttpRuntime.AppDomainAppVirtualPath;
if (appPath.Length > 1)
return appPath + "/" + path.Substring (2);
return "/" + path.Substring (2);
}
return path;
}
public static string ResolvePhysicalPathFromAppAbsolute (string path)
{
if (path [0] != '~') return path;
if (path.Length == 1)
return HttpRuntime.AppDomainAppPath;
if (path [1] == '/' || path [1] == '\\') {
string appPath = HttpRuntime.AppDomainAppPath;
if (appPath.Length > 1)
return appPath + "/" + path.Substring (2);
return "/" + path.Substring (2);
}
return path;
}
}
}
@@ -1,91 +0,0 @@
<%--
// Mainsoft.Web.AspnetConfig - Site administration utility
// Authors:
// Klain Yoni <[email protected]>
//
// Mainsoft.Web.AspnetConfig - Site administration utility
// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>
<%@ Master Language="C#" AutoEventWireup="true" EnableTheming="false" CodeBehind="Util.master.cs" Inherits="Mainsoft.Web.AspnetConfig.Util" %>
<%@ Register TagPrefix="Custom" Namespace="Mainsoft.Web.AspnetConfig" Assembly="Mainsoft.Web.AspnetConfig" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<link href="<%= Page.ClientScript.GetWebResourceUrl (typeof(Util), "Mainsoft.Web.AspnetConfig.aspnetconfig.Mainsoft.Web.AspnetConfig.css") %>" rel="stylesheet" type="text/css" />
<title>ASP.Net Web Application Administration</title>
<style type="text/css">
A.SiteMap:visited { color: #507CD1; }
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table width="100%">
<tr>
<td>
&nbsp;&nbsp;
</td>
</tr>
<tr>
<td class="h1">
Web Site Administration Tool
</td>
</tr>
<tr>
<td>
<table class="bordredtable">
<tr style="background-color:">
<td style="background-color: lightblue">
<table cellpadding="0" cellspacing="0">
<tr>
<td>Current page : &nbsp;</td>
<td style="font-family: Verdana; font-size: 0.8em; color: #507CD1; font-weight:bold;">
<table>
<tr>
<asp:ContentPlaceHolder ID="SiteMapLinks" runat="server"></asp:ContentPlaceHolder>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" valign="top">
<asp:ContentPlaceHolder ID="Main" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
<tr>
<td align="right">
<asp:Button ID="Back" runat="server" Text="Back" />
<%--style="padding-right: 1px; padding-left: 1px; font-weight: bold; padding-bottom: 1px; margin: 1px; color: yellow; padding-top: 1px; background-color: #6699ff"--%>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
@@ -1,49 +0,0 @@
using System;
using System.Resources;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Mainsoft.Web.AspnetConfig
{
public partial class Util : System.Web.UI.MasterPage
{
bool allowRemoteConfiguration // Default is false
{
get
{
if (System.Configuration.ConfigurationSettings.AppSettings["allowRemoteConfiguration"] != null) {
return bool.Parse (System.Configuration.ConfigurationSettings.AppSettings["allowRemoteConfiguration"]);
}
else {
return false;
}
}
}
public String Backurl
{
get { return ViewState["BackUrl"] == null ? String.Empty : (string) ViewState["BackUrl"]; }
set { ViewState["BackUrl"] = value; }
}
protected override void OnInit (EventArgs e)
{
if (!(allowRemoteConfiguration || Request.IsLocal)) {
Server.Transfer ("~/aspnetconfig/SecurError.aspx");
}
base.OnInit (e);
}
protected void Page_Load (object sender, EventArgs e)
{
}
}
}
@@ -1,20 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Mainsoft.Web.AspnetConfig {
public partial class Util {
protected System.Web.UI.HtmlControls.HtmlHead Head1;
protected System.Web.UI.HtmlControls.HtmlForm form1;
protected System.Web.UI.WebControls.ContentPlaceHolder SiteMapLinks;
protected System.Web.UI.WebControls.ContentPlaceHolder Main;
protected System.Web.UI.WebControls.Button Back;
}
}
@@ -1,41 +0,0 @@
<!--Minimalistic buildfile -->
<project name="Mainsoft.Web.AspnetConfig" default="all">
<property name="ghroot" value="${project::get-base-directory()}\..\..\..\..\.."/>
<!--Allways at the beginning-->
<include buildfile="${ghroot}\vsbuild\properties.xml" />
<!--MANDATORY SECTION-->
<!--Could be GH ANT .NET-->
<property name="projecttype" value=".NET2005"/>
<!--Could be RUNTIME TOOLS ... -->
<property name="rules" value="RUNTIME"/>
<property name="msbuild_file" value="Mainsoft.Web.AspnetConfig.csproj"/>
<!--Fileset describing project output files. Uset by copy/delete rules in framework-->
<fileset id="output" basedir="${project::get-base-directory()}\bin" failonempty="true">
<include name="Mainsoft.Web.AspnetConfig.jar"/>
<include name="Mainsoft.Web.AspnetConfig.dll"/>
</fileset>
<!--END MANDATORY SECTION-->
<!--OPTIONAL SECTION-->
<!--
<target name="postbuild">
</target>
-->
<!--
<property name="cvnsrc" value="svn://svn.myrealbox.com/source/trunk/mcs/<cvn_folder>"/>
<target name="prebuild">
Put something there if you need
</target>
-->
<!--END OPTIONAL SECTION-->
<!--Allways at the end-->
<include buildfile="${ghroot}\vsbuild\framework.xml" />
</project>
Whitespace-only changes.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

@@ -1,19 +0,0 @@
/AbstractAttributeMap.cs -crlf
/AspNetFacesContext.cs -crlf
/BaseExternalContext.cs -crlf
/BaseFacesPageHandlerFactory.cs -crlf
/BaseFacesStateManager.cs -crlf
/BaseFacesViewHandler.cs -crlf
/ChangeLog -crlf
/IExtendedViewHandler.cs -crlf
/OutputStreamWrapper.cs -crlf
/RequestParameterMap.cs -crlf
/RequestParameterValuesMap.cs -crlf
/ServletFacesContext.cs -crlf
/ServletFacesPageHandler.cs -crlf
/ServletFacesPageHandlerFactory.cs -crlf
/ServletFacesStateManager.cs -crlf
/ServletFacesViewHandler.cs -crlf
/ServletIncludeUtils.cs -crlf
/ServletResourceLoader.cs -crlf
/SessionWrapper.cs -crlf
@@ -1,333 +0,0 @@
//
// Mainsoft.Web.Hosting.AbstractAttributeMap.cs
//
// Authors:
// Konstantin Triger <[email protected]>
//
// (C) 2008 Mainsoft Co. (http://www.mainsoft.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using java.util;
using System;
namespace Mainsoft.Web.Hosting
{
partial class BaseExternalContext
{
public abstract class AbstractAttributeMap : AbstractMap
{
private Set _keySet;
private Collection _values;
private Set _entrySet;
public override void clear () {
List names = new ArrayList ();
for (Enumeration e = getAttributeNames (); e.hasMoreElements (); ) {
names.add (e.nextElement ());
}
for (Iterator it = names.iterator (); it.hasNext (); ) {
removeAttribute ((String) it.next ());
}
}
public override bool containsKey (Object key) {
return getAttribute (key.ToString ()) != null;
}
public override bool containsValue (Object findValue) {
if (findValue == null) {
return false;
}
for (Enumeration e = getAttributeNames (); e.hasMoreElements (); ) {
Object value = getAttribute ((String) e.nextElement ());
if (findValue.Equals (value)) {
return true;
}
}
return false;
}
public override Set entrySet () {
return (_entrySet != null) ? _entrySet : (_entrySet = new EntrySet (this));
}
public override Object get (Object key) {
return getAttribute (key.ToString ());
}
public override bool isEmpty () {
return !getAttributeNames ().hasMoreElements ();
}
public override Set keySet () {
return (_keySet != null) ? _keySet : (_keySet = new KeySet (this));
}
public override Object put (Object key, Object value) {
String key_ = key.ToString ();
Object retval = getAttribute (key_);
setAttribute (key_, value);
return retval;
}
public override void putAll (Map t) {
for (Iterator it = t.entrySet ().iterator (); it.hasNext (); ) {
Map.Entry entry = (Map.Entry) it.next ();
setAttribute (entry.getKey ().ToString (), entry.getValue ());
}
}
public override Object remove (Object key) {
String key_ = key.ToString ();
Object retval = getAttribute (key_);
removeAttribute (key_);
return retval;
}
public override int size () {
int size = 0;
for (Enumeration e = getAttributeNames (); e.hasMoreElements (); ) {
size++;
e.nextElement ();
}
return size;
}
public override Collection values () {
return (_values != null) ? _values : (_values = new Values (this));
}
abstract protected Object getAttribute (string key);
abstract protected void setAttribute (string key, Object value);
abstract protected void removeAttribute (string key);
abstract protected Enumeration getAttributeNames ();
private class KeySet : AbstractSet
{
protected readonly AbstractAttributeMap _owner;
public KeySet (AbstractAttributeMap owner) {
_owner = owner;
}
public override Iterator iterator () {
return new KeyIterator (_owner);
}
public override bool isEmpty () {
return _owner.isEmpty ();
}
public override int size () {
return _owner.size ();
}
public override bool contains (Object o) {
return _owner.containsKey (o);
}
public override bool remove (Object o) {
return _owner.remove (o) != null;
}
public override void clear () {
_owner.clear ();
}
}
private class KeyIterator : Iterator
{
protected readonly AbstractAttributeMap _owner;
protected readonly Enumeration _e;
public KeyIterator (AbstractAttributeMap owner) {
_owner = owner;
_e = _owner.getAttributeNames ();
}
protected Object _currentKey;
public virtual void remove () {
// remove() may cause ConcurrentModificationException.
// We could throw an exception here, but not throwing an exception
// allows one call to remove() to succeed
if (_currentKey == null) {
throw new NoSuchElementException (
"You must call next() at least once");
}
_owner.remove (_currentKey);
}
public bool hasNext () {
return _e.hasMoreElements ();
}
public virtual Object next () {
return _currentKey = _e.nextElement ();
}
}
private class Values : KeySet
{
public Values (AbstractAttributeMap owner)
: base (owner) {
}
public override Iterator iterator () {
return new ValuesIterator (_owner);
}
public override bool contains (Object o) {
return _owner.containsValue (o);
}
public override bool remove (Object o) {
if (o == null) {
return false;
}
for (Iterator it = iterator (); it.hasNext (); ) {
if (o.Equals (it.next ())) {
it.remove ();
return true;
}
}
return false;
}
}
private class ValuesIterator : KeyIterator
{
public ValuesIterator (AbstractAttributeMap owner)
: base (owner) { }
public override Object next () {
base.next ();
return _owner.get (_currentKey);
}
}
private class EntrySet : KeySet
{
public EntrySet (AbstractAttributeMap owner) : base (owner) { }
public override Iterator iterator () {
return new EntryIterator (_owner);
}
public override bool contains (Object o) {
if (!(o is Map.Entry)) {
return false;
}
Map.Entry entry = (Map.Entry) o;
Object key = entry.getKey ();
Object value = entry.getValue ();
if (key == null || value == null) {
return false;
}
return value.Equals (_owner.get (key));
}
public override bool remove (Object o) {
if (!(o is Map.Entry)) {
return false;
}
Map.Entry entry = (Map.Entry) o;
Object key = entry.getKey ();
Object value = entry.getValue ();
if (key == null || value == null
|| !value.Equals (_owner.get (key))) {
return false;
}
return _owner.remove (((Map.Entry) o).getKey ()) != null;
}
}
/**
* Not very efficient since it generates a new instance of <code>Entry</code>
* for each element and still internaly uses the <code>KeyIterator</code>.
* It is more efficient to use the <code>KeyIterator</code> directly.
*/
private class EntryIterator : KeyIterator
{
public EntryIterator (AbstractAttributeMap owner) : base (owner) { }
public override Object next () {
base.next ();
// Must create new Entry every time--value of the entry must stay
// linked to the same attribute name
return new EntrySetEntry (_currentKey);
}
}
private class EntrySetEntry : Map.Entry
{
readonly AbstractAttributeMap _owner;
public EntrySetEntry (AbstractAttributeMap owner) {
_owner = owner;
}
private readonly Object _currentKey;
public EntrySetEntry (Object currentKey) {
_currentKey = currentKey;
}
public Object getKey () {
return _currentKey;
}
public Object getValue () {
return _owner.get (_currentKey);
}
public Object setValue (Object value) {
return _owner.put (_currentKey, value);
}
public int hashCode () {
return _currentKey == null ? 0 : _currentKey.GetHashCode ();
}
public bool equals (Object obj) {
if (!(obj is EntrySetEntry))
return false;
return _currentKey != null && _currentKey.Equals (obj);
}
}
}
}
}
@@ -1,119 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using javax.faces.context;
using System.Web;
using System.Web.UI;
using javax.servlet;
using javax.faces.lifecycle;
namespace Mainsoft.Web.Hosting
{
public abstract class AspNetFacesContext : FacesContext
{
readonly FacesContext _oldFacesContex;
readonly FacesContext _facesContex;
readonly HttpContext _httpContext;
readonly ExternalContext _externalContext;
public HttpContext Context {
get { return _httpContext; }
}
protected AspNetFacesContext (FacesContext wrappedFacesContex, ExternalContext externalContext, HttpContext httpContext, FacesContext oldFacesContex) {
_facesContex = wrappedFacesContex;
_httpContext = httpContext;
_oldFacesContex = oldFacesContex;
_externalContext = externalContext;
setCurrentInstance (this);
}
public bool IsProcessingInclude () {
if (_oldFacesContex == null)
return false;
if (getViewRoot ().getChildCount () == 0)
throw new InvalidOperationException ();
Page page = (Page) getViewRoot ().getChildren ().get (0);
return !page.IsPostBack;
}
public override void addMessage (string __p1, javax.faces.application.FacesMessage __p2) {
_facesContex.addMessage (__p1, __p2);
}
public override javax.faces.application.Application getApplication () {
return _facesContex.getApplication ();
}
public override java.util.Iterator getClientIdsWithMessages () {
return _facesContex.getClientIdsWithMessages ();
}
public override ExternalContext getExternalContext () {
return _externalContext;
}
public override javax.faces.application.FacesMessage.Severity getMaximumSeverity () {
return _facesContex.getMaximumSeverity ();
}
public override java.util.Iterator getMessages (string __p1) {
return _facesContex.getMessages (__p1);
}
public override java.util.Iterator getMessages () {
return _facesContex.getMessages ();
}
public override javax.faces.render.RenderKit getRenderKit () {
return _facesContex.getRenderKit ();
}
public override bool getRenderResponse () {
return _facesContex.getRenderResponse ();
}
public override bool getResponseComplete () {
return _facesContex.getResponseComplete ();
}
public override ResponseStream getResponseStream () {
return _facesContex.getResponseStream ();
}
public override ResponseWriter getResponseWriter () {
return _facesContex.getResponseWriter ();
}
public override javax.faces.component.UIViewRoot getViewRoot () {
return _facesContex.getViewRoot ();
}
public override void release () {
_facesContex.release ();
FacesContext.setCurrentInstance (_oldFacesContex);
}
public override void renderResponse () {
_facesContex.renderResponse ();
}
public override void responseComplete () {
_facesContex.responseComplete ();
}
public override void setResponseStream (ResponseStream __p1) {
_facesContex.setResponseStream (__p1);
}
public override void setResponseWriter (ResponseWriter __p1) {
_facesContex.setResponseWriter (__p1);
}
public override void setViewRoot (javax.faces.component.UIViewRoot __p1) {
_facesContex.setViewRoot (__p1);
}
}
}
@@ -1,73 +0,0 @@
//
// Mainsoft.Web.Hosting.BaseExternalContext.cs
//
// Authors:
// Konstantin Triger <[email protected]>
//
// (C) 2008 Mainsoft Co. (http://www.mainsoft.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.Text;
using javax.faces.context;
using System.Web;
using java.util;
namespace Mainsoft.Web.Hosting
{
public abstract partial class BaseExternalContext : ExternalContext
{
readonly HttpContext _httpContext;
readonly string _executionFilePath;
private Map _requestParameterMap;
private Map _requestParameterValuesMap;
protected BaseExternalContext (HttpContext httpContext, string executionFilePath) {
_httpContext = httpContext;
_executionFilePath = executionFilePath;
}
protected HttpContext Context {
get { return _httpContext; }
}
public override Map getRequestParameterMap () {
return _requestParameterMap ?? (_requestParameterMap = new RequestParameterMap (Context.Request.Form));
}
public override Iterator getRequestParameterNames () {
return new IEnumeratorIteratorImpl (Context.Request.Form.Keys.GetEnumerator ());
}
public override Map getRequestParameterValuesMap () {
return _requestParameterValuesMap ?? (_requestParameterValuesMap = new RequestParameterValuesMap (Context.Request.Form));
}
public override string getRequestPathInfo () {
return _executionFilePath.Substring (getRequestContextPath ().Length);
}
}
}
@@ -1,46 +0,0 @@
//
// (C) 2007 Mainsoft Corporation (http://www.mainsoft.com)
// Author: Igor Zelmanovich <[email protected]>
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using javax.faces.context;
using javax.faces.lifecycle;
using javax.servlet;
using javax.faces;
using javax.faces.webapp;
namespace Mainsoft.Web.Hosting
{
public abstract class BaseFacesPageHandlerFactory : IHttpHandlerFactory
{
public abstract IHttpHandler GetHandler (HttpContext context, string requestType, string url, string pathTranslated);
public virtual void ReleaseHandler (IHttpHandler handler) {
}
}
}
@@ -1,106 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using javax.faces.application;
using javax.faces.component;
using javax.faces.context;
using System.Diagnostics;
using System.Web.UI;
using javax.faces.render;
using javax.faces;
namespace Mainsoft.Web.Hosting
{
public abstract class BaseFacesStateManager : StateManager
{
protected static readonly string VIEWSTATE = "__VIEWSTATE";
protected static readonly RenderKitFactory RenderKitFactory = (RenderKitFactory) FactoryFinder.getFactory (FactoryFinder.RENDER_KIT_FACTORY);
public override StateManager.SerializedView saveSerializedView (FacesContext facesContext) {
Object treeStruct = getTreeStructureToSave (facesContext);
Object compStates = getComponentStateToSave (facesContext);
SerializedView serializedView = new SerializedView (this, treeStruct, compStates);
return serializedView;
}
protected override sealed Object getTreeStructureToSave (FacesContext facesContext) {
return String.Empty;
}
public override UIViewRoot restoreView (FacesContext facesContext,
String viewId,
String renderKitId) {
UIViewRoot uiViewRoot = restoreTreeStructure (facesContext, viewId, renderKitId);
Page page = (Page) uiViewRoot.getChildren ().get (0);
if (page.IsPostBack || page.IsCallback)
restoreComponentState (facesContext, uiViewRoot, renderKitId);
else
facesContext.renderResponse ();
return uiViewRoot;
}
protected override sealed UIViewRoot restoreTreeStructure (FacesContext facesContext, string viewId, string renderKitId) {
return facesContext.getApplication ().getViewHandler ().createView (facesContext, viewId);
}
protected override Object getComponentStateToSave (FacesContext facesContext) {
Trace.WriteLine ("Entering getComponentStateToSave");
UIViewRoot viewRoot = facesContext.getViewRoot ();
if (viewRoot.isTransient ()) {
return null;
}
Object serializedComponentStates = ((UIComponent) viewRoot.getChildren ().get (0)).processSaveState (facesContext);
//Locale is a state attribute of UIViewRoot and need not be saved explicitly
Trace.WriteLine ("Exiting getComponentStateToSave");
return serializedComponentStates;
}
protected void SaveStateInClient (FacesContext facesContext, StateManager.SerializedView serializedView) {
//UIViewRoot uiViewRoot = facesContext.getViewRoot ();
////save state in response (client-side: full state; server-side: sequence)
//RenderKit renderKit = RenderKitFactory.getRenderKit (facesContext, uiViewRoot.getRenderKitId ());
//// not us.
//renderKit.getResponseStateManager ().writeState (facesContext, serializedView);
java.io.ByteArrayOutputStream bytearrayoutputstream = new java.io.ByteArrayOutputStream ();
java.io.ObjectOutputStream objectoutputstream = new java.io.ObjectOutputStream (bytearrayoutputstream);
//ignore tree structure
//objectoutputstream.writeObject (serializedView.getStructure ());
objectoutputstream.writeObject (serializedView.getState ());
objectoutputstream.close ();
bytearrayoutputstream.close ();
string s =
@"<div>
<input type=""hidden"" name=""" + VIEWSTATE + "\" id=\"" + VIEWSTATE + "\" value=\"" +
Convert.ToBase64String ((byte []) vmw.common.TypeUtils.ToByteArray (bytearrayoutputstream.toByteArray ())) + @""" />
</div>";
facesContext.getResponseWriter ().write (s);
}
protected object GetStateFromClient (FacesContext facesContext, String viewId, String renderKitId) {
//RenderKit renderKit = RenderKitFactory.getRenderKit (facesContext, renderKitId);
//ResponseStateManager responseStateManager = renderKit.getResponseStateManager ();
//responseStateManager.getTreeStructureToRestore (facesContext, viewId); //ignore result. Must call for compatibility with sun implementation.
//return responseStateManager.getComponentStateToRestore (facesContext);
java.util.Map map = facesContext.getExternalContext ().getRequestParameterMap ();
string s1 = (string) map.get (VIEWSTATE);
byte [] buffer = Convert.FromBase64String (s1);
java.io.ByteArrayInputStream bytearrayinputstream = new java.io.ByteArrayInputStream (vmw.common.TypeUtils.ToSByteArray (buffer));
java.io.ObjectInputStream inputStream = new java.io.ObjectInputStream (bytearrayinputstream);
//ignore tree structure
//inputStream.readObject ();
object state = inputStream.readObject ();
inputStream.close ();
bytearrayinputstream.close ();
return state;
}
}
}
@@ -1,79 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using javax.faces.application;
using java.util;
using javax.faces.context;
using javax.faces.component;
using javax.faces.render;
using System.Web.UI;
using System.Web;
using System.Diagnostics;
namespace Mainsoft.Web.Hosting
{
public abstract class BaseFacesViewHandler : ViewHandler, IExtendedViewHandler
{
readonly ViewHandler _viewHandler;
public static readonly string NAMESPACE = "__NAMESPACE";
public BaseFacesViewHandler (ViewHandler viewHandler) {
_viewHandler = viewHandler;
}
public override string getActionURL (FacesContext facesContext, string viewId) {
return _viewHandler.getActionURL (facesContext, viewId);
}
public override Locale calculateLocale (FacesContext facesContext) {
return _viewHandler.calculateLocale (facesContext);
}
public override String calculateRenderKitId (FacesContext facesContext) {
return _viewHandler.calculateRenderKitId (facesContext);
}
public override UIViewRoot createView (FacesContext facesContext, String viewId) {
// create instance of Page by viewId
StringBuilder sb = new StringBuilder ();
sb.Append (facesContext.getExternalContext ().getRequestContextPath ());
sb.Append (viewId);
IHttpHandler page = PageParser.GetCompiledPageInstance (sb.ToString (), null, ((AspNetFacesContext) facesContext).Context);
HttpContext context = ((AspNetFacesContext) facesContext).Context;
page.ProcessRequest (context);
UIViewRoot uiViewRoot = _viewHandler.createView (facesContext, viewId);
uiViewRoot.getChildren ().add (0, (UIComponent) page);
Trace.WriteLine ("Created view " + viewId);
return uiViewRoot;
}
public override String getResourceURL (FacesContext facesContext, String path) {
return _viewHandler.getResourceURL (facesContext, path);
}
public override void renderView (FacesContext facesContext, UIViewRoot viewToRender) {
if (viewToRender == null)
throw new ArgumentNullException ("viewToRender", "viewToRender must not be null");
((UIComponent) viewToRender.getChildren ().get (0)).encodeChildren (facesContext);
}
public override UIViewRoot restoreView (FacesContext facesContext, String viewId) {
return _viewHandler.restoreView (facesContext, viewId);
}
public override void writeState (FacesContext facesContext) {
StateManager manager = facesContext.getApplication ().getStateManager ();
StateManager.SerializedView serializedView = manager.saveSerializedView (facesContext);
manager.writeState (facesContext, serializedView);
}
public virtual string EncodeNamespace (FacesContext facesContext, string value) {
return value;
}
}
}
@@ -1,396 +0,0 @@
//
// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Configuration;
using System.Web;
using System.Web.Configuration;
using System.Threading;
using System.Web.Hosting;
using System.IO;
using javax.servlet;
using javax.servlet.http;
using vmw.common;
using java.util;
using vmw.@internal;
using java.lang.reflect;
using java.net;
using System.Globalization;
using System.Diagnostics;
using javax.faces;
using javax.faces.context;
using javax.faces.lifecycle;
using javax.faces.webapp;
using javax.faces.render;
namespace Mainsoft.Web.Hosting
{
public interface IJDBCDriverDeregisterer
{
void DeregisterDriver (java.sql.Driver driver);
}
/// <summary>
/// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
/// </summary>
public class BaseHttpServlet : HttpServlet, IJDBCDriverDeregisterer
{
bool _appVirDirInited = false;
static FacesContextFactory _facesContextFactory;
static Lifecycle _lifecycle;
static RenderKitFactory _renderKitFactory;
public BaseHttpServlet()
{
}
public static RenderKitFactory RenderKitFactory {
get { return _renderKitFactory; }
}
public static FacesContextFactory FacesContextFactory {
get { return _facesContextFactory; }
}
public static Lifecycle Lifecycle {
get { return _lifecycle; }
}
override public void init(ServletConfig config)
{
base.init(config);
InitRuntime (config, this);
}
public static void InitRuntime (ServletConfig config, object evidence) {
ServletContext context = config.getServletContext ();
if (context.getAttribute (J2EEConsts.APP_DOMAIN) != null)
return;
_facesContextFactory = (FacesContextFactory) FactoryFinder.getFactory (FactoryFinder.FACES_CONTEXT_FACTORY);
//TODO: null-check for Weblogic, that tries to initialize Servlet before ContextListener
//Javadoc says: Lifecycle instance is shared across multiple simultaneous requests, it must be implemented in a thread-safe manner.
//So we can acquire it here once:
LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory (FactoryFinder.LIFECYCLE_FACTORY);
_lifecycle = lifecycleFactory.getLifecycle (context.getInitParameter (FacesServlet.LIFECYCLE_ID_ATTR) ?? LifecycleFactory.DEFAULT_LIFECYCLE);
_renderKitFactory = (RenderKitFactory) FactoryFinder.getFactory (FactoryFinder.RENDER_KIT_FACTORY);
AppDomain servletDomain = createServletDomain (config);
vmw.@internal.EnvironmentUtils.setAppDomain (servletDomain);
try {
//GH Infromation Initizalization
long currentTime = java.lang.System.currentTimeMillis ();
servletDomain.SetData (".domainId", currentTime.ToString ("x"));
currentTime = ~currentTime;
servletDomain.SetData (".appId", currentTime.ToString ("x"));
servletDomain.SetData (".appName", servletDomain.SetupInformation.ApplicationName);
servletDomain.SetData (J2EEConsts.CLASS_LOADER, java.lang.Thread.currentThread ().getContextClassLoader ());
//servletDomain.SetData (J2EEConsts.CLASS_LOADER, vmw.common.TypeUtils.ToClass (evidence).getClassLoader ());
//servletDomain.SetData(J2EEConsts.SERVLET_CONFIG, config);
servletDomain.SetData (J2EEConsts.RESOURCE_LOADER, new ServletResourceLoader (context));
lock (evidence) {
if (context.getAttribute (J2EEConsts.APP_DOMAIN) == null)
context.setAttribute (J2EEConsts.APP_DOMAIN, servletDomain);
}
//config.getServletContext ().setAttribute (J2EEConsts.CURRENT_SERVLET, this);
}
finally {
vmw.@internal.EnvironmentUtils.cleanTLS ();
vmw.@internal.EnvironmentUtils.clearAppDomain ();
}
}
protected override void service (HttpServletRequest req, HttpServletResponse resp)
{
const string assemblies = "/assemblies";
const string getping = "getping";
const string setping = "setping";
const string version = "2.2";
string servletPath = req.getServletPath ();
if (String.CompareOrdinal (assemblies, 0, servletPath, 0, assemblies.Length) == 0) {
if (servletPath.Length == assemblies.Length ||
servletPath [assemblies.Length] == '/') {
string requestURI = req.getRequestURI ();
bool getp = requestURI.EndsWith (getping, StringComparison.Ordinal);
if (!getp && requestURI.EndsWith (setping, StringComparison.Ordinal)) {
getServletContext().setAttribute(getping, version);
getp = true;
}
if (getp) {
string ping = (string) getServletContext ().getAttribute (getping);
if (ping == null)
ping = "0";
resp.getOutputStream ().print (ping);
return;
}
}
}
resp.setContentType ("text/html");
try
{
// Very important - to update Virtual Path!!!
AppDomain servletDomain = (AppDomain)this.getServletContext().getAttribute(J2EEConsts.APP_DOMAIN);
if (!_appVirDirInited) {
string appVPath = req.getContextPath ();
if (appVPath == null || appVPath.Length == 0)
appVPath = "/";
servletDomain.SetData (IAppDomainConfig.APP_VIRT_DIR, appVPath);
servletDomain.SetData (".hostingVirtualPath", req.getContextPath ());
_appVirDirInited = true;
}
// Put to the TLS current AppDomain of the servlet, so anyone can use it.
vmw.@internal.EnvironmentUtils.setAppDomain(servletDomain);
// put request to the TLS
//Thread.SetData(_servletRequestSlot, req);
//// put response to the TLS
//Thread.SetData(_servletResponseSlot, resp);
//// put the servlet object to the TLS
//Thread.SetData(_servletSlot, this);
resp.setHeader("X-Powered-By", "ASP.NET");
resp.setHeader("X-AspNet-Version", "1.1.4322");
HttpWorkerRequest gwr = new ServletWorkerRequest (this, req, resp);
CultureInfo culture = (CultureInfo) vmw.@internal.EnvironmentUtils.getCultureInfoFromLocale (req.getLocale ());
Thread currentTread = Thread.CurrentThread;
currentTread.CurrentCulture = culture;
currentTread.CurrentUICulture = culture;
HttpRuntime.ProcessRequest(gwr);
}
finally
{
HttpContext.Current = null;
//Thread.SetData(_servletRequestSlot, null);
//Thread.SetData(_servletResponseSlot, null);
//Thread.SetData(_servletSlot, null);
vmw.@internal.EnvironmentUtils.clearAppDomain();
}
}
override public void destroy()
{
base.destroy();
DestroyRuntime (getServletContext (), this);
}
public static void DestroyRuntime (ServletContext context, IJDBCDriverDeregisterer evidence) {
AppDomain servletDomain = (AppDomain) context.getAttribute (J2EEConsts.APP_DOMAIN);
if (servletDomain == null)
return;
try {
vmw.@internal.EnvironmentUtils.setAppDomain (servletDomain);
Debug.WriteLine ("Destroy of GhHttpServlet");
HttpRuntime.Close ();
vmw.@internal.EnvironmentUtils.cleanAllBeforeServletDestroy (evidence);
context.removeAttribute (J2EEConsts.APP_DOMAIN);
try {
FactoryFinder.releaseFactories ();
}
catch (FacesException) { }
java.lang.ClassLoader appClassLoader = vmw.common.TypeUtils.ToClass (evidence).getClassLoader ();
IJDBCDriverDeregisterer dereg = evidence;
java.util.Enumeration en = java.sql.DriverManager.getDrivers ();
while (en.hasMoreElements ()) {
Object o = en.nextElement ();
if (vmw.common.TypeUtils.ToClass (o).getClassLoader () == appClassLoader)
dereg.DeregisterDriver ((java.sql.Driver) o);
}
java.lang.Thread.currentThread ().setContextClassLoader (null);
}
catch (Exception e) {
Debug.WriteLine (String.Format ("ERROR in Servlet Destroy {0},{1}", e.GetType (), e.Message));
Debug.WriteLine (e.StackTrace);
}
finally {
vmw.@internal.EnvironmentUtils.clearAppDomain ();
}
}
private static AppDomain createServletDomain(ServletConfig config)
{
string rootPath = J2EEUtils.GetApplicationRealPath(config.getServletContext ());
AppDomainSetup domainSetup = new AppDomainSetup();
string name = config.getServletName();//.getServletContextName();
if (name == null)
name = "GH Application";
domainSetup.ApplicationName = name;
domainSetup.ConfigurationFile = Path.Combine (rootPath, "Web.config");
domainSetup.PrivateBinPath = Path.Combine (rootPath, "WEB-INF/lib");
AppDomain servletDomain = AppDomain.CreateDomain(name, null, domainSetup);
//servletDomain.SetData(IAppDomainConfig.APP_PHYS_DIR, J2EEUtils.GetApplicationPhysicalPath(config));
//servletDomain.SetData(IAppDomainConfig.WEB_APP_DIR, rootPath);
servletDomain.SetData(IAppDomainConfig.APP_PHYS_DIR, J2EEUtils.GetApplicationPhysicalPath(config.getServletContext ()));
servletDomain.SetData(IAppDomainConfig.WEB_APP_DIR, rootPath);
servletDomain.SetData(IAppDomainConfig.SERVLET_CONFIG, config);
//Set DataDirectory substitution string (http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx)
string dataDirectory = config.getServletContext ().getInitParameter ("DataDirectory");
if (dataDirectory == null)
dataDirectory = "App_Data";
if (!Path.IsPathRooted (dataDirectory)) {
java.io.InputStream inputStream = config.getServletContext ().getResourceAsStream ("/WEB-INF/classes/appData.properties");
string root;
if (inputStream != null) {
try {
Properties props = new Properties ();
props.load (inputStream);
root = props.getProperty ("root.folder");
}
finally {
inputStream.close ();
}
}
else
root = config.getServletContext ().getRealPath ("/");
if (root == null)
root = String.Empty;
dataDirectory = Path.Combine (root, dataDirectory);
}
if (dataDirectory [dataDirectory.Length - 1] != Path.DirectorySeparatorChar)
dataDirectory += Path.DirectorySeparatorChar;
servletDomain.SetData ("DataDirectory", dataDirectory);
if (config.getServletContext ().getRealPath ("/") == null)
servletDomain.SetData(".appStartTime", DateTime.UtcNow);
// The BaseDir is the full path to the physical dir of the app
// and allows the application to modify files in the case of
// open deployment.
string webApp_baseDir = config.getServletContext().getRealPath("");
if (webApp_baseDir == null || webApp_baseDir == "")
webApp_baseDir = rootPath;
servletDomain.SetData(IAppDomainConfig.APP_BASE_DIR , webApp_baseDir);
Debug.WriteLine("Initialization of webapp " + webApp_baseDir);
//servletDomain.SetData(".hostingVirtualPath", "/");
//servletDomain.SetData(".hostingInstallDir", "/");
return servletDomain;
}
#region IJDBCDriverDeregisterer Members
public void DeregisterDriver (java.sql.Driver driver) {
java.sql.DriverManager.deregisterDriver (driver);
}
#endregion
}
}
namespace System.Web.GH
{
/// <summary>
/// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
/// </summary>
public class BaseHttpServlet : Mainsoft.Web.Hosting.BaseHttpServlet
{
}
}
namespace System.Web.J2EE
{
/// <summary>
/// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
/// </summary>
public class BaseHttpServlet : Mainsoft.Web.Hosting.BaseHttpServlet
{
}
}
public class GhDynamicHttpServlet : System.Web.GH.BaseHttpServlet
{
}
public class GhStaticHttpServlet : System.Web.GH.BaseStaticHttpServlet
{
}
public class GhHttpServlet : System.Web.GH.BaseHttpServlet
{
GhStaticHttpServlet staticServlet;
public GhHttpServlet () {
staticServlet = new GhStaticHttpServlet ();
}
override public void init (ServletConfig config) {
base.init (config);
staticServlet.init (config);
}
override protected void service (HttpServletRequest req, HttpServletResponse resp) {
string pathInfo = req.getRequestURI ();
string contextPath = req.getContextPath ();
if (pathInfo.Equals (contextPath) ||
((pathInfo.Length - contextPath.Length) == 1) &&
pathInfo [pathInfo.Length - 1] == '/' && pathInfo.StartsWith (contextPath))
pathInfo = contextPath + req.getServletPath ();
if (pathInfo.EndsWith (".aspx") ||
pathInfo.EndsWith (".asmx") ||
pathInfo.EndsWith (".invoke")) {
base.service (req, resp);
}
else {
staticServlet.service (req, resp);
}
}
override public void destroy () {
staticServlet.destroy ();
base.destroy ();
}
}
@@ -1,186 +0,0 @@
//
// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Configuration;
using System.Web;
using System.Threading;
using javax.servlet;
using javax.servlet.http;
using vmw.common;
using System.Diagnostics;
namespace Mainsoft.Web.Hosting
{
/// <summary>
/// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
/// </summary>
public class BaseStaticHttpServlet : HttpServlet
{
public BaseStaticHttpServlet()
{
}
override public void init(ServletConfig config)
{
base.init(config);
AppDir = config.getServletContext ().getInitParameter (IAppDomainConfig.APP_DIR_NAME);
if (AppDir != null) {
AppDir = AppDir.Replace('\\', '/');
if (AppDir[AppDir.Length - 1] != '/')
AppDir += '/';
}
}
override protected void service(HttpServletRequest req, HttpServletResponse resp)
{
resp.setHeader("X-Powered-By", "ASP.NET");
resp.setHeader("X-AspNet-Version", "1.1.4322");
String filename = getServletContext().getRealPath(req.getServletPath());
ServletOutputStream hos;
try {
hos = resp.getOutputStream();
}
catch (java.lang.IllegalStateException e)
{
string mimeType = getServletContext().getMimeType(filename);
if (mimeType == null || mimeType.StartsWith("text")) {
sendFileUsingWriter(resp, filename);
return;
}
else
throw e;
}
try
{
string mimeType = this.getServletContext().getMimeType(filename);
if (mimeType == null)
mimeType = "text/plain";
resp.setContentType(mimeType);
FileStream fis = null;
try {
fis = new FileStream(filename,FileMode.Open,FileAccess.Read);
byte[] buf = new byte[4 * 1024]; // 4K buffer
int bytesRead;
while ((bytesRead = fis.Read(buf,0,buf.Length)) != -1 &&
bytesRead != 0) {
hos.write(TypeUtils.ToSByteArray(buf), 0, bytesRead);
}
}
finally {
if (fis != null) fis.Close();
}
}
catch (System.IO.FileNotFoundException e)
{
resp.setStatus(404,"Object Not Found.");
HttpException myExp = new HttpException (404, "File '" + filename + "' not found.");
hos.print(((HttpException) myExp).GetHtmlErrorMessage ());
hos.flush();
}
catch(Exception e)
{
Trace.WriteLine (String.Format ("ERROR in Static File Reading {0},{1}", e.GetType (), e.Message));
resp.setStatus(500);
HttpException myExp = new HttpException ("Exception in Reading static file", e);
hos.print(((HttpException) myExp).GetHtmlErrorMessage ());
hos.flush();
}
}
void sendFileUsingWriter(HttpServletResponse resp, string filename)
{
java.io.PrintWriter writer = resp.getWriter();
try
{
resp.setContentType(this.getServletContext().getMimeType(filename));
StreamReader fis = null;
char[] buf = new char[4 * 1024]; // 4K buffer
try {
fis = new StreamReader(filename);
int charsRead;
while ((charsRead = fis.Read(buf,0,buf.Length)) != -1 &&
charsRead != 0) {
writer.write(buf, 0, charsRead);
}
}
finally {
if (fis != null) fis.Close();
}
}
catch (System.IO.FileNotFoundException e)
{
resp.setStatus(404,"Object Not Found.");
HttpException myExp = new HttpException (404, "File '" + filename + "' not found.");
writer.print(((HttpException) myExp).GetHtmlErrorMessage ());
writer.flush();
}
catch(Exception e)
{
Trace.WriteLine (String.Format ("ERROR in Static File Reading {0},{1}", e.GetType (), e.Message));
resp.setStatus(500);
HttpException myExp = new HttpException ("Exception in Reading static file", e);
writer.print(((HttpException) myExp).GetHtmlErrorMessage ());
writer.flush();
}
}
override public void destroy()
{
base.destroy();
}
private string AppDir;
}
}
namespace System.Web.J2EE
{
/// <summary>
/// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
/// </summary>
public class BaseStaticHttpServlet : Mainsoft.Web.Hosting.BaseStaticHttpServlet
{
}
}
namespace System.Web.GH
{
/// <summary>
/// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
/// </summary>
public class BaseStaticHttpServlet : Mainsoft.Web.Hosting.BaseStaticHttpServlet
{
}
}
@@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using javax.faces.context;
namespace Mainsoft.Web.Hosting
{
public interface IExtendedViewHandler
{
string EncodeNamespace (FacesContext facesContext, string value);
}
}
@@ -1,122 +0,0 @@
//
// Mainsoft.Web.Hosting.IncludeHelperServlet
//
// Authors:
// Eyal Alaluf ([email protected])
//
// (C) 2006 Mainsoft Co. (http://www.mainsoft.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.IO;
using System.Web.UI;
using java.io;
using javax.servlet;
using javax.servlet.http;
namespace Mainsoft.Web.Hosting
{
/// <summary>
/// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
/// </summary>
public class IncludeHelperServlet : HttpServlet
{
public IncludeHelperServlet()
{
}
override protected void service(HttpServletRequest req, HttpServletResponse resp)
{
string servletPath = ServletIncludeUtils.getServletPath(req);
TextWriter writer = (TextWriter)ServletIncludeUtils.getTextWriter(req);
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(servletPath);
HttpServletResponseWrapper wrapper = new AspxResponseWrapper(resp, writer);
dispatcher.include(req, wrapper);
}
sealed class AspxResponseWrapper : HttpServletResponseWrapper
{
public AspxResponseWrapper(HttpServletResponse resp, TextWriter writer) : base (resp)
{
jwriter = new PrintWriter(new JavaWriterFromTextWriter(writer));
}
public override PrintWriter getWriter()
{
return jwriter;
}
readonly PrintWriter jwriter;
}
sealed class JavaWriterFromTextWriter : Writer
{
public JavaWriterFromTextWriter(TextWriter writer)
{
this.writer = writer;
}
public override void flush()
{
writer.Flush ();
}
public override void write(char[] buffer, int offset, int count)
{
writer.Write(buffer, offset, count);
}
public override void write(String s)
{
writer.Write(s);
}
public override void write(string s, int start, int count)
{
if (start == 0 && count == s.Length)
writer.Write(s);
else
writer.Write(s.Substring(start, count));
}
public override void close()
{
// Ignore close as we don't own here the writer.
}
readonly TextWriter writer;
}
}
}
namespace System.Web.GH
{
/// <summary>
/// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
/// </summary>
public class IncludeHelperServlet : Mainsoft.Web.Hosting.IncludeHelperServlet
{
}
}
@@ -1,188 +0,0 @@
//
// Mainsoft.Web.Hosting.OutputStreamWrapper
//
// Authors:
// Vladimir Krasnov ([email protected])
//
// (C) 2006 Mainsoft
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Web;
using System.Collections.Generic;
using System.Text;
using java.io;
using vmw.common;
namespace Mainsoft.Web.Hosting
{
/// <summary>
///
/// </summary>
public sealed class OutputStreamWrapper : java.io.Writer
{
enum OutputMode
{
CharWriter,
ByteStream,
}
readonly PrintWriter _printWriter;
readonly OutputStream _outputStream;
readonly OutputMode _outputMode;
private byte [] _bytebuffer;
private char [] _charBuffer;
//sbyte [] _oneByte = new sbyte [1];
Encoding _encoding = null;
/// <summary>
/// Ctor from writer
/// </summary>
/// <param name="writer"></param>
public OutputStreamWrapper (PrintWriter writer)
{
_printWriter = writer;
_outputMode = OutputMode.CharWriter;
}
/// <summary>
/// Ctor from stream
/// </summary>
/// <param name="outputStream"></param>
public OutputStreamWrapper (OutputStream outputStream)
{
_outputStream = outputStream;
_outputMode = OutputMode.ByteStream;
}
/// <summary>
///
/// </summary>
public override void close ()
{
// BUGBUG
// on WPS, closing the writer causes
// any portlets rendered after us to be not shown...
//_writer.close();
}
/// <summary>
/// Flushes servers stream
/// </summary>
public override void flush ()
{
if (_outputMode == OutputMode.CharWriter)
_printWriter.flush ();
else
_outputStream.flush();
}
/// <summary>
/// Writes char array
/// </summary>
/// <param name="chars"></param>
/// <param name="index"></param>
/// <param name="count"></param>
public override void write (char [] chars, int index, int count)
{
if (_outputMode == OutputMode.CharWriter) {
_printWriter.write (chars, index, count);
}
else {
int length = Encoding.GetMaxByteCount (count);
byte [] bytebuffer = GetByteBuffer (length);
int realLength = Encoding.GetBytes (chars, index, count, bytebuffer, 0);
_outputStream.write (TypeUtils.ToSByteArray (bytebuffer), 0, realLength);
}
}
/// <summary>
/// Writes byte array
/// </summary>
/// <param name="sbytes"></param>
/// <param name="index"></param>
/// <param name="count"></param>
public void write (sbyte [] sbytes, int index, int count)
{
if (_outputMode == OutputMode.ByteStream)
_outputStream.write (sbytes, index, count);
else {
int length = Encoding.GetMaxCharCount (count);
char [] charbuffer = GetCharBuffer (length);
int realLength = Encoding.GetChars ((byte []) TypeUtils.ToByteArray (sbytes), index, count, charbuffer, 0);
_printWriter.write (charbuffer, 0, realLength);
}
}
private char [] GetCharBuffer (int length)
{
// We will reuse the buffer if its size is < 32K
if (_charBuffer != null && _charBuffer.Length >= length)
return _charBuffer;
if (length > 32 * 1024)
return new char [length];
if (length < 1024)
length = 1024;
_charBuffer = new char [length];
return _charBuffer;
}
private byte [] GetByteBuffer (int length)
{
// We will reuse the buffer if its size is < 32K
if (_bytebuffer != null && _bytebuffer.Length >= length)
return _bytebuffer;
if (length > 32 * 1024)
return new byte [length];
if (length < 1024)
length = 1024;
_bytebuffer = new byte [length];
return _bytebuffer;
}
private Encoding Encoding
{
get
{
if (_encoding == null) {
HttpContext current = HttpContext.Current;
_encoding = (current != null) ? current.Response.ContentEncoding : Encoding.UTF8;
}
return _encoding;
}
}
}
}
@@ -1,118 +0,0 @@
//
// Mainsoft.Web.Hosting.RequestParameterMap.cs
//
// Authors:
// Konstantin Triger <[email protected]>
//
// (C) 2008 Mainsoft Co. (http://www.mainsoft.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using java.util;
using System.Collections.Specialized;
using System.Collections;
namespace Mainsoft.Web.Hosting
{
partial class BaseExternalContext
{
abstract class BaseRequestParameterMap : AbstractAttributeMap
{
readonly NameValueCollection _form;
protected BaseRequestParameterMap (NameValueCollection form) {
_form = form;
}
protected NameValueCollection Form {
get { return _form; }
}
protected override void setAttribute (String key, Object value) {
throw new NotSupportedException (
"Cannot set Request Parameter");
}
protected override void removeAttribute (String key) {
throw new NotSupportedException (
"Cannot remove Request Parameter");
}
protected override Enumeration getAttributeNames () {
return new EnumerationImpl (_form.Keys.GetEnumerator ());
}
sealed class EnumerationImpl : Enumeration
{
readonly IEnumerator _en;
public EnumerationImpl (IEnumerator en) {
_en = en;
}
#region Enumeration Members
public bool hasMoreElements () {
return _en.MoveNext ();
}
public object nextElement () {
return _en.Current;
}
#endregion
}
}
sealed class RequestParameterMap : BaseRequestParameterMap
{
public RequestParameterMap (NameValueCollection form)
: base (form) {
}
protected override Object getAttribute (String key) {
return Form [key];
}
}
sealed class IEnumeratorIteratorImpl : Iterator
{
readonly private IEnumerator _en;
public IEnumeratorIteratorImpl (IEnumerator en) {
_en = en;
}
public bool hasNext () {
return _en.MoveNext ();
}
public Object next () {
return _en.Current;
}
public void remove () {
throw new NotSupportedException (GetType ().Name + " UnsupportedOperationException");
}
}
}
}
@@ -1,49 +0,0 @@
//
// Mainsoft.Web.Hosting.RequestParameterValuesMap.cs
//
// Authors:
// Konstantin Triger <[email protected]>
//
// (C) 2008 Mainsoft Co. (http://www.mainsoft.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using java.util;
using System.Collections.Specialized;
namespace Mainsoft.Web.Hosting
{
partial class BaseExternalContext
{
sealed class RequestParameterValuesMap : BaseRequestParameterMap
{
public RequestParameterValuesMap (NameValueCollection form)
: base (form) {
}
protected override Object getAttribute (String key) {
return Form.GetValues (key);
}
}
}
}
@@ -1,167 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using javax.faces.context;
using System.Web;
using System.Web.UI;
using javax.servlet;
using javax.faces.lifecycle;
using javax.faces.application;
namespace Mainsoft.Web.Hosting
{
public class ServletFacesContext : AspNetFacesContext
{
protected ServletFacesContext (FacesContext wrappedFacesContext, ExternalContext externalContext, HttpContext httpContext, FacesContext oldFacesContext)
: base (wrappedFacesContext, externalContext, httpContext, oldFacesContext) {
}
public static ServletFacesContext GetFacesContext (FacesContextFactory facesContextFactory,
ServletContext servletContext,
ServletRequest servletRequest,
ServletResponse servletResponse,
Lifecycle lifecycle,
HttpContext httpContext,
string executionFilePath) {
FacesContext oldFacesContex = FacesContext.getCurrentInstance ();
FacesContext wrappedFacesContex = facesContextFactory.getFacesContext (servletContext, servletRequest, servletResponse, lifecycle);
ExternalContext externalContext = new ServletExternalContext (wrappedFacesContex.getExternalContext (), httpContext, executionFilePath);
ServletFacesContext context = new ServletFacesContext (wrappedFacesContex, externalContext, httpContext, oldFacesContex);
return context;
}
}
#region ServletExternalContext
public class ServletExternalContext : BaseExternalContext
{
readonly ExternalContext _externalContext;
public ServletExternalContext (ExternalContext externalContext, HttpContext httpContext, string executionFilePath)
: base (httpContext, executionFilePath) {
_externalContext = externalContext;
}
public override void dispatch (string __p1) {
_externalContext.dispatch (__p1);
}
public override string encodeActionURL (string __p1) {
return _externalContext.encodeActionURL (__p1);
}
public override string encodeNamespace (string __p1) {
return _externalContext.encodeNamespace (__p1);
}
public override string encodeResourceURL (string __p1) {
return _externalContext.encodeResourceURL (__p1);
}
public override java.util.Map getApplicationMap () {
return _externalContext.getApplicationMap ();
}
public override string getAuthType () {
return _externalContext.getAuthType ();
}
public override object getContext () {
return _externalContext.getContext ();
}
public override string getInitParameter (string __p1) {
return _externalContext.getInitParameter (__p1);
}
public override java.util.Map getInitParameterMap () {
return _externalContext.getInitParameterMap ();
}
public override string getRemoteUser () {
return _externalContext.getRemoteUser ();
}
public override object getRequest () {
return _externalContext.getRequest ();
}
public override string getRequestContextPath () {
return _externalContext.getRequestContextPath ();
}
public override java.util.Map getRequestCookieMap () {
return _externalContext.getRequestCookieMap ();
}
public override java.util.Map getRequestHeaderMap () {
return _externalContext.getRequestHeaderMap ();
}
public override java.util.Map getRequestHeaderValuesMap () {
return _externalContext.getRequestHeaderValuesMap ();
}
public override java.util.Locale getRequestLocale () {
return _externalContext.getRequestLocale ();
}
public override java.util.Iterator getRequestLocales () {
return _externalContext.getRequestLocales ();
}
public override java.util.Map getRequestMap () {
return _externalContext.getRequestMap ();
}
public override string getRequestServletPath () {
return _externalContext.getRequestServletPath ();
}
public override java.net.URL getResource (string __p1) {
return _externalContext.getResource (__p1);
}
public override java.io.InputStream getResourceAsStream (string __p1) {
return _externalContext.getResourceAsStream (__p1);
}
public override java.util.Set getResourcePaths (string __p1) {
return _externalContext.getResourcePaths (__p1);
}
public override object getResponse () {
return _externalContext.getResponse ();
}
public override object getSession (bool __p1) {
return _externalContext.getSession (__p1);
}
public override java.util.Map getSessionMap () {
return _externalContext.getSessionMap ();
}
public override java.security.Principal getUserPrincipal () {
return _externalContext.getUserPrincipal ();
}
public override bool isUserInRole (string __p1) {
return _externalContext.isUserInRole (__p1);
}
public override void log (string __p1, Exception __p2) {
_externalContext.log (__p1, __p2);
}
public override void log (string __p1) {
_externalContext.log (__p1);
}
public override void redirect (string __p1) {
_externalContext.redirect (__p1);
}
}
#endregion
}
@@ -1,139 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using javax.faces.component;
using System.Web.UI;
using javax.faces.context;
using javax.faces.lifecycle;
using javax.faces;
using javax.servlet;
using javax.faces.webapp;
using javax.servlet.http;
using vmw.common;
using System.Diagnostics;
using javax.faces.render;
using System.IO;
namespace Mainsoft.Web.Hosting
{
public abstract class BaseFacesPageHandler
{
static protected void SetupResponseWriter (AspNetFacesContext facesContext, string contentType, string characterEncoding) {
RenderKit renderKit = BaseHttpServlet.RenderKitFactory.getRenderKit (facesContext, facesContext.getViewRoot ().getRenderKitId ());
ResponseWriter writer = renderKit.createResponseWriter (new AspNetResponseWriter (facesContext.Context.Response.Output), contentType, characterEncoding);
facesContext.setResponseWriter (writer);
}
#region AspNetResponseWriter
private sealed class AspNetResponseWriter : java.io.Writer
{
readonly TextWriter _writer;
public AspNetResponseWriter (TextWriter writer) {
_writer = writer;
}
public override void close () {
_writer.Close ();
}
public override void flush () {
_writer.Flush ();
}
public override void write (char [] __p1, int __p2, int __p3) {
_writer.Write (__p1, __p2, __p3);
}
public override void write (int __p1) {
_writer.Write ((char) __p1);
}
public override void write (char [] __p1) {
_writer.Write (__p1);
}
public override void write (string __p1) {
_writer.Write (__p1);
}
public override void write (string __p1, int __p2, int __p3) {
_writer.Write (__p1, __p2, __p3);
}
}
#endregion
}
public class ServletFacesPageHandler : BaseFacesPageHandler, IHttpHandler, IServiceProvider
{
readonly FacesContextFactory _facesContextFactory;
readonly Lifecycle _lifecycle;
readonly string _executionFilePath;
readonly Type _pageType;
Page _page;
public bool IsReusable {
get { return false; }
}
public ServletFacesPageHandler (string executionFilePath, Type pageType, FacesContextFactory facesContextFactory, Lifecycle lifecycle) {
_facesContextFactory = facesContextFactory;
_lifecycle = lifecycle;
_executionFilePath = executionFilePath;
_pageType = pageType;
}
protected virtual ServletFacesContext GetFacesContext (FacesContextFactory facesContextFactory,
ServletContext servletContext,
ServletRequest servletRequest,
ServletResponse servletResponse,
Lifecycle lifecycle,
HttpContext httpContext,
string executionFilePath) {
return ServletFacesContext.GetFacesContext (facesContextFactory, servletContext, servletRequest, servletResponse, lifecycle, httpContext, executionFilePath);
}
public void ProcessRequest (HttpContext context) {
ServletWorkerRequest wr = (ServletWorkerRequest) ((IServiceProvider) context).GetService (typeof (HttpWorkerRequest));
ServletContext servletContext = wr.GetContext ();
HttpServletRequest request = wr.ServletRequest;
HttpServletResponse response = wr.ServletResponse;
ServletFacesContext facesContext = GetFacesContext (_facesContextFactory, servletContext, request, response, _lifecycle, context, _executionFilePath);
try {
try {
try {
Trace.WriteLine ("FacesPageHandler: before execute");
_lifecycle.execute (facesContext);
Trace.WriteLine ("FacesPageHandler: after execute");
}
finally {
UIViewRoot viewRoot = facesContext.getViewRoot ();
if (viewRoot != null && viewRoot.getChildCount () > 0)
_page = (Page) viewRoot.getChildren ().get (0);
}
Trace.WriteLine ("FacesPageHandler: before render");
SetupResponseWriter (facesContext, response.getContentType (), response.getCharacterEncoding ());
_lifecycle.render (facesContext);
Trace.WriteLine ("FacesPageHandler: after render");
}
catch (FacesException fex) {
Exception inner = fex.InnerException;
if (inner != null)
TypeUtils.Throw (inner);
throw;
}
}
finally {
facesContext.release ();
}
}
public object GetService (Type serviceType) {
if (serviceType == typeof (Type))
return _pageType;
if (serviceType == typeof (Page))
return _page;
return null;
}
}
}
@@ -1,25 +0,0 @@
using System.Web;
using System.Web.Compilation;
using System.Web.UI;
using javax.faces.component;
using javax.servlet;
using javax.faces.context;
using javax.faces.lifecycle;
using javax.servlet.http;
using System;
using javax.faces.webapp;
using javax.faces;
using System.Web.J2EE;
namespace Mainsoft.Web.Hosting
{
public sealed class ServletFacesPageHandlerFactory : BaseFacesPageHandlerFactory
{
public override IHttpHandler GetHandler (HttpContext context, string requestType, string url, string path) {
Type pageType = PageMapper.GetObjectType (context, url);
IHttpHandler handler = new ServletFacesPageHandler (url, pageType, BaseHttpServlet.FacesContextFactory, BaseHttpServlet.Lifecycle);
return SessionWrapper.WrapHandler (handler);
}
}
}
@@ -1,66 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using javax.faces;
using javax.faces.application;
using javax.faces.render;
using javax.faces.component;
using javax.faces.context;
using System.Web.Hosting;
using System.Web;
using java.util;
using System.Diagnostics;
using javax.servlet.http;
namespace Mainsoft.Web.Hosting
{
public sealed class ServletFacesStateManager : BaseFacesStateManager
{
public override void writeState (FacesContext facesContext, StateManager.SerializedView serializedView) {
Trace.WriteLine ("Entering writeState");
if (serializedView != null) {
if (isSavingStateInClient (facesContext)) {
SaveStateInClient (facesContext, serializedView);
}
else {
HttpSession session = (HttpSession) facesContext.getExternalContext ().getSession (true);
string key = ((IExtendedViewHandler) facesContext.getApplication ().getViewHandler ()).EncodeNamespace (facesContext, VIEWSTATE);
session.setAttribute (key, serializedView);
}
}
Trace.WriteLine ("Exiting writeState");
}
protected override void restoreComponentState (FacesContext facesContext,
javax.faces.component.UIViewRoot uiViewRoot,
String renderKitId) {
Trace.WriteLine ("Entering restoreComponentState");
Object serializedComponentStates;
if (isSavingStateInClient (facesContext)) {
serializedComponentStates = GetStateFromClient (facesContext, uiViewRoot.getViewId(), renderKitId);
}
else {
HttpSession session = (HttpSession) facesContext.getExternalContext ().getSession (false);
if (session == null)
serializedComponentStates = null;
else {
string key = ((IExtendedViewHandler) facesContext.getApplication ().getViewHandler ()).EncodeNamespace (facesContext, VIEWSTATE);
SerializedView serializedView = session.getAttribute (key) as SerializedView;
if (serializedView == null)
serializedComponentStates = null;
else
serializedComponentStates = serializedView.getState ();
}
}
((UIComponent) uiViewRoot.getChildren ().get (0)).processRestoreState (facesContext, serializedComponentStates);
Trace.WriteLine ("Exiting restoreComponentState");
}
}
}
@@ -1,29 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using javax.faces.application;
using javax.servlet.http;
using java.util;
using javax.faces.context;
using javax.faces.component;
using java.lang;
using javax.faces.render;
namespace Mainsoft.Web.Hosting
{
public class ServletFacesViewHandler : BaseFacesViewHandler
{
public ServletFacesViewHandler (ViewHandler viewHandler)
: base (viewHandler) {
}
public override string getActionURL (FacesContext facesContext, string viewId) {
if (viewId.Length > 0 && viewId [0] == '/') {
return facesContext.getExternalContext ().getRequestContextPath () + viewId;
}
else {
return viewId;
}
}
}
}
@@ -1,61 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using javax.servlet;
using System.Web;
using javax.servlet.http;
namespace Mainsoft.Web.Hosting
{
public class ServletIncludeUtils
{
public static void includeServlet (String servletPath, Object writer, Object aspPage, Object [] servletParams) {
// Need to define logic for resolving the servletPath. Share code with portlet createRenderUrl.
HttpContext context = HttpContext.Current;
HttpWorkerRequest wr = (HttpWorkerRequest) ((IServiceProvider) context).GetService (typeof (HttpWorkerRequest));
RequestDispatcher dispatcher = ((ServletContext) ((IServiceProvider) wr).GetService (typeof (ServletContext))).getRequestDispatcher (SERVLET_INCLUDE_HELPER_PATH);
ServletResponse response = (ServletResponse) ((IServiceProvider) wr).GetService (typeof (ServletResponse));
ServletRequest request = (ServletRequest) ((IServiceProvider) wr).GetService (typeof (ServletRequest));
// Setup params for the include call.
String oldServletPath = (String) setAttribute (request, SERVLET_PATH_ATTRIBUTE_NAME, servletPath);
Object oldAspPage = setAttribute (request, ASPPAGE_ATTRIBUTE_NAME, aspPage);
Object [] oldServletParams = (Object []) setAttribute (request, SERVLET_PARAMS_ATTRIBUTE_NAME, servletParams);
Object oldWriter = setAttribute (request, TEXT_WRITER_ATTRIBUTE_NAME, writer);
// Do the include call.
dispatcher.include (request, response);
// Restore previous attribute values after the call.
request.setAttribute (SERVLET_PATH_ATTRIBUTE_NAME, oldServletPath);
request.setAttribute (ASPPAGE_ATTRIBUTE_NAME, oldAspPage);
request.setAttribute (SERVLET_PARAMS_ATTRIBUTE_NAME, oldServletParams);
request.setAttribute (TEXT_WRITER_ATTRIBUTE_NAME, oldWriter);
}
public static String getServletPath (ServletRequest request) {
return (String) request.getAttribute (SERVLET_PATH_ATTRIBUTE_NAME);
}
public static Object getAspPage (ServletRequest request) {
return request.getAttribute (ASPPAGE_ATTRIBUTE_NAME);
}
public static Object [] getServletParams (ServletRequest request) {
return (Object []) request.getAttribute (SERVLET_PARAMS_ATTRIBUTE_NAME);
}
public static Object getTextWriter (ServletRequest request) {
return request.getAttribute (TEXT_WRITER_ATTRIBUTE_NAME);
}
private static Object setAttribute (ServletRequest request, String attrname, Object newval) {
Object oldval = request.getAttribute (attrname);
request.setAttribute (attrname, newval);
return oldval;
}
public static readonly String SERVLET_INCLUDE_HELPER_PATH = "/servletincludehelper";
public static readonly String ASPPAGE_ATTRIBUTE_NAME = "vmw.servlet.include.asppage";
public static readonly String SERVLET_PATH_ATTRIBUTE_NAME = "vmw.servlet.include.servlet.path";
public static readonly String SERVLET_PARAMS_ATTRIBUTE_NAME = "vmw.servlet.include.servlet.params";
public static readonly String TEXT_WRITER_ATTRIBUTE_NAME = "vmw.servlet.include.text.writer";
}
}
@@ -1,50 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using [email protected];
using javax.servlet;
using java.io;
using java.net;
namespace Mainsoft.Web.Hosting
{
class ServletResourceLoader : IResourceLoader
{
ServletContext _context;
public ServletResourceLoader (ServletContext context) {
_context = context;
}
public URL getResource (String resourceName) {
if (resourceName == null)
throw new ArgumentNullException ("resourceName");
if (!resourceName.StartsWith ("/"))
resourceName = "/" + resourceName;
return _context.getResource (resourceName);
}
public InputStream getResourceAsStream (String resourceName) {
if (resourceName == null)
throw new ArgumentNullException ("resourceName");
if (!resourceName.StartsWith ("/"))
resourceName = "/" + resourceName;
return _context.getResourceAsStream (resourceName);
}
public java.util.Set getResourcePaths (String path) {
if (path == null)
throw new ArgumentNullException ("path");
if (!path.StartsWith ("/"))
path = "/" + path;
return _context.getResourcePaths (path);
}
}
}
@@ -1,202 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using javax.servlet.http;
using java.security;
using javax.servlet;
namespace Mainsoft.Web.Hosting
{
public sealed class ServletWorkerRequest : BaseWorkerRequest
{
readonly HttpServlet _HttpServlet;
readonly HttpServletRequest _HttpServletRequest;
readonly HttpServletResponse _HttpServletResponse;
OutputStreamWrapper _outputStream;
public ServletWorkerRequest (HttpServlet servlet, HttpServletRequest req, HttpServletResponse resp)
: base (req.getContextPath(), req.getServletPath (), req.getRequestURI ()) {
_HttpServlet = servlet;
_HttpServletRequest = req;
_HttpServletResponse = resp;
}
static readonly Type typeOfHttpServletRequest = typeof (HttpServletRequest);
static readonly Type typeOfHttpServletResponse = typeof (HttpServletResponse);
static readonly Type typeOfHttpServlet = typeof (HttpServlet);
static readonly Type typeOfHttpSession = typeof (HttpSession);
static readonly Type typeOfServletContext = typeof (ServletContext);
static readonly Type typeOfServletConfig = typeof (ServletConfig);
public override object GetService (Type serviceType) {
if (serviceType == typeOfHttpServlet ||
serviceType == typeOfServletConfig)
return _HttpServlet;
if (serviceType == typeOfHttpServletRequest)
return _HttpServletRequest;
if (serviceType == typeOfHttpServletResponse)
return _HttpServletResponse;
if (serviceType == typeOfHttpSession)
return GetSession (false);
if (serviceType == typeOfServletContext)
return _HttpServlet.getServletContext ();
return base.GetService (serviceType);
}
public HttpServlet Servlet {
get {
return _HttpServlet;
}
}
public HttpServletRequest ServletRequest {
get {
return _HttpServletRequest;
}
}
public HttpServletResponse ServletResponse {
get {
return _HttpServletResponse;
}
}
public override string GetHttpVerbName () {
return _HttpServletRequest.getMethod ();
}
public override string GetHttpVersion () {
return _HttpServletRequest.getProtocol ();
}
public override string GetLocalAddress () {
return _HttpServletRequest.getLocalAddr ();
}
public override int GetLocalPort () {
return _HttpServletRequest.getServerPort ();
}
public override string GetPathInfo () {
return base.GetPathInfo () ?? String.Empty;
}
public override string GetQueryString () {
return _HttpServletRequest.getQueryString ();
}
public override string GetRemoteAddress () {
return _HttpServletRequest.getRemoteAddr ();
}
public override string GetRemoteName () {
return _HttpServletRequest.getRemoteHost ();
}
public override int GetRemotePort () {
try {
return _HttpServletRequest.getRemotePort ();
}
catch (Exception e) {
// if servlet API is 2.3 and below - there is no method getRemotePort
// in ServletRequest interface... should be described as limitation.
return 0;
}
}
public override string GetProtocol () {
return _HttpServletRequest.getScheme ();
}
public override string GetServerName () {
return _HttpServletRequest.getServerName ();
}
public override bool IsSecure () {
return _HttpServletRequest.isSecure ();
}
public override void SendStatus (int statusCode, string statusDescription) {
// setStatus(int, string) is deprecated
_HttpServletResponse.setStatus (statusCode/*, statusDescription*/);
}
public override void SendUnknownResponseHeader (string name, string value) {
if (HeadersSent ())
return;
_HttpServletResponse.addHeader (name, value);
}
public override bool HeadersSent () {
return _HttpServletResponse.isCommitted ();
}
public override void SendCalculatedContentLength (int contentLength) {
_HttpServletResponse.setContentLength (contentLength);
}
public override string GetAuthType () {
return _HttpServletRequest.getAuthType ();
}
protected override int getContentLength () {
return _HttpServletRequest.getContentLength ();
}
protected override string getContentType () {
return _HttpServletRequest.getContentType ();
}
public override string GetRemoteUser () {
return _HttpServletRequest.getRemoteUser ();
}
protected override java.util.Enumeration getHeaderNames () {
return _HttpServletRequest.getHeaderNames ();
}
protected override string getHeader (string name) {
return _HttpServletRequest.getHeader (name);
}
protected override java.io.InputStream getInputStream () {
return _HttpServletRequest.getInputStream ();
}
public override javax.servlet.ServletContext GetContext () {
return _HttpServlet.getServletContext ();
}
protected override OutputStreamWrapper CreateOutputStream (bool binary) {
return _outputStream ?? (_outputStream = binary ?
new OutputStreamWrapper (_HttpServletResponse.getOutputStream ()) :
new OutputStreamWrapper (_HttpServletResponse.getWriter ()));
}
public override HttpSession GetSession (bool create) {
return _HttpServletRequest.getSession (create);
}
public override bool IsRequestedSessionIdValid () {
return _HttpServletRequest.isRequestedSessionIdValid ();
}
public override string GetRequestedSessionId () {
return _HttpServletRequest.getRequestedSessionId ();
}
public override bool IsUserInRole (string name) {
return _HttpServletRequest.isUserInRole (name);
}
public override Principal GetUserPrincipal () {
return _HttpServletRequest.getUserPrincipal ();
}
public override BaseHttpContext CreateContext (System.Web.HttpContext context) {
return new ServletHttpContext (context);
}
}
}
Loaded 100 of 488 files, more files were not shown because too many files have changed in this diff. Show more