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
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
319 changed files with 6430 additions and 16166 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"
+5
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
+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); \
+1
View File
@@ -24,6 +24,7 @@ PROFILE_MCS_FLAGS = \
-d:MOBILE_DYNAMIC \
-d:XAMMAC \
-d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK \
-d:XAMARIN_MODERN \
-nowarn:1699 \
-nostdlib \
-lib:$(topdir)/class/lib/$(PROFILE) \
+2 -1
View File
@@ -4,7 +4,8 @@ PROFILE_MCS_FLAGS += \
-d:NO_SYSTEM_DRAWING_DEPENDENCY \
-d:NO_WINFORMS_DEPENDENCY \
-d:NO_SYSTEM_WEB_DEPENDENCY \
-d:XAMMAC_4_5
-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);
}
}
}
@@ -1,430 +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.Text;
using System.Runtime.InteropServices;
using System.Web.Util;
using System.Web.J2EE;
using System.Collections;
using System.Web;
using javax.servlet;
using javax.servlet.http;
using System.Collections.Specialized;
using System.Globalization;
using System.Web.Hosting;
using vmw.common;
using InputStream=java.io.InputStream;
using java.security;
namespace Mainsoft.Web.Hosting {
[MonoTODO("Implement security demands on the path usage functions (and review)")]
[ComVisible (false)]
public abstract class BaseWorkerRequest : HttpWorkerRequest, IHttpExtendedWorkerRequest, IServiceProvider
{
OutputStreamWrapper _OutputStream;
readonly string _contextPath;
readonly string _requestUri;
readonly string _pathInfo;
static readonly StringDictionary _srvVarsToHeaderMap;
private string [][] unknownHeaders;
string _rawUrl;
private HttpWorkerRequest.EndOfSendNotification _endOfSendCallback;
private object _endOfSendArgs;
enum KnownServerVariable {
AUTH_TYPE,
CONTENT_LENGTH,
CONTENT_TYPE,
QUERY_STRING,
REMOTE_ADDR,
REMOTE_HOST,
REMOTE_USER,
REQUEST_METHOD,
REQUEST_URI,
SCRIPT_NAME,
SERVER_NAME,
SERVER_PORT,
SERVER_PROTOCOL,
SERVER_SOFTWARE,
PATH_INFO
};
static readonly Hashtable KnownServerVariableMap;
static BaseWorkerRequest() {
_srvVarsToHeaderMap = new StringDictionary();
_srvVarsToHeaderMap.Add("HTTP_ACCEPT", "Accept");
_srvVarsToHeaderMap.Add("HTTP_REFERER", "Referer");
_srvVarsToHeaderMap.Add("HTTP_ACCEPT_LANGUAGE", "Accept-Language");
_srvVarsToHeaderMap.Add("HTTP_ACCEPT_ENCODING", "Accept-Encoding");
_srvVarsToHeaderMap.Add("HTTP_CONNECTION", "Connection");
_srvVarsToHeaderMap.Add("HTTP_HOST", "Host");
_srvVarsToHeaderMap.Add("HTTP_USER_AGENT", "User-Agent");
_srvVarsToHeaderMap.Add("HTTP_SOAPACTION", "SOAPAction");
string[] knownServerVariableNames = Enum.GetNames(typeof(KnownServerVariable));
KnownServerVariableMap = CollectionsUtil.CreateCaseInsensitiveHashtable(knownServerVariableNames.Length);
for (int i = 0; i < knownServerVariableNames.Length; i++)
KnownServerVariableMap[knownServerVariableNames[i]] = (KnownServerVariable)i;
}
public BaseWorkerRequest (string contextPath, string servletPath, string requestURI) {
_contextPath = contextPath;
//string contextPath = req.getContextPath();
//string servletPath = req.getServletPath ();
//string requestURI = req.getRequestURI ();
// servletPath - Returns the part of this request's URL that calls the servlet.
// so it contains default page.
// requestURI - Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.
// so it contains what the user passed.
//
// the one containing more information wins.
if (contextPath.Length + servletPath.Length > requestURI.Length)
requestURI = contextPath + servletPath;
else {
int contextPos = requestURI.IndexOf(contextPath, StringComparison.Ordinal);
if (contextPos > 0)
requestURI = requestURI.Substring (contextPos);
}
_requestUri = Uri.UnescapeDataString(requestURI);
const int dotInvokeLength = 7; //".invoke".Length
if (_requestUri.Length > dotInvokeLength &&
String.CompareOrdinal(".invoke", 0, _requestUri,
_requestUri.Length - dotInvokeLength, dotInvokeLength) == 0) {
_requestUri = _requestUri.Substring(0, _requestUri.Length - dotInvokeLength);
int paramNameStart = _requestUri.LastIndexOf('/');
_pathInfo = _requestUri.Substring(paramNameStart, _requestUri.Length - paramNameStart);
}
const int aspnetconfigLength = 12; //"aspnetconfig".Length
int endingSlash = _requestUri [_requestUri.Length - 1] == '/' ? 1 : 0;
if (_requestUri.Length > aspnetconfigLength &&
String.CompareOrdinal ("aspnetconfig", 0, _requestUri,
_requestUri.Length - aspnetconfigLength - endingSlash, aspnetconfigLength) == 0) {
if (endingSlash == 0)
_requestUri += "/";
_requestUri += "Default.aspx";
}
}
static readonly Type typeOfWriter = typeof (java.io.Writer);
public virtual object GetService (Type serviceType)
{
if (serviceType == typeOfWriter)
return CreateOutputStream (false);
return null;
}
[MonoTODO("Implement security")]
public override string MachineInstallDirectory {
get {
return ".";
}
}
public override string MachineConfigPath {
get { return "."; }
}
public override void EndOfRequest () {
if (_endOfSendCallback != null)
_endOfSendCallback(this, _endOfSendArgs);
_OutputStream = null;
}
public override void FlushResponse (bool finalFlush) {
//kostat
//IPortletActionResponse resp =_HttpServletResponse as IPortletActionResponse;
//if (_OutputStream == null || resp != null && resp.isRedirected())
// return;
if (_OutputStream == null)
return;
_OutputStream.flush();
if (finalFlush)
_OutputStream.close();
}
public override string GetAppPath () {
return _contextPath;
}
public override string GetFilePath () {
string uri = GetUriPath();
string pathInfo = GetPathInfo();
if (pathInfo != null && pathInfo.Length > 0)
uri = uri.Substring (0, uri.Length - pathInfo.Length);
return uri;
}
public override string GetFilePathTranslated () {
string page = GetFilePath ();
if (Path.DirectorySeparatorChar != '/')
page = page.Replace ('/', Path.DirectorySeparatorChar);
if (page [0] == Path.DirectorySeparatorChar)
page = page.Substring (1);
return Path.Combine (GetAppPathTranslated (), page);
}
public override string GetPathInfo () {
return _pathInfo;
}
public override string GetRawUrl () {
if (_rawUrl == null) {
StringBuilder builder = new StringBuilder();
builder.Append(GetUriPath());
string pathInfo = GetPathInfo();
string query = GetQueryString();
if (query != null && query.Length > 0) {
builder.Append('?');
builder.Append(query);
}
_rawUrl = builder.ToString();
}
return _rawUrl;
}
public override string GetServerVariable(string name) {
// FIXME: We need to make a proper mapping between the standard server
// variables and java equivalent. probably we have to have a configuration file
// which associates between the two. Pay a special attention on GetUnknownRequestHeader/s
// while implementing. Ensure that system web "common" code correctly calls each method.
string headerName = _srvVarsToHeaderMap[name];
if (headerName != null)
return getHeader( headerName );
object knownVariable = KnownServerVariableMap[name];
if (knownVariable != null)
return GetKnownServerVariable((KnownServerVariable)knownVariable);
return getHeader( name );
}
public abstract string GetAuthType ();
protected abstract int getContentLength ();
protected abstract string getContentType ();
public abstract string GetRemoteUser ();
protected abstract string getHeader (string name);
protected abstract java.util.Enumeration getHeaderNames ();
protected abstract InputStream getInputStream ();
public abstract ServletContext GetContext ();
protected abstract OutputStreamWrapper CreateOutputStream (bool binary);
public abstract HttpSession GetSession (bool create);
public abstract bool IsRequestedSessionIdValid ();
public abstract string GetRequestedSessionId ();
public abstract bool IsUserInRole (string name);
public abstract Principal GetUserPrincipal ();
string GetKnownServerVariable(KnownServerVariable index) {
switch (index) {
case KnownServerVariable.AUTH_TYPE : return GetAuthType();
case KnownServerVariable.CONTENT_LENGTH : return Convert.ToString(getContentLength());
case KnownServerVariable.CONTENT_TYPE : return getContentType();
case KnownServerVariable.QUERY_STRING : return GetQueryString();
case KnownServerVariable.REMOTE_ADDR : return GetRemoteAddress();
case KnownServerVariable.REMOTE_HOST : return GetRemoteName();
case KnownServerVariable.REMOTE_USER : return GetRemoteUser();
case KnownServerVariable.REQUEST_METHOD : return GetHttpVerbName ();
case KnownServerVariable.REQUEST_URI : return GetUriPath();
case KnownServerVariable.SCRIPT_NAME : return GetFilePath ();
case KnownServerVariable.SERVER_NAME : return GetServerName();
case KnownServerVariable.SERVER_PORT : return Convert.ToString(GetLocalPort());
case KnownServerVariable.SERVER_PROTOCOL : return GetHttpVersion ();
case KnownServerVariable.SERVER_SOFTWARE : return GetContext().getServerInfo();
case KnownServerVariable.PATH_INFO : return GetPathInfo();
default: throw new IndexOutOfRangeException("index");
}
}
public override string GetUriPath() {
return _requestUri;
}
public override IntPtr GetUserToken() {
return IntPtr.Zero;
}
public override string GetAppPathTranslated () {
return J2EEUtils.GetApplicationRealPath (GetContext ());
}
public override string MapPath (string virtualPath) {
if (virtualPath == null)
throw new ArgumentNullException ("virtualPath");
ServletContext context = GetContext ();
string contextPath = GetAppPath ();
if ((virtualPath.Length > contextPath.Length && virtualPath [contextPath.Length] != '/') ||
string.Compare (contextPath, 0, virtualPath, 0, contextPath.Length, StringComparison.OrdinalIgnoreCase) != 0) {
for (int appVirtualPathIndex = 0; appVirtualPathIndex > 0 && virtualPath.Length > appVirtualPathIndex; ) {
appVirtualPathIndex = virtualPath.IndexOf ('/', appVirtualPathIndex + 1);
string crossContextPath = appVirtualPathIndex > 0 ?
virtualPath.Remove (appVirtualPathIndex) : virtualPath;
ServletContext other = context.getContext (crossContextPath);
if (other != null) {
string appVirtualPath = appVirtualPathIndex > 0 ?
virtualPath.Substring (appVirtualPathIndex) : String.Empty;
return other.getRealPath (appVirtualPath);
}
}
throw new HttpException (
String.Format ("MapPath: Mapping across applications is not allowed. ApplicationPath is '{0}', VirtualPath is '{1}'.",
contextPath, virtualPath));
}
string thisAppVirtualPath = virtualPath.Length > contextPath.Length ? virtualPath.Substring (contextPath.Length) : String.Empty;
return J2EEUtils.GetApplicationRealPath (context, thisAppVirtualPath);
}
public override void SendResponseFromFile (IntPtr handle, long offset, long length) {
throw new NotSupportedException();
}
public override void SendResponseFromFile (string filename, long offset, long length) {
using (FileStream fs = File.OpenRead (filename)) {
byte [] buffer = new byte [4 * 1024];
if (offset != 0)
fs.Position = offset;
long remain = length;
int n;
while (remain > 0 && (n = fs.Read (buffer, 0, (int) Math.Min (remain, buffer.Length))) != 0){
remain -= n;
SendResponseFromMemory(buffer, n);
}
}
}
//kostat
//private OutputStreamWrapper CreateOutputStream (bool binary)
//{
// IPortletActionResponse resp = _HttpServletResponse as IPortletActionResponse;
// if (resp != null)
// return null; // no output stream while processAction
// if (_OutputStream != null)
// return _OutputStream;
// if (_HttpServletResponse != null) {
// if (binary)
// _OutputStream = new OutputStreamWrapper (_HttpServletResponse.getOutputStream ());
// else
// _OutputStream = new OutputStreamWrapper (_HttpServletResponse.getWriter ());
// }
// return _OutputStream;
//}
public override void SendResponseFromMemory (byte [] data, int length) {
_OutputStream = CreateOutputStream (true);
if (_OutputStream == null)
return;
sbyte [] sdata = vmw.common.TypeUtils.ToSByteArray(data);
_OutputStream.write(sdata, 0 , length);
}
public override void SendKnownResponseHeader (int index, string value) {
SendUnknownResponseHeader (GetKnownResponseHeaderName (index), value);
}
public override string GetKnownRequestHeader (int index) {
return GetUnknownRequestHeader(GetKnownRequestHeaderName (index));
}
public override string GetUnknownRequestHeader (string name) {
return getHeader(name);
}
public override string [][] GetUnknownRequestHeaders () {
if (unknownHeaders == null) {
ArrayList pairs = new ArrayList ();
for (java.util.Enumeration he = getHeaderNames(); he.hasMoreElements() ;) {
string key = (string) he.nextElement();
int index = HttpWorkerRequest.GetKnownRequestHeaderIndex (key);
if (index != -1)
continue;
pairs.Add (new string [] {key, getHeader(key)});
}
if (pairs.Count != 0) {
unknownHeaders = new string [pairs.Count][];
for (int i = 0; i < pairs.Count; i++)
unknownHeaders [i] = (string []) pairs [i];
}
}
if (unknownHeaders == null) unknownHeaders = new string [0][];
return unknownHeaders;
}
public override int ReadEntityBody (byte [] buffer, int size) {
if (buffer == null || size == 0)
return 0;
sbyte [] sbuffer = vmw.common.TypeUtils.ToSByteArray(buffer);
InputStream inp = getInputStream();
if (inp == null)
return 0;
int r = inp.read (sbuffer, 0, size);
return r < 0 ? 0 : r;
}
public override void SetEndOfSendNotification(System.Web.HttpWorkerRequest.EndOfSendNotification callback, object extraData) {
_endOfSendCallback = callback;
_endOfSendArgs = extraData;
}
public abstract BaseHttpContext CreateContext (HttpContext context);
}
}
@@ -1,75 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.J2EE;
using System.Web.SessionState;
namespace Mainsoft.Web.Hosting
{
public static class SessionWrapper
{
static readonly Type IRequiresSessionStateType = typeof (IRequiresSessionState);
static readonly Type IReadOnlySessionStateType = typeof (IReadOnlySessionState);
public static IHttpHandler WrapHandler (IHttpHandler handler) {
Type type = (Type) ((IServiceProvider) handler).GetService (typeof (Type));
if (IRequiresSessionStateType.IsAssignableFrom (type))
return IReadOnlySessionStateType.IsAssignableFrom (type) ?
(handler is IHttpExtendedHandler ? (IHttpHandler) new ReadOnlySessionWrapperExtendedHandler ((IHttpExtendedHandler) handler) : new ReadOnlySessionWrapperHandler (handler)) :
(handler is IHttpExtendedHandler ? new SessionWrapperExtendedHandler ((IHttpExtendedHandler) handler) : new SessionWrapperHandler (handler));
return handler;
}
#region SessionWrappers
class SessionWrapperHandler : IHttpHandler, IRequiresSessionState, IServiceProvider
{
protected readonly IHttpHandler _handler;
public SessionWrapperHandler (IHttpHandler handler) {
_handler = handler;
}
public bool IsReusable {
get { return _handler.IsReusable; }
}
public void ProcessRequest (HttpContext context) {
_handler.ProcessRequest (context);
}
public object GetService (Type serviceType) {
return ((IServiceProvider) _handler).GetService (serviceType);
}
}
sealed class ReadOnlySessionWrapperHandler : SessionWrapperHandler, IReadOnlySessionState
{
public ReadOnlySessionWrapperHandler (IHttpHandler handler) : base (handler) { }
}
#endregion
#region ExtendedSessionWrappers
class SessionWrapperExtendedHandler : SessionWrapperHandler, IHttpExtendedHandler
{
public SessionWrapperExtendedHandler (IHttpExtendedHandler handler)
: base (handler) {
}
public bool IsCompleted {
get { return ((IHttpExtendedHandler) _handler).IsCompleted; }
}
}
sealed class ReadOnlySessionWrapperExtendedHandler : SessionWrapperExtendedHandler, IReadOnlySessionState
{
public ReadOnlySessionWrapperExtendedHandler (IHttpExtendedHandler handler) : base (handler) { }
}
#endregion
}
}
@@ -1,150 +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>{77DE6DDE-B8D4-4710-ADB3-4D5C3F4058C8}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AssemblyName>Mainsoft.Web</AssemblyName>
<JDKName>1.4.2</JDKName>
<GHProjectType>1</GHProjectType>
<Version>2.0</Version>
<RootNamespace>Mainsoft.Web</RootNamespace>
<jarserver>iap2</jarserver>
<StartupObject>
</StartupObject>
<ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">
<OutputPath>bin\Release_Java\</OutputPath>
<DefineConstants>JAVA;NET_2_0</DefineConstants>
<BaseAddress>285212672</BaseAddress>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<SkipValidation>false</SkipValidation>
<KeepIntermediate>false</KeepIntermediate>
<GHProjectType>1</GHProjectType>
<PreCompile>false</PreCompile>
<AdditionalClassPath>
</AdditionalClassPath>
<ApplicationServerType>
</ApplicationServerType>
<Version>2.0</Version>
<JDKName>1.4.2</JDKName>
<jarserver>iap2</jarserver>
<TargetPlatform>0</TargetPlatform>
<DocumentationFile>bin\Release_Java\Mainsoft.Web.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug_Java\</OutputPath>
<DefineConstants>TRACE;DEBUG;JAVA;NET_2_0</DefineConstants>
<BaseAddress>285212672</BaseAddress>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<SkipValidation>True</SkipValidation>
<KeepIntermediate>False</KeepIntermediate>
<GHProjectType>1</GHProjectType>
<PreCompile>false</PreCompile>
<AdditionalClassPath>
</AdditionalClassPath>
<ApplicationServerType>
</ApplicationServerType>
<Version>2.0</Version>
<JDKName>1.4.2</JDKName>
<jarserver>iap2</jarserver>
<TargetPlatform>0</TargetPlatform>
<DocumentationFile>bin\Debug_Java\Mainsoft.Web.XML</DocumentationFile>
</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>
<UserProperties REFS-RefInfo-myfaces="repository:vmw:framework:2.0" REFS-JarPath-myfaces="" REFS-JarPath-JavaEE="" REFS-RefInfo-rt="repository:jre:sun:1.4.2" REFS-JarPath-rt="" REFS-JarPath-mscorlib="..\lib\mscorlib.jar" REFS-JarPath-system="..\lib\System.jar" REFS-JarPath-system-data="..\lib\System.Data.jar" REFS-JarPath-system-xml="..\lib\System.Xml.jar" REFS-JarPath-system-configuration="..\lib\System.Configuration.jar" REFS-JarPath-system-web="..\lib\System.Web.jar" REFS-JarPath-j2se-helpers="..\lib\J2SE.Helpers.jar" REFS-JarPath-j2ee-helpers="..\lib\J2EE.Helpers.jar" REFS-RefInfo-javaee="repository:JavaEE:tomcat:1.3" />
</VisualStudio>
</ProjectExtensions>
<ItemGroup>
<Reference Include="J2SE.Helpers">
<HintPath>..\lib\J2SE.Helpers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="JavaEE, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="myfaces, Version=1.6.65535.65535, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="rt, Version=1.4.2.65535, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\build\common\MonoTODOAttribute.cs">
<Link>MonoTODOAttribute.cs</Link>
</Compile>
<Compile Include="Mainsoft.Web.Hosting\AbstractAttributeMap.cs" />
<Compile Include="Mainsoft.Web.Hosting\BaseExternalContext.cs" />
<Compile Include="Mainsoft.Web.Hosting\BaseFacesPageHandlerFactory.cs" />
<Compile Include="Mainsoft.Web.Hosting\AspNetFacesContext.cs" />
<Compile Include="Mainsoft.Web.Hosting\BaseFacesStateManager.cs" />
<Compile Include="Mainsoft.Web.Hosting\BaseFacesViewHandler.cs" />
<Compile Include="Mainsoft.Web.Hosting\IExtendedViewHandler.cs" />
<Compile Include="Mainsoft.Web.Hosting\RequestParameterMap.cs" />
<Compile Include="Mainsoft.Web.Hosting\RequestParameterValuesMap.cs" />
<Compile Include="Mainsoft.Web.Hosting\ServletFacesContext.cs" />
<Compile Include="Mainsoft.Web.Hosting\ServletFacesStateManager.cs" />
<Compile Include="Mainsoft.Web.Hosting\ServletFacesViewHandler.cs" />
<Compile Include="Mainsoft.Web.Hosting\BaseHttpServlet.cs" />
<Compile Include="Mainsoft.Web.Hosting\BaseStaticHttpServlet.cs" />
<Compile Include="Mainsoft.Web.Hosting\ServletFacesPageHandler.cs" />
<Compile Include="Mainsoft.Web.Hosting\IncludeHelperServlet.cs" />
<Compile Include="Mainsoft.Web.Hosting\OutputStreamWrapper.cs" />
<Compile Include="Mainsoft.Web.Hosting\ServletFacesPageHandlerFactory.cs" />
<Compile Include="Mainsoft.Web.Hosting\ServletIncludeUtils.cs" />
<Compile Include="Mainsoft.Web.Hosting\ServletResourceLoader.cs" />
<Compile Include="Mainsoft.Web.Hosting\ServletWorkerRequest.cs" />
<Compile Include="Mainsoft.Web.Hosting\ServletWorkerRequest.jvm.cs" />
<Compile Include="Mainsoft.Web.Hosting\SessionWrapper.cs" />
<Compile Include="Mainsoft.Web.Profile\CloudscapeProfileProvider.cs" />
<Compile Include="Mainsoft.Web.Profile\DerbyProfileHelper.cs" />
<Compile Include="Mainsoft.Web.Profile\DerbyProfileProvider.cs" />
<Compile Include="Mainsoft.Web.Security\CloudscapeMembershipProvider.cs" />
<Compile Include="Mainsoft.Web.Security\CloudscapeRoleProvider.cs" />
<Compile Include="Mainsoft.Web.Security\DerbyApplicationsHelper.cs" />
<Compile Include="Mainsoft.Web.Security\DerbyMembershipHelper.cs" />
<Compile Include="Mainsoft.Web.Security\DerbyMembershipProvider.cs" />
<Compile Include="Mainsoft.Web.Security\DerbyRoleProvider.cs" />
<Compile Include="Mainsoft.Web.Security\DerbyRolesHelper.cs" />
<Compile Include="Mainsoft.Web.Security\DerbyDBSchema.cs" />
<Compile Include="Mainsoft.Web.Security\ServletAuthenticationModule.cs" />
<Compile Include="Mainsoft.Web.SessionState\ServletSessionStateItemCollection.cs" />
<Compile Include="Mainsoft.Web.SessionState\ObjectInputStream.cs" />
<Compile Include="Mainsoft.Web.SessionState\ObjectOutputStream.cs" />
<Compile Include="Mainsoft.Web.SessionState\ServletSessionIDManager.cs" />
<Compile Include="Mainsoft.Web.SessionState\ServletSessionStateStoreProvider.cs" />
<Compile Include="Mainsoft.Web.SessionState\SessionListener.cs" />
<Compile Include="Mainsoft.Web\BaseHttpContext.cs" />
<Compile Include="Mainsoft.Web\J2EEConsts.cs" />
<Compile Include="Mainsoft.Web\J2EEUtils.cs" />
<Compile Include="Mainsoft.Web\ServletHttpContext.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\System.Web\System.Web.Phantom\System.Web.Phantom.csproj">
<Project>{FBFDAD51-74B6-4660-81C0-9C8B6C8D3B47}</Project>
<Name>System.Web.Phantom</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
</Project>
@@ -1,4 +0,0 @@
/ChangeLog -crlf
/CloudscapeProfileProvider.cs -crlf
/DerbyProfileHelper.cs -crlf
/DerbyProfileProvider.cs -crlf
@@ -1,49 +0,0 @@
//
// Mainsoft.Web.Profile.CloudscapeProfileProvider
//
// 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.Collections.Specialized;
using System.Text;
namespace Mainsoft.Web.Profile
{
/// <summary>
/// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
/// </summary>
[Obsolete]
public class CloudscapeProfileProvider : DerbyProfileProvider
{
public override void Initialize (string name, NameValueCollection config)
{
if (string.IsNullOrEmpty (name))
name = "CloudscapeProfileProvider";
base.Initialize (name, config);
}
}
}
@@ -1,288 +0,0 @@
//
// Mainsoft.Web.Profile.DerbyProfileHelper
//
// 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.Security;
using System.Web.Configuration;
using System.Data;
using System.Data.OleDb;
using System.Data.Common;
using System.Collections.Generic;
using System.Text;
using Mainsoft.Web.Security;
namespace Mainsoft.Web.Profile
{
class DerbyProfileHelper
{
private static OleDbParameter AddParameter (OleDbCommand command, string paramName, object paramValue)
{
OleDbParameter prm = new OleDbParameter (paramName, paramValue);
command.Parameters.Add (prm);
return prm;
}
public static int Profile_DeleteInactiveProfiles(DbConnection connection, string applicationName, int profileAuthOptions, DateTime inactiveSinceDate)
{
string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);
if (appId == null)
return 0;
string queryDelete = @"DELETE FROM aspnet_Profile WHERE UserId IN ( " +
"SELECT UserId FROM aspnet_Users WHERE ApplicationId = ? AND LastActivityDate <= ? " +
GetProfileAuthOptions (profileAuthOptions) + ")";
OleDbCommand cmdDelete = new OleDbCommand (queryDelete, (OleDbConnection) connection);
AddParameter (cmdDelete, "ApplicationId", appId);
AddParameter (cmdDelete, "LastActivityDate", inactiveSinceDate);
return cmdDelete.ExecuteNonQuery ();
}
public static int Profile_DeleteProfiles(DbConnection connection, string applicationName, string [] userNames)
{
int deletedUsers = 0;
string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);
if (appId == null)
return 0;
OleDbTransaction trans = (OleDbTransaction) connection.BeginTransaction ();
try {
foreach (string username in userNames) {
string userId = GetUserId (connection, trans, appId, username);
if (userId == null)
continue;
string queryDelete = "DELETE FROM aspnet_Profile WHERE UserId = ?";
OleDbCommand cmdDelete = new OleDbCommand (queryDelete, (OleDbConnection) connection);
cmdDelete.Transaction = trans;
AddParameter (cmdDelete, "UserId", userId);
cmdDelete.Transaction = trans;
deletedUsers += cmdDelete.ExecuteNonQuery ();
}
trans.Commit ();
return deletedUsers;
}
catch (Exception e) {
trans.Rollback ();
throw e;
}
}
public static int Profile_GetNumberOfInactiveProfiles (DbConnection connection, string applicationName, int profileAuthOptions, DateTime inactiveSinceDate)
{
string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);
if (appId == null)
return 0;
string querySelect = @"SELECT COUNT(*) FROM aspnet_Users usr, aspnet_Profile prf WHERE ApplicationId = ? " +
"AND usr.UserId = prf.UserId AND LastActivityDate <= ? " + GetProfileAuthOptions(profileAuthOptions);
OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);
AddParameter (cmdSelect, "ApplicationId", appId);
AddParameter (cmdSelect, "LastActivityDate", inactiveSinceDate);
using (OleDbDataReader reader = cmdSelect.ExecuteReader ()) {
if (reader.Read ())
return reader.GetInt32 (0);
}
return 0;
}
public static int Profile_GetInactiveProfiles (DbConnection connection, string applicationName, int profileAuthOptions, int pageIndex, int pageSize, string userNameToMatch, DateTime inactiveSinceDate, out DbDataReader reader)
{
reader = null;
string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);
if (appId == null)
return -1;
string querySelect = @"SELECT usr.UserName, usr.IsAnonymous, usr.LastActivityDate, prf.LastUpdatedDate, " +
"LENGTH(prf.PropertyNames) + LENGTH(prf.PropertyValuesString) + LENGTH(prf.PropertyValuesBinary)" +
"FROM aspnet_Users usr, aspnet_Profile prf WHERE usr.ApplicationId = ? AND usr.UserId = prf.UserId " +
"AND usr.LastActivityDate <= ? " + GetProfileAuthOptions (profileAuthOptions) +
(string.IsNullOrEmpty(userNameToMatch) ? "" : " AND usr.LoweredUserName LIKE ?");
OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);
AddParameter (cmdSelect, "ApplicationId", appId);
AddParameter (cmdSelect, "LastActivityDate", inactiveSinceDate);
if (!string.IsNullOrEmpty (userNameToMatch))
AddParameter (cmdSelect, "LoweredUserName", userNameToMatch.ToLowerInvariant());
reader = cmdSelect.ExecuteReader ();
return 0;
}
public static int Profile_GetProfiles (DbConnection connection, string applicationName, int profileAuthOptions, int pageIndex, int pageSize, string userNameToMatch, out DbDataReader reader)
{
reader = null;
string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);
if (appId == null)
return -1;
string querySelect = @"SELECT usr.UserName, usr.IsAnonymous, usr.LastActivityDate, prf.LastUpdatedDate, " +
"LENGTH(prf.PropertyNames) + LENGTH(prf.PropertyValuesString) + LENGTH(prf.PropertyValuesBinary)" +
"FROM aspnet_Users usr, aspnet_Profile prf WHERE ApplicationId = ? AND usr.UserId = prf.UserId " +
GetProfileAuthOptions (profileAuthOptions) +
(string.IsNullOrEmpty (userNameToMatch) ? "" : " AND usr.LoweredUserName LIKE ?");
OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);
AddParameter (cmdSelect, "ApplicationId", appId);
if (!string.IsNullOrEmpty (userNameToMatch))
AddParameter (cmdSelect, "LoweredUserName", userNameToMatch.ToLowerInvariant ());
reader = cmdSelect.ExecuteReader ();
return 0;
}
public static int Profile_GetProperties (DbConnection connection, string applicationName, string username, DateTime currentTimeUtc, out DbDataReader reader)
{
reader = null;
string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);
if (appId == null)
return -1;
string userId = GetUserId (connection, null, appId, username);
if (userId == null)
return -1;
string queryUpdUser = @"UPDATE aspnet_Users SET LastActivityDate = ? WHERE UserId = ?";
OleDbCommand cmdUpdUser = new OleDbCommand (queryUpdUser, (OleDbConnection) connection);
AddParameter (cmdUpdUser, "LastActivityDate", currentTimeUtc);
AddParameter (cmdUpdUser, "UserId", userId);
cmdUpdUser.ExecuteNonQuery ();
string querySelect = @"SELECT PropertyNames, PropertyValuesString, PropertyValuesBinary FROM aspnet_Profile WHERE UserId = ?";
OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);
AddParameter (cmdSelect, "UserId", userId);
reader = cmdSelect.ExecuteReader ();
return 0;
}
public static int Profile_SetProperties (DbConnection connection, string applicationName, string propertyNames, string propertyValuesString, byte [] propertyValuesBinary, string username, bool isUserAnonymous, DateTime currentTimeUtc)
{
string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);
if (appId == null) {
object newAppId = DerbyApplicationsHelper.Applications_CreateApplication (connection, applicationName);
appId = newAppId as string;
if (appId == null)
return -1;
}
OleDbTransaction trans = (OleDbTransaction) connection.BeginTransaction ();
try {
string userId = GetUserId (connection, trans, appId, username);
if (userId == null) {
object newUserId = null;
DerbyMembershipHelper.Users_CreateUser (connection, trans, appId, username, true, currentTimeUtc, ref newUserId);
userId = newUserId as string;
if (userId == null) {
trans.Rollback ();
return -1;
}
}
string queryUpdUser = @"UPDATE aspnet_Users SET LastActivityDate=? WHERE UserId = ?";
OleDbCommand cmdUpdUser = new OleDbCommand (queryUpdUser, (OleDbConnection) connection);
cmdUpdUser.Transaction = trans;
AddParameter (cmdUpdUser, "LastActivityDate", currentTimeUtc);
AddParameter (cmdUpdUser, "UserId", userId);
cmdUpdUser.ExecuteNonQuery ();
string querySelect = @"SELECT * FROM aspnet_Profile WHERE UserId = ?";
OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);
cmdSelect.Transaction = trans;
AddParameter (cmdSelect, "UserId", userId);
bool userHasRecords = false;
using (OleDbDataReader reader = cmdSelect.ExecuteReader ()) {
userHasRecords = reader.HasRows;
}
if (userHasRecords) {
string queryUpdate = @"UPDATE aspnet_Profile SET PropertyNames = ?, PropertyValuesString = ?, " +
"PropertyValuesBinary = ?, LastUpdatedDate = ? WHERE UserId = ?";
OleDbCommand cmdUpdate = new OleDbCommand (queryUpdate, (OleDbConnection) connection);
cmdUpdate.Transaction = trans;
AddParameter (cmdUpdate, "PropertyNames", propertyNames);
AddParameter (cmdUpdate, "PropertyValuesString", propertyValuesString);
AddParameter (cmdUpdate, "PropertyValuesBinary", propertyValuesBinary);
AddParameter (cmdUpdate, "LastUpdatedDate", currentTimeUtc);
AddParameter (cmdUpdate, "UserId", userId);
cmdUpdate.ExecuteNonQuery ();
}
else {
string queryInsert = @"INSERT INTO aspnet_Profile(UserId, PropertyNames, PropertyValuesString, " +
"PropertyValuesBinary, LastUpdatedDate) VALUES (?, ?, ?, ?, ?)";
OleDbCommand cmdInsert = new OleDbCommand (queryInsert, (OleDbConnection) connection);
cmdInsert.Transaction = trans;
AddParameter (cmdInsert, "UserId", userId);
AddParameter (cmdInsert, "PropertyNames", propertyNames);
AddParameter (cmdInsert, "PropertyValuesString", propertyValuesString);
AddParameter (cmdInsert, "PropertyValuesBinary", propertyValuesBinary);
AddParameter (cmdInsert, "LastUpdatedDate", currentTimeUtc);
cmdInsert.ExecuteNonQuery ();
}
trans.Commit ();
}
catch (Exception e) {
trans.Rollback ();
throw e;
}
return 0;
}
private static string GetUserId (DbConnection connection, DbTransaction trans, string applicationId, string username)
{
if (username == null)
return null;
string selectQuery = "SELECT UserId FROM aspnet_Users WHERE LoweredUserName = ? AND ApplicationId = ?";
OleDbCommand selectCmd = new OleDbCommand (selectQuery, (OleDbConnection) connection);
if (trans != null)
selectCmd.Transaction = (OleDbTransaction) trans;
AddParameter (selectCmd, "LoweredUserName", username.ToLowerInvariant ());
AddParameter (selectCmd, "ApplicationId", applicationId);
using (OleDbDataReader reader = selectCmd.ExecuteReader ()) {
if (reader.Read ())
return reader.GetString (0);
}
return null;
}
private static string GetProfileAuthOptions (int profileAuthOptions)
{
switch (profileAuthOptions) {
case 1:
return "AND IsAnonymous = 0";
case 2:
return "AND IsAnonymous = 1";
}
return string.Empty;
}
}
}
Loaded 100 of 319 files, more files were not shown because too many files have changed in this diff. Show more