Skip to content

Commit 84c2019

Browse files
committed
Updates 03.05.21
1 parent 7d5692c commit 84c2019

File tree

549 files changed

+41537
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

549 files changed

+41537
-36
lines changed

.vscode/sftp.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "Syncrob.it",
3-
"host": "97.107.135.88",
3+
"host": "192.168.144.42",
44
"protocol": "sftp",
55
"port": 2304,
66
"username": "syncrobit",
77
"password": "m3rt3c123",
8-
"remotePath": "/home/syncrobit/public_html/dashboard",
8+
"remotePath": "/home/syncrobit/public_html",
99
"uploadOnSave": true
1010
}

ajax.php

+43-33
Original file line numberDiff line numberDiff line change
@@ -15,45 +15,53 @@
1515
die(json_encode($response));
1616
}
1717

18+
if($_SESSION['id'] == session_id()){
19+
$response['status'] = "invalid";
20+
$response['message'] = "Invalid Session";
21+
die(json_encode($response));
22+
}
23+
1824

1925
switch($_POST['action']){
2026
case "LOGIN":
21-
$action = SB_AUTH::makeAuth($_POST['username'], $_POST['password']);
27+
$action = SB_AUTH::makeAuth(htmlspecialchars($_POST['username']), htmlspecialchars($_POST['password']));
2228
$response = $action;
2329
break;
2430

2531
case "REGISTER_USER":
26-
$action = SB_AUTH::registerUser($_POST['username'], $_POST['password'], $_POST['email'], $_POST['first_name'], $_POST['last_name']);
32+
$action = SB_AUTH::registerUser(htmlspecialchars($_POST['username']), htmlspecialchars($_POST['password']),
33+
htmlspecialchars($_POST['email']), htmlspecialchars($_POST['first_name']),
34+
htmlspecialchars($_POST['last_name']));
2735
$response['status'] = $action;
2836
break;
2937

3038
case "CHECK_EMAIL":
31-
$action = SB_AUTH::checkIfEmailExists($_POST['email']);
39+
$action = SB_AUTH::checkIfEmailExists(htmlspecialchars($_POST['email']));
3240
$response = ($action) ? "Email already exists!" : "true";
3341
break;
3442

3543
case "CHECK_EMAIL_REVERSE":
36-
$action = SB_AUTH::checkIfEmailExists($_POST['email']);
44+
$action = SB_AUTH::checkIfEmailExists(htmlspecialchars($_POST['email']));
3745
$response = (!$action) ? "Email not in our database!" : "true";
3846
break;
3947

4048
case "CHECK_USERNAME":
41-
$action = SB_AUTH::checkIfUsernameExists($_POST['username']);
49+
$action = SB_AUTH::checkIfUsernameExists(htmlspecialchars($_POST['username']));
4250
$response = ($action) ? "Username already exists!" : "true";
4351
break;
4452

4553
case "RESEND_EMAIL":
46-
$action = SB_AUTH::resendEmail($_POST['uID']);
54+
$action = SB_AUTH::resendEmail(htmlspecialchars($_POST['uID']));
4755
$response['status'] = $action;
4856
break;
4957

5058
case "FORGOT_PASSWORD":
51-
$action = SB_AUTH::forgotPassword($_POST['email']);
59+
$action = SB_AUTH::forgotPassword(htmlspecialchars($_POST['email']));
5260
$response['status'] = $action;
5361
break;
5462

5563
case "UPDATE_PASSWORD_FORGOT":
56-
$action = SB_USER::updatePasswordForgot($_POST['uID'], $_POST['password']);
64+
$action = SB_USER::updatePasswordForgot(htmlspecialchars($_POST['uID']), htmlspecialchars($_POST['password']));
5765
$response['status'] = ($action) ? "success" : "failed";
5866
break;
5967

@@ -90,8 +98,9 @@
9098
break;
9199

92100
case "UPDATE_USER_SETTINGS":
93-
$action = SB_USER::updateUserSettings($_SESSION['uID'], $_POST['time_zone'],
94-
$_POST['date_format'], $_POST['time_format'], $_POST['wallet_address']);
101+
$action = SB_USER::updateUserSettings($_SESSION['uID'], htmlspecialchars($_POST['time_zone']),
102+
htmlspecialchars($_POST['date_format']), htmlspecialchars($_POST['time_format']),
103+
htmlspecialchars($_POST['wallet_address']));
95104
$response['status'] = ($action) ? "success" : "failed";
96105
break;
97106

@@ -102,76 +111,77 @@
102111
break;
103112

104113
case "UPDATE_USER_DETAILS":
105-
$action = SB_USER::updateUserDetails($_SESSION['uID'], $_POST['first_name'], $_POST['last_name'],
106-
$_POST['address'], $_POST['city'], $_POST['state'],
107-
$_POST['country'], $_POST['zip']);
114+
$action = SB_USER::updateUserDetails($_SESSION['uID'], htmlspecialchars($_POST['first_name']), htmlspecialchars($_POST['last_name']),
115+
htmlspecialchars($_POST['address']), htmlspecialchars($_POST['city']), htmlspecialchars($_POST['state']),
116+
htmlspecialchars($_POST['country']), htmlspecialchars($_POST['zip']));
108117
$response['status'] = $action;
109118
break;
110119

111120
case "CHANGE_EMAIL":
112121
$action = SB_USER::changeEmail($email);
113122
$response['status'] = $action;
114-
reak;
123+
break;
115124

116125
case "GET_STATES":
117-
$action = SB_CORE::getStates($_POST['iso']);
126+
$action = SB_CORE::getStates(htmlspecialchars($_POST['iso']));
118127
$response['status'] = "success";
119128
$response['data'] = $action;
120129
break;
121130

122131
case "GET_CITY_STATE":
123-
$action = SB_CORE::getZipCode($_POST['iso'], $_POST['zipCode']);
132+
$action = SB_CORE::getZipCode(htmlspecialchars($_POST['iso']), htmlspecialchars($_POST['zipCode']));
124133
$response['status'] = "success";
125134
$response['data'] = $action;
126135
break;
127136

128137
case "CHECK_CURRENT_PASSWORD":
129-
$action = SB_USER::checkCurrentPass($_POST['password']);
138+
$action = SB_USER::checkCurrentPass(htmlspecialchars($_POST['password']));
130139
$response = ($action) ? "true" : "Password does not match!";
131140
break;
132141

133142
case "CHECK_PASSWORD":
134-
$action = SB_USER::checkCurrentPass($_POST['password']);
143+
$action = SB_USER::checkCurrentPass(htmlspecialchars($_POST['password']));
135144
$response['status'] = ($action) ? "success" : "false";
136145
break;
137146

138147
case "UPDATE_PASSWORD":
139-
$action = SB_USER::updatePassword($_SESSION['uID'], $_POST['password'], $_POST['current_pass']);
148+
$action = SB_USER::updatePassword($_SESSION['uID'], htmlspecialchars($_POST['password']), htmlspecialchars($_POST['current_pass']));
140149
$response['status'] = ($action) ? "success" : "failed";
141150
break;
142151

143152
case "UPDATE_PROFILE_IMG":
144-
$action = SB_USER::updateProfileImg($_SESSION['uID'], $_POST['img']);
153+
$action = SB_USER::updateProfileImg($_SESSION['uID'], htmlspecialchars($_POST['img']));
145154
$response['status'] = ($action) ? "success" : "failed";
146155
break;
147156

148157
case "DESTORY_SESSION":
149-
$action = SB_USER::destroyActiveSession($_POST['sID']);
158+
$action = SB_USER::destroyActiveSession(htmlspecialchars($_POST['sID']));
150159
$response['status'] = ($action) ? "success" : "failed";
151160
break;
152161

153162
case "CHECK_HELIUM_ADDRESS":
154-
$action = SB_HELIUM::checkIfValidAddress($_POST['w_address']);
163+
$action = SB_HELIUM::checkIfValidAddress(htmlspecialchars($_POST['w_address']));
155164
$response = ($action) ? "true" : "Invalid Helium Wallet Address";
156165
break;
157166

158167
case "ADD_WALLET_ADDRESS":
159-
$action = SB_USER::addWallet($_SESSION['uID'], $_POST['nickname'], $_POST['wAddr'], $_POST['primary']);
168+
$action = SB_USER::addWallet($_SESSION['uID'], htmlspecialchars($_POST['nickname']), htmlspecialchars($_POST['wAddr']), htmlspecialchars($_POST['primary']));
160169
$response = $action;
161170
break;
162171

163172
case "GET_USER_WALLET_DETAILS":
164-
$action = SB_USER::getUserWallet($_SESSION['uID'], $_POST['wID']);
173+
$action = SB_USER::getUserWallet($_SESSION['uID'], htmlspecialchars($_POST['wID']));
165174
$response = $action;
166175
break;
167176

168177
case "EDIT_USER_WALLET":
169-
$action = SB_USER::editUserWallet($_SESSION['uID'], $_POST['wID'], $_POST['nickname'], $_POST['wAddr'], $_POST['primary']);
178+
$action = SB_USER::editUserWallet($_SESSION['uID'], htmlspecialchars($_POST['wID']), htmlspecialchars($_POST['nickname']),
179+
htmlspecialchars($_POST['wAddr']), htmlspecialchars($_POST['primary']));
170180
$response['status'] = $action;
171181
break;
172182

173183
case "DELETE_USER_WALLET":
174-
$action = SB_USER::deleteUserWallet($_SESSION['uID'], $_POST['wID']);
184+
$action = SB_USER::deleteUserWallet($_SESSION['uID'], htmlspecialchars($_POST['wID']));
175185
$response = $action ;
176186
break;
177187

@@ -188,39 +198,39 @@
188198
break;
189199

190200
case "ADD_API_KEY":
191-
$action = SB_API::addKeys($_SESSION['uID'], $_POST['appName']);
201+
$action = SB_API::addKeys($_SESSION['uID'], htmlspecialchars($_POST['appName']));
192202
$response = $action;
193203
break;
194204

195205
case "DELETE_KEY":
196-
$action = SB_API::deleteKey($_SESSION['uID'], $_POST['kID']);
206+
$action = SB_API::deleteKey($_SESSION['uID'], htmlspecialchars($_POST['kID']));
197207
$response = $action;
198208
break;
199209

200210
case "GET_API_KEY":
201-
$action = SB_API::getUserKey($_SESSION['uID'], $_POST['kID']);
211+
$action = SB_API::getUserKey($_SESSION['uID'], htmlspecialchars($_POST['kID']));
202212
$response['status'] = (!$action) ? "failed" : "success";
203213
$response['apiKey'] = $action;
204214
break;
205215

206216
case "GET_HISTORY":
207-
$action = SB_SUBSCRIPTION::getPaymentHistory($_SESSION['uID'], $_POST['range']);
217+
$action = SB_SUBSCRIPTION::getPaymentHistory($_SESSION['uID'], htmlspecialchars($_POST['range']));
208218
$response['status'] = (!$action) ? "failed" : "success";
209219
$response['history'] = $action;
210220
break;
211221

212222
case "UPGRADE_PGK":
213-
$action = SB_SUBSCRIPTION::updateUserPkg($_SESSION['uID'], $_POST['pkg']);
223+
$action = SB_SUBSCRIPTION::updateUserPkg($_SESSION['uID'], htmlspecialchars($_POST['pkg']));
214224
$response['status'] = ($action) ? "success" : "failed";
215225
break;
216226

217227
case "CREATE_IP_MAP":
218-
$action = SB_WATCHDOG::createIPMap($_POST['ip']);
228+
$action = SB_WATCHDOG::createIPMap(htmlspecialchars($_POST['ip']));
219229
$response = $action;
220230
break;
221231

222232
case "GET_ACCT_HISTORY":
223-
$action = SB_WATCHDOG::getUserActivity($_SESSION['uID'], $_POST['start'], $_POST['end']);
233+
$action = SB_WATCHDOG::getUserActivity($_SESSION['uID'], htmlspecialchars($_POST['start']), htmlspecialchars($_POST['end']));
224234
$response['status'] = (!$action) ? "success" : "failed";
225235
$response['history'] = $action;
226236
break;

includes/config.inc.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@
1717
define("SB_TMP", SB_CORE."tmp/");
1818

1919
/** MySQL Credentials */
20-
define("SB_DB_HOST", "127.0.0.1");
20+
define("SB_DB_HOST", "192.168.170.171");
2121
define("SB_DB_USER", "syncrobit");
2222
define("SB_DB_PASSWORD", "m3rt3c123");
2323
define("SB_DB_DATABASE", "syncrobit");
2424

25+
/** Memcached Credentials */
26+
define("SB_MEMCACHED", "192.168.198.141");
27+
define("SB_MEMCACHED_LONG", "");
28+
define("SB_MEMCACHED_MEDIUM", "");
29+
define("SB_MEMCACHED_FAST", "");
30+
2531
/** Postgres Credentials */
2632

2733
//define("SB_PG_HOST", "etl.dewi.org");

libs/sessions.lib.php

+1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ public function getUserIPAddress(){
123123

124124
public static function updateUID($uID){
125125
$sID = session_id();
126+
$_SESSION['id'] = $sID;
126127

127128
try {
128129
$sql = "UPDATE `sb_sessions` SET `uid` = :uID WHERE `id` = :sID";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 2
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.DS_Store
2+
bower_components
3+
main
4+
node_modules
5+
temp
6+
update
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
flag-icon.min.css
2+
bower_components/
3+
main/
4+
temp/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"arrowParens": "avoid",
3+
"bracketSpacing": false,
4+
"jsxBracketSameLine": false,
5+
"printWidth": 80,
6+
"proseWrap": "preserve",
7+
"requirePragma": false,
8+
"semi": true,
9+
"singleQuote": true,
10+
"tabWidth": 2,
11+
"trailingComma": "all",
12+
"useTabs": false,
13+
"overrides": [
14+
{
15+
"files": "*.json",
16+
"options": {
17+
"printWidth": 200
18+
}
19+
}
20+
]
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
language: node_js
2+
node_js:
3+
- '10'
4+
5+
cache: yarn
6+
7+
notifications:
8+
- email: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
module.exports = (grunt)->
2+
less = 'less'
3+
TARGET_DIR = 'css'
4+
5+
grunt.initConfig
6+
less:
7+
flag:
8+
src: 'less/flag-icon.less'
9+
dest: 'css/flag-icon.css'
10+
docs:
11+
src: 'assets/docs.less'
12+
dest: 'assets/docs.css'
13+
14+
cssmin:
15+
flag:
16+
src: 'css/flag-icon.css'
17+
dest: 'css/flag-icon.min.css'
18+
19+
watch:
20+
css:
21+
options:
22+
livereload: true
23+
files: '**/*.less'
24+
tasks: ['build']
25+
26+
assets:
27+
options:
28+
livereload: true
29+
files: ['index.html', 'assets/*']
30+
31+
connect:
32+
server:
33+
options:
34+
port: 8000
35+
keepalive: true
36+
37+
38+
grunt.loadNpmTasks 'grunt-contrib-less'
39+
grunt.loadNpmTasks 'grunt-contrib-cssmin'
40+
grunt.loadNpmTasks 'grunt-contrib-watch'
41+
grunt.loadNpmTasks 'grunt-contrib-connect'
42+
43+
grunt.registerTask 'build', ['less', 'cssmin']
44+
grunt.registerTask 'default', ['build', 'watch']
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2013 Panayiotis Lipiridis
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9+
of the Software, and to permit persons to whom the Software is furnished to do
10+
so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)