mirror of
https://github.com/Doodle3D/doodle3d-connect.git
synced 2024-12-25 01:53:48 +01:00
Reorganised files
Moved files meant for release to www folder Removed old files
This commit is contained in:
parent
101100f7e5
commit
7512b680b6
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,2 +1,6 @@
|
||||
|
||||
credentials.php
|
||||
.*
|
||||
**/.*/**
|
||||
!/.gitignore
|
||||
www/js/*.js
|
||||
www/css/*.css
|
||||
|
180
less/add2home.css
Normal file
180
less/add2home.css
Normal file
@ -0,0 +1,180 @@
|
||||
/**
|
||||
*
|
||||
* Main container
|
||||
*
|
||||
*/
|
||||
#addToHomeScreen {
|
||||
z-index:9999;
|
||||
-webkit-user-select:none;
|
||||
user-select:none;
|
||||
-webkit-box-sizing:border-box;
|
||||
box-sizing:border-box;
|
||||
-webkit-touch-callout:none;
|
||||
touch-callout:none;
|
||||
width:240px;
|
||||
font-size:15px;
|
||||
padding:12px 14px;
|
||||
text-align:left;
|
||||
font-family:helvetica;
|
||||
background-image:-webkit-gradient(linear,0 0,0 100%,color-stop(0,#fff),color-stop(0.02,#eee),color-stop(0.98,#ccc),color-stop(1,#a3a3a3));
|
||||
border:1px solid #505050;
|
||||
-webkit-border-radius:8px;
|
||||
-webkit-background-clip:padding-box;
|
||||
color:#333;
|
||||
text-shadow:0 1px 0 rgba(255,255,255,0.75);
|
||||
line-height:130%;
|
||||
-webkit-box-shadow:0 0 4px rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
#addToHomeScreen.addToHomeIOS7 {
|
||||
background:#f2f2f2 !important;
|
||||
-webkit-border-radius:1px !important;
|
||||
border:1px solid #ccc;
|
||||
-webkit-box-shadow:0 0 4px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
#addToHomeScreen.addToHomeIpad {
|
||||
width:268px;
|
||||
font-size:18px;
|
||||
padding:14px;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* The 'wide' class is added when the popup contains the touch icon
|
||||
*
|
||||
*/
|
||||
#addToHomeScreen.addToHomeWide {
|
||||
width:296px;
|
||||
}
|
||||
|
||||
#addToHomeScreen.addToHomeIpad.addToHomeWide {
|
||||
width:320px;
|
||||
font-size:18px;
|
||||
padding:14px;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* The balloon arrow
|
||||
*
|
||||
*/
|
||||
#addToHomeScreen .addToHomeArrow {
|
||||
position:absolute;
|
||||
background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(0,rgba(204,204,204,0)),color-stop(0.4,rgba(204,204,204,0)),color-stop(0.4,#ccc));
|
||||
border-width:0 1px 1px 0;
|
||||
border-style:solid;
|
||||
border-color:#505050;
|
||||
width:16px; height:16px;
|
||||
-webkit-transform:rotateZ(45deg);
|
||||
bottom:-9px;
|
||||
left:50%;
|
||||
margin-left:-8px;
|
||||
-webkit-box-shadow:inset -1px -1px 0 #a9a9a9;
|
||||
-webkit-border-bottom-right-radius:2px;
|
||||
}
|
||||
|
||||
#addToHomeScreen.addToHomeIOS7 .addToHomeArrow {
|
||||
background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(0,rgba(204,204,204,0)),color-stop(0.4,rgba(204,204,204,0)),color-stop(0.4,#f2f2f2)) !important;
|
||||
-webkit-box-shadow:inset -1px -1px 0 #fff !important;
|
||||
border-color:#ccc !important;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* The balloon arrow for iPad
|
||||
*
|
||||
*/
|
||||
#addToHomeScreen.addToHomeIpad .addToHomeArrow {
|
||||
-webkit-transform:rotateZ(-135deg);
|
||||
background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(0,rgba(238,238,238,0)),color-stop(0.4,rgba(238,238,238,0)),color-stop(0.4,#eee));
|
||||
-webkit-box-shadow:inset -1px -1px 0 #fff;
|
||||
top:-9px; bottom:auto; left:50%;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Close button
|
||||
*
|
||||
*/
|
||||
#addToHomeScreen .addToHomeClose {
|
||||
-webkit-box-sizing:border-box;
|
||||
position:absolute;
|
||||
right:4px;
|
||||
top:4px;
|
||||
width:18px;
|
||||
height:18px; line-height:14px;
|
||||
text-align:center;
|
||||
text-indent:1px;
|
||||
-webkit-border-radius:9px;
|
||||
background:rgba(0,0,0,0.12);
|
||||
color:#888;
|
||||
-webkit-box-shadow:0 1px 0 #fff;
|
||||
font-size:16px;
|
||||
}
|
||||
|
||||
#addToHomeScreen.addToHomeIOS7 .addToHomeClose {
|
||||
line-height:12px;
|
||||
padding-right:1px;
|
||||
background:transparent;
|
||||
border: 1px solid #888;
|
||||
-webkit-box-shadow:none;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* The '+' icon, displayed only on iOS < 4.2
|
||||
*
|
||||
*/
|
||||
#addToHomeScreen .addToHomePlus {
|
||||
font-weight:bold;
|
||||
font-size:1.3em;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* The 'share' icon, displayed only on iOS >= 4.2
|
||||
*
|
||||
*/
|
||||
#addToHomeScreen .addToHomeShare {
|
||||
display:inline-block;
|
||||
width:18px;
|
||||
height:15px;
|
||||
background-repeat:no-repeat;
|
||||
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAeCAQAAADu6HTYAAADPElEQVR4Xq3TX2gcRRzA8e/M7mVv2+TSNpc/TZtrY6jUGqgaSAmEChKLrYK0YH0RFC2CSCkEfCghiKU04J8qNigq6os+iQV98MHWFwVBrQQRWs21lBw5cw3NNb1/udu72RGG5Y77IzXW77D7sAwf5scyYoL6BGXSDKFZwaGpLvIUaeoCkvX1MmsM0Ny6oRSQYOLuIS+YZOpfQdqslpUxcZrzTVAz4qPwW2O3CeIwC/RSzeY6Ow1QhUrkr+YOWfEKDkEP8Rij7CHKJmrFSDHBdwGEE5wiGChPN+PnT8VdRtEIl1d4gRj/1EVe5ZSBKGh8iqQpo/Fo5+3C/gz0MYg4zgwbqday1/Q4B8BGQ45d/Hi54lakCrU5obOcidJpu1+Lg9whjabyaOYLnrIBFFaRD+xe2ybMDWY66GmP/WA9cGfGp0CWhy0wkMN8inepFiH2rV1j0NQSNQbFLRQnS8/8YSDBBpadfv4CYDub2fmeHDNAsL1MBWUel0iA+Xik6eHcyvD3vAMSU1TGuA/YRS+dD7ovCQN43GKRFCU20Kd3V/avDVVyAZ5niTEuLA5/zBGWg9EEEhfJKN200Tat8CmRAQb9+wv7soPlHt2tQorsz1uPbr0HTY4sJwrH47zJZwABBAKLMBoQXepwgTwdHCo+fXMkQ4lrxEmQ5AaXipPqDY9V2vn09tgvTPI71EEGYxM+/uMJLJ4svpgaWGKOi/xKgmqLSUGSUd5f2vIVJ/CgBaTIUsZ7ZBsn0+NzfMOXLFCXQyTcybN6ep5ZZgUOHn7jpfUpsZshdugPGf+E5zjbyHTSRyQ8xfRPPM/s63RHeuknSoT22mjmmnAOIMkUZ6D1xSfPPAfd1WFKM3sO2CMaHx8M1NjnXKHaAGGkOW0C02WeYHUz4qMtx+w5gUDS8NckYe5lHsMYwCZEPyEEmjLDZFmAS7CDviMdxyTkMNVBKEmYLvbiQQBIBBbCQG04bGQvFWz6CfsCQLWCigILFwcfkGYBiOpbYuOizTAyYyDdCtrGaRG1LCkIgMYEFhI0WqQZoSlbGRyHKe4qOx7iv2bVQW9dp4dlM/x6kmwnWQcd/Q3FCqwTEiT5s+6D5v/pb0SSHyg7uhMWAAAAAElFTkSuQmCC);
|
||||
background-size:18px 15px;
|
||||
text-indent:-9999em;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
#addToHomeScreen.addToHomeIOS7 .addToHomeShare {
|
||||
width:11px;
|
||||
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAA8CAYAAAAQTCjdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAASCQAAEgkB80sG3AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAKjSURBVGiB7dpPiFVVHMDxz7m9NCtMyI2bEJEC25WrEkzHUXCRraIwdNE8ZxfYIlcis1ZEbGEzT1QCF4XgH1CyWhUoJKIWNRGEiCNKmkSiYTzfcfGuOokx77x3ZlS8382959zfn+/invvn3RdijHIRBrwkOINCYXEcdjpb7VyiYdBsLScwt5y6IloYdzqXo36Ro0gY9IKWo+5JwmzBt2HQnBw9ehYNazyn5TBee8Dh+Vq+CWu92GufnkTDR6ab7gDeBNHouMM/l9tXTXM0fGBmL726Fg1Dam74EsvKqR8VNowL2Yzj5f7rnnE4DHq2235diYYhhTGfC94up35T0y+6di/ITU0rKVd+sEi0P7xr2pSJOu8zvF+OzqEv7vDH/WFxt7/cshy/ticsN8sXYUht0kXDOlsF9XJ4UaEvNoz9X3zc5bKaZThbyr5jzJ4wlNY7KTgM+ES0vhz+KeiPw36fKC/ucAF9uFBOrTZm26SJCtaV27+xIo7cXdkTEhvOoh+XyxprU1qnim7CQdGK2HAyKRexYVShT3RItDElN+mkjiP2Ym+S3f01hv2EVal5WW6hU0ElmptaqJuBpXg6MbeFH2LDpU6CQ93zWIKnEvs0cayGU3glMfkOo1jQYewZzOuyz7FC95Jwo5OgUFfgeg993hh/eTqCTxOSm/iuk8DY0Ap1b2GhtHXxsfZN4j/X0fOx4auEIknEhqv4OiUn1L13Z/+xWfWVaG4q0dxUormpRHNTieamEs1NJZqbJ1Q0jHvdiJo5S2cVjSNOCHZhn3/SnuYnIvl3yomIIz7MXZMn9hydRCrR3FSiualEc1OJ5qYSzU0lmptKNDePjWgwcPePT7/g+4cp8wCW4GXaryK3tL+mLdD5x62ppllgu7bso8q/2HIbzGWdNmWnSJwAAAAASUVORK5CYII=);
|
||||
background-size:11px 15px;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* The touch icon (if available)
|
||||
*
|
||||
*/
|
||||
#addToHomeScreen .addToHomeTouchIcon {
|
||||
display:block;
|
||||
float:left;
|
||||
-webkit-border-radius:6px;
|
||||
border-radius:6px;
|
||||
-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.5),
|
||||
inset 0 0 2px rgba(255,255,255,0.9);
|
||||
box-shadow:0 1px 3px rgba(0,0,0,0.5),
|
||||
inset 0 0 2px rgba(255,255,255,0.9);
|
||||
background-repeat:no-repeat;
|
||||
width:57px; height:57px;
|
||||
-webkit-background-size:57px 57px;
|
||||
background-size:57px 57px;
|
||||
margin:0 12px 0 0;
|
||||
border:1px solid #333;
|
||||
-webkit-background-clip:padding-box;
|
||||
background-clip:padding-box;
|
||||
}
|
20
www/api/connect.php
Normal file
20
www/api/connect.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header("Content-type: application/json");
|
||||
|
||||
require 'credentials.php';
|
||||
|
||||
$database = "doodle3d_com_connect";
|
||||
$dsn = "mysql:host=doodle1.sql.greenhost.nl;dbname=$database";
|
||||
$table = "signins";
|
||||
|
||||
try {
|
||||
$db = new PDO($dsn, $username, $password);
|
||||
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch (PDOException $e) {
|
||||
$response = array( "status" => "error",
|
||||
"msg" => $e->getMessage()." (".$e->getCode().")");
|
||||
exit(json_encode($response)."\r\n");
|
||||
}
|
||||
?>
|
24
www/api/create_table.php
Normal file
24
www/api/create_table.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require 'connect.php';
|
||||
|
||||
try {
|
||||
// exported structure using phpMyAdmin
|
||||
$createsql = $db->prepare("CREATE TABLE IF NOT EXISTS $table (" .
|
||||
"`id` varchar(31) NOT NULL," .
|
||||
"`remoteip` varchar(15) NOT NULL," .
|
||||
"`localip` varchar(15) NOT NULL," .
|
||||
"`wifiboxid` varchar(140) NOT NULL," .
|
||||
"`hidden` tinyint(1) NOT NULL DEFAULT '0'," .
|
||||
"`date` datetime NOT NULL," .
|
||||
"PRIMARY KEY (`id`)" .
|
||||
") ENGINE=InnoDB DEFAULT CHARSET=latin1;");
|
||||
|
||||
if($createsql->execute() == TRUE)
|
||||
echo "$table created";
|
||||
} catch (PDOException $e) {
|
||||
$response = array( "status" => "error",
|
||||
"msg" => $e->getMessage()." (".$e->getCode().")");
|
||||
exit(json_encode($response)."\r\n");
|
||||
}
|
||||
?>
|
21
www/api/list.example
Normal file
21
www/api/list.example
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"status":"success",
|
||||
"data":[
|
||||
{
|
||||
"id":"62.216.8.197\/10.0.0.18",
|
||||
"remoteip":"62.216.8.197",
|
||||
"localip":"10.0.0.18",
|
||||
"wifiboxid":"Albert",
|
||||
"hidden":"0",
|
||||
"date":"2013-10-03 17:24:33",
|
||||
},
|
||||
{
|
||||
"id":"62.216.8.197\/10.0.0.29",
|
||||
"remoteip":"62.216.8.197",
|
||||
"localip":"10.0.0.29",
|
||||
"wifiboxid":"Wilbert",
|
||||
"hidden":"0",
|
||||
"date":"2013-10-03 17:52:19"
|
||||
}
|
||||
],
|
||||
}
|
21
www/api/list.php
Normal file
21
www/api/list.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
require 'connect.php';
|
||||
|
||||
$hourago = time() - 60*60;
|
||||
$remoteip = getenv('REMOTE_ADDR');
|
||||
|
||||
try {
|
||||
$statement = $db->prepare("SELECT * FROM $table where date >= FROM_UNIXTIME(:hourago) AND remoteip = :remoteip");
|
||||
$statement->execute(array( ':hourago' => $hourago,
|
||||
':remoteip' => $remoteip));
|
||||
$boxes = $statement->fetchAll(PDO::FETCH_CLASS);
|
||||
} catch (PDOException $e) {
|
||||
$response = array( "status" => "error",
|
||||
"msg" => $e->getMessage()." (".$e->getCode().")");
|
||||
exit(json_encode($response)."\r\n");
|
||||
}
|
||||
|
||||
$response = array( "status" => "success",
|
||||
"data" => $boxes);
|
||||
exit(json_encode($response)."\r\n");
|
||||
?>
|
68
www/api/signin.php
Normal file
68
www/api/signin.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/*if ($_SERVER['REQUEST_METHOD'] != "POST") {
|
||||
$response = array( "status" => "error",
|
||||
"msg" => "'signin' can only be accessed with the POST method");
|
||||
|
||||
|
||||
exit(json_encode($response)."\r\n");
|
||||
}*/
|
||||
|
||||
require 'connect.php';
|
||||
|
||||
if(!isset($_GET['localip'])) {
|
||||
$response = array( "status" => "error",
|
||||
"msg" => "missing localip");
|
||||
exit(json_encode($response)."\r\n");
|
||||
}
|
||||
$localip = $_GET['localip'];
|
||||
|
||||
if(!isset($_GET['wifiboxid'])) {
|
||||
$response = array( "status" => "error",
|
||||
"msg" => "missing wifiboxid");
|
||||
exit(json_encode($response)."\r\n");
|
||||
}
|
||||
$wifiboxid = $_GET['wifiboxid'];
|
||||
|
||||
$remoteip = getenv('REMOTE_ADDR');
|
||||
|
||||
$timestamp = time();
|
||||
|
||||
$id = $remoteip.'/'.$localip; //TODO: column length: 31
|
||||
|
||||
try {
|
||||
$statement = $db->prepare( "REPLACE INTO $table " .
|
||||
"SET id = :id, " .
|
||||
" remoteip = :remoteip, " .
|
||||
" localip = :localip, " .
|
||||
" wifiboxid = :wifiboxid, " .
|
||||
" date = FROM_UNIXTIME(:timestamp)");
|
||||
$statement->execute(array( ":id" => $id,
|
||||
":remoteip" => $remoteip,
|
||||
":localip" => $localip,
|
||||
":wifiboxid" => $wifiboxid,
|
||||
":timestamp" => $timestamp));
|
||||
} catch (PDOException $e) {
|
||||
$response = array( "status" => "error",
|
||||
"msg" => $e->getMessage()." (".$e->getCode().")");
|
||||
exit(json_encode($response)."\r\n");
|
||||
}
|
||||
|
||||
// Remove old signins
|
||||
$hourago = time() - 60*60;
|
||||
try {
|
||||
$statement = $db->prepare("DELETE FROM $table WHERE date < FROM_UNIXTIME(:hourago)");
|
||||
$statement->execute(array( ':hourago' => $hourago));
|
||||
} catch (PDOException $e) {
|
||||
$response = array( "status" => "error",
|
||||
"msg" => $e->getMessage()." (".$e->getCode().")");
|
||||
exit(json_encode($response)."\r\n");
|
||||
}
|
||||
|
||||
$responseData = array( "remoteip" => $remoteip,
|
||||
"localip" => $localip,
|
||||
"wifiboxid" => $wifiboxid,
|
||||
"timestamp" => $timestamp);
|
||||
$response = array( "status" => "success",
|
||||
"data" => $responseData);
|
||||
exit(json_encode($response)."\r\n");
|
||||
?>
|
BIN
www/img/apple-touch-icon-144x144-precomposed.png
Normal file
BIN
www/img/apple-touch-icon-144x144-precomposed.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.3 KiB |
BIN
www/img/favicon.ico
Executable file
BIN
www/img/favicon.ico
Executable file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
www/img/favicon.png
Normal file
BIN
www/img/favicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 814 B |
BIN
www/img/logo_full.png
Executable file
BIN
www/img/logo_full.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
BIN
www/img/logo_small.png
Normal file
BIN
www/img/logo_small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 46 KiB |
BIN
www/img/logo_smaller_wide.png
Normal file
BIN
www/img/logo_smaller_wide.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
Loading…
Reference in New Issue
Block a user