Skip to content

Commit 1e5e775

Browse files
authored
Merge pull request #688 from causefx/develop
Develop
2 parents 053cce9 + ef39c9b commit 1e5e775

31 files changed

+3507
-1987
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ Network Trash Folder
4646
Temporary Items
4747
.apdisk
4848

49+
# Files from my local computer
50+
php_errors.log
51+
4952
# =========================
5053
# Organizr files
5154
# =========================
@@ -58,6 +61,8 @@ org.log
5861
org*.log
5962
test.php
6063
users.db
64+
speedtest.db
65+
chatpack.db
6166
config/cacert.pem
6267
config/config.php
6368
config/config*.bak.php
@@ -67,3 +72,7 @@ config/users*.db
6772
config/users*.bak.db
6873
config/tmp/*
6974
images/cache/*
75+
backups/*
76+
backups/
77+
backups
78+
test*.php

ajax.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,14 @@
6464
echo getPlexStreams(12, PLEXSHOWNAMES, $GLOBALS['USER']->role);
6565
die();
6666
break;
67+
case 'ombi-requests':
68+
qualifyUser(PLEXHOMEAUTH, true);
69+
echo buildOmbiList($GLOBALS['USER']->role, $GLOBALS['USER']->username);
70+
die();
71+
break;
6772
case 'emby-recent':
6873
qualifyUser(EMBYHOMEAUTH, true);
69-
echo getEmbyRecent($_GET['type'], 12);
74+
echo getEmbyRecent(array("Movie" => EMBYRECENTMOVIE, "Episode" => EMBYRECENTTV, "MusicAlbum" => EMBYRECENTMUSIC, "Series" => EMBYRECENTTV));
7075
die();
7176
break;
7277
case 'plex-recent':
@@ -123,6 +128,9 @@
123128
default: // Stuff that you need admin for
124129
qualifyUser('admin', true);
125130
switch ($action) {
131+
case 'ombi-action':
132+
sendResult(ombiAction($_POST['id'], $_POST['action_type'], $_POST['type']), "search", "OMBI ", "action completed successfully", "an error occured");
133+
break;
126134
case 'get-emails':
127135
$response = printEmails(getEmails($_POST['type']));
128136
break;
@@ -150,6 +158,10 @@
150158
case 'remove-images':
151159
removeFiles('images/'.(isset($_POST['file'])?$_POST['file']:''));
152160
sendNotification(true);
161+
break;
162+
case 'remove-file':
163+
removeFiles($_POST['file']);
164+
sendNotification(true);
153165
break;
154166
case 'update-config':
155167
$response['notify'] = sendNotification(updateConfig($_POST));
@@ -226,4 +238,3 @@
226238
} else {
227239
sendNotification(false, 'Error: No Output Specified!');
228240
}
229-

bower_components/bootstrap/dist/css/bootstrap.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bower_components/jquery/dist/jquery.min.js

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chat/refreshmessages.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
(SELECT id, timestamp, user, avatar, message
1818
FROM chatpack_log ORDER BY id DESC LIMIT 125)
1919
ORDER BY id ASC") )
20-
{
20+
{
2121
$newmessages = array();
2222

2323
while( $row = $result->fetchArray() )
@@ -27,16 +27,17 @@
2727
$user = $row["user"];
2828
$avatar = $row["avatar"];
2929
$message = $row["message"];
30-
30+
3131
$timenow = time();
3232
$messagetime = date("h:iA", intval($timestamp));
3333
$messagedate = date("m-d", intval($timestamp));
34+
$messagenewtime = date("Y-m-d H:i:s", intval($timestamp));
3435
$message = utf8_encode($message);
35-
36+
3637
$msgstr = ""; // message components
3738

3839
if( strlen($user) > 0 && strlen($message) > 0 )
39-
{
40+
{
4041
// catch emoticon
4142

4243
$emoticon = false;
@@ -63,12 +64,12 @@
6364
$ending = substr($imagename, $endingpos+1);
6465
$originalimg = $originalname . "." . $ending;
6566
}
66-
67+
6768
if( !$emoticon && !$image )
6869
{
6970
$message = decryptmessage($message);
7071
}
71-
72+
7273
// catch URLs
7374

7475
/*$message = str_replace("https://", "http://", $message);
@@ -91,7 +92,7 @@
9192
"<span style=\"color: #d89334;\"><strong>$1</strong></span>", $message);
9293

9394
// user online avatar
94-
95+
9596
//$avatar = "<img class=\"avatarimg\" id=\"$timestamp\" src=\"" . $avatar . "\">";
9697

9798
// unique message key
@@ -101,9 +102,9 @@
101102

102103
// show user avatar and message
103104
if($user == $currentuser){
104-
$msgstr = $msgstr . "<p class=\"avatarandtext\" id=\"$messagekey\"><li><img src=\"$avatar\" id=\"$timestamp\" class=\"img-circle user-avatar $user\" alt=\"$user\"><div class=\"chat-panel blue-bg messagelike\" id=\"$id\"><div class=\"chat-heading clearfix\"><h4 class=\"pull-left zero-m\">$user</h4><p class=\"pull-right\"><i class=\"fa fa-clock-o\"></i>$messagedate $messagetime </p></div><div class=\"chat-body\">$message</div><span class=\"readed\"><i class=\"fa fa-heart red\" id=\"like$id\"></i></span></div></li></p>";//class="chat-inverted"
105+
$msgstr = $msgstr . "<p class=\"avatarandtext\" id=\"$messagekey\"><li><img src=\"$avatar\" id=\"$timestamp\" class=\"img-circle user-avatar $user\" alt=\"$user\"><div class=\"chat-panel blue-bg messagelike\" id=\"$id\"><div class=\"chat-heading clearfix\"><h4 class=\"pull-left zero-m\">$user</h4><p class=\"pull-right\"><i class=\"fa fa-clock-o\"></i><timestamp time=\"$messagenewtime\" class=\"chat-timestamp\">$messagenewtime</timestamp></p></div><div class=\"chat-body\">$message</div></div></li></p>";//class="chat-inverted"
105106
}else{
106-
$msgstr = $msgstr . "<p class=\"avatarandtext\" id=\"$messagekey\"><li class=\"chat-inverted\"><img src=\"$avatar\" id=\"$timestamp\" class=\"img-circle user-avatar $user\" alt=\"$user\"><div class=\"chat-panel red-bg messagelike\" id=\"$id\"><div class=\"chat-heading clearfix\"><h4 class=\"pull-left zero-m\">$user</h4><p class=\"pull-right\"><i class=\"fa fa-clock-o\"></i>$messagedate $messagetime </p></div><div class=\"chat-body\">$message</div><span class=\"readed\"><i class=\"fa fa-heart red liked\" id=\"like$id\"></i></span></div></li></p>";//class="chat-inverted"
107+
$msgstr = $msgstr . "<p class=\"avatarandtext\" id=\"$messagekey\"><li class=\"chat-inverted\"><img src=\"$avatar\" id=\"$timestamp\" class=\"img-circle user-avatar $user\" alt=\"$user\"><div class=\"chat-panel red-bg messagelike\" id=\"$id\"><div class=\"chat-heading clearfix\"><h4 class=\"pull-left zero-m\">$user</h4><p class=\"pull-right\"><i class=\"fa fa-clock-o\"></i><timestamp time=\"$messagenewtime\" class=\"chat-timestamp\">$messagenewtime</timestamp></p></div><div class=\"chat-body\">$message</div></div></li></p>";//class="chat-inverted"
107108
}
108109

109110
array_push($newmessages, $msgstr);
@@ -126,7 +127,7 @@ function decryptmessage($msg)
126127
$initvector = "aC92eG1PdGhuMXN6";
127128
$decryptedmessage = openssl_decrypt($msg, "AES-256-CBC", $key, 0, $initvector);
128129
$decryptedmessage = utf8_encode($decryptedmessage);
129-
130+
130131
return $decryptedmessage;
131132
}
132133

@@ -151,4 +152,4 @@ function decryptmessage($msg)
151152
}
152153
}
153154

154-
?>
155+
?>

chatAJAX.php

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)