Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #7

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,11 @@ docs/build
userSettings.json
do_not_run_brewpi
config_user.php
.idea/*
.idea/*

#############
## database
#############
phpmyadmin
include/membersite_config.php

35 changes: 35 additions & 0 deletions admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/* Copyright 2013 BrewPi/Julien Mottin.
* This file is part of BrewPi.

* BrewPi is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.

* BrewPi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

* You should have received a copy of the GNU General Public License
* along with BrewPi. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>Brewpi Login admin</title>
<link rel="STYLESHEET" type="text/css" href="css/fg_membersite.css">
</head>
<body>
<p>Please follow one of the following links to handle your session to Brewpi :
<ul>
<li>Create a new account : <a href="register.php">register</a></li>
<li>Confirm registration : <a href="confirmreg.php">confirm</a></li>
<li>Terminate session : <a href="logout.php">log out</a></li>
<li>Go back to <a href="./">BrewPi</a></li>
</ul>
</p>
</body>
49 changes: 36 additions & 13 deletions beer-panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,57 @@
*/
?>

<?php
require_once("./include/membersite_config.php");
?>

<div id="top-bar" class="ui-widget ui-widget-header ui-corner-all">
<div id="lcd" class="lcddisplay"><span class="lcd-text">
<span class="lcd-line" id="lcd-line-0">Live LCD waiting</span>
<span class="lcd-line" id="lcd-line-1">for update from</span>
<span class="lcd-line" id="lcd-line-2">script...</span>
<span class="lcd-line" id="lcd-line-3"></span>
<div id="lcd" class="lcddisplay">
<span class="lcd-text">
<span class="lcd-line" id="lcd-line-0">Live LCD waiting</span>
<span class="lcd-line" id="lcd-line-1">for update from</span>
<span class="lcd-line" id="lcd-line-2">script...</span>
<span class="lcd-line" id="lcd-line-3"></span>
</span>
</div>
<div id="logo-container">
<img src="brewpi_logo.png">
<div id=beer-name-container>
<span>Fermenting: </span><a href='#' id="beer-name"><?php echo $beerName;?></a>
<span>Fermenting: </span>
<?php
if($fgmembersite->CheckLogin()) {
echo '<a href="#" id="beer-name">' . $beerName . '</a>';
}
else {
echo $beerName;
}
?>
<span class="data-logging-state"></span>
</div>
</div>
<button class="script-status ui-state-error"></button>
<button id="maintenance" class="ui-state-default">Maintenance panel</button>
<!-- Login HACK : only display login button instead of admin buttons when not logged in -->
<?php
if(!$fgmembersite->CheckLogin())
{
echo '<button id="login">Log in</button>';
}
else {
echo '<button class="script-status ui-state-error"></button>';
echo '<button id="maintenance" class="ui-state-default">Maintenance panel</button>';
}
?>
</div>
<div class="chart-container">
<div id="curr-beer-chart-label" class="beer-chart-label"></div>
<div id="curr-beer-chart" class="beer-chart" style="width:900px; height:390px"></div>
<div id="curr-beer-chart-controls" class="beer-chart-controls" style="display: none">
<button class="refresh-curr-beer-chart"></button>
<button class="chart-help"></button>
<button class="toggle beerTemp" title="Beer temperature" onClick="toggleLine(this)">
<button class="toggle beerSet" title="Beer setting" onClick="toggleLine(this)">
<button class="toggle fridgeTemp" title="Fridge temperature" onClick="toggleLine(this)">
<button class="toggle fridgeSet inactive" title="Fridge setting" onClick="toggleLine(this)">
<button class="toggle roomTemp inactive" title="Room temperature" onClick="toggleLine(this)">
<button class="toggle beerTemp" title="Beer temperature" onClick="toggleLine(this)"></button>
<button class="toggle beerSet" title="Beer setting" onClick="toggleLine(this)"></button>
<button class="toggle fridgeTemp" title="Fridge temperature" onClick="toggleLine(this)"></button>
<button class="toggle fridgeSet inactive" title="Fridge setting" onClick="toggleLine(this)"></button>
<button class="toggle roomTemp inactive" title="Room temperature" onClick="toggleLine(this)"></button>
<button class="toggleAnnotations" title="Annotations" onClick="toggleAnnotations(this)">A</button>
</div>
</div>
Expand Down
62 changes: 62 additions & 0 deletions confirmreg.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?PHP
require_once("./include/membersite_config.php");

if(isset($_GET['code']))
{
if($fgmembersite->ConfirmUser())
{
$fgmembersite->RedirectToURL("thank-you-regd.html");
}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>Confirm registration</title>
<link rel="STYLESHEET" type="text/css" href="css/fg_membersite.css" />
<script type='text/javascript' src='js/gen_validatorv31.js'></script>
</head>
<body>

<h2>Confirm registration</h2>
<p>
Please enter the confirmation code in the box below
</p>

<!-- Form Code Start -->
<div id='fg_membersite'>
<form id='confirm' action='<?php echo $fgmembersite->GetSelfScript(); ?>' method='get' accept-charset='UTF-8'>
<div class='short_explanation'>* required fields</div>
<div><span class='error'><?php echo $fgmembersite->GetErrorMessage(); ?></span></div>
<div class='container'>
<label for='code' >Confirmation Code:* </label><br/>
<input type='text' name='code' id='code' maxlength="50" /><br/>
<span id='register_code_errorloc' class='error'></span>
</div>
<div class='container'>
<input type='submit' name='Submit' value='Submit' />
</div>

</form>
<!-- client-side Form Validations:
Uses the excellent form validation script from JavaScript-coder.com-->

<script type='text/javascript'>
// <![CDATA[

var frmvalidator = new Validator("confirm");
frmvalidator.EnableOnPageErrorDisplay();
frmvalidator.EnableMsgsTogether();
frmvalidator.addValidation("code","req","Please enter the confirmation code");

// ]]>
</script>
</div>
<!--
Form Code End (see html-form-guide.com for more info.)
-->

</body>
</html>
18 changes: 13 additions & 5 deletions control-panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
<li><a href="#beer-constant-control"><span>Beer constant</span></a></li>
<li><a href="#fridge-constant-control"><span>Fridge constant</span></a></li>
<li><a href="#temp-control-off"><span>Off</span></a></li>
<button id="apply-settings">Apply</button>
<?php
if($fgmembersite->CheckLogin()) {
echo '<button id="apply-settings">Apply</button>';
}
?>
<div id="status-message" class="ui-state-error ui-corner-all">
<p>
<span id="icon" class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
Expand All @@ -36,10 +40,14 @@
</ul>
<div id="profile-control">
<div id="controls">
<button id="load-controls">Open</button>
<button id="new-controls">New</button>
<button id="edit-controls">Edit</button>
<button id="saveas-controls">Save As</button>
<?php
if($fgmembersite->CheckLogin()) {
echo '<button id="load-controls">Open</button>';
echo '<button id="new-controls">New</button>';
echo '<button id="edit-controls">Edit</button>';
echo '<button id="saveas-controls">Save As</button>';
}
?>
<button id="refresh-controls">Refresh</button>
<button id="help-profile" class="profile-help">Help</button>
</div>
Expand Down
166 changes: 166 additions & 0 deletions css/fg_membersite.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
/*
Registration/Login Form by html-form-guide.com
You can customize all the aspects of the form in this style sheet
*/

#fg_membersite fieldset
{
width: 230px;
padding:20px;
border:1px solid #ccc;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
-khtml-border-radius: 10px;
border-radius: 10px;
}

#fg_membersite legend, #fg_membersite h2
{
font-family : Arial, sans-serif;
font-size: 1.3em;
font-weight:bold;
color:#333;
}

#fg_membersite label
{
font-family : Arial, sans-serif;
font-size:0.8em;
font-weight: bold;
}

#fg_membersite input[type="text"],#fg_membersite textarea,
#fg_membersite input[type="password"]
{
font-family : Arial, Verdana, sans-serif;
font-size: 0.8em;
line-height:140%;
color : #000;
padding : 3px;
border : 1px solid #999;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-khtml-border-radius: 5px;
border-radius: 5px;

}

#fg_membersite input[type="text"],
#fg_membersite input[type="password"]
{
height:18px;
width:220px;
}

#fg_membersite #scaptcha
{
width:60px;
height:18px;
}

#fg_membersite input[type="submit"]
{
width:100px;
height:30px;
padding-left:0px;
}

#fg_membersite textarea
{
height:120px;
width:310px;
}

#fg_membersite input[type="text"]:focus,
#fg_membersite textarea:focus
{
color : #009;
border : 1px solid #990000;
background-color : #ffff99;
font-weight:bold;
}

#fg_membersite .container
{
margin-top:8px;
margin-bottom: 10px;
}

#fg_membersite .error
{
font-family: Verdana, Arial, sans-serif;
font-size: 0.7em;
color: #900;
background-color : #ffff00;
}

#fg_membersite #register_password_errorloc
{
clear:both;
}

#fg_membersite fieldset#antispam
{
padding:2px;
border-top:1px solid #EEE;
border-left:0;
border-right:0;
border-bottom:0;
width:350px;
}

#fg_membersite fieldset#antispam legend
{
font-family : Arial, sans-serif;
font-size: 0.8em;
font-weight:bold;
color:#333;
}

#fg_membersite .short_explanation
{
font-family : Arial, sans-serif;
font-size: 0.6em;
color:#333;
}

/* spam_trap: This input is hidden. This is here to trick the spam bots*/
#fg_membersite .spmhidip
{
display:none;
width:10px;
height:3px;
}
#fg_membersite #fg_crdiv
{
font-family : Arial, sans-serif;
font-size: 0.3em;
opacity: .2;
-moz-opacity: .2;
filter: alpha(opacity=20);
}
#fg_membersite #fg_crdiv p
{
display:none;
}

#fg_membersite_content li
{
font-family : Arial, sans-serif;
padding-top:10px;
padding-bottom:10px;
}
#fg_membersite_content
{
font-family : Arial, sans-serif;
font-size: 0.9em;
line-height: 150%
}

#fg_membersite_content h2
{
font-family : Arial, sans-serif;
font-size: 1.5em;
font-weight:bold;
color:#333;
}
Loading