Skip to content

Commit 00de853

Browse files
committed
Updates 030521
1 parent 2636742 commit 00de853

14 files changed

+182
-153
lines changed

ajax.php

+1-7
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,7 @@
8282
$action = SB_AUTH::logOut();
8383
$response['status'] = ($action) ? "success" : "failed";
8484
break;
85-
86-
case "GET_OVERVIEW":
87-
$action = SB_HELIUM::getOverViewSummary();
88-
$response['status'] = ($action) ? "success" : "failed";
89-
$response['data'] = $action;
90-
break;
91-
85+
9286
case "GET_USER_SETTINGS":
9387
$action = SB_USER::getUserSettings($_SESSION['uID']);
9488
$response['status'] = ($action) ? "success" : "failed";

includes/config.inc.php

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

1919
/** MySQL Credentials */
20-
define("SB_DB_HOST", "192.168.170.171");
20+
define("SB_DB_HOST", "mysql.local");
2121
define("SB_DB_USER", "syncrobit");
2222
define("SB_DB_PASSWORD", "m3rt3c123");
2323
define("SB_DB_DATABASE", "syncrobit");
@@ -29,7 +29,7 @@
2929
define("MEMCACHED_LONG", 1005200);
3030

3131
/** Postgres Credentials */
32-
define("SB_PG_HOST", "192.168.144.115");
32+
define("SB_PG_HOST", "pgsql.local");
3333
define("SB_PG_USER", "etl");
3434
define("SB_PG_PASSWORD", "m3rt3c123");
3535
define("SB_PG_DATABASE", "etl");

libs/api.lib.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ public static function generateKeys(){
1717

1818
public static function addKeys($uID, $appName){
1919
global $msql_db;
20-
$time = time();
21-
$uID = sanitize_sql_string($uID);
22-
$appName = sanitize_sql_string($appName);
20+
$time = time();
21+
$uID = sanitize_sql_string($uID);
22+
$appName = sanitize_sql_string($appName);
2323

2424
try {
2525
$sql = "INSERT INTO `sb_api_keys` (`uid`, `app_name`, `key`, `created`)
@@ -45,7 +45,7 @@ public static function addKeys($uID, $appName){
4545
return array("status" => "failed");
4646

4747
} catch (PDOException $e) {
48-
echo $e->getMessage();
48+
error_log($e->getMessage());
4949
}
5050

5151
return false;
@@ -65,7 +65,7 @@ public static function getKeysCount($uID){
6565
return $statement->rowCount();
6666

6767
} catch (PDOException $e) {
68-
echo $e->getMessage();
68+
error_log($e->getMessage());
6969
}
7070

7171
return false;
@@ -93,7 +93,7 @@ public static function deleteKey($uID, $kID){
9393
return array("status" => "failed");
9494

9595
} catch (PDOException $e) {
96-
echo $e->getMessage();
96+
error_log($e->getMessage());
9797
}
9898

9999
return false;
@@ -148,7 +148,7 @@ public static function getUserKeys($uID){
148148
return $return;
149149

150150
} catch (PDOException $e) {
151-
echo $e->getMessage();
151+
error_log($e->getMessage());
152152
}
153153

154154
return false;
@@ -170,7 +170,7 @@ public static function getUserKey($uID, $kID){
170170
return $row['key'];
171171

172172
} catch (PDOException $e) {
173-
echo $e->getMessage();
173+
error_log($e->getMessage());
174174
}
175175

176176
return false;

libs/auth.lib.php

+14-12
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static function makeAuth($username, $password){
7676
}
7777

7878
} catch (PDOException $e) {
79-
echo $e->getMessage();
79+
error_log($e->getMessage());
8080
}
8181

8282
SB_WATCHDOG::insertUserActivity(SB_USER::userName2uID($username), 'LOGIN', 'Login failed.');
@@ -107,18 +107,20 @@ public static function registerUser($username, $password, $email, $first_name, $
107107
$email = sanitize_sql_string($email);
108108
$first_name = sanitize_sql_string($first_name);
109109
$last_name = sanitize_sql_string($last_name);
110+
$member_s = time();
110111

111112
try {
112113
$sql = "INSERT INTO `sb_users`
113114
(`username`, `password`, `email`, `first_name`, `last_name`, `address`, `city`, `state`, `country`, `zip_code`, `hash`, `active`, `pwd_hash`, `member_since`)
114-
VALUES (:username, MD5(:password), :email, :first_name, :last_name, NULL, NULL, NULL, NULL, NULL, :hash, 0, NULL, NOW())";
115+
VALUES (:username, MD5(:password), :email, :first_name, :last_name, NULL, NULL, NULL, NULL, NULL, :hash, 0, NULL, :member_since)";
115116
$statement = $msql_db->prepare($sql);
116117
$statement->bindParam(":username", $username);
117118
$statement->bindParam(":password", $password);
118119
$statement->bindParam(":email", $email);
119120
$statement->bindParam(":first_name", $first_name);
120121
$statement->bindParam(":last_name", $last_name);
121122
$statement->bindParam(":hash", $hash);
123+
$statement->bindParam(":member_since", $member_s);
122124

123125
if($statement->execute()){
124126
$uid = $msql_db->lastInsertId();
@@ -129,14 +131,14 @@ public static function registerUser($username, $password, $email, $first_name, $
129131
$_SESSION['isLoggedIn'] = 1;
130132
$_SESSION['uID'] = $uid;
131133
$_SESSION['isInactive'] = 1;
132-
$_SESSION['last_activity'] = time();
134+
$_SESSION['last_activity'] = $member_s;
133135

134136
return "success";
135137
}
136138
}
137139
return "failed";
138140
} catch (PDOException $e) {
139-
echo $e->getMessage();
141+
error_log($e->getMessage());
140142
}
141143

142144
return "failed";
@@ -176,7 +178,7 @@ public static function checkIfEmailExists($email){
176178
return $statement->rowCount() > 0;
177179

178180
} catch (PDOException $e) {
179-
echo $e->getMessage();
181+
error_log($e->getMessage());
180182
}
181183

182184
return false;
@@ -195,7 +197,7 @@ public static function checkIfUsernameExists($username){
195197
return $statement->rowCount() > 0;
196198

197199
} catch (PDOException $e) {
198-
echo $e->getMessage();
200+
error_log($e->getMessage());
199201
}
200202

201203
return false;
@@ -253,7 +255,7 @@ public static function resendEmail($uID){
253255
return "success";
254256
}
255257
} catch (PDOException $e) {
256-
echo $e->getMessage();
258+
error_log($e->getMessage());
257259
}
258260

259261
return "failed";
@@ -277,7 +279,7 @@ public static function checkActivationHash($email, $hash){
277279

278280
return $statement->rowCount() > 0;
279281
} catch (PDOException $e) {
280-
echo $e->getMessage();
282+
error_log($e->getMessage());
281283
}
282284

283285
return false;
@@ -302,7 +304,7 @@ public static function updateActivationStatus($email){
302304
return $statement->execute();
303305

304306
} catch (PDOException $e) {
305-
echo $e->getMessage();
307+
error_log($e->getMessage());
306308
}
307309

308310
return false;
@@ -331,7 +333,7 @@ public static function forgotPassword($email){
331333
}
332334

333335
} catch (PDOException $e) {
334-
echo $e->getMessage();
336+
error_log($e->getMessage());
335337
}
336338

337339
return "failed";
@@ -356,7 +358,7 @@ public static function checkForgotPwdHash($email, $hash){
356358

357359
return $statement->rowCount() > 0;
358360
} catch (PDOException $e) {
359-
echo $e->getMessage();
361+
error_log($e->getMessage());
360362
}
361363

362364
return false;
@@ -375,7 +377,7 @@ public static function deleteForgotPwdHash($email){
375377
return $statement->execute();
376378

377379
} catch (PDOException $e) {
378-
echo $e->getMessage();
380+
error_log($e->getMessage());
379381
}
380382

381383
return false;

libs/core.lib.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static function getSetting($setting){
1919
return $row['setting_value'];
2020

2121
} catch (PDOException $e) {
22-
echo $e->getMessage();
22+
error_log($e->getMessage());
2323
}
2424

2525
return false;
@@ -57,7 +57,7 @@ public static function getCountryID($iso){
5757
return $row['id'];
5858

5959
} catch (PDOException $e) {
60-
echo $e->getMessage();
60+
error_log($e->getMessage());
6161
}
6262

6363
return $return;
@@ -79,7 +79,7 @@ public static function getZipCode($iso, $zipCode){
7979
return array("city" => $row['city_name'], "state" => $row['state_name']);
8080

8181
} catch (PDOException $e) {
82-
echo $e->getMessage();
82+
error_log($e->getMessage());
8383
}
8484
}
8585

@@ -106,7 +106,7 @@ public static function getStates($selected){
106106
return $return;
107107

108108
} catch (PDOException $e) {
109-
echo $e->getMessage();
109+
error_log($e->getMessage());
110110
}
111111

112112
return false;
@@ -129,7 +129,7 @@ public static function getMaintenanceState(){
129129
return ($row['setting_value'] == 1);
130130

131131
} catch (PDOException $e) {
132-
echo $e->getMessage();
132+
error_log($e->getMessage());
133133
}
134134

135135
return true;
@@ -165,7 +165,7 @@ public static function getMaintenanceDate(){
165165
return $return;
166166

167167
} catch (PDOException $e) {
168-
echo $e->getMessage();
168+
error_log($e->getMessage());
169169
}
170170

171171
return false;
@@ -187,7 +187,7 @@ public static function getMaitenanceAllowed(){
187187
return (in_array($u_ip, $allow_ip));
188188

189189
} catch (PDOException $e) {
190-
echo $e->getMessage();
190+
error_log($e->getMessage());
191191
}
192192

193193
return false;
@@ -292,7 +292,7 @@ public static function setIpCache($ip, $cache){
292292
return ($statement->execute());
293293

294294
} catch (PDOException $e) {
295-
echo $e->getMessage();
295+
error_log($e->getMessage());
296296
}
297297

298298
return false;
@@ -313,7 +313,7 @@ public static function getIpCache($ip){
313313
}
314314

315315
} catch (PDOException $e) {
316-
echo $e->getMessage();
316+
error_log($e->getMessage());
317317
}
318318

319319
return false;

0 commit comments

Comments
 (0)