richtig Abmelden

BusinessServerPages; Erstellung von Webapplikationen.

richtig Abmelden

Postby Ava146 » Thu Oct 16, 2003 9:56 am

Moin moin,

das Thema wurde hier zwar schonmal behandelt, aber die Lösung mit dem Wrapper ist nicht so richtig effektiv.

Problem:
Dieser wrapper wird ordentlich ausgeführt, aber solange noch irgendein Browserfenster offen ist, kommt man ohne Anmeldeschirm in die Applikation. Wie kann ich das erreichen?

Danke im Vorraus

Gruss Aga
Ava146
..
..
 
Posts: 26
Joined: Fri Feb 14, 2003 12:25 pm

Postby Philippa2744 » Thu Oct 16, 2003 10:31 am

Moin,

welches Release?

LoLo
Philippa2744
...
...
 
Posts: 303
Joined: Fri Mar 07, 2003 5:17 pm

Postby Ava146 » Thu Oct 16, 2003 11:06 am

6.20 patch 28
Ava146
..
..
 
Posts: 26
Joined: Fri Feb 14, 2003 12:25 pm

Postby Philippa2744 » Fri Oct 17, 2003 11:36 am

Hab's bei mir nochmal nachgetestet, deswegen hat's mit der Antwort etwas länger gedauert. Ich verwende den Wrapper aus der System (BSP-Application). Wenn Du damit sauber einen Logoff machst, dann wird auch der Browsercache geleert, d.h. wenn Du eine weitere Seite (derselben Browserinstanz!!!) geöffnet hast, kannst Du danach nicht mehr zurück in die Anwendung springen!

Anders sieht es aus, wenn Du zwei Browserinstanzen geöffnet hast (also zweimal z.B. den Internet Explodierer ;-) neu gestartet hast). Dann ist in der Regel ein doppeltes Anmelden notwendig und von daher auch ein doppeltes Abmelden. Ich vermute aber, dass Du diesen Fall nicht meinst.

Wenn es bei Dir nicht klappen sollte, gehe ich davon aus, das die Abmeldung nicht korrekt funktioniert.
Bei mir habe ich die Abmeldung wie folgt realisiert (Log off -Button in jeder BSP).

Code: [Select all] [Expand/Collapse] [Download] (Untitled.txt)
  1.         <td class="headerline"> </td>
  2.             <td class="headertop" nowrap><input type = "button"
  3.                           value         = "LogOff"
  4.                           onClick       = "parent.exitBSPApplication&#40; 'default.htm'&#41;;"/>
  5.             </td>
  6.         <td class="headertop" width="100%"> </td>
  7.  
GeSHi ©


'default.htm' ist bei mir der kopierte 'wrapper', d.h. die Seite 'session_single_frame.htm' aus der System.

LoLo
Philippa2744
...
...
 
Posts: 303
Joined: Fri Mar 07, 2003 5:17 pm

Postby Ava146 » Fri Oct 17, 2003 1:23 pm

hmm, danke für die Antwort!

Ja, ich meine 2 Browser einer Instanz.
Ich benutze auch single_frame als wrapper.
Ich hab dein Knöpfchen mal eingebunden (seite heisst bei mir session.htm)

allerdings bekomme ich einen Javascriptfehler 'Das Objekt unterstützt diese Eigenschaft oder Methode nicht!'

Ich benutze Frames, muss ich da auf was bestimmtes achten?

Gruss Aga
Ava146
..
..
 
Posts: 26
Joined: Fri Feb 14, 2003 12:25 pm

Postby Philippa2744 » Fri Oct 17, 2003 3:15 pm

Hast Du denn Deine BSP-Applikation über Deine Session.html aufgerufen? Das ist dann nämlich die Einstiegsseite, die zuerst aufgerufen wird und einen Verweis hat auf Deine eigentliche Startseite (innerhalb der wrappers musst Du das noch anpassen!). Dann wird die Methode auch unterstützt und das Session-Handling funktioniert.
Das tut es bei Dir nämlich im Moment sicherlich nicht ;-)
Philippa2744
...
...
 
Posts: 303
Joined: Fri Mar 07, 2003 5:17 pm

Postby Ava146 » Mon Oct 20, 2003 10:01 am

Guten Morgen!

Ja, ich rufe die Session.htm als Einstiegsseite auf und dort verweise ich auf meine Index.htm. Er tut auch so, als würde er die Session beenden, wenn ich das Fenster schliesse. Guckst du hier :D :

<%@page language="abap" %>

<% " Copy this page into your BSP application, and change line below.
" This page should always used be as entry point into application.

DATA: target_page TYPE STRING VALUE 'index.htm'.

" Comment: In ie, when the browser is closed, the new popup window is
" still executed, before complete shutdown. This allows us to still close
" the session in the backend. With NN, when the browser is closed, it
" is gone for ever. So no session cleanup. This is feature/bug of one
" browser or the other browser.
%>

<html>

<script language="JavaScript">

function Loader(name)
{
doc=window.frames[name].document;
doc.writeln('<html><body onLoad="JavaScript:document.f.submit();">');
doc.writeln('<form id="f" name="f" target="SAP_BASIS_A" method="POST" action="<%=target_page%>">');
<% DATA: ffs TYPE tihttpnvp, ff TYPE ihttpnvp.
request->get_form_fields( changing fields = ffs ).
DELETE ffs WHERE name cs '~'.
LOOP AT ffs INTO ff.
%>
doc.writeln('<input type="hidden" name="<%=ff-name%>" value="<%=ff-value%>">');
<% ENDLOOP. %>
doc.writeln('<table border="0" width="100%" height="100%"><tr><td align="CENTER" valign="MIDDLE"><span style="font-family:Arial,sans-serif;"><otr>Loading...</otr></span></td></tr></table>');
doc.writeln('</form></body></html>');
doc.close();
<% if runtime->session_manager->is_enabled is not initial. %>
var liBehindFirstDot = location.hostname.indexOf( "." ) + 1;
if ( liBehindFirstDot > 0) document.domain = location.hostname.substr( liBehindFirstDot );
<% endif. %>
}

function exitBSPApplication(newTargetUrl)
{
<% if runtime->session_manager->is_running = 0. %>
<% CLASS cl_bsp_login_application DEFINITION LOAD. %>
var url = "<%=CL_BSP_LOGIN_APPLICATION=>GET_SESSIONEXIT_URL( page = page )%>";
var prop = 'height=100,width=400,top='+(screen.height-100)/2+',left='+(screen.width-400)/2;
var out = window.open(url,'_blank',prop);
<% endif. %>
document.getElementById("SAP_BASIS_FRAMESET").onunload = null;

if(newTargetUrl) window.setTimeout('{document.location.href="'+newTargetUrl+'";}', 750);
}

function frameLoaded(name)
{
}

</script>

<frameset id="SAP_BASIS_FRAMESET" rows="*,0" onUnLoad="exitBSPApplication();" resize="no" framespacing="0" frameborder="0">
<frame name="SAP_BASIS_A" src="JavaScript:parent.Loader('SAP_BASIS_A');" onLoad="JavaScript:frameLoaded('SAP_BASIS_A');" >
<noframes>This browser does not support frames.</noframes>
</frameset>

</html>
Ava146
..
..
 
Posts: 26
Joined: Fri Feb 14, 2003 12:25 pm


Return to BSP + BHTML

Who is online

Users browsing this forum: No registered users and 4 guests