Compare commits

...
Author SHA1 Message Date
Alexis Christoforides 832de4b8b4 [referencesource][System.Web.Services] Unix paths fix DiscoveryClientProtocol.GetRelativePath was harcoded to use '\'. 2016-03-03 17:35:15 -05:00
Zoltan Varga 735c3907df [llvm] Disable support for nested clauses, it still doesn't work. Fixes #37273. 2016-03-02 19:44:26 -05:00
Sebastien Pouliot eef138022d Merge branch 'mono-4.2.0-branch-c6sr2' of github.com:mono/mono into mono-4.2.0-branch-c6sr2 2016-03-02 19:43:07 -05:00
Zoltan Varga ee33394503 [jit] Fix the reference type detection for Volatile:Read/Write (). Fixes part of #37846. 2016-03-02 19:42:21 -05:00
Alexis Christoforides 390560f898 Bump version to 4.2.3 2016-03-01 18:03:03 -05:00
Miguel de Icaza d9d3a13cdd [Mainsoft] Remove deprecated code: the Mainsoft code has not been maintained in years 2016-02-29 17:27:11 -05:00
Sebastien Pouliot 8497921397 Merge pull request #2467 from vargaz/fix37079-2
[jit] Fix the support for gshared types in mini_emit_initobj (), prev…
2016-02-26 14:40:44 -08:00
Alexis Christoforides 217b7f002f Merge pull request #2552 from ludovic-henry/4.2.0-fix-gc
[4.2.0] Fix various GC related bugs
2016-02-26 16:48:00 -05:00
Chris Hamons f4a0a0218f Fix serialization under XM 4.5 Target Framework
- System.Configuration.ConfigurationErrorsException: Failed to load configuration section for dataContractSerializer
2016-02-26 15:05:03 -05:00
Zoltan Varga 272d012642 [jit] Fix the support for gshared types in mini_emit_initobj (), previously we were treating them as reference types, leading to stack overwrites. Fixes #37079. 2016-02-01 14:37:29 +00:00
Ludovic Henry 1409b15a45 [sgen] Fix register scanning on ARM
This bug would trigger a use after sweep in System.Threading.Tasks.Task.FinishContinuations:3621.

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

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

\#define ARCH_NUM_REGS 14
```

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

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

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=38012
2016-01-29 18:40:48 +00:00
Alexis Christoforides 175c4093fd Bump winconfig.h -> 4.2.2 2016-01-20 13:52:14 -05:00
Zoltan Varga dec06f41a7 [jit] Fix the support for gshared types in mini_emit_initobj (), previously we were treating them as reference types, leading to stack overwrites. Fixes #37079. 2016-01-20 11:43:10 -05:00
Vlad Brezae 1e5792afb0 [sgen] Fix race between block allocation and concurrent sweep.
Adding a new block to the allocated_blocks array is racy with the removal of nulls when sweeping. We wait for sweep to finish to avoid that.

This also handles the problem of allocating degraded objects while sweeping.
2016-01-19 18:29:38 -05:00
Zoltan Varga 5542212864 [runtime] Make sure ptr-to-structure and structure-and-ptr wrappers are unique, this is needed by full aot. Fixes #20186. 2016-01-15 14:45:56 -05:00
Aaron Bockover e173ad882d XmlObjectSerialier: fix ISerializable (bxc#37171)
The shim/bridge between Mono and the RS implementation of
XmlObjectSerializer, DataContractSerializer, etc. did not properly
invoke the constructor required by ISerializable, as it completely
omitted passing the populated SerializationInfo object.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=37171
2016-01-14 15:21:00 -05:00
Rodrigo Kumpera 55f343859e Merge pull request #2321 from ludovic-henry/4.2.0-fix-delegate-36646
[4.2.0][delegate] Fix multicast remove behaviour
2016-01-14 15:19:10 -05:00
Rodrigo Kumpera 28498d9ba7 Merge pull request #2322 from ludovic-henry/4.2.0-fix-threadpool-36414
[4.2.0][threadpool] Fix get min and available threads icalls
2016-01-14 15:11:06 -05:00
Sebastien Pouliot 77f20d34de Merge pull request #2309 from BrzVlad/fix-35414-sr6
[aot] Don't hardcode the nursery size in aot write barriers

ref: https://trello.com/c/xTK5QDV6/182-xi-bug-35414-monotouch-test-classic-crash-on-64-bit-device-when-sgen-is-enabled
2016-01-05 10:56:52 -05:00
Zoltan Varga 971c68401a Fix the build. 2016-01-04 15:33:52 -05:00
Zoltan Varga e07ac9d9ec [jit] Avoid a verification error in gsharedvt code with ldarga + gshared types. Fixes #36292. 2016-01-04 14:49:18 -05:00
Rodrigo Kumpera 8b0e7164b7 [verifier] Fix the verifiers to handle Roslyn style fixed blocks.
Roslyn used byref vars whenever possible to store fixed statements. This leads to confusion in
both the full verifier and the JIT built-in one.

Now we skip it in the JIT one and allow it when not in strict mode for the full verifier.
2016-01-04 14:49:12 -05:00
Alexis Christoforides 2e55c43203 Merge pull request #2348 from ludovic-henry/4.2.0-fix-threadpool-overflow
[4.2.0][threadpool] Fix overflow of max number of worker threads
2015-12-17 16:26:18 -05:00
Alexis Christoforides 1bd3c14687 Bump to include packaging change (F# bump to 4.0.1.1) 2015-12-16 11:53:40 -05:00
Zoltan Varga 95ff24403a [aot] Cache inflated methods loaded from aot images to avoid repeating an expensive search. Fixes #36256. 2015-12-15 16:26:52 -05:00
Zoltan Varga 2e19bf113b [runtime] Implement native-to-managed marshalling of byref delegate arguments. Fixes #35545. 2015-12-15 12:54:41 -06:00
Miguel de Icaza 0b95069fd4 [System.Runtime.Serialization] Static serializer calls directly into internal APIs to fix C6 regression
With C6 we introduced a regression
https://bugzilla.xamarin.com/show_bug.cgi?id=36100, which is caused by
the new static serialization code that we wrote to reuse Microsoft's
serializer.

The code uses Invoke on a series of MethodInfos, and this obscures the
actual code that will be invoked at runtime to serialize certain
objects, causing the following exception:

Attempting to JIT compile method '(wrapper runtime-invoke) <Module>:runtime_invoke_bool_Nullable`1<Decimal> (object,intptr,intptr,intptr)' while running with --aot-only.

This patch makes the simple code work, but a more thorough review of
the code would allow us to remove many of the slow dynamic codepaths
in the serializer.

We opted for that approach to keep the code as similar as possible to the
original.

But the code basically does this:

* Use the XmlFormatGeneratorStatics property InternalSerializeMethod,
  whose sole purpose is to delay computing the MethodInfo for the
  XmlFormatWriterGenerator's InternalSerialize.

* Use the resulting method in a few places to call the MethodInfo.

The MethodInfo was used because the original code uses Reflection.Emit
to create fast serializers and it needs handles to internal methods,
but our static rewriter does not need it.

We should replace all of those uses, but for now, this patch at least
deals with the 36100 bug.
2015-12-15 08:17:22 -05:00
Zoltan Varga 8237bc9af6 Remove some tests added by 43b9ad0a72 by mistake. 2015-12-15 00:53:01 -05:00
Alexis Christoforides 046cd23b40 Merge pull request #2303 from kumpera/remove_fsw_limit
[System] Remove arbitrary debugging limit from FileSystemWatcher on OSX, fixes #28693
2015-12-14 15:45:19 -05:00
Zoltan Varga 4732507d62 [gsharedvt] Fix support for constrained calls on interfaces. Fixes #36383. 2015-12-14 15:35:58 -05:00
Marek Habersack 640b9d0741 Fix endless recursion in XmlCompiledTransform on mobile
One of the XmlCompiledTransform overloads called itself recursively,
leading to either a stack overflow or segfault

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=36436
2015-12-14 15:25:05 -05:00
Miguel de Icaza 7b877872dd [mono/driver] On OSX, increase the number of file handles available.
We just reverted a patch that prevented the FileSystemWatcher from
opening too many file descriptors (200).  That was a band-aid at one
of the spots that opened too many file, as we would exhaust the number
of files, and later abort when some other operation needed files.

The problem is that OSX defaults to 256 file descriptors, and .NET
applications are file descriptor hungry, in fact, many applications
increase their file handled limit before starting.

This patch on OSX will attempt to increase the number of handles
available to 1024 if the number of handles avaialble is less than
that.

The commit that removed the limit was:

2af882232c

And it was closed to fix:

Conflicts:
	mono/mini/driver.c
2015-12-14 15:14:26 -05:00
Alexis Christoforides 7ad84f7adc Merge pull request #2283 from lambdageek/dev/bug-36418-backport-4.2
Bug 36418 backport 4.2
2015-12-14 15:02:09 -05:00
Zoltan Varga 923059c639 [runtime] Fix Thread.CurrentThread in non-root appdomains by setting the tls slot in start_wrapper, otherwise Thread.CurrentThread would create a new Thread object so there would be two. Fixes #35828. 2015-12-14 14:58:58 -05:00
Alexis Christoforides 2b911f11ed Merge pull request #2320 from ludovic-henry/4.2.0-fix-delegate-36640
[4.2.0][delegate] Fix multicast Method property implementation
2015-12-14 14:57:23 -05:00
Alexis Christoforides 11c13515c4 Merge pull request #2328 from BrzVlad/fix-sgen-c6
[sgen] Backport sgen fixes for c6
2015-12-14 14:55:59 -05:00
Ludovic Henry 0ce7f78a7f [threadpool] Fix overflow of max number of worker threads
In case all threads would wait on a Sleep or a Wait, the monitor thread would simply increase the number of max working thread, up to the point it would overflow the number of max worker threads.
2015-12-14 10:29:45 +00:00
Ludovic Henry 1c651584e2 [threadpool] Fix get min and available threads icalls
Fix bug #36414
2015-12-11 16:18:07 +00:00
Alexis Christoforides c043855ce2 Bump version to 4.2.2 2015-12-10 18:44:35 -05:00
Vlad Brezae c70aa59fc2 [sgen] Make sure we scan aligned memory regions
When we suspend a thread, the stack pointer might not be aligned.

Conflicts:
	mono/sgen/sgen-gc.c
2015-12-11 00:34:49 +02:00
Vlad Brezae 21fbd4eeb8 [sgen] Fix marking of cards on 64bit 2015-12-11 00:22:42 +02:00
Zoltan Varga 43b9ad0a72 [jit] Increase the buffer size used by the dyncall data structures to 512, add a test for #36566. 2015-12-10 14:42:05 -05:00
Ludovic Henry d31c05479d [delegate] Fix multicast remove behaviour
The .NET delegate removal semantic is a bit unpredictable. For example, the following (d1 + d2 + d3) - (d1 + d3) is going to return the d123 delegate, and not the d2 delegate as we could have guessed. This is because removal will remove the `list' of delegates as a whole, and not the elements in the list.

The previous implementation would then have a different behavior than the one observed on .NET.

Fixes bug #36646
2015-12-10 11:05:59 +00:00
Ludovic Henry e5fad40671 [delegate] Fix multicast Method property implementation
.NET returns the method for the last delegate of the multicast delegate.
2015-12-10 11:04:54 +00:00
Zoltan Varga e409334f88 [profiler] Avoid a crash at shutdown by installing the assembly unload hook for the 'start_unload' event instead of the 'end_unload' event, the latter receives a mostly freed assembly. 2015-12-09 13:01:28 +01:00
Marek Safar 146b74df48 Bump reference source to merge a fix for #36003 2015-12-09 10:00:34 +01:00
Vlad Brezae c9dffe293b [aot] Don't hardcode the nursery size in aot write barriers
It can be passed at runtime in the nursery-size option of MONO_GC_PARAMS environment variable.

Fixes #35414

Conflicts:
	mono/mini/aot-compiler.c
	mono/mini/aot-runtime.c
	mono/mini/patch-info.h
2015-12-09 08:04:41 +02:00
Miguel de Icaza c11e75e8e0 [System] Remove arbitrary debugging limit from FileSystemWatcher on OSX, fixes #28693 2015-12-08 12:42:24 -05:00
Alexis Christoforides 3ddba85dc9 Merge pull request #2293 from mono/revert-2292-revert-2230-4.2.0-threadpool-exit-worker
[threadpool-ms] Exit worker thread after 5 to 60 seconds
2015-12-07 15:48:25 -05:00
Marek Safar 65fad4874c [mcs] Set null operator barrier between invocation instance and its arguments. Fixes #33341 2015-12-07 17:28:28 +01:00
Marek Safar 9e29889f02 [System.Data] Implement CommandBehavior.SequentialAccess support for GetValues method. Fixes #35857 2015-12-07 17:25:13 +01:00
Alan McGovern 125833a11d Revert "Revert "[threadpool-ms] Exit worker thread after 5 to 60 seconds"" 2015-12-07 10:48:01 +00:00
Alan McGovern 71a3d43327 Merge pull request #2292 from mono/revert-2230-4.2.0-threadpool-exit-worker
Revert "[threadpool-ms] Exit worker thread after 5 to 60 seconds"
2015-12-07 10:47:58 +00:00
Alan McGovern 91d47d27c8 Revert "[threadpool-ms] Exit worker thread after 5 to 60 seconds" 2015-12-07 10:47:44 +00:00
Alan McGovern a433b69a80 Merge pull request #2230 from ludovic-henry/4.2.0-threadpool-exit-worker
[threadpool-ms] Exit worker thread after 5 to 60 seconds
2015-12-07 10:35:09 +00:00
Zoltan Varga 9e61c73cb0 [profiler] Create a static version of libmono-profiler-log which doesn't link against eglib, to prevent duplicate symbols errors when its linked with the runtime. Fixes part of #29745. 2015-12-04 15:40:37 -05:00
Sebastien Pouliot 39edf24948 [linker] Both the TypeSpecification (T) along with the GenericArguments (G) must be preserved from custom attributes, e.g. T<G> 2015-12-04 15:28:42 -05:00
Alexis Christoforides 02bfbe0481 Merge mono-4.2.0-branch-c6sr0 into mono-4.2.0-branch 2015-12-04 15:04:48 -05:00
Alexander Köplinger 1c09a56dc5 Merge pull request #2211 from akoeplinger/bug-30018-c6sr1
Port fix for Bug 30018 to C6SR1
2015-12-03 14:05:53 -05:00
Alexander Köplinger 11bf512481 Merge pull request #2167 from akoeplinger/bug-34675-c6sr1
Fix for Bug 34675 - mono-4.2.0-branch
2015-12-02 18:22:34 -05:00
Aleksey Kliger 9caf0258a8 Make System.DefaultBinder.CanConvertPrimitive reflexive (Closes #36418) 2015-12-02 17:07:10 -05:00
Aleksey Kliger cf84931d51 Test case for #36418 2015-12-02 17:07:10 -05:00
Radek Doulik 24e1d03575 [linker] match type pattern with nested types
- cherry-picked for C6 SR1

 - this way the following xml will match all the types in the assembly
   MyAssembly

    <linker>
        <assembly fullname="MyAssembly">
            <type fullname="*" />
        </assembly>
    </linker>

   before this change it will only match the types defined in main
   module and none of the nested types
2015-12-01 21:52:17 +01:00
Radek Doulik bb6d8b94e6 [linker] do not try to iterate thru null array
- cherry-picked for C6 SR1

 - fixes the case when custom attribute instance constructor contains
   null value for System.Type[] array
2015-12-01 21:31:39 +01:00
Jonathan Mitchell 70ef083e21 Let Mono live with Xcode on EL Capitan. This was merged into master as 3adcd34f78. 2015-12-01 12:45:58 -05:00
Marcos Henrich 58731e1bbb Merge pull request #2235 from esdrubal/mono-4.2.0-branch
C6 SR1 [corlib] Fixes TimeZoneInfo.ParseTZBuffer abbrevs.
2015-12-01 10:57:53 -05:00
João Matos b0736716ee Merge pull request #2251 from directhex/mono-4.2.0-branch-msvc
MSVC fixes for Cycle 6 branch
2015-12-01 10:27:45 -05:00
Alexis Christoforides a7605b3ba7 Merge pull request #2257 from kumpera/bug_36000
[jit] Fix memory leaks in the generic sharing code by making sure tha…
2015-11-23 11:07:10 -05:00
Zoltan Varga 30015f1127 [jit] Fix memory leaks in the generic sharing code by making sure that values stored into an rgctx slot are never NULL, since otherwise the runtime would recompute them on every access. Fixes #36000. 2015-11-20 13:43:36 -05:00
Jo Shields 599d21e79a [msvc] Fix path to ml64.exe in masm.fixed.props
(cherry picked from commit e3fa11a369)
2015-11-19 14:23:36 +00:00
Marcos Henrich 677ccd3670 [corlib] Fixes TimeZoneInfo.ParseTZBuffer abbrevs.
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=31432

In a few android devices TimeZoneInfo.ParseTZBuffer was failing ito
parse Europe/Moscow with:
at System.ThrowHelper.ThrowKeyNotFoundException ()
at System.Collections.Generic.Dictionary`2[System.Int32,System.String].get_Item (Int32 key)mscorlib/system/collections/generic/dictionary.cs:176
at System.TimeZoneInfo.ParseTimesTypes (System.Byte[] buffer, Int32 index, Int32 count, System.Collections.Generic.Dictionary`2 abbreviations) [0x0002f] in mcs/class/corlib/System/TimeZoneInfo.cs:1293
at System.TimeZoneInfo.ParseTZBuffer (System.String id, System.Byte[] buffer, Int32 length)

It was failing while getting the third index [3] from] from abbrevs.

abbrevs added values were the following:
[0, MMT]
[1, MT]
[2, T]
[4, MST]
[5, ST]
[6, T]
[8, MDST]
[9, DST]
[10, ST]
[11, T]
[13, S]
[15, M]
[17, MSK]
[18, SK]
[19, K]
[21, EET]
[22, ET]
[23, T]
[25, MSD]
[26, SD]
[27, D]
[29, EEST]
[30, EST]
[31, ST]
[32, T]

Index 3 was not added because its values is an empty string, as indexes
with empty values are used in this case we are now adding them to the
abbrevs dictionary.

Fixes #31432
2015-11-16 15:37:41 +00:00
Marcos Henrich a3170c6652 [corlib] Tests TimeZoneInfo.ParseTZBuffer
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=31432

Tests TimeZoneInfo.ParseTZBuffer with Europe/Moscow data that thrown
at System.ThrowHelper.ThrowKeyNotFoundException ()
at System.Collections.Generic.Dictionary`2[System.Int32,System.String].get_Item (Int32 key)mscorlib/system/collections/generic/dictionary.cs:176
at System.TimeZoneInfo.ParseTimesTypes (System.Byte[] buffer, Int32 index, Int32 count, System.Collections.Generic.Dictionary`2 abbreviations) [0x0002f] in mcs/class/corlib/System/TimeZoneInfo.cs:1293
at System.TimeZoneInfo.ParseTZBuffer (System.String id, System.Byte[] buffer, Int32 length)
2015-11-16 15:37:41 +00:00
Alexander Köplinger 90ae50f236 [msvc] Remove left over project guid from mono.sln
The project was removed from the solution in 735fc51cc0, but one instance was missed.
This should fix the Windows build on Jenkins.

(cherry picked from commit a353efb8bb)
2015-11-13 12:25:26 +00:00
Alexis Christoforides 5ded2191cd Fix MSVC build after 1657026514
(cherry picked from commit 735fc51cc0)
2015-11-13 12:25:19 +00:00
Jo Shields b2a9512d01 Remove obsolete mono_install_threadpool* from msvc/mono*.def 2015-11-13 11:16:59 +00:00
Jo Shields b370336cd5 Fix version string for MSVC 2015-11-13 10:18:45 +00:00
triton 87e626328a [msvc] Update Visual Studio project files.
(cherry picked from commit ff141cf1ee)
2015-11-12 16:51:39 +00:00
Jo Shields 7be29019a8 Bundle modified masm.props with fully qualified ml.exe call.
In some more esoteric environments (say bash.exe spawned by
jenkins-slave.exe), the _MASM target's attempts to call ml.exe fail
due to ml.exe missing from $PATH (even when it appears to be fine).

The ClCompile target doesn't suffer this issue, since it uses the
full path to CL.exe rather than assuming CL.exe is in $PATH.
Bundle a lightly patched masm.props to duplicate the ClCompile
target behaviour.

This should have no impact on you unless for some reason you're
using a different MASM to the one provided with MSVC.

(cherry picked from commit 900552b7d3)
2015-11-12 16:51:28 +00:00
BrennanConroy da922677a8 More robust get_address_info
We have been running into this issue: https://bugzilla.xamarin.com/show_bug.cgi?id=30018 a lot recently, after digging into getaddrinfo a bit we saw that the linked list of addrinfo structs had 1 or more valid ones which can be used and 1 bad one which should just be discarded.
2015-11-09 21:15:02 +01:00
pjbeaman 6dd2d0d52b Merge pull request #2202 from mono/revert-2090-mono-4.2.0-branch-bug25480
Revert 8862921b86
2015-11-05 14:28:06 -05:00
David Karlaš e39caabfc4 Revert 8862921b86 2015-11-05 16:45:45 +01:00
Rodrigo Kumpera ce72e1ff24 Merge pull request #2164 from alexrp/mono-4.2.0-branch-profiler-crash
[profiler] Disable the hack to attempt to get code start/size info. (4.2.0)
2015-11-03 14:16:57 -05:00
Alexander Köplinger 5a86dd3421 [System.Core] Make sure DateTime.AddDays() is preserved by the linker in a test
We use the method in the code instead of just via reflection.
This allows the test to work on iOS device builds.
2015-11-02 19:54:24 -05:00
Alexis Christoforides cb99470f97 Revert "[System] Test Socket TCP double bind."
This reverts commit c22742e3f8, and removes the 'TcpDoubleBind' test.
2015-11-02 14:52:47 -05:00
Marcos Henrich a997e5af7f Merge pull request #2146 from esdrubal/mono-4.2.0-branch
Fixes mono-symbolicate in Mono 4.2
2015-11-02 14:26:21 +00:00
Alexis Christoforides 4576dc8594 Bump for another part of #32317 fix 2015-10-30 14:03:52 -04:00
Alexis Christoforides 110fdd8baa Bump to test a Bockbuild-side fix for #32317 2015-10-29 21:44:25 -04:00
David Karlaš 8862921b86 Merge pull request #2090 from DavidKarlas/mono-4.2.0-branch-bug25480
[C6SR1] Bug 25480 - OutputPath property is not set for this project
2015-10-29 20:53:58 +01:00
Marek Safar 7c0dc31b21 [mcs] Support auto-property with private setter with member definition from external assembly. Fixes #35236 2015-10-29 08:52:10 +01:00
Zoltan Varga d41309c59d [llvm] Fix the handling of r4 arguments during calls. Fixes #35044. 2015-10-28 08:57:25 -04:00
Rodrigo Kumpera ebe6609165 Merge pull request #2133 from kumpera/linux-debugger-fix
[sdb] Fix state initialization of suspended threads to work when the debugger thread is not attached. Fixes #34750
2015-10-26 16:55:06 -04:00
Ludovic Henry 158c7da277 [threadpool-ms] Exit worker thread after 5 to 60 seconds
The timeout before exiting a worker thread is random to limit the worst
case scenario where, if the timeout is set to N seconds, the user would
launch a lot of work item simultaneously, at an interval of N + 1
seconds. In this case, we would have to kill all the threads at once,
and starts them all over again 1 second later. The randomization makes
the creation and destruction more linear in time, and avoid burst.
2015-10-26 17:41:29 +00:00
Alexander Köplinger fda525b873 [runtime] Remove explicit support for v4.0.30128 and v4.0.20506
These versions were still binding to the 4.0 mscorlib, which is a reference-only assembly now
and isn't intended for being used at runtime.

This issue manifested itself when someone used e.g. <supportedRuntime version="v4.0.20506"/> in
the app.config, causing the runtime to try loading that version and then bailing out with
"Corlib not in sync with this runtime: expected corlib version 117, found 111." (with 111 being
the corlib version at the time the reference assemblies were generated).

The fix is to remove the specific versions from the supported_runtimes array, causing programs
to automatically use the newest version instead.

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

Other reports:

https://youtrack.jetbrains.com/issue/TW-42700
https://youtrack.jetbrains.com/issue/TW-41337
http://stackoverflow.com/questions/29988698/teamcity-nunitlauncher-running-on-linux-mono-gives-corlib-not-in-sync-with-th
2015-10-23 15:12:08 +02:00
Marek Safar fc228e416c Merge pull request #2161 from akoeplinger/bug-34334-c6sr1
Fixes for Bug 34334 - mono-4.2.0-branch
2015-10-23 12:24:07 +02:00
Alexis Christoforides c706a85c7b Revert "[System] Updated SocketTest.TcpDoubleBind."
This reverts commit 4010f73b57.
2015-10-22 18:55:19 -04:00
Zoltan Varga e8594766a8 [gsharedvt] Inflate methods properly in one case. Fixes #34926. 2015-10-22 18:33:42 -04:00
Alexis Christoforides 6ff1c569c9 Revert "Merge pull request #2135 from esdrubal/mono-4.2.0-branch"
This reverts commit 545185ec94, reversing
changes made to b50293b53d.
2015-10-22 18:30:30 -04:00
Alex Rønne Petersen e665173c67 [profiler] Disable the hack to attempt to get code start/size info.
This is causing crashes by poking into runtime internals, and since we no
longer need this for anything critical, disable it.

https://bugzilla.xamarin.com/show_bug.cgi?id=35171
2015-10-22 22:17:09 +02:00
Alexander Köplinger 9ab01f838f [interpreter] Relax check for forcing compilation for built-in structs
Method calls on structs like DateTime wouldn't work before,
even though we know we don't have self mutating structs in mscorlib.

Fixes part 2 of https://bugzilla.xamarin.com/show_bug.cgi?id=34334
2015-10-22 19:30:50 +02:00
Alexander Köplinger 7e72f20d1e [interpreter] Implement comparing string values in (Not)EqualInstruction
When comparing a string with null the other checks in the interpreter for type equality didn't catch this case
and this ultimately resulted in a NotImplementedException in EqualInstruction and NotEqualInstruction.

The fix is to handle the TypeCode.String case in those instructions.
We don't need to do it for CreateLifted() as that method only applies for Nullable<T> types which doesn't make sense for string.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=34334
2015-10-22 19:30:21 +02:00
Alexis Christoforides 66852f89aa Another bump to include F# packaging fix 2015-10-19 15:09:33 -04:00
Marcos Henrich 704e30fddd [corlib] Changes StackTrace.ToString to use Exception format.
StackTrace.ToString format was different from Exception.ToString.
StackTrace.ToString had an identation of 3 spaces instead of 2, outputed
"line " before the line number which Exception.ToString does not, and it
did not print offsets.

This change allows StackTrace.ToString output to be used by the mono-symbolicate tool.
2015-10-19 14:37:44 +01:00
Marcos Henrich 165249622b Test mono-symbolicate with StackTrace.ToString.
We were testing mono-symbolicate tool with Exception.Tostring stack
traces but now we also test that the tool works with StackTrace.ToString.
2015-10-19 14:37:44 +01:00
Ludovic Henry 545185ec94 Merge pull request #2135 from esdrubal/mono-4.2.0-branch
[System] Added icall SupportsPortReuse.
2015-10-16 11:12:55 +01:00
Marcos Henrich e8d2ecaa4d [System] Added icall SupportsPortReuse.
Linux kernels before 3.9 did not support port reuse.
Added private method System.Net.Sockets.Socket.SupportsPortReuse,
which returns true when the runtime is able to bind to the same address
and port multiple times.
2015-10-15 14:11:54 +01:00
Sandy Armstrong b50293b53d Merge pull request #2131 from sandyarmstrong/mono-4.2.0-branch+mt-runtime
[corlib] Use same Console and Environment logic in monotouch_runtime
2015-10-14 09:42:02 -07:00
Rodrigo Kumpera b37aa3fc8a [sdb] Fix state initialization of suspended threads to work when the debugger thread is not attached. Fixes #34750
The problem happens because thread_interrupt runs in the debugger thread (suspend initiator).

thread_interrupt then calls mono_thread_state_init_from_monoctx which collects the state of the current thread
which is definitely not what we wanted.

There used to be some compensation code after calling mono_thread_state_init_from_monoctx to actually init the state properly.
This is why it worked, at all.

Thew problem is that the debugger thread now might not attach at all under some circumstances, which would trigger
mono_thread_state_init_from_monoctx to return FALSE and trip into the assert.

The fix is to simply not use mono_thread_state_init_from_monoctx at all, just copy the state from data. This fix has the
bonus of getting the domain correctly.
2015-10-13 18:33:00 -04:00
Alexis Christoforides 54ce6bd6ed Revert "[System] Added icall SupportsPortReuse."
This reverts commit f2908d1a5a.
2015-10-13 17:30:12 -04:00
Sandy Armstrong b89abf868e [corlib] Use same Console and Environment logic in monotouch_runtime
The `monotouch_runtime` profile is exclusively used for the monotouch
REPL assemblies used by Xamarin Sketches and Inspector. In those cases,
Console and Environment should behave just the same as in the
`monotouch` profile.

The only real difference between the two profiles should be the presence
of SRE in `monotouch_runtime`.
2015-10-13 11:05:19 -07:00
Alexis Christoforides 3c2754755b Trigger a build to bring in F# El Cap patch and version upgrade. Fixes #34612 2015-10-13 12:27:54 -04:00
Marcos Henrich 390acad06d Merge pull request #2125 from esdrubal/mono-4.2.0-branch
[System] Added icall SupportsPortReuse.
2015-10-13 15:41:30 +01:00
Marcos Henrich f2908d1a5a [System] Added icall SupportsPortReuse.
Linux kernels before 3.9 did not support port reuse.
Added private method System.Net.Sockets.Socket.SupportsPortReuse,
which returns true when the runtime is able to bind to the same address
and port multiple times.
2015-10-13 12:15:10 +01:00
Marek Safar d8b68fd578 [mcs] Resolve target before resolving collection/dictionary initializers. Fixes #34604 2015-10-08 15:08:38 +02:00
Jonathan Pryor 28af3f202a [Mono.Posix] Fix signal tests to run on OS X, Android.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=33558

Several of the Signal-related tests were disabled when running on OS X
because OS X doesn't provide reliable delivery: it will try to deliver
a signal, but if it's already been delivered it won't continue
delivering them. This results in failures such as:

	1) MonoTests.Mono.Unix.UnixSignalTest.TestWaitAny :   Expected: 23061
	  But was:  100000

(Note that "Expected" and "actual" are reversed. Oops.)

Thus, signals are delivered, just "not enough."

As It Happens™, Android is similar: running these tests on
Xamarin.Android results in test failures because not enough signals
are received. (It's not as bad as OS X -- only ~10% off -- but it's
not *all* of the signals either.)

Fix the tests so that they *don't* require that we receive as many
signals as we raise. Instead, assert that all of the UnixSignal
instances actually have a UnixSignal.Count value greater than 0, i.e.
that they've been signaled AT ALL.

Loosening up the tests in this manner allows the tests to pass on
OS X, and should allow things to work as expected on Android.
2015-10-07 14:45:02 -04:00
Alexis Christoforides 29c1622b37 Merge pull request #2104 from ludovic-henry/mono-4.2.0-branch
[corlib] Fix dispose race condition in CancellationTokenSource
2015-10-06 17:57:17 -04:00
Marek Safar fd21271747 [mcs] Add link to closest parent async storey only if it hold captured this. Fixes #34168 2015-10-06 13:22:33 +02:00
Rodrigo Kumpera 70539135ea Revert "Inflate calli generic method signature even if not a wrapper"
This reverts commit 92f4544a12.
2015-10-02 14:51:55 -04:00
Ludovic Henry 155e48717a [corlib] Fix dispose race condition in CancellationTokenSource
The race condition would manifest in the following code:

```
for (int i = 0, total = 100000; i < total; ++i) {
    if (i % 50 == 0)
            Console.WriteLine ("{0}/{1}", i, total);

    var c1 = new CancellationTokenSource ();
    var wh = c1.Token.WaitHandle;
    c1.CancelAfter (1);
    Thread.Sleep (1);
    c1.Dispose ();
}
```

And we would observe the following exception:
```
Unhandled Exception: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Threading.ManualResetEvent'.
 at System.Threading.WaitHandle.CheckDisposed () [0x00016] in /Users/builder/data/lanes/1196/33e00ac6/source/mono/mcs/class/corlib/System.Threading/WaitHandle.cs:426
 at System.Threading.EventWaitHandle.Set () [0x0000c] in /Users/builder/data/lanes/1196/33e00ac6/source/mono/mcs/class/corlib/System.Threading/EventWaitHandle.cs:205
 at (wrapper remoting-invoke-with-check) System.Threading.EventWaitHandle:Set ()
 at System.Threading.CancellationTokenSource.NotifyCancellation (Boolean throwOnFirstException) [0x00051] in /Users/builder/data/lanes/1196/33e00ac6/source/mono/external/referencesource/mscorlib/system/threading/CancellationTokenSource.cs:723
 at System.Threading.CancellationTokenSource.Cancel (Boolean throwOnFirstException) [0x00006] in /Users/builder/data/lanes/1196/33e00ac6/source/mono/external/referencesource/mscorlib/system/threading/CancellationTokenSource.cs:409
 at System.Threading.CancellationTokenSource.Cancel () <0x7d75ada8 + 0x00017> in <filename unknown>:0
 at System.Threading.CancellationTokenSource.TimerCallbackLogic (System.Object obj) [0x00012] in /Users/builder/data/lanes/1196/33e00ac6/source/mono/external/referencesource/mscorlib/system/threading/CancellationTokenSource.cs:538
```

This would be a race condition between the TimerCallbackLogic call to Cancel and the call to Dispose on another thread. You could trigger it more reliably by putting a Thread.Sleep at CancellationTokenSource.cs:599.

Also fixes ConcurrentCancelLinkedTokenSourceWhileDisposing race condition between Cancel and Dispose, by applying the same pattern as CancellationTokenSource.TimerCallbackLogic.
2015-10-02 17:23:08 +01:00
Virgile Bello 92f4544a12 Inflate calli generic method signature even if not a wrapper 2015-10-02 16:07:09 +01:00
Rodrigo Kumpera cc1cf601d6 Merge pull request #2094 from kumpera/el_cap_fix
[runtime] Attempt to resolve DllImport using the installation lib dir.
2015-09-29 18:02:17 -04:00
Zoltan Varga c75e47b524 [jit] Fix the linking of bblocks for switch statements, previously we were linking the bblock containing the range check with the target bblocks as well, causing problems when using llvm. Fixes #34147. 2015-09-29 16:39:19 -04:00
Alexis Christoforides 804ddbc632 [runtime] Attempt to resolve DllImport using the installation lib dir. 2015-09-28 16:31:18 -04:00
Marek Habersack 328e048e15 [test] Fix dependency on compiler behavior for a couple of tests
A couple of tests for System.Reflection.MethodBody assumed the code generated
by the compiler will be the same as the one generated by Mono's MCS. However,
when the code is built by CSC in release mode (version that comes with VS2015
was tested) the optimizations remove locals required by the old version of the
tests. Also, CSC orders the locals differently to MCS and that breaks one of
the tests which relied on the declaration order.
Another difference is that CSC and MCS type a certain local variable differently.
The variable being a byte* in source code is output in IL as such by MCS, but CSC
outputs an int8& - a by-ref type.
The tests are built by VS but they are executed by Mono on Android and so the
differences come up as errors.
This commit fixes both issues by working around the differences.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=33370 when it is included in XA
2015-09-28 11:49:13 -04:00
Marek Habersack e325236fa3 [threadpool] Prevent high CPU usage in certain conditions
Threadpool uses poll(2) to watch the file descriptors for activity but
it can sometimes miss that an fd went into error. When that happens the
poll call is interrupted with EAGAIN since the erroneous fd's events have
already been read and there's nothing left in the queue for it. That, in turn,
causes mono to run the loop so quickly that it uses 100% of the CPU. It happens,
for instance, with Xamarin Studio which can utilize two CPU cores to the full while
idling on the opening screen.

This commit makes sure to remove the descriptors with errors from the poll set and
thus preventing the syscall from being interrupted and returning EAGAIN.
2015-09-25 19:17:52 +01:00
Rodrigo Kumpera aa64024074 [threading] Apparentlty zero is a valid tls key on some systems.
(cherry picked from commit 2437b1ea77)
2015-09-25 13:32:17 +01:00
David Karlaš 3b2029216e [XBuild] Ignoring paths of .csproj, .targets and .sln file paths so in case of missmatch between values in <ProjectReference> or .sln and actual file system continue matching project file path and project 2015-09-24 17:18:26 +02:00
David Karlaš 77972f864d [XBuild] Bug 25480 - OutputPath property is not set for this project
This error was generated when iOS(or any other kind of project, that is referencing other project in solution via <ProjectReference>) wanted to get OutputPath of PCL(or any other referenced project) but it failed in case of IDE because wrong conditions(see .targets files changes). Reason this bug was never discovered before is because PCL project was already loaded before with correct configuration/platform so not having AssignProjectConfiguration target executed had no effect. Reason it appeared in this case(Bug 25480) was that .sln and .csproj<ProjectReference> had folder path defined as XamlSamples but actual file system had xamlsamples(notice different chars casing). So projects.TryGet(filePath, out project) failed, hence project had to be reloaded, and then bug from .targets files showed up...

A bit more details about fix: The AssignProjectConfiguration target assigns configurations to the various @(ProjectReference), and is used from targets like ResolveProjectReferences, which are enabled only while building solution files ( $(BuildingSolutionFile) ) or when invoked from the IDE ( $(BuildingInsideVisualStudio) ). But the AssignProjectConfiguration target ignores the IDE case, which breaks usage of ResolveProjectReferences from the same. Fix up to run for both the cases.
2015-09-24 17:18:14 +02:00
Marcos Henrich 4a18c575ac Merge pull request #2070 from esdrubal/mono-4.2.0-branch
[System] Fix TCP socket reuse.
2015-09-21 14:12:33 +01:00
Marcos Henrich 4010f73b57 [System] Updated SocketTest.TcpDoubleBind.
Multiple threads listening to the same address and port are not possible
before linux 3.9 kernel, where the socket option SO_REUSEPORT was
introduced.

This commit makes TcpDoubleBind sensible to this OS capability.
2015-09-21 14:09:44 +01:00
Marcos Henrich 0fd8e508db [System] Fix TCP socket reuse.
TCP sockets with option SocketOptionName.ReuseAddress were not working on Linux.

Fixes #31557.
2015-09-21 14:09:43 +01:00
Marcos Henrich c22742e3f8 [System] Test Socket TCP double bind.
Test checks that when setting TCP socket option ReuseAddress, it is
possible to bind other sockets to the same endpoint.

Covers #31557.
2015-09-21 14:09:43 +01:00
Marek Safar d120a48340 [corlib] Match es-es NumberGroupSeparator with es. Fixes #34047 2015-09-21 10:00:22 +02:00
Marek Safar d983aa605a Merge branch 'pr/2065' 2015-09-21 09:12:52 +02:00
Zoltan Varga 3b0d49736f Add an 'rgctx' field to MonoDelegate, not yet used. 2015-09-20 14:57:18 -04:00
Alex Rønne Petersen 5c4305818c [mcs] 'future' option is now 'experimental' - clarify in man page and help text. 2015-09-20 08:12:12 +02:00
Alex Rønne Petersen 2d9372887c [profiler] Emit dummy code start/size info in cases where we can't retrieve it. 2015-09-20 08:11:00 +02:00
João Matos 628dfbbc89 Merge pull request #2066 from lukaszunity/start-managed-process-fix-mono-4.2
Process.Start fix for Mono 4.2.0
2015-09-18 11:48:34 +01:00
Lukasz b5fa2b4eda Put quotes around path to mono. Fixes bug where Process.Start will fail for a managed process if the path to mono contains spaces. 2015-09-18 12:08:34 +02:00
Zoltan Varga cf5a450af3 [runtime] Fix a potential buffer overflow in mono_network_get_data (). Fixes #33851. 2015-09-17 14:25:12 -04:00
Ludovic Henry 486936d464 [delegate] Fix NRE on GetHashCode 2015-09-17 17:49:38 +01:00
Ludovic Henry d0b9c74d35 [threadpool-io-poll] Use mono_poll instead of platform specific poll/WSAPoll 2015-09-17 16:38:12 +01:00
Ludovic Henry 5fa2fd3d5c [threadpool-io] Log if an error occured on a socket 2015-09-17 16:38:03 +01:00
Ludovic Henry 77de476c44 [delegate] Fix Equals on Delegate to virtual method
The comparison was failing because we were still using the method field (instead of the Method property), which would then return, in the case of a delegate to a virtual function, the method on the base class, instead of the method on the derived class. Updated the test cases to check that too.
2015-09-17 16:37:12 +01:00
Ludovic Henry 20f555aefb [delegate] Bump BCL version for field added on Delegate 2015-09-17 16:36:07 +01:00
Ludovic Henry 4a7fcac075 [delegate] Fix bug #33218 "Action ReflectedType differs from Delegate ReflectedType" 2015-09-17 16:34:41 +01:00
Zoltan Varga 11ce499c40 [sdb] Avoid aborting the runtime with a breakpoint signal if Debugger.Break () is called, add a MONO_DEBUG=native-debugger-break option to enable it. Fixes #33952. 2015-09-15 15:05:56 -04:00
Marek Safar 90c1daf7dc [mcs] Lift result of null operator over dotted expressions only ending with not null operator on value type. Fixes #33797 2015-09-14 17:17:17 +02:00
Marek Safar dbd64296dc Bump ikvm to merge a fix for #32487 2015-09-11 15:31:39 +02:00
Rodrigo Kumpera 19130f7816 [threading] Allow mono_thread_info_current_unchecked to be called before the tls key it uses is initialized. 2015-09-10 17:37:55 -04:00
Rodrigo Kumpera 4fd72b41e7 Fix the build. 2015-09-10 15:08:37 -04:00
Rodrigo Kumpera c02307527f [suspend] Wrap mmap and unmmap around critical sections to better handle library interposing. Fixes #19379
Instruments uses library interposing to record calls to mmap and munmap. It does take lock within the interposers
which means the async suspend could suspend a thread holding such lock while sgen tries to mmap more memory in,
causing a deadlock.

The workaround is to protect our uses of mmap and munmap in the hopes that they are enough to reduce the likelihood
of those hangs happening.
2015-09-10 14:56:19 -04:00
Marcos Henrich e82dc9b80a Fixes DotNetRelativeOrAbsoluteTest.
Test was not changing Uri.useDotNetRelativeOrAbsolute back to its
previous value.
2015-09-09 19:45:59 -04:00
Zoltan Varga 58a0d6c0f4 Fix a warning. 2015-09-09 17:41:13 -04:00
Rolf Bjarne Kvinge 588a9dfb97 [mono-api-html] Adding members to an interface is a breaking change, so show it in red. 2015-09-09 11:41:50 +02:00
Rolf Bjarne Kvinge 070414b678 [mono-api-info] Sort constructors using full signature.
So that info files can be compared textually to test for api equality.
2015-09-09 10:32:56 +02:00
Rolf Bjarne Kvinge 924615b32a [mono-api-html] Fix printing of Obsolete attributes. 2015-09-08 13:56:04 +02:00
Rolf Bjarne Kvinge c9a6d708a9 [mono-api-info] Sort nested types.
So that info files can be compared textually to test for api equality.
2015-09-08 13:56:04 +02:00
Rolf Bjarne Kvinge 749a6d407e [mono-api-info] Sort methods using full signature.
So that info files can be compared textually to test for api equality.
2015-09-08 12:06:52 +02:00
Marek Safar 4a1653412f [mcs] Null operator on value type extension argument. Fixes #33754 2015-09-08 11:07:11 +02:00
Marek Safar ec95d97fa6 [mcs] Lift result of binary operation on enum types in more cases. Fixes #33723 2015-09-07 20:30:15 +02:00
Zoltan Varga b72b8b187d [aot] Avoid an assert in mono_aot_jit_info_table_find () when the address is right after the end of the method. Fixes #32955. 2015-09-07 09:36:15 -04:00
Rolf Bjarne Kvinge a3bcbb7b58 [mono-api-info] Order interfaces.
So that info files can be compared textually to test for api equality.
2015-09-07 12:58:09 +02:00
Marcos Henrich 74ea9f56e3 Merge pull request #2038 from esdrubal/mono-4.2.0-branch
[corlib] Fixes TimeZoneInfo.GetDaylightChanges.
2015-09-06 19:41:42 +01:00
Marcos Henrich 537f1de77a [corlib] Fixes TimeZoneInfo.GetDaylightChanges.
Fixes #32722.
2015-09-06 19:40:07 +01:00
Marcos Henrich c39fc0cecc [corlib] Test GetSystemTimeZones in all timezones.
Covers #32722.
2015-09-06 19:40:06 +01:00
Marcos Henrich b2cd2b28fc Merge pull request #2037 from esdrubal/mono-4.2.0-branch
[System] UriKind.RelativeOrAbsolute workaround.
2015-09-05 12:08:12 +01:00
Marcos Henrich 67805650b9 [System] UriKind.RelativeOrAbsolute workaround.
In .NET an URI constructor from "/foo" and UriKind.RelativeOrAbsolute is
relative whereas in mono it is assumed as an absolute file path.

This adds another workaround that changes all Uri constructor calls to
behave like .NET when receiving UriKind.RelativeOrAbsolute.

The environment variable workaround consists in setting
MONO_URI_DOTNETRELATIVEORABSOLUTE=true before starting the application:

Reflection workaround:
```
if (Type.GetType ("Mono.Runtime") != null)
    typeof (Uri).GetField ("useDotNetRelativeOrAbsolute",
        BindingFlags.Static | BindingFlags.GetField | BindingFlags.NonPublic).
        SetValue (null, true);
```

WARNING: The workarounds change the behavior of all Uri constructor calls.
Unexpected problems can occur if an used library relies on
UriKind.RelativeOrAbsolute to parse absolute file paths.
2015-09-05 12:06:58 +01:00
Zoltan Varga ec3afb7da4 [jit] Fix crashes in the dwarf writer if the backing field of an enum is not named 'value__'. Fixes #33591. 2015-09-04 17:46:42 -04:00
triton 6a6343c5da [threadpool-io] Fixed the Windows backend to call the correct polling function. 2015-09-03 22:49:13 +01:00
Marek Habersack d0f6e32026 Fix NREX in Linux network change notification code
Linux code uses a netlink socket to be notified about network interface
changes. The code is a bit racy and for that reson it can happen that
the LinuxNetworkChange.OnDataAvailable handler is called after the
socket is destroyed (from a timer event) and socket stored in an
instance variable is already null. This is a race most probably
introduced by the new threadpool or TPL code as it started to happen in
several places (mostly BCL tests on Android, but it's *not* specific to
Android).
The workaround here serves as a quick band-aid to be able to move on,
but a more thorough review of the socket code will be required.
2015-09-03 23:18:42 +02:00
Marek Safar 413cb9b41a Merge pull request #1968 from LogosBible/uribuilder-no-hostname
Fix UriBuilder.ToString() when the host is empty.
2015-09-03 20:46:16 +02:00
Marek Safar 5382fc7b11 [mcs] Use auto-property backing field for setting only when setter is not available. Fixes #33600 2015-09-03 17:37:49 +02:00
Marek Safar f215040500 [mcs] Cache fixed array type expression. Fixes #33573 2015-09-03 13:06:11 +02:00
Ludovic Henry 1ba5bc6aa7 [threadpool-io] Reduce the value of poll_fds_size on socket removal 2015-09-03 10:12:58 +01:00
Ludovic Henry f41fa10aa8 [threadpool-io] Remove sparse-array for poll backend
The sparse-array approach led to better insert/remove performance, by allowing a O(1) access, but led to memory consumption issue. The kernel would, for example, have to parse the whole array, even if it's mostly empty, and that can be an issue for large arrays.
2015-09-03 10:12:57 +01:00
Ludovic Henry 4c84f3c99d [threadpool-io] Remove unecessary operation change
These 2 operations are going to be treated the same in managed, so the change is useless
2015-09-03 10:12:57 +01:00
Ludovic Henry 312c249d36 [threadpool-io] Add log tracing 2015-09-03 10:12:57 +01:00
Ludovic Henry fa0059bb83 [threadpool-io] Rework backend API
The main change is the fd will not be removed from the backend when there is no event to poll, but only when we close the socket. This also reduce the number of functions of the backend.
2015-09-03 10:12:57 +01:00
Ludovic Henry f180a0aa3b [threadpool-io] Move the states table to the selector thread exclusively
This greatly simplify the model of the states as we do not need to worry about modifications in different threads.
2015-09-03 10:12:57 +01:00
Ludovic Henry b17dda2348 [threadpool-io] Disable AIO by default 2015-09-03 10:12:56 +01:00
Marek Safar 864629bacd [mcs] Implements null operator used from both outer and inner expression of the statement. Fixes #33341 2015-09-03 10:58:50 +02:00
Zoltan Varga 9871c89692 [sdb] Fix locals info when two c# level locals are allocated to the same IL local. 2015-09-02 16:40:36 -04:00
Joel Martinez 90d7758e2e [mdoc] Fixes an issue with member and type deletion.
Specifically, when updating classic and unified assemblies, members
that were completely removed from one or both assemblies were not
being removed from the XML. This patch updates mdoc's `DeleteMember`
method to properly handle deletion in all scenarios (normal, classic, unified).

Of course, deletion will still not happen if one of two things is true:

- `--delete` is *not* passed into the `mdoc update` call and the member node
  contains existing documentation.
- `--preserve` *is* passed into the `mdoc update` invocation.

In both of those cases, the member will not be deleted, and a message stating
as such will be written as a warning to the output.
2015-09-02 11:49:17 -04:00
Miguel de Icaza 8eff004670 Bump version, in preparation for a future release 2015-09-02 11:49:09 -04:00
Marek Safar d3f3d95a1c [corlib] Construct specific culture using most specific culture name region. Fixes #33400 2015-09-02 10:58:04 +02:00
Zoltan Varga a88262b52b Revert "[sdb] Disallow nested invokes."
This reverts commit d3e75456b3.

Revert this, it is supported functionality.
2015-09-01 21:22:01 -04:00
Mark Probst 8486317e0b [sgen] Properly synchronize allocated_blocks.
We were missing a memory barrier here.  This might fix the current
intermittent crashes on wrench.
2015-09-01 18:29:21 -04:00
Zoltan Varga 7d8a09f2ed [runtime] Throw an exception instead of asserting when trying to call remoting methods linked away. 2015-09-01 16:17:16 -04:00
Zoltan Varga 393fd6001e [bcl] Disable some tests which rely on fp behavior on mobile. (#33510). 2015-09-01 15:10:16 -04:00
Zoltan Varga cd90e8c706 [ppdb] Fix support for Assembly.LoadFrom(). Fixes #33550. 2015-09-01 15:06:01 -04:00
Zoltan Varga f902ecd5be Revert "[llvm] Disable support for nested clauses again, it still causes test failures like #32583."
This reverts commit 557e9f5c0b.

Revert this as it breaks the build.
2015-09-01 12:24:25 -04:00
Marek Safar 595392d965 [mcs] Remove not implemented from ambiguous static type lookup. Fixes #33527 2015-09-01 11:40:40 +02:00
Zoltan Varga 557e9f5c0b [llvm] Disable support for nested clauses again, it still causes test failures like #32583. 2015-08-31 18:36:30 -04:00
Marek Safar 2701b19413 Revert "[mcs] Don't report error for warnings which are not intended to be compiler warnings. Fixes #33487"
This reverts commit 6dec86a023.
2015-08-31 15:23:59 +02:00
Marek Safar 6dec86a023 [mcs] Don't report error for warnings which are not intended to be compiler warnings. Fixes #33487 2015-08-31 14:16:30 +02:00
Marcos Henrich 70c6478d97 [runtime] Removed duplicated code 2015-08-31 10:26:46 +01:00
Marcos Henrich c24df31a2d Fixes get_module_filename. 2015-08-31 10:14:38 +01:00
Marcos Henrich a832ca5578 Merge pull request #2009 from esdrubal/DotNetRelativeOrAbsolute
[System] UriKind.RelativeOrAbsolute workaround.
2015-08-29 12:29:45 +01:00
Vlad Brezae 90877bd0fb [sgen] Add missing write barriers for the concurrent collector 2015-08-28 18:09:19 -07:00
Vlad Brezae fb9b4f8789 [sgen] Major allocation should not happen while we sweep 2015-08-28 18:08:55 -07:00
Vlad Brezae ae33495a12 [sgen] Clear nursery at gc if we are doing concurrent checks 2015-08-28 18:08:35 -07:00
Vlad Brezae 9173d8aa78 [sgen] Fix scanning of invalid entries within arrays 2015-08-28 18:08:19 -07:00
Marek Habersack 9b990f2b19 Remove stray ifdef 2015-08-28 15:19:52 +02:00
Zoltan Varga 296bc43db3 Fix the build. 2015-08-27 16:29:18 -04:00
Marek Safar bb2eacec40 [mcs] Try to report better error message for file excedding PE/COFF limit. Fixes #32487 2015-08-27 16:17:43 -04:00
Zoltan Varga 6f87943866 [gsharedvt] Disable the box+brtrue optimization for gsharedvt types. Fixes #33324. 2015-08-27 16:15:42 -04:00
Zoltan Varga d3e75456b3 [sdb] Disallow nested invokes. 2015-08-26 16:42:01 -04:00
Dylan Borg f4de388789 fix the x86 build 2015-08-26 12:14:40 -04:00
Zoltan Varga 801e6f8760 [runtime] Fix native backtraces with lldb by closing stdin. 2015-08-25 10:47:52 -04:00
Alex Rønne Petersen b81f846775 [profiler] Add GC handle events with backtraces. 2015-08-25 09:16:48 +02:00
Alex Rønne Petersen 4ca894aaf4 [profiler] Remove CodeAnalyst profiler module.
This product has been discontinued by AMD and we don't even have support for
building this profiler module in the build system anyway; chances are pretty
good that bitrot has set in.
2015-08-25 09:16:41 +02:00
Alex Rønne Petersen 0c74c0342c [profiler] Describe buffer size arithmetic with comments. 2015-08-25 09:16:33 +02:00
Zoltan Varga cdc35fc76b [sdb] Remove the code which stopped single stepping when exiting a runtime invoke, it was only enabled on ios/android, and it doesn't seem to be needed anymore. 2015-08-24 16:53:33 -04:00
Marek Safar 7e42365186 [runtime] Remove eager exception stack construction when it contains dynamic method. Fixes #33064
We used to construct exception stack traces as string at throw site (for dynamic methods) but
that does not work correctly because exception stack trace can be decomposed via
new StackTrace (exception) or merged via ExceptionDispatchInfo both of them need the exception
stack in raw form and not as a string.

Further the format used by local stack builder was not same as format used by
System.Diagnostics.StackTrace.

The orignal reason for the specialization was that dynamic method can be collected
before stack is rendered which leads to stack frame to be reported as

at <unknown method> instead of
at (wrapper dynamic-method)

That should be addressed by gc-link between dynamic method and exception or
stack-frame.
2015-08-21 23:38:16 -04:00
Martin Baulig 1d2c58215f [WFC]: Fix yesterday's commit.
We actually don't need the length check here.  The only place where
the 'ref parameters' could possibly be replaced is at the end of the
private Request() method - to remove the 'IAsyncResult' argument from
and End*() method.

This fixes commit 0b1360c8e3 and bug #32886.
2015-08-19 13:19:50 +02:00
Zoltan Varga 220b9ba759 [sdb] Fix the handling of strings with embedded null values. Fixes #33066. 2015-08-18 17:18:47 -04:00
Martin Baulig 0b1360c8e3 [WCF]: Fix non-byref parameters; bug #32886. 2015-08-18 20:01:54 +02:00
Marek Habersack cff09392e1 [tests] Disable a Unix signal test on Android
The test causes the runtime to silently crash in fashion similar to what
real-time signals do to the runtime (a segfault without a single trace
of a crash, causing the process to just hang)
2015-08-18 14:55:09 +02:00
Marek Safar 08b7103fef [system] Keep excluded socket mobile tests in sync 2015-08-17 18:48:31 +02:00
Marek Safar 4b31a4cd57 [corlib] Update incorrect test 2015-08-17 16:30:40 +02:00
Marek Safar a22465351b [corlib] Propagate captured ExceptionDispatchInfo to user's StackTrace copies. Fixes #32918 2015-08-17 16:28:16 +02:00
Zoltan Varga 4fd7f72a55 [bcl] Fix test failures in the System.ServiceModel tests after 9ffb681d06. 2015-08-15 22:27:23 -04:00
Alexander Köplinger 5345159fdd [corlib] Implement MonoEvent Module property
Add tests for Event-, Method- and ConstructorInfo to verify accessing .Module works (the latter two already worked before this change).
2015-08-15 14:47:42 -04:00
Zoltan Varga 34ea1c350f [jit] Remove some dead code. 2015-08-15 00:08:49 -04:00
Zoltan Varga 917c8f6b12 [gsharedvt] Don't pass non-variable size gsharedvt types by ref. Fixes #32931. 2015-08-14 18:45:49 -04:00
Zoltan Varga 66ddca9cbc [arm] Add support for split reg-stack argument passing to the dyn call code. Fixes #33080. 2015-08-14 14:05:52 -04:00
Rolf Bjarne Kvinge 880b0ddde1 Add specific configure option to enable the WatchOS BCL libraries. 2015-08-14 12:30:43 +02:00
Marcos Henrich 644d8d6571 [runtime] GetModuleFileNameEx
GetModuleFileNameEx now returns a full path instead of the process name.
Fixes #32579
2015-08-14 10:13:21 +01:00
Marcos Henrich b4ff1e3d0f Fixes process names trimmed to 15 chars.
Process names were trimmed to 15 characters. proc_name was used to
retrieve the process name, by looking at its implementation we can see
that it returns a buffer which the size is MAXCOMLEN defined as 16.

When the proc_name result length is equal to 15 (MAXCOMLEN - 1) we now check if
proc_pidpath is able to return a longer process name.

Fixes #32539.
2015-08-14 10:13:20 +01:00
Rolf Bjarne Kvinge 05d33f1888 Build an initial version of System.Net.Http.dll for monotouch as part of the regular BCL build.
We have Facade assemblies that depend on System.Net.Http.dll to exist, so
we can't delay building it (at least one version of it).
2015-08-13 14:45:42 +02:00
Marek Habersack afdc35694b Posix RTS test fixes and Android compatibility
Android's libc (bionic) defines the _GNU_SOURCE macro but fails to adhere
to the GNU sematics in (at least) one case - the strerror_r function.
The function follows XSI semantics instead of the GNU one which caused our
code to segfault on Android. This patch special-cases Android to use the XSI
semantics for strerror_r. This un-breaks some POSX real-time singals tests.

It also makes provisions for detecting whether the real-time signals are safe
to use on the current platform. They are safe for all platforms desktop Mono
runs on, but they're not safe on most Android platforms.
2015-08-13 11:28:09 +02:00
Alexander Köplinger 14804f4582 Revert "[Microsoft.Build.Engine] Fix bug with escaped semicolon and spaces"
This reverts commit 51297ed7ab.

It caused a regression for escaped quotes (%22) in msbuild properties. See https://github.com/mono/mono/commit/51297ed7ab06480df84520c758639b6cef0790d9#commitcomment-11827605.

Disable test that now fails again after the revert. Add new test that verifies the behavior originally broken by the change.
2015-08-13 00:03:42 +02:00
Zoltan Varga 044b879cfb [runtime] Revert part of the previous commit to avoid the profiler crashing. 2015-08-13 00:03:36 +02:00
Zoltan Varga 186ce2fc46 [runtime] Avoid passing gshared methods to clients of the embedding api. 2015-08-13 00:03:28 +02:00
Ludovic Henry 0900418353 Merge pull request #1974 from rolfbjarne/bug32947-4.2.0-pre2
[threadpool-ms-io] Remove unnecessary asserts. Fixes #32947.
2015-08-11 14:20:50 -03:00
João Matos 12eefdae82 [aot] Rewrite the options parser to properly handle arguments.
Basically our previous behaviour was just splitting strings by "," which did not behave as expected when passing strings.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=31996.
2015-08-11 17:44:10 +01:00
Rolf Bjarne Kvinge a1c8874b2c [threadpool-ms-io] Remove unnecessary asserts. Fixes #32947.
Neither is_socket_async_callback nor is_async_read_handler need to
actually successfully load the classes they're comparing against;
if the classes can't be loaded, then the input class is obviously
not of that class.

This occurs when mscorlib is linked, the classes to compare against
might be linked away.

https://bugzilla.xamarin.com/show_bug.cgi?id=32947
2015-08-11 15:13:04 +02:00
Marek Safar 376b2c32bb [corlib] Handle Module in RuntimePropertyInfo. Fixes #32815 2015-08-10 13:05:26 +02:00
Marek Safar 5048da46fe [mcs] Fix string interpolation parsing where inner expression contains { } tokens. Fixes #32832 2015-08-10 11:14:59 +02:00
Ludovic Henry eede15eb71 [runtime] Fix memory corruption due to incorrect use of MONO_OBJECT_SETREF
MONO_OBJECT_SETREF would use mono_gc_wbarrier_set_field which would write over 8 bytes ( *(void**)field = value ), while we want to write over 1 byte here.
2015-08-07 09:32:06 -04:00
Ludovic Henry 5bcb420286 [runtime] Add testing for unhandled exception 2015-08-07 09:31:59 -04:00
Ludovic Henry 3f07b978c4 [runtime] Refactor AsyncResult.Invoke icall and swallow exception on AsyncCallback
The swallowed exception is the behavior we can observe on .NET and Mono 4.0
2015-08-07 09:31:47 -04:00
Ludovic Henry 0d47e98ca4 [bcl] Remove old ThreadPool managed class 2015-08-07 09:27:59 -04:00
Zoltan Varga abc5449308 [runtime] Avoid a memory overflow in Buffer.InternalBlockCopy () if the caller passes in a negative value by mistake. 2015-08-06 22:16:07 -04:00
Marek Safar 5bcc48192c [system.net.http] Add special handling for chunked transfer-encoding httpwebrequest initialization. Fixes #31877 2015-08-05 10:12:27 +02:00
Zoltan Varga ac5452a1b9 Fix the build. 2015-08-04 23:02:23 -04:00
Rodrigo Kumpera b892a92153 [runtime] Reenable Frak TLS on OSX 2015-08-04 22:05:13 -04:00
Marek Safar 8abcfa68f6 [mcs] Cached labels definite assignment check does not need exact match but anything larger than original set satisfies the condition. Fixes #32732 2015-08-04 15:33:55 +02:00
Marek Safar 012cc7f646 [mcs] Special case return expression of Task<Task> in async block. Fixes #32712 2015-08-04 13:02:03 +02:00
Zoltan Varga 3396738374 [arm] Avoid running out of thunk space if the same instruction is patched multiple times. Fixes #32179. 2015-08-03 12:04:27 -04:00
Tom Philpot 64e24dffc1 Fix NRE in CheckAvailableForRecycling. Fixes #32685 2015-08-01 08:55:24 +02:00
Jonathan Pryor 33a75810b5 [mkbundle] Add mkbundle --dos2unix parameter.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=25086
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=31875
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=32171

Reverts and reworks commit bcfec743.

The problem is that when Xamarin.Android is running mkbundle, dos2unix
should NEVER be used, because the Android NDK NEVER wants Unix-like
paths, which is what dos2unix creates.

Commit bcfec743 attempted to fix this by removing dos2unix invocation
from the Xamarin.Android codepath.

The problem is that the logic was backwards: it removed dos2unix
invocation when XAMARIN_ANDROID was NOT defined, and PRESERVED
dos2unix invocation when XAMARIN_ANDROID WAS defined.

Meaning commit bcfec743 broke normal/default mkbundle.exe use on
Windows -- it would no longer probe for and use dos2unix if present --
and Xamarin.Android use of mkbundle continued to check for and use
dos2unix if it was present, continuing the buggy behavior.

Doh!

Thus, a reworking: Add a `mkbundle --dos2unix` parameter.
If `mkbundle --dos2unix=false` is specified, dos2unix will NOT be
probed for, and will NOT be used. If `mkbundle --dos2unix` or
`mkbundle --dos2unix=true` is used, then dos2unix WILL be used.

This allows the caller to consistently, ahead of time, control
mkbundle's behavior regarding dos2unix, which will e.g. allow
Xamarin.Android to *always* specify --dos2unix=false, allowing things
to build as desired there.
2015-07-31 15:36:32 -04:00
Marek Safar 2d1c17d47e [runtime] Add 2.0 build assemblies to remapping table. Fixes #32561 2015-07-31 13:52:45 +02:00
Martin Baulig c133880bc4 [System]: Fix WebConnectionStream.SetHeadersAsync() logic for #31830.
This fixes commits 8ccfe0f8ff and
c109f9ca03.

Added new test:
https://github.com/xamarin/web-tests/commit/d60bc3f637ca2bf4aa1379b839d878e224d344c8
2015-07-30 15:36:43 +02:00
Sebastien Pouliot 6b6e7ca19e [tests] iOS9 (beta) have fixed bug #27864, adjust test 2015-07-29 16:45:58 -04:00
Martin Baulig c109f9ca03 Revert "[System] Don't assume WebConnectionStream of unknown http methods require write stream. Fixes #31830"
This reverts commit 8ccfe0f8ff.

This commit breaks the Content-Type logic for existing HTTP verbs such as for instance
using DELETE with an empty body [1].  Added two new test cases [2] and [3] to the stable
branch of the web-tests (https://github.com/xamarin/web-tests/tree/stable) for the particular
scenario from bug #31830 as well as the default HttpClient.SendAsync() without a Content [4].

The rules are as follows:

1.) HttpWebRequest adds the Content-Length header if and only if you're calling
    GetRequestStream(); a length of 0 will be used if you don't actually write
    any content.

    This is true for POST, PUT, DELETE and "obscute" verbs.

2.) HttpClient.SendAsync() always adds a Content-Length header.

Tests:

[1] https://github.com/xamarin/web-tests/blob/31b8fed0ec1283b8c0693bb14d1ac266792c1020/Xamarin.WebTests/Xamarin.WebTests.Tests/TestPost.cs#L84

[2] https://github.com/xamarin/web-tests/blob/31b8fed0ec1283b8c0693bb14d1ac266792c1020/Xamarin.WebTests/Xamarin.WebTests.Tests/TestPost.cs#L296

[3] https://github.com/xamarin/web-tests/blob/31b8fed0ec1283b8c0693bb14d1ac266792c1020/Xamarin.WebTests/Xamarin.WebTests.Tests/TestHttpClient.cs#L134

[4] https://github.com/xamarin/web-tests/blob/31b8fed0ec1283b8c0693bb14d1ac266792c1020/Xamarin.WebTests/Xamarin.WebTests.Tests/TestHttpClient.cs#L127

(cherry picked from commit 3f1ae72f1b385c3c5e4b5ac2b93d13418c020f02)
2015-07-28 21:14:18 +02:00
Marcin Cieslak 3b17abfb9b [mswin][build] unbreak windows build on 'updates_signal' 2015-07-27 15:20:49 -04:00
Marek Safar 8331376182 [mcs] Reset doc reader state after expression bodied property. Fixes #32456 2015-07-27 14:12:01 +02:00
Marek Safar 84b3dda86f [Mono.Debugger.Soft] Exclude invalid C# code 2015-07-24 18:10:58 +02:00
Marek Safar e8c3f7719e [mcs] Fix crash during ambiguous implementation of the query pattern error reporting. Fixes #32060 2015-07-24 17:31:24 +02:00
Marek Safar ae9fcd19f0 [mcs] struct parameterless instance constructor feature was removed from C#6 for compatibility reasons 2015-07-24 15:55:27 +02:00
Zoltan Varga 5a5d899da0 [runtime] Avoid stack overflow when marshalling an out stringbuilder argument in pinvoke callbacks. Fixes #31932. 2015-07-23 23:09:02 -04:00
Zoltan Varga bf863dbc46 [arm] Allocate thunk space for tail calls. Fixes #32179. 2015-07-23 23:04:34 -04:00
Zoltan Varga 362468798c [gsharedvt] Set exception_message when disabling LLVM. 2015-07-22 20:29:14 -04:00
Zoltan Varga 118291ff5d [arm] Enable support for a few more calling conventions for LLVM. 2015-07-22 20:29:07 -04:00
Marek Habersack 2610994023 [tests] Android 4.4.4 doesn't have signal(2) 2015-07-22 00:13:18 +02:00
Marek Habersack 53b8083989 [tests] Fix path used by the test so that it works on Android 4.4.4 2015-07-22 00:13:18 +02:00
Marek Habersack 59f2da8400 [tests] Disable on Android, getpwnam_r doesn't exist there 2015-07-22 00:13:18 +02:00
Marek Habersack 44ba163605 [tests] Don't assume CWD is writable
Use temporary path instead. CWD is / on Android and is not writable
2015-07-22 00:13:17 +02:00
Marek Habersack 8373e4943d [tests] Nunit syntax helpers don't exist in Xamarin.Android 2015-07-22 00:13:17 +02:00
Zoltan Varga 65b1b10846 [llvm] Fix a problem introduced by 4a685f44c8, the size of the return type was computed incorrectly. 2015-07-21 18:12:06 -04:00
Rodrigo Kumpera 3409240895 [profiler] Correct the profiler format. 2015-07-21 18:05:30 -04:00
Rodrigo Kumpera 3a7212a46e [profiler] Use version 11 for the 4.2 profiler changes plus fix docs on format. 2015-07-21 18:05:24 -04:00
Rodrigo Kumpera 24b917c8a1 Merge pull request #1926 from alexrp/profiler-improvements
More profiler improvements
2015-07-21 18:04:59 -04:00
Zoltan Varga 2efa0cc807 [llvm] Add support for returning vtypes as a scalar, this is used on arm64. 2015-07-21 16:41:18 -04:00
Zoltan Varga 5f01b80b43 [llvm] Add support for pass/returning vtypes by ref. 2015-07-21 16:41:18 -04:00
Ludovic Henry b3838e42d1 [runtime] Make sure EPOLLONESHOT is defined 2015-07-21 12:18:21 -03:00
Marek Safar eb2aad684f [corlib] Use better names for predefined encodings. Fixes #32137 2015-07-21 14:45:34 +02:00
Marek Habersack 080036d99b [test] Fix test on Android
On Android application runs with its CWD set to / and so the path
test modified in this commit expects to find a path of the //one form
which is not what the combine operation returns.
2015-07-21 11:15:32 +02:00
Marek Habersack eafd3db1ab [tests] Disable some tests on Android due to missing APIs
bionic doesn't have the following entries:

  setgrent
  getgrnam_r
  setpwent

API 21 in the NDK conditionally declares some of those but they are absent
from either libc.so or libc.a.
2015-07-21 11:15:32 +02:00
Marek Safar 1f85a26443 [mcs] Set builder for partial method definition attributes. Fixes #31948 2015-07-21 11:12:17 +02:00
Rodrigo Kumpera 27b4ff05b6 [lock-tracer] Small improvements to the decoder. 2015-07-20 19:02:29 -04:00
Rodrigo Kumpera c59699fa3b [lock-decoder] Update it to include the threads lock. 2015-07-20 19:02:21 -04:00
Rodrigo Kumpera 5fa2f04f19 [runtime] Safe publish MonoImage::name_cache and exploit that around the runtime. Fix ImageLock nested use. 2015-07-20 19:02:15 -04:00
Rodrigo Kumpera e665f8967e [mini] Fix locking order violation in mono_get_seq_points.
mono_get_seq_points takes the domain lock then calls mini_get_shared_method.

mini_get_shared_method then calls into general metadata code that eventually take
the loader lock.

The loader lock has precedence over the domain lock.
2015-07-20 19:00:35 -04:00
Rodrigo Kumpera cb6829d336 [build] Rename RUNTIME variable to avoid clash with make.config's version
Starting with 62c86e2243 mono/mini/Makefile now includes mcs/build/config.make.
Both files define RUNTIME, but with different values. The mini one requires the usage of MONO_PATH while the one in
mcs don't.

To fix that we rename the mini var to MINI_RUNTIME.
2015-07-20 19:00:31 -04:00
Rodrigo Kumpera 2fabccfb08 [runtime] Fix locking in mono_image_file_for_image. 2015-07-20 19:00:27 -04:00
Ludovic Henry 9391cdcd27 [threadpool-ms-io] Factor update removing 2015-07-20 16:19:18 -03:00
Ludovic Henry 86084a1870 [threadpool-ms-io] Remove socket synchronously from backend when closing socket
To achieve this, we need to wait for the update to be applied to the backend.

This is mainly for the epoll backend, as we do not need to remove the fd from the backend when using kqueue.
2015-07-20 16:19:18 -03:00
Ludovic Henry c68e23c85c [threadpool-ms-io] Fix epoll socket close/remove race condition
With the previous commit, it fixes a range of bug that happens only with epoll. This is because, contrary to poll and kqueue, epoll keeps an internal state that has to be kept in sync with the threadpool_io->states hash table.

This threadpool_io->states hash table is keeping a list of file descriptor to watch, with the corresponding SocketAsyncResult to callback in case of event on the fd. But epoll also keeps its internal state that needs to me modified with EPOLL_CTL_ADD, EPOLL_CTL_MOD and EPOLL_CTL_DEL.
Contrary to kqueue, EPOLLONESHOT does not force epoll to remove the socket from its internal state once an event have been triggered; but it will just not fire this event again, until this event is reset. Also, epoll will remove a fd from its internal state when this fd is closed.

This will lead to a bunch of out-of-sync states like the following :
 - the user start reading asynchronously the STDOUT of a child process, the child process quit (closing the STDOUT fd), this fd is reused by the OS for something else (like a socket), the IO threadpool call epoll_ctl with EPOLL_CTL_MOD (because the fd is still in the states hashtable), but the OS returns an error because the underlying file is different, even if the fd is the same.
 - the user opens a socket, does some asynchronous operation on it, and close it; removing it from the table but not from epoll (as it does not call epoll_ctl with EPOLL_CTL_DEL). For another reason, the fd has not been closed in the OS (and thus in epoll), because it might, for example, still be open by another process. After that, we receive an event for this fd (as it is still in epoll), and between the time of the epoll_wait and the epoll_ctl with EPOLL_CTL_DEL, the fd is actually closed in the OS, leading to a EBADF error.

The g_warning have also been replaced by g_error, so we do not silently discard this kind of error in testing.
2015-07-20 16:19:18 -03:00
Ludovic Henry 72275b5e74 [bcl] Remove ProcessAsyncReader handle from IO ThreadPool on closing 2015-07-20 16:19:17 -03:00
Ludovic Henry 8a26b5a034 [threadpool-ms-io] Rework some utility functions 2015-07-20 16:19:17 -03:00
Ludovic Henry 20cf9e3dbf [threadpool-ms-io] Replace the 2 locks by only 1 2015-07-20 16:19:17 -03:00
Ludovic Henry 510f4d4f71 [utils] Factor lazy initialization of threadpool-ms and threadpool-ms-io for use by other modules 2015-07-20 16:19:16 -03:00
Zoltan Varga ec44efbd8d [gshared] Fix constrained partial calls to Object:GetType (). 2015-07-20 15:15:38 -04:00
Marek Safar 1ca4d2bc72 [mcs] Add missing interpolated string segmnent clone. Fixes #32135 2015-07-20 19:34:31 +02:00
Marek Safar 9f936798b8 [mcs] Parentheses expression can act as conditional access receiver. Fixes #32130 2015-07-20 18:43:38 +02:00
Marek Safar 4400165ac2 [mcs] Resolve nullable expression before unwrapping. Fixes #32054 2015-07-20 18:43:24 +02:00
Radek Doulik 29de937efd [linker] Instead of preserving every method with a [Register] attribute...
[merged from monodroid by rodo]

part of

commit 0b9c100b60fc2502a0d6347d50cac444bb82b285
Author: Jonathan Pobst <[email protected]>
Date:   Wed Sep 28 15:50:39 2011 -0500

    Instead of preserving every method with a [Register] attribute on it in Mono.Android.dll, only save the things that the user actually uses.  Reduces HelloWorld release apk by ~1.3MB.
2015-07-19 10:57:22 +02:00
Radek Doulik 9c9500fe48 [linker] return count of marked methods
[merged from monodroid by rodo]

 - part of

commit 216f75038afee2105182fc6af329f1fc83c4298f
Author: Radek Doulik <[email protected]>
Date:   Sun Nov 23 11:40:42 2014 +0100

    [linker] mark methods (from Register attr) in base type when needed

     - fixes #10268
     - methods from these Register attributes were not marked:

       https://github.com/xamarin/monodroid/blob/master/src/Mono.Android/src/Android.Widget/AdapterView.cs#L132-135

       because the app used class derived from BaseAdapter class and the methods
       existed only in the base class and were not marked
2015-07-19 10:57:04 +02:00
Radek Doulik b440f7a673 [linker] fix Linking for assemblies with type forwarders (like PCL)
[merged from monodroid by rodo]

commit 840487dd904a5552f77dcc7388b27c37ca09169f
Author: Radek Doulik <[email protected]>
Date:   Thu Oct 16 20:03:58 2014 +0200

     - sometime the assemblies with action set to Copy still might
       contain type references to forwarders and thus point to
       Delete assemblies, which are removed during linking, resulting
       in unresolvable type references

     - fixes https://bugzilla.xamarin.com/show_bug.cgi?id=23617
       XA forms template now builds and works OK
       XA app template builds and works OK
2015-07-19 10:56:31 +02:00
Radek Doulik eabc704b94 [linker] process only .xml files, catch xml exceptions
[merged from monodroid by rodo]

commit f51f044e30b822f191777a395563ef9d46f8b69d
Author: Radek Doulik <[email protected]>
Date:   Wed Mar 4 18:28:59 2015 +0100

     - fixes #27620

     - in this case we were trying to process Application.java
       as linker an assembly XML linker description, which led
       to uncaught XmlException
2015-07-19 10:56:13 +02:00
Radek Doulik 235168ae74 [linker] In ResolveFromXmlStep, bail if no <linker> element is found.
[merged from monodroid by rodo]

commit 2edecdc39ca55c65de4f57557e5e31b5d432eaa4
Author: Alex Rønne Petersen <[email protected]>
Date:   Mon Jul 1 15:35:59 2013 +0200

    The BlacklistStep pass will feed the ResolveFromXmlStep pass XML files
    that may not necessarily *be* linker descriptor files. This can happen
    if an embedded file happens to be named "Foo.Bar.xml" and an assembly
    called Foo.Bar is referenced in a project. The chances of this happening
    are probably very low, but better safe than sorry.
2015-07-19 10:56:03 +02:00
Radek Doulik 9c71282be7 [linker] Fortify the BlacklistStep.
[merged from monodroid by rodo]

commit 3001f693c52be0da673446179daf498265024867
Author: Alex Rønne Petersen <[email protected]>
Date:   Tue Jul 30 20:06:21 2013 +0200

    1. Catch XmlExceptions in case of broken XML files.
    2. Only process files that actually end in ".xml".
2015-07-19 10:55:21 +02:00
Radek Doulik e4c78936cd [linker] Support linker descriptor files embedded in the assemblies being linked.
[merged from monodroid by rodo]

commit 3e19b22eb24ff9faeebe1ace7461d8f91f807041
Author: Alex Rønne Petersen <[email protected]>
Date:   Mon Jul 1 15:34:26 2013 +0200

    This is in addition to those files that are already embedded in the linker assembly
    itself (such as mscorlib.xml). People can use this feature to tell the linker that
    certain methods/fields/types must be kept if a particular assembly is being referenced
    by embedding a descriptor file in it.
2015-07-19 10:54:55 +02:00
Ludovic Henry 40024f85b8 [threadpool-ms] Use define for monitor thread minimal lifetime 2015-07-16 16:30:48 -03:00
Ludovic Henry 23e0541b01 [threadpool-ms] Fix monitor thread starting and ending at a multiple times per second 2015-07-16 16:25:02 -03:00
João Matos 0d045cb82b [runtime] Implemented MonoContext for WatchOS using ucontext.
We cannot use inline assembly for WatchOS.
2015-07-16 18:54:24 +01:00
Marek Habersack 44a3f5cb6a [tests] Fix tests on OS/X
OS/X, like Android, uses a symlink for the $TMP directory. The tests used to assume
that the link points to the /private/tmp directory (which is the case) but earlier
changes introduced here for Android employed a more generic mechanism to determine the
actual temporary directory.
This commit removes the '/private' prefix assumption from OS/X
2015-07-16 17:52:29 +02:00
Marek Habersack 3784c69c2f [tests] Disable until a server that works is found
This test depends on server behavior. I changed the server to xamarin.com
earlier on, but it stopped behaving as required recently. The test should
not rely on random servers, so until we have a server we can rely on I'm
disabling it.
2015-07-15 20:41:41 +02:00
Marek Habersack 2c821dd384 [tests] Crashes on Android 64-bit
Disable for all other architectures as well, as there's not enough
flexibility in this respect :(
2015-07-15 20:41:41 +02:00
Marek Habersack 1d9c46ad68 [tests] Disable on Android due to runtime segfault
The Dispose call in FakeSafeHandle causes the Mono runtime to segfault
when passing the call up the chain. As a consequence of disabling the
base class call, the other tests disabled by this commit fail.
2015-07-15 20:41:40 +02:00
Marek Habersack c68dc66765 [tests] Runtime segfaults on Android, probably due to AppDomain.Unload 2015-07-15 20:41:40 +02:00
Marek Habersack 95cb416bbf [tests] Disable tests not working on mobile platforms 2015-07-15 20:41:39 +02:00
Marek Habersack add93988d1 [tests] Add Xamarin.Android assembly name to list of probes 2015-07-15 20:41:39 +02:00
Marek Habersack f3fd8cb951 [tests] Disable on Android due to environment differences
Assemblies in Xamarin.Android cannot be accessed as FileStream/files directly
2015-07-15 20:41:38 +02:00
Marek Habersack f8f6a0d431 [tests] Adjust the test for Android-specific behavior 2015-07-15 20:41:37 +02:00
Marek Habersack b261748f35 [tests] Disable on Android due to environment differences
Xamarin.Android doesn't ship with the Mono.Compilerservices.SymbolWriter
assembly that is required by this test.
2015-07-15 20:41:37 +02:00
Marek Habersack f822059758 [tests] Assembly.GetEntryAssembly works differently on Android
There's no entry assembly as such, adjust the test accordingly.
2015-07-15 20:41:36 +02:00
Marek Habersack e882a125ee [tests] Disable on Android due to environment differences
It's not possible to save the assembly in the current directory on Android and AssemblyBuilder.DefineDynamicModule will not
allow a full path to the assembly to be passed to it. Trying to change the current directory before saving will not work either as
FileStream will then prepend / to the file name (perhaps it's another bug) and write access to the filesystem root is, obviously, denied
2015-07-15 20:41:36 +02:00
Marek Habersack 554247cd6a [tests] Disable on Android due to environment differences
Xamarin.Android doesn't ship with the Mono.Compilerservices.SymbolWriter
assembly that is required by this test.
2015-07-15 20:41:35 +02:00
Marek Habersack 7c7b648cf1 [tests] Disable on Android
Fails with System.MethodAccessException : Method `t17:.ctor ()' is inaccessible from method `t18:.ctor ()'
2015-07-15 20:41:35 +02:00
Marek Habersack 815079d694 [tests] Disable parts relying on APIs not in Mobile Profile 2015-07-15 20:41:34 +02:00
Marek Habersack 4e13efc5de [tests] The test crashes the runtime 2015-07-15 20:41:33 +02:00
Marek Habersack 83af81148a [tests] Disable code to prevent Mono runtime crash
AppDomain unloading causes a segfault with the Mono runtime on Android.
Until the cause is found and fixed this code must remain disabled.
2015-07-15 20:41:33 +02:00
Marek Habersack cbf56e58ce [tests] Disable on Android due to environment differences
Xamarin.Android doesn't ship with the Mono.Compilerservices.SymbolWriter
assembly that is required by this test.
2015-07-15 20:41:32 +02:00
Marek Habersack 7128850271 [tests] Disable on Android due to environment differences
DefineResource doesn't allow path in its fileName parameter and the
test attempts to write to / in effect (which is the default CWD for
Android apps)
2015-07-15 20:41:32 +02:00
Marek Habersack 4c276327d3 [tests] Xamarin.Android works the same way as the desktop Mono 2015-07-15 20:41:31 +02:00
Marek Habersack 1e9aea859d [tests] Adjust test to work in unsupported scenarios
On Android (possibly on other systems too) it is possible that no gateway address is available and its lack is NOT an error
Here is a sample of /proc/net/route from Nexus 9 running Android 5.1.1 (IPInterfaceProperties parses that file on Linux)

  Iface	Destination	Gateway 	Flags	RefCnt	Use	Metric	Mask		MTU	Window	IRTT
  wlan0	0001A8C0	00000000	0001	0	0	0	00FFFFFF	0	0	0

Gateway is set to any address and it is explicitly ignored by the route information parser

For comparison, here's route contents from an Android 4.4.4 device:

  Iface	Destination	Gateway 	Flags	RefCnt	Use	Metric	Mask		MTU	Window	IRTT
  wlan0	00000000	0101A8C0	0003	0	0	0	00000000	0	0	0
  wlan0	00000000	0101A8C0	0003	0	0	203	00000000	0	0	0
  wlan0	0001A8C0	00000000	0001	0	0	0	00FFFFFF	0	0	0
  wlan0	0001A8C0	00000000	0001	0	0	0	00FFFFFF	0	0	0
  wlan0	0001A8C0	00000000	0001	0	0	203	00FFFFFF	0	0	0
  wlan0	0101A8C0	00000000	0005	0	0	0	FFFFFFFF	0	0	0

Obviously, this test fails on the first device and succeeds on the second. For this reason the test is modified to succeed
in case of devices like the first one since it's not a real failure but a shortcoming of the .NET API
2015-07-15 20:41:31 +02:00
Marek Habersack b67536d46e [tests] Fix tests which rely on temp dir location being a real dir
Android M (that's where I ran into it) makes the path returned by
Path.GetTempPath () a symlink to the real directory used for temporary
files. When the tests change the directory the symlink is followed and
subsequent reads of the current directory name will return the real dir
name which doesn't match what was constructed using the value returned by
GetTempPath ()
2015-07-15 20:41:30 +02:00
Marek Habersack 4dcaef892a [tests] Fails on Android ARM64
The test works on all the other supported architectures but segfaults on
ARM64 (Nexus 9 running Lollipop 5.1.1)
2015-07-15 20:41:29 +02:00
Marek Habersack f2b1ae76b5 [test] Disable on Android for now
The test throws the following exception

  MonoTests.System.Security.Cryptography.AesCfbTests.Roundtrip=System.Security.Cryptography.CryptographicException : Bad PKCS7 padding. Invalid length 236.
  at Mono.Security.Cryptography.SymmetricTransform.ThrowBadPaddingException (PaddingMode padding, Int32 length, Int32 position) <0x3bf26858 + 0x000bb> in <filename unknown>:0
  at Mono.Security.Cryptography.SymmetricTransform.FinalDecrypt (System.Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) <0x3bf264f8 + 0x0022f> in <filename unknown>:0
  at Mono.Security.Cryptography.SymmetricTransform.TransformFinalBlock (System.Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) <0x3bf219b0 + 0x00077> in <filename unknown>:0
  at MonoTests.System.Security.Cryptography.CfbTests.Decryptor (System.Security.Cryptography.SymmetricAlgorithm algo, System.Byte[] encdata) <0x3bf261f8 + 0x00221> in <filename unknown>:0
  at MonoTests.System.Security.Cryptography.CfbTests.CFB (System.Security.Cryptography.SymmetricAlgorithm algo, Int32 feedbackSize) <0x3bf20000 + 0x0011b> in <filename unknown>:0
  at MonoTests.System.Security.Cryptography.AesCfbTests.CFB (System.Security.Cryptography.SymmetricAlgorithm algo) <0x3ca53ef0 + 0x00043> in <filename unknown>:0
  at MonoTests.System.Security.Cryptography.CfbTests.ProcessPadding (System.Security.Cryptography.SymmetricAlgorithm algo) <0x3ca53e80 + 0x0004f> in <filename unknown>:0
  at MonoTests.System.Security.Cryptography.CfbTests.ProcessKeySizes (System.Security.Cryptography.SymmetricAlgorithm algo) <0x3bf3fc20 + 0x000b7> in <filename unknown>:0
  at MonoTests.System.Security.Cryptography.CfbTests.ProcessBlockSizes (System.Security.Cryptography.SymmetricAlgorithm algo) <0x3bf3f910 + 0x0007b> in <filename unknown>:0
  at MonoTests.System.Security.Cryptography.AesCfbTests.Roundtrip () <0x3bf3cf28 + 0x00073> in <filename unknown>:0
  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) <0x3bf3cc10 + 0x0008f> in <filename unknown>:0
2015-07-15 20:41:29 +02:00
Marek Habersack 88a3f06371 [tests] Don't use Assembly.Location on Android
Assembly.Location will contain just the assembly file name without any path, which
is not what the test(s) expect. The reason is that the assemblies on Android live
in the APK, are embedded in the native code or don't exist at all (AOT)
2015-07-15 20:41:28 +02:00
Marek Habersack 2bc21e8d37 [tests] Android behaves the same as desktop Mono
The same exceptions are thrown in Xamarin.Android, unlike in Xamarin.iOS which
behaves differently to desktop Mono
2015-07-15 20:41:28 +02:00
Marek Habersack 9f552c56d4 [tests] Disable for Android
The test works when only its fixture is ran, fails when ran as part of the
entire BCL test suite.
2015-07-15 20:41:27 +02:00
Marek Habersack e3fec9e89d [tests] Disable because URL is no longer there
The test relies on presence of a specific file that is now gone. Disabled
until a stable URL is found :P
2015-07-15 20:41:27 +02:00
Marek Habersack 0844ab738a [tests] Disable for Android
The test works when only its fixture is ran, fails when ran as part of the
entire BCL test suite.
2015-07-15 20:41:26 +02:00
Marek Habersack 2b4bd5351e [tests] Disable for Android
The test works when only its fixture is ran, fails when ran as part of the
entire BCL test suite.
2015-07-15 20:41:25 +02:00
Marek Habersack ffb69e3ed0 [tests] Android doesn't have access to Assembly.Location
Attempts to access the test dll which won't work on Android since the
dll is either in the apk or bundled in the native code or not there at
all (AOT)
2015-07-15 20:41:25 +02:00
Marek Habersack 5a20bf3669 [tests] Disable for Android
The tests work fine if only this fixture is ran, they fail when ran as part
of the entire test suite.
2015-07-15 20:41:24 +02:00
Marek Habersack aac7b3d216 [tests] Disable for Android
The tests work fine if only this fixture is ran, they fail when ran as part
of the entire test suite.
2015-07-15 20:41:24 +02:00
Marek Habersack abe3adff5f [tests] System zlib errors out for these on Android 2015-07-15 20:41:23 +02:00
Marek Habersack 5e0a6c3b13 [tests] Large locks not supported on Android
While bionic reports it supports 64-bit offsets for locks and exposes the
necessary APIs, attempt to use offsets larger than 32 bits results in
an error.
2015-07-15 20:41:23 +02:00
Marek Habersack 370d4195f0 [tests] The test hangs on Android 2015-07-15 20:41:22 +02:00
Marek Habersack 18c9d7d27f [tests] The test hangs on Android 2015-07-15 20:41:21 +02:00
Marek Habersack 80dc792e4c [tests] Use xamarin web server
http://elmundo.es/ started to send more than one cookie while
xamarin.com sends just one.
2015-07-15 20:41:21 +02:00
Marek Habersack e821deecbc [tests] Don't assume specific charset
Don't assume a specific charset in HTTP response from a server. Google
changes response charset based on the country of the client's
IP. There's no point in checking for the specific charset, it's enough
to check whether the response header has correct format.
2015-07-15 20:41:20 +02:00
Marek Habersack be33fcad91 [tests] Different CPUs have different precision
Fix the test to compare the subtraction result to value more
conservative than Double.Epsilon, to account for differences in
different CPU floating point units on Android.
2015-07-15 20:41:20 +02:00
Marek Habersack 0d209f09ad [tests] Use correct path in process tests
/bin/ls doesn't exist on Android, it's /system/bin/ls
2015-07-15 20:41:19 +02:00
Marek Habersack 7830885e02 [test] There is no runtime directory on Android
We return an empty string which is considered to be a valid value in
Android. Adjust the test for that.
2015-07-15 20:41:18 +02:00
Marek Habersack 7dc9cf81bc [tests] Use 2.1 profile assembly names for mobile 2015-07-15 20:41:18 +02:00
Marek Habersack 0c3c93efb5 [tests] Make failures more descriptive and fix XA
The test failures didn't really indicate which of the Fail statements
caused the test failure. Also, the 10k offset turned out to be not
enough for the XA test suite (it's much bigger than that)
2015-07-15 20:41:17 +02:00
Marek Habersack 9e9fecc45a [tests] Assembly.Location doesn't work on XA
Xamarin.Android stores assemblies inside apk (or bundled, or AOT-ed) and
so Assembly.Location will not point to a real path on the
filesystem. It merely contains assembly name.
2015-07-15 20:41:17 +02:00
Marek Habersack fb56b1a52f [tests] No Mono.CompilerServices.SymbolWriter in XA 2015-07-15 20:41:16 +02:00
Marek Habersack ecd44a1678 [tests] No declarative security in mobile profile 2015-07-15 20:41:16 +02:00
Marek Habersack 888874ab45 [tests] Fix for when CWD is /
The test case doesn't account for the situation when the tests are ran
at the root of the Unix filesystem. This is, admittedly, a rare case on
Desktop but it's precisely what CWD is for Android processes. The test
would fail because it would get a path of the //Form instead of the /Form
2015-07-15 20:41:15 +02:00
Marek Habersack 4e98727a7d [tests] Works in stand-alone app, fails in nunit 2015-07-15 20:32:13 +02:00
Marek Habersack 3903d320ec [tests] Fails on mobile with no details 2015-07-15 20:32:06 +02:00
Marek Habersack 16d09c2059 [tests] Doesn't work on mobile 2015-07-15 20:31:58 +02:00
Marek Habersack 6b8a4e5f3c [tests] Works in stand-alone app, fails in nunit 2015-07-15 20:31:50 +02:00
Marek Habersack 79c20ee775 [tests] Xamarin.Android has the desktop behavior 2015-07-15 20:31:46 +02:00
Marek Habersack 05f2e5e522 [tests] Xamarin.Android already has the namespace 2015-07-15 20:31:40 +02:00
Martin Baulig 42ca455df2 [xbuild]: Fix ResolveAssemblyReference.ResolveReference() with empty search paths.
When using shared projects, the search path and/or framework paths may sometimes
contain empty elements.

This fixes commit 5b12d9ae37.

(cherry picked from commit 4efdd29f70)
2015-07-14 23:40:34 +02:00
Marek Safar 4ad996b1e1 [system] Add missing APIs 2015-07-14 20:08:42 +02:00
Zoltan Varga 95333c0a5c [runtime] Fix the mono_get_lmf_addr () optimization for x86-ios. Fixes #31921. 2015-07-14 13:43:28 -04:00
Marek Safar 09212389e2 [ilasm] Imlicitly set enums value__ special flags 2015-07-14 11:33:45 +02:00
Marek Safar ed5e137a72 [ilasm] Make only structs automatically sealed (partially reverts 541a65ddd3) 2015-07-14 11:33:35 +02:00
Marek Safar 5e097d4d49 [ilasm] Don't make enums and structs sealed when sealed modifier is not used 2015-07-14 11:33:24 +02:00
Rolf Bjarne Kvinge a112354a21 Look for resgen2 where mcs is.
Fixes an issue on El Capitán where resgen2 isn't necessarily in PATH.
2015-07-14 10:25:09 +02:00
Ludovic Henry 7128196f5c [threadpool-ms] Add tracing 2015-07-13 22:51:27 -03:00
Zoltan Varga 604017a71d [jit] Fix float32 support for the interlocked opcodes. 2015-07-13 15:15:15 -04:00
Marek Safar 8ccfe0f8ff [System] Don't assume WebConnectionStream of unknown http methods require write stream. Fixes #31830 2015-07-13 17:17:28 +02:00
Zoltan Varga 1daadd26c5 [runtime] Add support for portable pdb files without a MODULE table. Fix mono_ppdb_get_seq_points (). 2015-07-12 16:43:05 -04:00
Zoltan Varga 3c7f754d94 [runtime] Update portable pdb support for the latest spec. 2015-07-12 16:42:58 -04:00
Zoltan Varga fa2f8d903d [runtime] Make mono_trace_set_printerr_handler () call g_set_printerr_handler (). Fixes #31451. 2015-07-12 12:38:33 -04:00
Marek Safar f1ffee0453 [mcs] Emit symbol info local variables for compiler generated storey variables. Fixes #31784 2015-07-11 07:47:02 +02:00
Zoltan Varga 31d5a3eaf4 [aot] Emit the got into the bss section on osx too. 2015-07-10 15:17:13 -04:00
Rodrigo Kumpera 2d4f6b3442 [jit] Use a feature macro instead of hardcoding users. 2015-07-10 13:36:45 -04:00
Rodrigo Kumpera 87e9d0314a [arm] Fixed the max length of seq_point. Fixes #31829. 2015-07-10 12:25:29 -04:00
Rodrigo Kumpera 339f080a2a [jit] Disable fast tls on osx if MONO_HAVE_FAST_TLS is not defined. 2015-07-10 12:25:20 -04:00
Rodrigo Kumpera ebd6235cd3 [utils] Disable fast TLS on darwin until we have proper fallbacks in place. 2015-07-10 12:25:13 -04:00
Rodrigo Kumpera ece83305f8 [mini] Add some extra asserts around fast tls to ensure we don't mess up. 2015-07-10 12:25:09 -04:00
Rodrigo Kumpera b7a2903b28 [utils] Don't abort at startup if remote TLS reads is not available.
Remote TLS reads is not a required feature for the runtime to work on
mach systems. We still want it available, but can leave the assertion
to happen when someone actually use it.

Usage won't happen today as part of regular code execution, so moving
the assert will make us more robust.
2015-07-10 12:24:58 -04:00
Rodrigo Kumpera 65c54d2d84 [utils] Add fallback TLS offset scanning to X86 and AMD64. 2015-07-10 12:24:50 -04:00
Craig S. Bosma de99b00081 Add TLS offset for pre-release OS X 10.11 x86, as in #1919 for x64 2015-07-10 12:22:21 -04:00
Craig S. Bosma 679e726432 Add TLS offset for pre-release OS X 10.11 on amd64 2015-07-10 12:21:55 -04:00
Alan McGovern 6d52dee3d4 Bump to get a new build with a new gtk 2015-07-10 17:12:09 +01:00
Zoltan Varga ec55965085 [llvm] Fix the handling of nested clauses. 2015-07-09 15:34:40 -04:00
Zoltan Varga 8a63d50e64 [jit] Fix a regression introduced by ce567f4026. cfg->flags was initialized with a JitFlags value. 2015-07-09 15:34:34 -04:00
Zoltan Varga 6604c8c595 [sdb] Allow boxed vtypes as this when invoking vtype methods. Fixes #30023. 2015-07-08 17:11:21 -04:00
Zoltan Varga 146772f894 [sdb] Allow invoking of valuetype ctors. 2015-07-07 16:33:30 -04:00
Ludovic Henry b956524379 bump referencesource 2015-07-07 13:59:39 -03:00
Alexis Christoforides 82c2ba94d3 [referencesource] Switch to 'mono-4.2.0-pre-branch' instead of 'mono' branch 2015-07-07 17:07:59 +03:00
Zoltan Varga 96df0a76c4 [aot] Fix static linking support when using llvm. 2015-07-06 22:01:56 -04:00
Zoltan Varga 166dca4754 [aot] Mark the data arrays emitted using llvm as constant. 2015-07-06 21:04:17 -04:00
Zoltan Varga 5318b06bda [aot] Handle already gsharedvt methods correctly in add_extra_method_with_depth (). 2015-07-06 21:04:08 -04:00
Zoltan Varga 8c31e362af [gsharedvt] Handle gsharedvt methods correctly in check_method_sharing(). We need to pass mrgctx/vtable arguments for them since at runtime, the specific method called could be a non-gsharedvt method. 2015-07-06 21:04:01 -04:00
Ludovic Henry 59adeedd90 [threadpool-ms] Fix unhandled exception support 2015-07-06 18:27:27 -04:00
Zoltan Varga 74cd6414be Trigger a build. 2015-07-06 14:37:04 -04:00
Zoltan Varga 57e4ed9c5d Bump version to 4.2.0. 2015-07-06 14:30:03 -04:00
Jonathan Pryor 0bf72ac919 [Mono.Posix] Allow building without [Obsolete] Mono.Posix.
For a future Xamarin.Android release, we'd like to include
Mono.Posix.dll for simple Unix interop support.

That said, since Mono.Posix has never been included with
Xamarin.Andorid before, this makes a perfect opportunity to remove
some [Obsolete] cruft within Mono.Posix.dll, namely the types within
the Mono.Posix namespace.

Unfortunately, simply not compiling the types within the Mono.Posix
directory doesn't result in compilable code, due to references to
types within the Mono.Posix namespace by other types, e.g.
Mono.Unix.PeerCred using Mono.Posix.PeerCredData.

Fix things so that the Mono.Posix sources can be omitted, allowing
compilation of an assembly with fewer [Obsolete] types.

This change shrinks the size of Mono.Posix.dll by ~10.5KB.
2015-07-06 14:03:32 -04:00
Marcos Henrich 94e31f159f Merge pull request #1900 from esdrubal/cyclic-ref
[runtime] mono_class_from_name cyclic ref handling
2015-07-06 11:50:16 +01:00
Marcos Henrich a7c3e83d98 Merge pull request #1906 from esdrubal/xbuild-CopyLocal-fix
[xbuild] Fixes copied TargetFramework assemblies.
2015-07-06 11:49:40 +01:00
João Matos f7816d844a Merge pull request #1913 from RavuAlHemio/bug31635
[Mono.Posix] Special-case UTF-32 in PtrToString. Fixes #31635.
2015-07-06 11:10:32 +01:00
Ondřej Hošek 6bfb7e6d14 [Mono.Posix] Special-case UTF-32 in PtrToString. Fixes #31635.
Since UTF32Encoding returns 8 for GetMaxByteCount(1), PtrToString
expects 8 NUL bytes to stop scanning for the end of the string.
Since all the other UTF schemes are special-cased in
GetStringByteLength, do the same for UTF32Encoding.
2015-07-04 02:05:30 +02:00
Rodrigo Kumpera 5d93b2a292 [jit] Add emulation r4 to u8 conversion. Fixes #31582.
Most targets, like arm and amd64 don't support fast float to ulong conversion.
2015-07-03 14:32:04 -04:00
Ludovic Henry f3e35f228c [runtime] Fix cpu usage greater than 100% error
We simply relax the conditions as we do not need a very high precision.
2015-07-02 15:45:40 -03:00
Rodrigo Kumpera 6efe705614 Merge pull request #1907 from alexanderkyte/slow_aot_startup_hash
[runtime] Speed up find_aot_method_in_module
2015-07-02 14:03:15 -04:00
Alexander Kyte 7bb3b98f58 [runtime] Conversion of a printf to string append for performance 2015-07-01 16:33:34 -04:00
Alexander Kyte 3d47daa63d [runtime] Avoid repeated method hashing in find_aot_module 2015-07-01 16:22:35 -04:00
Alexander Kyte e22887717f [runtime/tests] Added a stress test of find_aot_module. 2015-07-01 16:22:28 -04:00
Marcos Henrich 01dcc6c162 [runtime] mono_class_from_name cyclic ref handling
The changes fix stack overflows caused while traversing images with
cyclic references.

Fixes #31396
2015-07-01 17:26:28 +01:00
Marcos Henrich 5b12d9ae37 [xbuild] Fixes copied TargetFramework assemblies.
xbuild was copying TargetFramework assemblies when the builded project
had dependencies in a TargetFramework.

Doing so is not the msbuild behaviour and was causing bugs while
resolving Types at load time.

Fixes #28592 and #31396
2015-07-01 15:49:37 +01:00
454 changed files with 23050 additions and 16741 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.2.0-branch
[submodule "external/reference-assemblies"]
path = external/binary-reference-assemblies
url = git://github.com/mono/reference-assemblies.git
+1
View File
@@ -497,3 +497,4 @@ to do at all), first edit `.gitmodules` to point to the new location, then:
The desired output diff is a change in `.gitmodules` to reflect the
change in the remote URL, and a change in /<submodule> where you see
the desired change in the commit hash.
+16 -12
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.0],
AC_INIT(mono, [4.2.3],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_CONFIG_SRCDIR([README.md])
@@ -3491,10 +3491,11 @@ case "x$libgc" in
;;
esac
AC_ARG_WITH(profile4_5,[ --with-profile4_5=yes,no If you want to install the 4.5 FX (defaults to yes)], [], [with_profile4_5=yes])
AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to build the MonoDroid assemblies (defaults to no)], [], [with_monodroid=no])
AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no If you want to build the Xamarin.iOS assemblies (defaults to no)], [], [with_monotouch=no])
AC_ARG_WITH(xammac, [ --with-xammac=yes,no If you want to build the Xamarin.Mac assemblies (defaults to no)], [], [with_xammac=no])
AC_ARG_WITH(profile4_5, [ --with-profile4_5=yes,no If you want to install the 4.5 FX (defaults to yes)], [], [with_profile4_5=yes])
AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to build the MonoDroid assemblies (defaults to no)], [], [with_monodroid=no])
AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no If you want to build the Xamarin.iOS assemblies (defaults to no)], [], [with_monotouch=no])
AC_ARG_WITH(monotouch_watch, [ --with-monotouch_watch=yes,no If you want to build the Xamarin.WatchOS assemblies (defaults to no)],[], [with_monotouch_watch=no])
AC_ARG_WITH(xammac, [ --with-xammac=yes,no If you want to build the Xamarin.Mac assemblies (defaults to no)], [], [with_xammac=no])
OPROFILE=no
AC_ARG_WITH(oprofile,[ --with-oprofile=no,<oprofile install dir> Enable oprofile support (defaults to no)],[
@@ -3574,6 +3575,7 @@ if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
with_profile4_5=no
with_monodroid=no
with_monotouch=no
with_monotouch_watch=no
with_xammac=no
fi
@@ -3596,6 +3598,7 @@ libmono_ldflags="$libmono_ldflags $LIBS"
AM_CONDITIONAL(INSTALL_4_5, [test "x$with_profile4_5" = xyes])
AM_CONDITIONAL(INSTALL_MONODROID, [test "x$with_monodroid" != "xno"])
AM_CONDITIONAL(INSTALL_MONOTOUCH, [test "x$with_monotouch" != "xno"])
AM_CONDITIONAL(INSTALL_MONOTOUCH_WATCH, [test "x$with_monotouch_watch" != "xno"])
AM_CONDITIONAL(INSTALL_XAMMAC, [test "x$with_xammac" != "xno"])
AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
@@ -4008,13 +4011,14 @@ echo "
LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm)
Libraries:
.NET 4.5: $with_profile4_5
MonoDroid: $with_monodroid
MonoTouch: $with_monotouch
Xamarin.Mac: $with_xammac
JNI support: $jdk_headers_found
libgdiplus: $libgdiplus_msg
zlib: $zlib_msg
.NET 4.5: $with_profile4_5
MonoDroid: $with_monodroid
Xamarin.iOS: $with_monotouch
Xamarin.WatchOS: $with_monotouch_watch
Xamarin.Mac: $with_xammac
JNI support: $jdk_headers_found
libgdiplus: $libgdiplus_msg
zlib: $zlib_msg
$disabled
"
if test x$with_static_mono = xno -a "x$host_win32" != "xyes"; then
+24 -2
View File
@@ -144,7 +144,8 @@ public enum Lock {
AssemblyBindingLock,
MarshalLock,
ClassesLock,
LoaderGlobalDataLock
LoaderGlobalDataLock,
ThreadsLock,
}
public class SimLock
@@ -242,7 +243,24 @@ public class SimLock
}
public override string ToString () {
return String.Format ("{0}", kind);
switch (kind) {
case Lock.LoaderLock:
case Lock.IcallLock:
case Lock.AssemblyBindingLock:
case Lock.MarshalLock:
case Lock.ClassesLock:
case Lock.LoaderGlobalDataLock:
case Lock.ThreadsLock:
return String.Format ("{0}", kind);
case Lock.ImageDataLock:
case Lock.DomainLock:
case Lock.DomainAssembliesLock:
case Lock.DomainJitCodeHashLock:
return String.Format ("{0}[{1}]", kind, id);
default:
return String.Format ("Unknown({0})[{1}]", kind, id);
}
}
}
@@ -311,6 +329,10 @@ public class Trace {
"add_record",
"mono_locks_lock_acquired",
"mono_locks_lock_released",
"mono_threads_lock",
"mono_threads_unlock",
"mono_domain_lock",
"mono_domain_unlock",
};
public Trace (string[] fields) {
+1 -1
+2 -2
View File
@@ -183,11 +183,11 @@ Restrict the compiler to use only the features available in C# 3.0
Restrict the compiler to use only the features available in C# 4.0
specification.
.TP
.I "future"
.I "experimental"
Enables unstable features from upcoming versions of the language.
.PP
Notice that this flag only restricts the language features available to
the programmer. A version of produced assemblies can be controled using
the programmer. A version of produced assemblies can be controlled using
.I SDK
option.
.ne
+6 -1
View File
@@ -992,7 +992,12 @@ where V is the architecture number 4, 5, 6, 7 and the options can be currently b
.TP
\fBMONO_ARM_FORCE_SOFT_FLOAT\fR
When Mono is built with a soft float fallback on ARM and this variable is set to
"1", Mono will always emit soft float code, even if a VFP unit is detected.
"1", Mono will always emit soft float code, even if a VFP unit is
detected.
.TP
\fBMONO_DARWIN_WATCHER_MAXFDS\fR
This is a debugging aid used to force limits on the FileSystemWatcher
implementation in Darwin. There is no limit by default.
.TP
\fBMONO_DISABLE_AIO\fR
If set, tells mono NOT to attempt using native asynchronous I/O services. In
+4
View File
@@ -337,6 +337,10 @@ version
.IP \[bu] 2
\f[I]thread\f[]: thread information
.IP \[bu] 2
\f[I]domain\f[]: app domain information
.IP \[bu] 2
\f[I]context\f[]: remoting context information
.IP \[bu] 2
\f[I]heapshot\f[]: live heap usage at heap shots
.IP \[bu] 2
\f[I]counters\f[]: counters samples
+1 -1
View File
@@ -6,7 +6,7 @@ BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PA
MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
# Use system resgen as we don't want local System.Windows.Forms dependency
RESGEN = resgen2
RESGEN := $(dir $(shell which $(EXTERNAL_MCS)))resgen2
profile-check:
@:
+1 -1
View File
@@ -6,7 +6,7 @@ BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PA
MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
# Use system resgen as we don't want local System.Windows.Forms dependency
RESGEN = resgen2
RESGEN := $(dir $(shell which $(EXTERNAL_MCS)))resgen2
# nuttzing!
+1 -1
View File
@@ -4,7 +4,7 @@ BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PA
MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
# Use system resgen as we don't want local System.Windows.Forms dependency
RESGEN = resgen2
RESGEN := $(dir $(shell which $(EXTERNAL_MCS)))resgen2
profile-check:
@:
-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,120 +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>
</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,55 +0,0 @@
// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility
// Authors:
// Klain Yoni <[email protected]>
//
// (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 GridCheckBox : CheckBox
{
[Bindable (true)]
public string User
{
get { return ViewState["User"] == null ? String.Empty : (string) ViewState["User"]; }
set { ViewState["User"] = value; }
}
[Bindable (true)]
public string Role
{
get { return ViewState["Role"] == null ? String.Empty : (string) ViewState["Role"]; }
set { ViewState["Role"] = 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);
}
}
}
Loaded 100 of 454 files, more files were not shown because too many files have changed in this diff. Show more