Skip to content
This repository was archived by the owner on Apr 16, 2019. It is now read-only.

Commit cae53f1

Browse files
committed
Fixed parts of the API.
1 parent 7af8995 commit cae53f1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

api.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function handleArgs($args){
2020
if(isset($args['user']) && isset($args['pass'])){
2121
$loginStatus = $this->ScriptRepo->loginUser($args['user'], $args['pass']);
2222
if($loginStatus['loginSuccess']){
23-
$sessionKey = makeSessionID();
23+
$sessionKey = $this->makeSessionID();
2424
$user = $this->ScriptRepo->databaseHandle->real_escape_string($args['user']);
2525
$time = time()+3600;
2626
$this->ScriptRepo->queryDatabase("INSERT INTO repo_sessions (id, username, sessionKey, time) VALUES ('NULL', '$user', '$sessionKey', '$time')");
@@ -48,10 +48,10 @@ public function handleArgs($args){
4848
case isset($args['browse']):
4949
if(isset($args['count'])){ $count = intval($args['count']); }else{ $count = 20; }
5050
if(isset($args['page'])){ $page = intval($args['page']); }else{ $page = 1; }
51-
$queryBrowse = $this->ScriptRepo->queryDatabase("SELECT * FROM repo_entries");
51+
$queryBrowse = $this->ScriptRepo->queryDatabase("SELECT * FROM repo_entries WHERE privacy=1");
5252
$this->data = array_merge(array('success' => true), $this->ScriptRepo->getResults($queryBrowse, $count, $page));
5353
break;
54-
case 'view':
54+
case isset($args['view']):
5555
if(isset($args['pubID'])){
5656
$pubID = $this->ScriptRepo->databaseHandle->real_escape_string($args['pubID']);
5757
$queryView = $this->ScriptRepo->queryDatabase("SELECT * FROM repo_entries WHERE pubID='$pubID'");
@@ -64,6 +64,7 @@ public function handleArgs($args){
6464
}else{
6565
$this->data = array('success' => false);
6666
}
67+
break;
6768
}
6869
}
6970
public function outputData(){

0 commit comments

Comments
 (0)