Skip to content

Commit

Permalink
Merge pull request #688 from causefx/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
causefx authored Oct 27, 2017
2 parents 053cce9 + ef39c9b commit 1e5e775
Show file tree
Hide file tree
Showing 31 changed files with 3,507 additions and 1,987 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ Network Trash Folder
Temporary Items
.apdisk

# Files from my local computer
php_errors.log

# =========================
# Organizr files
# =========================
Expand All @@ -58,6 +61,8 @@ org.log
org*.log
test.php
users.db
speedtest.db
chatpack.db
config/cacert.pem
config/config.php
config/config*.bak.php
Expand All @@ -67,3 +72,7 @@ config/users*.db
config/users*.bak.db
config/tmp/*
images/cache/*
backups/*
backups/
backups
test*.php
15 changes: 13 additions & 2 deletions ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,14 @@
echo getPlexStreams(12, PLEXSHOWNAMES, $GLOBALS['USER']->role);
die();
break;
case 'ombi-requests':
qualifyUser(PLEXHOMEAUTH, true);
echo buildOmbiList($GLOBALS['USER']->role, $GLOBALS['USER']->username);
die();
break;
case 'emby-recent':
qualifyUser(EMBYHOMEAUTH, true);
echo getEmbyRecent($_GET['type'], 12);
echo getEmbyRecent(array("Movie" => EMBYRECENTMOVIE, "Episode" => EMBYRECENTTV, "MusicAlbum" => EMBYRECENTMUSIC, "Series" => EMBYRECENTTV));
die();
break;
case 'plex-recent':
Expand Down Expand Up @@ -123,6 +128,9 @@
default: // Stuff that you need admin for
qualifyUser('admin', true);
switch ($action) {
case 'ombi-action':
sendResult(ombiAction($_POST['id'], $_POST['action_type'], $_POST['type']), "search", "OMBI ", "action completed successfully", "an error occured");
break;
case 'get-emails':
$response = printEmails(getEmails($_POST['type']));
break;
Expand Down Expand Up @@ -150,6 +158,10 @@
case 'remove-images':
removeFiles('images/'.(isset($_POST['file'])?$_POST['file']:''));
sendNotification(true);
break;
case 'remove-file':
removeFiles($_POST['file']);
sendNotification(true);
break;
case 'update-config':
$response['notify'] = sendNotification(updateConfig($_POST));
Expand Down Expand Up @@ -226,4 +238,3 @@
} else {
sendNotification(false, 'Error: No Output Specified!');
}

2 changes: 1 addition & 1 deletion bower_components/bootstrap/dist/css/bootstrap.min.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion bower_components/jquery/dist/jquery.min.js

Large diffs are not rendered by default.

23 changes: 12 additions & 11 deletions chat/refreshmessages.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
(SELECT id, timestamp, user, avatar, message
FROM chatpack_log ORDER BY id DESC LIMIT 125)
ORDER BY id ASC") )
{
{
$newmessages = array();

while( $row = $result->fetchArray() )
Expand All @@ -27,16 +27,17 @@
$user = $row["user"];
$avatar = $row["avatar"];
$message = $row["message"];

$timenow = time();
$messagetime = date("h:iA", intval($timestamp));
$messagedate = date("m-d", intval($timestamp));
$messagenewtime = date("Y-m-d H:i:s", intval($timestamp));
$message = utf8_encode($message);

$msgstr = ""; // message components

if( strlen($user) > 0 && strlen($message) > 0 )
{
{
// catch emoticon

$emoticon = false;
Expand All @@ -63,12 +64,12 @@
$ending = substr($imagename, $endingpos+1);
$originalimg = $originalname . "." . $ending;
}

if( !$emoticon && !$image )
{
$message = decryptmessage($message);
}

// catch URLs

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

// user online avatar

//$avatar = "<img class=\"avatarimg\" id=\"$timestamp\" src=\"" . $avatar . "\">";

// unique message key
Expand All @@ -101,9 +102,9 @@

// show user avatar and message
if($user == $currentuser){
$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"
$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"
}else{
$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"
$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"
}

array_push($newmessages, $msgstr);
Expand All @@ -126,7 +127,7 @@ function decryptmessage($msg)
$initvector = "aC92eG1PdGhuMXN6";
$decryptedmessage = openssl_decrypt($msg, "AES-256-CBC", $key, 0, $initvector);
$decryptedmessage = utf8_encode($decryptedmessage);

return $decryptedmessage;
}

Expand All @@ -151,4 +152,4 @@ function decryptmessage($msg)
}
}

?>
?>
96 changes: 0 additions & 96 deletions chatAJAX.php

This file was deleted.

Loading

0 comments on commit 1e5e775

Please sign in to comment.