Common stuff for all my devices' web server pages: css, login, log, ipv4, ipv6, firmware update, clock, reset info etc.

Dependents:   oldheating gps motorhome heating

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers web-login.c Source File

web-login.c

00001 
00002 #include "web-pages-base.h"
00003 #include "web-login.h"
00004 #include "http.h"
00005 #include "reset.h"
00006 
00007 int WebLoginOriginalToDo = 0;
00008 
00009 bool WebLoginCookiesContainValidSessionId(char* pCookies)
00010 {
00011     if (!WebLoginSessionIdIsSet()) return false;
00012     
00013     while (pCookies)
00014     {
00015         char* pName;
00016         char* pValue;
00017         pCookies = HttpCookiesSplit(pCookies, &pName, &pValue);
00018         
00019         if (HttpSameStr(pName, WebLoginSessionNameGet())) //HttpSameStr handles NULLs correctly
00020         {
00021             if (HttpSameStr(pValue, WebLoginSessionIdGet())) return true;
00022         }
00023     }
00024     return false;
00025 }
00026 void WebLoginForceNewPassword()
00027 {
00028     WebLoginSessionIdReset();
00029     WebLoginPasswordReset();
00030 }
00031 void WebLoginInit()
00032 {
00033     if (!ResetWasPushButton()) WebLoginPasswordRestore();
00034     WebLoginSessionNameCreate();
00035 }