Hamburger Hamburger

Heating and Ventilation Control

/HV_Admin_Login

Keine Erläuterungen gefunden.

<?php 
/* published under GPL www.gnu.org/licenses/gpl.html */
function HV_Admin_Login(){
  include_once("HV_config.php");
  include_once("HV_moveGate.php");
    global $debug;
  /* log off */
  if (isset($_POST['logout']) AND $_POST['logout']=="logout"){
    $_SESSION['IamGod']=FALSE;
  }
  /* log in */
  if (isset($_POST['login'])  AND $_POST['login'] =="login" AND $_POST['pwd_tmp']==$adminpwd){
    $_SESSION['IamGod']=TRUE;
  }
  /* if someone tries to steal the login, increase delay */
  if(!isset($_SESSION['IamGod']) OR !$_SESSION['IamGod']){
    if(isset($_SESSION['loginCount'])){
      $_SESSION['loginCount']++;
    }else{
      $_SESSION['loginCount']=1;
    }
    if($_SESSION['loginCount']>0){
      $time=time();
      time_sleep_until($time+$_SESSION['loginCount']);
    }
    if(isset($_GET['mode'])){
      $log="&mode=".$_GET['mode']."&file=".$_GET['file'];
    }else{
      $log="";
    }
    $form = "\n\n <p></p><form class='switches' action='?what2do=menu".$log."' method='POST'>
              <p align='center'>";
    $form.= "<input class='formField' name='pwd_tmp' type='password' size='10' maxlength='10'>
             <input class='formField' name='login' type='submit' value='login'>";
    $form.= "</p></form>";
  }else{
    $_SESSION['loginCount']=0;
    $form = "\n\n <div style='height:80px;'> </div>\n";
    $form.= "<table width='100%'>\n";
    $form.= "<tr><td style='text-align:left; width:50%;'>\n";
    $form.= "<ul style='text-align:left; font-size:xx-large;'>";
    $form.= "<li><a href='index.php?what2do=menu'>Control Panel</a></li>\n";
    $form.= "<li><a href='index.php?what2do=showServiceLog'>Service Intervall</a></li>\n";
    $form.= "<li><a href='index.php?what2do=editParams'>Parameter</a></li>\n";
    $form.= "</ul>\n";
    $form.= "</td><td style='text-align:left;'>\n";
    $form.= HV_gateButton(1);
    $form.= "</td></tr>\n</table>\n";
    $form.= "<div style='text-align:center'>\n";
    $form.= "<form class='switches' action='?what2do=login' method='POST'>\n";
    $form.= "<p><input class='formField' name='pwd_tmp' type='hidden' value='logout'>
             <INPUT class='formField' name='logout' TYPE=submit VALUE='logout'></p>\n";
    $form.= "</form>\n";
    $form.= "</div>\n";
  }


    if($debug){
        echo "<p><aj>HV_Admin_Login( )</aj></p>\n";
    }
  
  return $form;
}
?>

python

1/HvcLightControl.py
2/HvcHCSR04ultrasonic.py
3/HvcPV.py
4/HvcMotorDriver.py
5/HvcRollerShutter.py
6/manGenMqttMap.py
7/HvcReadSPI.py
8/HvcMqtt.py
9/HvcTables.py
10/HvcMain.py
11/HvcSetGPIO.py
12/HvcWifiRelay.py
13/HvcOperationMode.py
14/HvcControl.py
15/HvcRaw2phys.py
16/HvcWeather.py
17/HvcOneWire.py
18/makeDoc.py
19/HvcFronius.py
20/EnergyManager.py
21/HvcSendI2C.py

php

1/HV_colorMap.php
2/HV_Admin_Login.php
3/HV_readOperationState.php
4/HV_setParameters.php
5/HV_config.php
6/EM_handleJSON.php
7/index.php
8/readFilenames.php
9/HV_restart.php
10/HV_moveGate.php
11/HV_showLog.php
12/HV_RollerShutter.php
13/EM_editParameter.php
14/HV_serviceLog.php
15/HV_H2Olevel.php
16/HV_TempCal.php
17/HV_Fronius.php
18/EM_plot.php
19/readNamedData.php
20/HV_composeH2Oplot.php
21/HVdoc.php
22/HV_showWeatherForecast.php
23/HV_showHouse.php

Der gesamte Sourcecode darf gemäß GNU General Public License weiterverbreitet werden.