Skip to content

Commit 62db99e

Browse files
committed
whitebikes.info
1 parent 077b14d commit 62db99e

33 files changed

Lines changed: 2498 additions & 2224 deletions

.htaccess

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
php_flag auto_globals_jit off
2+
RewriteEngine on
3+
RewriteRule ^sms/(.*)$ $1
4+
RewriteCond %{REQUEST_FILENAME} !-d
5+
RewriteCond %{REQUEST_FILENAME}.php -f
6+
RewriteRule ^(.*?)/?$ $1.php [L]
7+
8+
RewriteCond %{HTTP_HOST} ^www.whitebikes.info [NC]
9+
RewriteRule ^(.*)$ https://whitebikes.info/$1 [R=301,L]
10+
11+
RewriteCond %{SERVER_PORT} ^80$
12+
RewriteRule ^(.*)$ https://whitebikes.info/$1 [R=301,L]
13+
RewriteRule ^register[/]*$ /register.php

AUTHORS.md

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -13,70 +13,4 @@ Daniel Duris, dusoft@staznosti.sk
1313
* Code improvements
1414
* Bug fixes
1515

16-
Released under GNU GPL v3. See LICENSE for more info.
17-
18-
Third party libraries
19-
------------
20-
Individual copyrights and licenses. See their websites for more info.
21-
22-
### jQuery
23-
https://jquery.com
24-
Copyright jQuery Foundation and other contributors, https://jquery.org/
25-
Released under the MIT License (MIT).
26-
27-
### DataTables
28-
http://datatables.net
29-
Copyright (c) 2008-2013 SpryMedia Limited
30-
Released under the MIT License (MIT).
31-
32-
### Bootstrap
33-
http://getbootstrap.com
34-
Copyright (c) 2011+ Twitter, Inc
35-
Released under the MIT License (MIT).
36-
37-
### Bootstrap Validator
38-
http://bootstrapvalidator.com
39-
Copyright Nguyen Huu Phuoc
40-
Released under the Attribution-NonCommercial-NoDerivs 3.0 Unported (CC BY-NC-ND 3.0).
41-
42-
### Leaflet
43-
http://leafletjs.com
44-
Copyright (c) 2010+, Vladimir Agafonkin
45-
Copyright (c) 2010-2011, CloudMade
46-
All rights reserved.
47-
Redistribution and use in source and binary forms, with or without modification, are
48-
permitted provided that the following conditions are met:
49-
1. Redistributions of source code must retain the above copyright notice, this list of
50-
conditions and the following disclaimer.
51-
2. Redistributions in binary form must reproduce the above copyright notice, this list
52-
of conditions and the following disclaimer in the documentation and/or other materials
53-
provided with the distribution.
54-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
55-
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
56-
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
57-
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
58-
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
59-
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
60-
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
61-
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
62-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
63-
64-
### Leaflet Sidebar
65-
https://github.com/turbo87/leaflet-sidebar/
66-
Copyright (c) 2013 Tobias Bieniek
67-
Released under the MIT License (MIT).
68-
69-
### TCPDF
70-
http://www.tcpdf.org
71-
Copyright (c) 2002+ Nicola Asuni, Tecnick.com LTD
72-
Released under GNU GPL v3.
73-
74-
### HTML Purifier
75-
http://htmlpurifier.org
76-
Copyright (C) 2006-2008 Edward Z. Yang
77-
Released under GNU GPL v2.1 or later.
78-
79-
### PHPMailer
80-
http://phpmailer.worxware.com/
81-
Copyright (c) 2001+ multiple authors
82-
Released under GNU GPL v2.1 or later.
16+
See LICENSE for more info.

INSTALL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ CRON job
7979

8080
User registration
8181
----------
82-
* 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).
83-
* Point users to yourweb/register.php to register.
82+
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).
83+
2. Point users to yourweb/register.php to register.
8484

8585
Connectors (SMS provider / gateway API files)
8686
----------

ROADMAP.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Open Source Bike Share Roadmap
22
============
3+
~~strikethrough~~ = feature has been implemented
34

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

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

1926
### Security
20-
* Prepared SQL commands (XSS and co. prevention)
27+
1. Prepared SQL commands (XSS and co. prevention)
2128

2229
### Others
2330
* https://github.com/mmmaly/OpenSourceBikeShare/issues?q=is%3Aissue+is%3Aopen

actions-qrcode.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ function response($message,$error=0,$log=1)
1919
echo '<base href="',$systemURL,'" />';
2020
echo '<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />';
2121
echo '<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css" />';
22+
echo '<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">';
23+
echo '<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">';
24+
echo '<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">';
25+
echo '<link rel="manifest" href="/site.webmanifest">';
26+
echo '<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">';
27+
echo '<meta name="msapplication-TileColor" content="#da532c">';
28+
echo '<meta name="theme-color" content="#ffffff">';
2229
if (file_exists("analytics.php")) require("analytics.php");
2330
echo '</head><body><div class="container">';
2431
if ($error)

actions-sms.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,18 @@ function rent($number,$bike,$force=FALSE)
156156
$row=$result->fetch_assoc();
157157
$standid=$row["currentStand"];
158158
$stacktopbike=checktopofstack($standid);
159+
160+
161+
$result=$db->query("SELECT serviceTag FROM stands WHERE standId='$standid'");
162+
$row=$result->fetch_assoc();
163+
$serviceTag=$row["serviceTag"];
164+
165+
if ( $serviceTag <> 0 )
166+
{
167+
sendSMS($number,"Renting from service stands is not allowed: The bike probably waits for a repair.");
168+
return;
169+
}
170+
159171
if ($watches["stack"] AND $stacktopbike<>$bike)
160172
{
161173
$result=$db->query("SELECT standName FROM stands WHERE standId='$standid'");
@@ -184,6 +196,7 @@ function rent($number,$bike,$force=FALSE)
184196
$result=$db->query("SELECT note FROM notes WHERE bikeNum=$bikeNum AND deleted IS NULL ORDER BY time DESC LIMIT 1");
185197
$row=$result->fetch_assoc();
186198
$note=$row["note"];
199+
$currentUserNumber = false;
187200
if ($currentUser)
188201
{
189202
$result=$db->query("SELECT number FROM users WHERE userId=$currentUser");
@@ -223,7 +236,7 @@ function rent($number,$bike,$force=FALSE)
223236
else
224237
{
225238
$result=$db->query("INSERT INTO history SET userId=$userId,bikeNum=$bikeNum,action='FORCERENT',parameter=$newCode");
226-
if ($currentUser) { sendSMS($currentUserNumber,_('System override').": "._('Your rented bike')." ".$bikeNum." "._('has been rented by admin')."."); }
239+
if ($currentUser) { sendSMS($number,_('System override').": "._('Your rented bike')." ".$bikeNum." "._('has been rented by admin')."."); }
227240
}
228241

229242

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

356+
$creditchange=0;
343357
if ($force==FALSE)
344358
{
345359
$creditchange=changecreditendrental($bikeNum,$userId);
@@ -348,10 +362,10 @@ function returnBike($number,$bike,$stand,$message="",$force=FALSE)
348362
else
349363
{
350364
$result=$db->query("INSERT INTO history SET userId=$userId,bikeNum=$bikeNum,action='FORCERETURN',parameter=$standId");
351-
if($currentUserNumber)
365+
/*if($currentUserNumber)
352366
{
353367
sendSMS($currentUserNumber,_('System override').": "._('Your rented bike')." ".$bikeNum." "._('has been returned by admin').".");
354-
}
368+
}*/
355369
}
356370

357371
if (iscreditenabled())
@@ -478,7 +492,7 @@ function freeBikes($number)
478492
$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");
479493
$rentedBikes=$result->num_rows;
480494

481-
if (rentedBikes!=0)
495+
if ($rentedBikes!=0)
482496
{
483497
$listBikes.=" "._('Empty stands').": ";
484498
}

0 commit comments

Comments
 (0)