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-query.c Source File

web-login-query.c

00001 
00002 #include "http.h"
00003 #include "web-pages-base.h"
00004 #include "web-login.h"
00005 
00006 bool WebLoginQueryPasswordOk = false;
00007 
00008 void WebLoginQuery(char* pQuery)
00009 {
00010     WebLoginQueryPasswordOk = false;
00011     
00012     while (pQuery)
00013     {
00014         char* pName;
00015         char* pValue;
00016         pQuery = HttpQuerySplit(pQuery, &pName, &pValue);
00017         
00018         int value = HttpQueryValueAsInt(pValue);
00019         if (HttpSameStr(pName, "todo"     )) WebLoginOriginalToDo = value;
00020         
00021         HttpQueryUnencode(pValue);
00022         if (HttpSameStr(pName, "password" ))
00023         {
00024             if (!WebLoginPasswordIsSet()) //This is if there has been a normal reset: not a fault nor a power on.
00025             {
00026                 WebLoginPasswordSet(pValue);
00027                 WebLoginQueryPasswordOk = true;
00028             }
00029             else
00030             {
00031                 WebLoginQueryPasswordOk = WebLoginPasswordMatches(pValue);
00032             }
00033         }
00034     }
00035 }