Skip to content

Commit

Permalink
whitebikes.info
Browse files Browse the repository at this point in the history
  • Loading branch information
sveneld committed Feb 26, 2024
1 parent 077b14d commit 62db99e
Show file tree
Hide file tree
Showing 33 changed files with 2,498 additions and 2,224 deletions.
13 changes: 13 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
php_flag auto_globals_jit off
RewriteEngine on
RewriteRule ^sms/(.*)$ $1
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [L]

RewriteCond %{HTTP_HOST} ^www.whitebikes.info [NC]
RewriteRule ^(.*)$ https://whitebikes.info/$1 [R=301,L]

RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://whitebikes.info/$1 [R=301,L]
RewriteRule ^register[/]*$ /register.php
68 changes: 1 addition & 67 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,70 +13,4 @@ Daniel Duris, [email protected]
* Code improvements
* Bug fixes

Released under GNU GPL v3. See LICENSE for more info.

Third party libraries
------------
Individual copyrights and licenses. See their websites for more info.

### jQuery
https://jquery.com
Copyright jQuery Foundation and other contributors, https://jquery.org/
Released under the MIT License (MIT).

### DataTables
http://datatables.net
Copyright (c) 2008-2013 SpryMedia Limited
Released under the MIT License (MIT).

### Bootstrap
http://getbootstrap.com
Copyright (c) 2011+ Twitter, Inc
Released under the MIT License (MIT).

### Bootstrap Validator
http://bootstrapvalidator.com
Copyright Nguyen Huu Phuoc
Released under the Attribution-NonCommercial-NoDerivs 3.0 Unported (CC BY-NC-ND 3.0).

### Leaflet
http://leafletjs.com
Copyright (c) 2010+, Vladimir Agafonkin
Copyright (c) 2010-2011, CloudMade
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

### Leaflet Sidebar
https://github.com/turbo87/leaflet-sidebar/
Copyright (c) 2013 Tobias Bieniek
Released under the MIT License (MIT).

### TCPDF
http://www.tcpdf.org
Copyright (c) 2002+ Nicola Asuni, Tecnick.com LTD
Released under GNU GPL v3.

### HTML Purifier
http://htmlpurifier.org
Copyright (C) 2006-2008 Edward Z. Yang
Released under GNU GPL v2.1 or later.

### PHPMailer
http://phpmailer.worxware.com/
Copyright (c) 2001+ multiple authors
Released under GNU GPL v2.1 or later.
See LICENSE for more info.
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ CRON job

User registration
----------
* Set `$limits["registration"]` to number of bikes user can rent after he registered. 0 is recommended, if you run a community system (admin can change this limit after verification).
* Point users to yourweb/register.php to register.
1. Set `$limits["registration"]` to number of bikes user can rent after he registered. 0 is recommended, if you run a community system (admin can change this limit after verification).
2. Point users to yourweb/register.php to register.

Connectors (SMS provider / gateway API files)
----------
Expand Down
11 changes: 9 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Open Source Bike Share Roadmap
============
~~strikethrough~~ = feature has been implemented

Real-life testing
----------
Expand All @@ -10,14 +11,20 @@ Real-life testing
Development
----------
### Priorities
* Complete admin interface on web (not part of map)
1. Automatic installation process (incl. QR code generation for bicycles and stands)
2. Complete admin interface on web (not part of map)
3. New user confirmation by admins
4. SMS system optional (cut off dependencies)
~~5. SMS testing (loopback) interface~~

### UX and functions
* i18n translations .po/.mo (gettext?)
* terms of use
* notes for stands (e.g. problem with stand)
* QR codes for autorent (bicycle QR code) / autoreturn (stand QR code)

### Security
* Prepared SQL commands (XSS and co. prevention)
1. Prepared SQL commands (XSS and co. prevention)

### Others
* https://github.com/mmmaly/OpenSourceBikeShare/issues?q=is%3Aissue+is%3Aopen
7 changes: 7 additions & 0 deletions actions-qrcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ function response($message,$error=0,$log=1)
echo '<base href="',$systemURL,'" />';
echo '<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />';
echo '<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css" />';
echo '<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">';
echo '<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">';
echo '<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">';
echo '<link rel="manifest" href="/site.webmanifest">';
echo '<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">';
echo '<meta name="msapplication-TileColor" content="#da532c">';
echo '<meta name="theme-color" content="#ffffff">';
if (file_exists("analytics.php")) require("analytics.php");
echo '</head><body><div class="container">';
if ($error)
Expand Down
22 changes: 18 additions & 4 deletions actions-sms.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,18 @@ function rent($number,$bike,$force=FALSE)
$row=$result->fetch_assoc();
$standid=$row["currentStand"];
$stacktopbike=checktopofstack($standid);


$result=$db->query("SELECT serviceTag FROM stands WHERE standId='$standid'");
$row=$result->fetch_assoc();
$serviceTag=$row["serviceTag"];

if ( $serviceTag <> 0 )
{
sendSMS($number,"Renting from service stands is not allowed: The bike probably waits for a repair.");
return;
}

if ($watches["stack"] AND $stacktopbike<>$bike)
{
$result=$db->query("SELECT standName FROM stands WHERE standId='$standid'");
Expand Down Expand Up @@ -184,6 +196,7 @@ function rent($number,$bike,$force=FALSE)
$result=$db->query("SELECT note FROM notes WHERE bikeNum=$bikeNum AND deleted IS NULL ORDER BY time DESC LIMIT 1");
$row=$result->fetch_assoc();
$note=$row["note"];
$currentUserNumber = false;
if ($currentUser)
{
$result=$db->query("SELECT number FROM users WHERE userId=$currentUser");
Expand Down Expand Up @@ -223,7 +236,7 @@ function rent($number,$bike,$force=FALSE)
else
{
$result=$db->query("INSERT INTO history SET userId=$userId,bikeNum=$bikeNum,action='FORCERENT',parameter=$newCode");
if ($currentUser) { sendSMS($currentUserNumber,_('System override').": "._('Your rented bike')." ".$bikeNum." "._('has been rented by admin')."."); }
if ($currentUser) { sendSMS($number,_('System override').": "._('Your rented bike')." ".$bikeNum." "._('has been rented by admin')."."); }
}


Expand Down Expand Up @@ -340,6 +353,7 @@ function returnBike($number,$bike,$stand,$message="",$force=FALSE)
}
$message.=" "._('Rotate lockpad to 0000.');

$creditchange=0;
if ($force==FALSE)
{
$creditchange=changecreditendrental($bikeNum,$userId);
Expand All @@ -348,10 +362,10 @@ function returnBike($number,$bike,$stand,$message="",$force=FALSE)
else
{
$result=$db->query("INSERT INTO history SET userId=$userId,bikeNum=$bikeNum,action='FORCERETURN',parameter=$standId");
if($currentUserNumber)
/*if($currentUserNumber)
{
sendSMS($currentUserNumber,_('System override').": "._('Your rented bike')." ".$bikeNum." "._('has been returned by admin').".");
}
}*/
}

if (iscreditenabled())
Expand Down Expand Up @@ -478,7 +492,7 @@ function freeBikes($number)
$result=$db->query("SELECT count(bikeNum) as bikeCount,placeName from bikes right join stands on bikes.currentStand=stands.standId where stands.serviceTag=0 group by placeName having bikeCount=0 order by placeName");
$rentedBikes=$result->num_rows;

if (rentedBikes!=0)
if ($rentedBikes!=0)
{
$listBikes.=" "._('Empty stands').": ";
}
Expand Down
Loading

0 comments on commit 62db99e

Please sign in to comment.