[Mono-dev] ASP Authorisations

2007-01-11 Thread Piotr Stulinski
Hi

I am still struggling to get ASP Authorisations to work correctly.

Somehow ASP.NET on mono is not checking the lines that are in my
web.config  as below...

location path=secure
system.web
  authorization
allow 
roles=Server_Administrator,Administrator,Auth_Level_0,Auth_Level_1,Auth_Level_2
/
deny users=* /
  /authorization
/system.web
  /location
  location path=admin
system.web
  authorization
allow roles=Server_Administrator,Administrator /
deny users=*,User /
  /authorization
/system.web
  /location

My code works 100% on windows using MS .NET it just refuses to work
correctly on linux under mono...

Is this a known bug, lack of functionality or am i simply doing
something wrong...

I have this on my login routine:

 System.Web.Security.FormsAuthentication.SetAuthCookie(txtName.Text,false);
System.Web.Security.FormsAuthenticationTicket ticket = new
FormsAuthenticationTicket(1,txtName.Text,DateTime.Now,DateTime.Now.AddMinutes(20),true,pvp.GetRoles(txtName.Text)[0],/);


String encryptedTicket = FormsAuthentication.Encrypt(ticket);
HttpCookie authcookie = new
HttpCookie(FormsAuthentication.FormsCookieName,encryptedTicket);
Response.Cookies.Add(authcookie);

And i have the following in my Globals.asax

 if (HttpContext.Current.Request.IsAuthenticated)
{
War3.PvpgnFunctions pvp = new War3.PvpgnFunctions();

HttpContext.Current.User = new
System.Security.Principal.GenericPrincipal(HttpContext.Current.User.Identity,
pvp.GetRoles(HttpContext.Current.User.Identity.Name));

}

Where i add the roles

It works fine on windows, totally run out of ideas on mono.

Regards

PJS
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] ASP.NET bin folder and referenced assemblies

2006-11-30 Thread Piotr Stulinski
Greetings fellow monkeys

I have been stumped with a particular irritating problem for the past
few weeks now.
I have the simplest mono ASP.NET website - it compiles 100% fine and
runs fine on windows... so no program error... i am running mono on my
Ubuntu machine and it just wont work! The program is so simple its
driving me insane..

The Program:

1) a DLL file which i compiled seperately Blah.dll with a simple
public function HelloWorld() which simply returns hello world - this
is in the bin folder

2) a plain webpage with code on it that simple initialises the class
in the above DLL and puts the output onto a label.

The Problem:

When i try run it on my ubuntu box it tells me it cant find the
referenced assembly.

How did i get it onto my linux box:
1) Simply copied it over into my xsp2 web server root via FTP.

What have i tried to date:
1) making sure the dll is executable (+x on unix machines)
2) i thought it might be a capitalistion problem so i copied my Bin - to - bin
3) i even tried to add the assembly into the web.config it wont find
it anywhere.
4) i did a chmod 777 for the entire webroot - just to test if it was a
permission problem.
5) having failed with all of the above, i tried to  start fresh and
copy the .cs file into the App_Code folder and see if mono would
autocompile it for me as i understand 1.2.1 has autocompile
functionality as per vs 2005 - i get exactly the same problem mono
tells me it cant find the dll - the reference library does not exist

I am sure my mono is working as if i write simple ASP.NET code onto
the actual aspx page it works 100%.

I am really new to mono, so maybe i am doing something wrong... i have
a good couple years c# experience any fellow monkey who can shed light
on this - i'll give you a banana.

Peter
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] How to compile using App_Code folder

2006-11-28 Thread Piotr Stulinski
Hi
I am struggling to get my site working with 1.2.1 - App_Code
functionality. I have 3 simple pages.

a Class1.cs in my App_Code folder with literally one method:

public static void HelloWorld()
{

return hello world;

}

a Default.aspx.cs

in the Load method i have


Label1.Text = Class1.HelloWorld();

and finally i have the

Default.aspx page with only

Label1 on it.

I have not changed any of the other Visual Studio 2005 settings extra,
i am not sure if i am supposed to? But when i execute it under the
above scenario i get a error:

Description: Error compiling a resource required to service this
request. Review your source file and modify it to fix this error.
Error message:
/opt/mono_home/code/Default.aspx.cs(15,23) : error CS0103: The name
`Class1' does not exist in the context of `_Default'


File name: /opt/mono_home/code/Default.aspx

Source File: /opt/mono_home/code/Default.aspx.cs

Line 1: No assembly returned after compilation!?

I am very new to compiling under mono. What i do know is that it works
100% if i dont use the Class1.cs file. So for example if i go

Lavel1.Text = Hello World;

that does work...

Any help or a mini tutorial or something on compiling would be great
doesnt seem to be much info around.

Thanks

Peter
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] App_Code folder

2006-09-11 Thread Piotr Stulinski
ASP.NET 2.0 App_Code compilation

I have looked all over the internet for help regarding ASP.NET 2.0 under monoand the App_Code folder. Alsoposted on gotmono forums butno reply.It seems that this code is completely ignored when executing a web page under mono? Has this not yet been implemented or is there something specific which needs to be done in order for this to execute correctly?


Thanks

Peter
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list