Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Security (http://www.velocityreviews.com/forums/f62-asp-net-security.html)
-   -   Attempt at creating the infamous WEB LOGOFF button... (http://www.velocityreviews.com/forums/t765248-attempt-at-creating-the-infamous-web-logoff-button.html)

dsl 10-19-2003 01:37 AM

Attempt at creating the infamous WEB LOGOFF button...
 
I'm a newbie (at this stuff anyway) - working with WIN2K server and
Sharepoint Team Services, working at creating an intranet... and looking for
a way to allow users to "log off" via a log off button for shared use of
individual computers throughout the day...

In browsing through various web resources, I came across an article for
creating a "browser.ocx" file, and using it with a little code to create the
log off effect.

Well, I created the .OCX per the instructions, registered it with regsrv32,
added the test1.htm page to the root of my web, and tested it.

I got the logoff button to appear ;-) ...(hey I'll take what I can
get...)... but the report of errors on the page. Before hitting the button,
an error:

"Automation server can't create object"

....and after hitting the button,

"'obj1' is null or not an object"

Any thoughts on this? For the sake of having any chance to answer this, I'm
splicing in the guts of the post I used below.
I currently have the web set for basic authentication, NO anonymous access,
but originally had it set with both basic AND windows authentication. Still
not sure where I'm going with that yet.

Any thoughts greatly appreciated...


Original message:
=========================================

From: "Joseph Geretz" <jgeretz@nospam.com>
Date: Sun, 9 Mar 2003 23:29:13 -0500

Hi Luc,

Thanks for the tip.

> http://support.microsoft.com/default...;en-us;q195192
>
> (clients have to download OCX, though...)


This actually works. It's not even that big a deal to code.

--------------
Option Explicit

Const END_BROWSER_SESSION = 42

Private Declare Function InternetSetOption Lib "wininet.dll" _
Alias "InternetSetOptionA" _
(ByVal hInternet As Long, _
ByVal lOption As Long, _
ByRef sBuffer As Any, _
ByVal lBufferLength As Long) _
As Integer

Public Function FlushCredentials() As Integer

FlushCredentials = InternetSetOption(0, END_BROWSER_SESSION, 0, 0)

End Function

--------------
<script language=javascript>
<!--
var logoff = new ActiveXObject("browser.logoff");
var x = logoff.FlushCredentials();
//-->
</script>
--------------

However, I'm not thrilled about having to rely on a client hosted ActiveX.
Is it possible to do this by working directly with the browser DOM via
javascript?

Thanks,

- Joe Geretz -

Next message: [MSFT]Allen: "RE: running app under custom account"
Previous message: Mike Bourne: "128 Bit encrytin problem with ASP.NET (VB)"
In reply to: Luc Kumps: "Re: How to provide Log Off for a Web Application?"
Next in thread: Luc Kumps: "Re: How to provide Log Off for a Web
Application?"




All times are GMT. The time now is 12:06 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.