Ewon TechForum
Providing technical solutions to technical requests


Logout for firmware 13
AngelaT Offline
Ewon Distributor
#1
Hi everyone,

I have a custom homepage on my Flexy.  The page includes a link to the Flexy's internal interface and a link to logout.  Now that firmware 13.0 is out, I need to change those links.

Changing the link to the internal interface is easy - we go to /index.shtm now instead of /index.htm.  However, I haven't figured out the logout yet.  Before firmware 13, the link could just load /Ast/LoggedOffAst.shtm   What's the trick to log off from a custom webpage in firmware 13.0?

Thanks,
Angela
Reply

simon Offline
eWON Support
#2
Angela,

Try this script (that uses the viewon Tag "TimeCounter").
You have to paste it in a Javascript section - interval 1000 ms


Code:
var timeout = getViewOnTagVal('TimeCounter');
timeout += 1;

if ( timeout > 5 && typeof flag == 'undefined') //5 seconds timeout
{
    flag = true;
   
    if (!document.execCommand('ClearAuthenticationCache',true)) // Trident-based browsers check only (IE, Edge)
    {      
       var d = '111111111111',
       hostParts = window.location.href.split('/');
       url = hostParts[0] + '//'+d+':'+d+'@';

       if (window.location.href.indexOf("m2web.talk2m.com") > -1)      
         url += hostParts[2]  + '/' + hostParts[3]  + '/' +  hostParts[4]  +'/Ast/MainAst.shtm?nocache='+(new Date().getTime());
       else
         url += hostParts[2]  + '/Ast/MainAst.shtm?nocache='+(new Date().getTime());

       $.ajax(
       {
            type: "get",
            url: url,
            timeout: 15000,
            error: function(jqXHR, status)
            {
                 window.location.href = '../../usr/login.html';
            },
            // should not occur
            success: function(jqXHR, status)
            {
                 window.location.href = '../../usr/login.html';
            }
         });
    }
    else
    {
         window.location.href = '../../usr/login.html';
    }
   
}
else
{
    setViewOnTagVal('TimeCounter', timeout);
}


function get_hostname(url) {
   var m = url.match(/^http:\/\/[^/]+/);
   return m ? m[0] : null;
}
Reply

AngelaT Offline
Ewon Distributor
#3
Thanks, Simon! I replaced '../../usr/login.html' with my custom home page and it worked like a charm.
Reply

insyncs Offline
Member
#4
Hi,

This isnt working for me, FW 14.0 in development

"../../usr/login.html"

i just want to force a logout from my viewon project and re-direct to "../../usr/viewon/Home.shtm"

Any ideas?  Cheers M
Reply

simon Offline
eWON Support
#5
Hi,

Have you tried to replace "../../usr/login.html" by your page "Home.shtm" ?

Simon
Reply

insyncs Offline
Member
#6
Like ../../usr/viewon/Home.shtm?

it takes me to the project home page, but it doesn't log me out?
Reply

simon Offline
eWON Support
#7
Hi,

Have you unchecked the option "Enable User page security" in the Ewon ? This one must be remain checked to make that working...

Simon
Reply

LewisH304 Offline
Junior Member
#8
(10-05-2018, 08:55 PM)AngelaT Wrote: Hi everyone,

I have a custom homepage on my Flexy.  The page includes a link to the Flexy's internal interface and a link to logout.  Now that firmware 13.0 is out, I need to change those links.

Changing the link to the internal interface is easy - we go to /index.shtm now instead of /index.htm.  However, I haven't figured out the logout yet.  Before firmware 13, the link could just load /Ast/LoggedOffAst.shtm   What's the trick to log off from a custom webpage in firmware 13.0?

Thanks,
Angela
Have the same issue. Just one user can log (recreated or new ones can’t)
In logs got:
11/13 19:16:34  MBW daemon.notice afpd[9836]: AFP statistics: 0.95 KB read, 0.82 KB written
11/13 19:16:34  MBW daemon.notice afpd[9836]: afp_over_dsi: client logged out, terminating DSI session
11/13 19:16:34  MBW daemon.err afpd[9836]: dsi_stream_read: len:0, unexpected EOF
11/13 19:16:34  MBW daemon.notice afpd[9836]: AFP logout by user
11/13 19:16:34  MBW daemon.notice afpd[9836]: AFP3.3 Login by user

So it looks like user is being automagically logout just after login.
(Mac 10.7.2 & 10.6.8; MBW II (white) 01.02.12; over WiFi)

Regards,
Lewis
Reply

simon Offline
eWON Support
#9
Lewis,

I don't understand. Where these logs come from ?
Could you give me more details on what you are doing ?

Simon
Reply



Possibly Related Threads…
12-06-2019, 02:08 PM
Last Post: valentin.joigneau
05-09-2017, 06:18 PM
Last Post: AngelaT



Users browsing this thread:
1 Guest(s)



Theme © Ewon 2019 - Forum software by © MyBB - Cookie policy