home.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. <?php
  2. /**
  3. * Copyright 2021, 2024 5 Mode
  4. *
  5. * This file is part of Homomm.
  6. *
  7. * Homomm is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * Homomm is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with Homomm. If not, see <https://www.gnu.org/licenses/>.
  19. *
  20. * home.php
  21. *
  22. * Homomm home page.
  23. *
  24. * @author Daniele Bonini <my25mb@aol.com>
  25. * @copyrights (c) 2021, 2024, 5 Mode
  26. */
  27. $msgHistory = [];
  28. $cmd = PHP_STR;
  29. $opt = PHP_STR;
  30. $param1 = PHP_STR;
  31. $param2 = PHP_STR;
  32. $param3 = PHP_STR;
  33. $user = PHP_STR;
  34. $userName = PHP_STR;
  35. $userHint = PHP_STR;
  36. $userHintResolved = PHP_STR;
  37. $picPath = PHP_STR;
  38. function showHistory() {
  39. global $msgHistory;
  40. global $user;
  41. global $curPath;
  42. global $picPath;
  43. $i = 1;
  44. //echo "curPath=$curPath<br>";
  45. foreach($msgHistory as $val) {
  46. if ((mb_stripos($val, "-master") !== false) && ($user == "MASTER")) {
  47. $float = "right";
  48. } else if ((mb_stripos($val, "-master") === false) && ($user != "MASTER")) {
  49. $float = "right";
  50. } else {
  51. $float = "left";
  52. }
  53. echo("<div style='width:100%;height:auto;border:0px solid red;margin-bottom:12px;'>");
  54. $val = rtrim($val,"\n");
  55. // grab the time
  56. preg_match('/^.+-(\d{4})-/i', $val, $matches);
  57. $time = $matches[1];
  58. $time = ltrim(left($time,2),"0") . ":" . right($time,2);
  59. // parsing for file ext
  60. $fileext = strtolower(pathinfo($val, PATHINFO_EXTENSION));
  61. if ($fileext === "png" || $fileext === "jpg" || $fileext === "jpeg" || $fileext === "gif") {
  62. // grab the img
  63. $img = substr($picPath, strlen(APP_PATH)) . DIRECTORY_SEPARATOR . $val;
  64. echo("<div style='background-color:#EEEEEE;float:$float;padding:5px;max-width:300px;min-width:260px;'><img src='$img' style='width:100%;'><div style='float:right;font-size:9px;'>$time</div></div><br><br><br>");
  65. } else {
  66. // grab the msg
  67. $msg = HTMLencode(file_get_contents($curPath . DIRECTORY_SEPARATOR . "msgs" . DIRECTORY_SEPARATOR . $val));
  68. echo("<div style='background-color:#EEEEEE;float:$float;padding:5px;;max-width:300px;min-width:260px;'>".str_replace("\n", "<br>", $msg)."<div style='float:right;font-size:9px;'>$time</div></div><br><br><br>");
  69. }
  70. echo("<div style='clear:both;'></div>");
  71. echo("</div>");
  72. $i++;
  73. }
  74. }
  75. function updateHistory(&$update, $maxItems) {
  76. global $msgHistory;
  77. global $curPath;
  78. global $picPath;
  79. // Making enough space in $msgHistory for the update..
  80. $shift = (count($msgHistory) + count($update)) - $maxItems;
  81. if ($shift > 0) {
  82. $msgHistory = array_slice($msgHistory, $shift, $maxItems);
  83. }
  84. // Adding $msgHistory update..
  85. if (count($update) > $maxItems) {
  86. $beginUpd = count($update) - ($maxItems-1);
  87. } else {
  88. $beginUpd = 0;
  89. }
  90. $update = array_slice($update, $beginUpd, $maxItems);
  91. foreach($update as $val) {
  92. $msgHistory[] = $val;
  93. }
  94. // Deleting unused message files..
  95. foreach (glob($curPath . DIRECTORY_SEPARATOR . "msgs" . DIRECTORY_SEPARATOR . "*.msg") as $msgFilePath) {
  96. $msgFileName = basename($msgFilePath);
  97. if (!in_array($msgFileName."\n", $msgHistory)) {
  98. unlink($curPath . DIRECTORY_SEPARATOR . "msgs" . DIRECTORY_SEPARATOR . $msgFileName);
  99. }
  100. }
  101. // Deleting unused pic files..
  102. foreach (glob($picPath . DIRECTORY_SEPARATOR . "*") as $imgFilePath) {
  103. $imgFileName = basename($imgFilePath);
  104. if (!in_array($imgFileName."\n", $msgHistory)) {
  105. unlink($picPath . DIRECTORY_SEPARATOR . $imgFileName);
  106. }
  107. }
  108. // Writing out $msgHistory on disk..
  109. $filepath = $curPath . DIRECTORY_SEPARATOR . ".HMM_history";
  110. file_put_contents($filepath, implode('', $msgHistory));
  111. }
  112. function parseCommand() {
  113. global $command;
  114. global $cmd;
  115. global $opt;
  116. global $param1;
  117. global $param2;
  118. global $param3;
  119. $str = trim($command);
  120. $ipos = stripos($str, PHP_SPACE);
  121. if ($ipos > 0) {
  122. $cmd = left($str, $ipos);
  123. $str = substr($str, $ipos+1);
  124. } else {
  125. $cmd = $str;
  126. return;
  127. }
  128. if (left($str, 1) === "-") {
  129. $ipos = stripos($str, PHP_SPACE);
  130. if ($ipos > 0) {
  131. $opt = left($str, $ipos);
  132. $str = substr($str, $ipos+1);
  133. } else {
  134. $opt = $str;
  135. return;
  136. }
  137. }
  138. $ipos = stripos($str, PHP_SPACE);
  139. if ($ipos > 0) {
  140. $param1 = left($str, $ipos);
  141. $str = substr($str, $ipos+1);
  142. } else {
  143. $param1 = $str;
  144. return;
  145. }
  146. $ipos = stripos($str, PHP_SPACE);
  147. if ($ipos > 0) {
  148. $param2 = left($str, $ipos);
  149. $str = substr($str, $ipos+1);
  150. } else {
  151. $param2 = $str;
  152. return;
  153. }
  154. $ipos = stripos($str, PHP_SPACE);
  155. if ($ipos > 0) {
  156. $param3 = left($str, $ipos);
  157. $str = substr($str, $ipos+1);
  158. } else {
  159. $param3 = $str;
  160. return;
  161. }
  162. }
  163. function upload() {
  164. global $curPath;
  165. global $user;
  166. global $userName;
  167. global $picPath;
  168. //if (trim($message,"\n")!==PHP_STR) {
  169. // myExecSendMessage();
  170. //}
  171. //if (!empty($_FILES['files'])) {
  172. if (!empty($_FILES['files']['tmp_name'][0])) {
  173. $uploads = (array)fixMultipleFileUpload($_FILES['files']);
  174. //no file uploaded
  175. if ($uploads[0]['error'] === PHP_UPLOAD_ERR_NO_FILE) {
  176. //updateHistoryWithErr("No file uploaded.", false);
  177. return;
  178. }
  179. foreach($uploads as &$upload) {
  180. switch ($upload['error']) {
  181. case PHP_UPLOAD_ERR_OK:
  182. break;
  183. case PHP_UPLOAD_ERR_NO_FILE:
  184. //updateHistoryWithErr("One or more uploaded files are missing.", false);
  185. return;
  186. case PHP_UPLOAD_ERR_INI_SIZE:
  187. //updateHistoryWithErr("File exceeded INI size limit.", false);
  188. return;
  189. case PHP_UPLOAD_ERR_FORM_SIZE:
  190. //updateHistoryWithErr("File exceeded form size limit.", false);
  191. return;
  192. case PHP_UPLOAD_ERR_PARTIAL:
  193. //updateHistoryWithErr("File only partially uploaded.", false);
  194. return;
  195. case PHP_UPLOAD_ERR_NO_TMP_DIR:
  196. //updateHistoryWithErr("TMP dir doesn't exist.", false);
  197. return;
  198. case PHP_UPLOAD_ERR_CANT_WRITE:
  199. //updateHistoryWithErr("Failed to write to the disk.", false);
  200. return;
  201. case PHP_UPLOAD_ERR_EXTENSION:
  202. //updateHistoryWithErr("A PHP extension stopped the file upload.", false);
  203. return;
  204. default:
  205. //updateHistoryWithErr("Unexpected error happened.", false);
  206. return;
  207. }
  208. if (!is_uploaded_file($upload['tmp_name'])) {
  209. //updateHistoryWithErr("One or more file have not been uploaded.", false);
  210. return;
  211. }
  212. // name
  213. $name = (string)substr((string)filter_var($upload['name']), 0, 255);
  214. if ($name == PHP_STR) {
  215. //updateHistoryWithErr("Invalid file name: " . $name, false);
  216. return;
  217. }
  218. $upload['name'] = $name;
  219. // fileType
  220. $fileType = substr((string)filter_var($upload['type']), 0, 30);
  221. $upload['type'] = $fileType;
  222. // tmp_name
  223. $tmp_name = substr((string)filter_var($upload['tmp_name']), 0, 300);
  224. if ($tmp_name == PHP_STR || !file_exists($tmp_name)) {
  225. //updateHistoryWithErr("Invalid file temp path: " . $tmp_name, false);
  226. return;
  227. }
  228. $upload['tmp_name'] = $tmp_name;
  229. //size
  230. $size = substr((string)filter_var($upload['size'], FILTER_SANITIZE_NUMBER_INT), 0, 12);
  231. if ($size == "") {
  232. //updateHistoryWithErr("Invalid file size.", false);
  233. return;
  234. }
  235. $upload["size"] = $size;
  236. $tmpFullPath = $upload["tmp_name"];
  237. $originalFilename = pathinfo($name, PATHINFO_FILENAME);
  238. $originalFileExt = pathinfo($name, PATHINFO_EXTENSION);
  239. $fileExt = strtolower(pathinfo($name, PATHINFO_EXTENSION));
  240. if ($originalFileExt!==PHP_STR) {
  241. //$destFileName = $originalFilename . "." . $fileExt;
  242. if ($user === "master") {
  243. $destFileName = date("Ymd-Hm") . "-" . mt_rand(100000, 999999) . "-master.$fileExt";
  244. } else {
  245. $destFileName = date("Ymd-Hm") . "-" . mt_rand(100000, 999999) . "-$userName.$fileExt";
  246. }
  247. } else {
  248. return;
  249. }
  250. $destFullPath = $picPath . DIRECTORY_SEPARATOR . $destFileName;
  251. if (file_exists($destFullPath)) {
  252. //updateHistoryWithErr("destination already exists", false);
  253. return;
  254. }
  255. copy($tmpFullPath, $destFullPath);
  256. // Updating history..
  257. $output = [];
  258. $output[] = $destFileName . "\n";
  259. updateHistory($output, HISTORY_MAX_ITEMS);
  260. // Cleaning up..
  261. // Delete the tmp file..
  262. unlink($tmpFullPath);
  263. }
  264. }
  265. }
  266. function myExecSendMessage() {
  267. global $curPath;
  268. global $message;
  269. global $user;
  270. global $userName;
  271. global $sendSMS;
  272. global $CONFIG;
  273. if (!empty($message)) {
  274. if ($user == "MASTER") {
  275. $fileName = date("Ymd-Hm") . "-" . mt_rand(100000, 999999) . "-master.msg";
  276. } else {
  277. $fileName = date("Ymd-Hm") . "-" . mt_rand(100000, 999999) . "-$userName.msg";
  278. }
  279. $msg = HTMLencode($message);
  280. if (right($msg,1)!="\n") {
  281. $msg = $msg . "\n";
  282. }
  283. // Creating the msg file..
  284. file_put_contents($curPath . DIRECTORY_SEPARATOR . "msgs" . DIRECTORY_SEPARATOR . $fileName, $msg);
  285. // Updating message history..
  286. $output = [];
  287. $output[] = $fileName . "\n";
  288. updateHistory($output, HISTORY_MAX_ITEMS);
  289. // Sending out the sms notifcation..
  290. if ($sendSMS && SMS_USERNAME!=PHP_STR) {
  291. $message = array(
  292. 'To'=>$CONFIG['AUTH'][$user]['PHONE'],
  293. 'MessagingServiceSid'=>SMS_MESSAGING_SERVICE,
  294. 'Body'=>SMS_BODY
  295. );
  296. sendSMS($message, SMS_API_URL, SMS_USERNAME, SMS_PASSWORD);
  297. }
  298. }
  299. }
  300. $password = filter_input(INPUT_POST, "Password");
  301. $command = filter_input(INPUT_POST, "CommandLine");
  302. $message = filter_input(INPUT_POST, "MessageLine");
  303. $sendSMS1 = filter_input(INPUT_POST, "chkSMS");
  304. if ($sendSMS1!="") {
  305. $sendSMS = true;
  306. } else {
  307. $sendSMS = false;
  308. }
  309. $pwd = PHP_STR;
  310. $userHint = filter_input(INPUT_POST, "userHint");
  311. $userHintResolved = PHP_STR;
  312. if ($userHint!=PHP_STR) {
  313. $found=false;
  314. foreach ($CONFIG['AUTH'] as $key => $val) {
  315. if ($userHint==$val['USERNAME']) {
  316. $userHintResolved = $key;
  317. $found=true;
  318. break;
  319. }
  320. }
  321. if (!$found) {
  322. die("Invalid chat!");
  323. }
  324. }
  325. $hideSplash = filter_input(INPUT_POST, "hideSplash");
  326. $hideHCSplash = filter_input(INPUT_POST, "hideHCSplash");
  327. //echo "password=*$password*<br>";
  328. if ($password != PHP_STR) {
  329. $hash = hash("sha256", $password . APP_SALT, false);
  330. $found=false;
  331. foreach ($CONFIG['AUTH'] as $key => $val) {
  332. //echo ("username=".$val['USERNAME']."<br>");
  333. if ($hash==$val['HASH']) {
  334. $user = $key;
  335. if ($userHintResolved==PHP_STR) {
  336. $userHintResolved = $key;
  337. }
  338. $found=true;
  339. break;
  340. }
  341. }
  342. if (!$found) {
  343. $password=PHP_STR;
  344. }
  345. if ($password != PHP_STR) {
  346. $userName = $CONFIG['AUTH'][$user]['USERNAME'];
  347. $pwd = APP_REPO_PATH . DIRECTORY_SEPARATOR . $CONFIG['AUTH'][$userHintResolved]['REPO_FOLDER'];
  348. $picPath = APP_PIC_PATH . DIRECTORY_SEPARATOR . $CONFIG['AUTH'][$userHintResolved]['PIC_FOLDER'];
  349. }
  350. }
  351. $curPath = APP_REPO_PATH;
  352. if ($pwd!==PHP_STR) {
  353. if (left($pwd, strlen(APP_REPO_PATH)) === APP_REPO_PATH) {
  354. $curPath = $pwd;
  355. chdir($curPath);
  356. if (!file_exists($curPath . DIRECTORY_SEPARATOR . ".HMM_history")) {
  357. $output = [];
  358. file_put_contents($curPath . DIRECTORY_SEPARATOR . ".HMM_history", $output);
  359. }
  360. if (!file_exists($curPath . DIRECTORY_SEPARATOR . "msgs")) {
  361. mkdir("msgs", 0777);
  362. }
  363. }
  364. }
  365. $ipos = strripos($curPath, PHP_SLASH);
  366. $curDir = substr($curPath, $ipos);
  367. if ($password !== PHP_STR) {
  368. $msgHistory = file($curPath . DIRECTORY_SEPARATOR . ".HMM_history");
  369. parseCommand($command);
  370. //echo("cmd=" . $cmd . "<br>");
  371. //echo("opt=" . $opt . "<br>");
  372. //echo("param1=" . $param1 . "<br>");
  373. //echo("param2=" . $param2 . "<br>");
  374. //upload();
  375. if (mb_stripos(CMDLINE_VALIDCMDS, "|" . $command . "|")) {
  376. if ($command === "sendmsg") {
  377. if (trim($message,"\n")!==PHP_STR) {
  378. myExecSendMessage();
  379. upload();
  380. }
  381. }
  382. } else if (mb_stripos(CMDLINE_VALIDCMDS, "|" . $cmd . "|")) {
  383. } else {
  384. // if I'm not saving data..
  385. //if (empty($editBoardParams) || $editBoardParams[0]['location']===PHP_STR) {
  386. // if (empty($_FILES['files']['tmp_name'][0])) {
  387. // updateHistoryWithErr("invalid command");
  388. // }
  389. //}
  390. }
  391. } else {
  392. $msgHistory = [];
  393. }
  394. ?>
  395. <!DOCTYPE html>
  396. <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
  397. <head>
  398. <meta charset="UTF-8"/>
  399. <meta name="style" content="day1"/>
  400. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  401. <!--
  402. Copyright 2021, 2024 5 Mode
  403. This file is part of Homomm.
  404. Homomm is free software: you can redistribute it and/or modify
  405. it under the terms of the GNU General Public License as published by
  406. the Free Software Foundation, either version 3 of the License, or
  407. (at your option) any later version.
  408. Homomm is distributed in the hope that it will be useful,
  409. but WITHOUT ANY WARRANTY; without even the implied warranty of
  410. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  411. GNU General Public License for more details.
  412. You should have received a copy of the GNU General Public License
  413. along with Homomm. If not, see <https://www.gnu.org/licenses/>.
  414. -->
  415. <title>Homomm: every person its messages..</title>
  416. <link rel="shortcut icon" href="./res/favicon66.ico?v=<?php echo(time()); ?>" />
  417. <meta name="description" content="Welcome to <?php echo(APP_NAME); ?>"/>
  418. <meta name="author" content="5 Mode"/>
  419. <meta name="robots" content="noindex"/>
  420. <script src="./js/jquery-3.1.0.min.js" type="text/javascript"></script>
  421. <script src="./js/common.js" type="text/javascript"></script>
  422. <script src="./js/bootstrap.min.js" type="text/javascript"></script>
  423. <script src="./js/sha.js" type="text/javascript"></script>
  424. <script src="./js/home.js" type="text/javascript" defer></script>
  425. <link href="./css/bootstrap.min.css" type="text/css" rel="stylesheet">
  426. <link href="./css/style.css?v=<?php echo(time()); ?>" type="text/css" rel="stylesheet">
  427. <script>
  428. function upload() {
  429. <?PHP if ($password!==PHP_STR): ?>
  430. $("input#files").click();
  431. <?PHP endif; ?>
  432. }
  433. window.addEventListener("load", function() {
  434. <?php if($password===PHP_STR):?>
  435. $("#Password").addClass("emptyfield");
  436. <?php endif; ?>
  437. maxY = document.getElementById("Console").scrollHeight;
  438. //alert(maxY);
  439. document.getElementById("MessageLine").focus();
  440. document.getElementById("Console").scrollTop=maxY;
  441. }, true);
  442. function hideTitle() {
  443. $("#myh1").hide("slow");
  444. }
  445. function startApp() {
  446. $("#HCsplash").hide("slow");
  447. $(document.body).css("background","#ffffff");
  448. $("#frmHC").show();
  449. <?php if (APP_SPLASH): ?>
  450. $(document.body).css("overflow-y","auto");
  451. <?php endif; ?>
  452. }
  453. <?php if($hideHCSplash!=="1"): ?>
  454. window.addEventListener("load", function() {
  455. //$("#HCsplash").show();
  456. //setTimeout("startApp()", 5000);
  457. $(document.body).css("background","#000000");
  458. $("#HCsplash").show("slow");
  459. setTimeout("hideTitle()", 2000);
  460. setTimeout("startApp()", 4000);
  461. }, true);
  462. <?php else: ?>
  463. window.addEventListener("load", function() {
  464. startApp();
  465. });
  466. <?php endif; ?>
  467. </script>
  468. </head>
  469. <body>
  470. <div id="HCsplash" style="padding-top: 160px; text-align:center;color:#ffffff;display:none;">
  471. <div id="myh1"><H1>Homomm</H1></div><br>
  472. <img src="./Public/static/res/HMMlogo2.png" style="width:310px;">
  473. </div>
  474. <form id="frmHC" method="POST" action="/" target="_self" enctype="multipart/form-data" style="display:<?php echo(($hideHCSplash==="1"?"inline":"none"));?>;">
  475. <div class="header">
  476. <a href="http://homomm.org" target="_blank" style="color:black; text-decoration: none;"><img src="/res/HMMlogo2.png" style="width:48px;">&nbsp;Homomm</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://github.com/par7133/Homomm" style="color:#000000"><span style="color:#119fe2">on</span> github</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="mailto:info@homomm.com" style="color:#000000"><span style="color:#119fe2">for</span> feedback</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="tel:+39-331-4029415" style="font-size:13px;background-color:#15c60b;border:2px solid #15c60b;color:black;height:27px;text-decoration:none;">&nbsp;&nbsp;get support&nbsp;&nbsp;</a>
  477. </div>
  478. <div style="clear:both; float:left; padding:8px; width:15%; height:100%; text-align:center;">
  479. <?php if ($user!="MASTER"): ?>
  480. <br><br>
  481. <img src="/res/HMMgenius.png" alt="HC Genius" title="HC Genius" style="position:relative; left:+6px; width:90%; border: 1px dashed #EEEEEE;">
  482. <?php else: ?>
  483. <div style="text-align:left;">&nbsp;Friends</div><br>
  484. <div style="position:relative;top:-10px;left:+6px; width:90%; overflow-y:auto; height:244px; border: 1px dashed #EEEEEE;">
  485. <?php foreach($CONFIG['AUTH'] as $key => $val):
  486. $myusername = $val['USERNAME'];
  487. echo("<div class=\"friend\" onclick=\"changeChat('$myusername')\" style=\"text-align:left;cursor:pointer;\">&nbsp;&nbsp;$myusername</div>");
  488. endforeach; ?>
  489. </div>
  490. <?php endif; ?>
  491. <div id="upload-cont"><input id="files" name="files[]" type="file" accept=".gif,.png,.jpg,.jpeg" style="visibility: hidden;"></div>
  492. &nbsp;<br><br>
  493. &nbsp;<input type="text" id="Password" name="Password" placeholder="password" style="font-size:10px; background:#393939; color:#ffffff; width: 90%; border-radius:3px;" value="<?php echo($password);?>" autocomplete="off"><br>
  494. &nbsp;<input type="text" id="Salt" placeholder="salt" style="position:relative; top:+5px; font-size:10px; background:#393939; color:#ffffff; width: 90%; border-radius:3px;" autocomplete="off"><br>
  495. &nbsp;<a href="#" onclick="showEncodedPassword();" style="position:relative; left:-2px; top:+5px; color:#000000; font-size:12px;">Hash Me!</a>
  496. </div>
  497. <div style="float:left; width:85%;height:600px; padding:8px; border-left: 1px solid #2c2f34;">
  498. <?php if (APP_SPLASH): ?>
  499. <?php if ($hideSplash !== PHP_STR): ?>
  500. <div id="splash" style="border-radius:20px; position:relative; left:+3px; width:98%; background-color: #33aced; padding: 20px; margin-bottom:8px;">
  501. <button type="button" class="close" aria-label="Close" onclick="closeSplash();" style="position:relative; left:-10px;">
  502. <span aria-hidden="true">&times;</span>
  503. </button>
  504. Hello and welcome to Homomm!<br><br>
  505. Homomm is a light and simple software on premise to exchange multimedia messages with friends.<br><br>
  506. Homomm is released under GPLv3 license, it is supplied AS-IS and we do not take any responsibility for its misusage.<br><br>
  507. Homomm name comes from the two words, "homines" meaning our choise to give chance to the human beings to come first,
  508. and "mm" for "multimedia messaging".<br><br>
  509. Homomm doesn't want to be a replacement of Whats App, Telegram, Wechat, etc. but simply want to be their alter ago.<br><br>
  510. First step, use the left side panel password and salt fields to create the hash to insert in the config file. Remember to manually set there also the salt value.<br><br>
  511. As you are going to run Homomm in the PHP process context, using a limited web server or phpfpm user, you must follow some simple directives for an optimal first setup:<br>
  512. <ol>
  513. <li>Check the permissions of your "Repo" folder in your web app private path; and set its path in the config file.</li>
  514. <li>In the Repo path create a "user" folder for each user and give to this folder the write permission. Set it appropriately in the config file.</li>
  515. <li>In the config file, set every "user" information appropriately like in the examples given.</li>
  516. <li>Configure your Twilio account information appropriately to send out sms notification.</li>
  517. <li>Configure the max history items and max recall history items as required (default: 50).</li>
  518. </ol>
  519. <br>
  520. Hope you can enjoy it and let us know about any feedback: <a href="mailto:info@homemm.com" style="color:#e6d236;">info@homemm.com</a>
  521. </div>
  522. <?php endif; ?>
  523. <?php endif; ?>
  524. &nbsp;Message board<br>
  525. <div id="Console" style="height:433px; overflow-y:auto; margin-top:10px;">
  526. <!--<div id="Console" style="height:493px; margin-top:10px;">-->
  527. <pre id="Consolep" style="min-height:433px;margin-left:5px;padding:10px;border:0px;background:url('/res/console-bg.png'); background-size:cover; color: #000000;">
  528. <?php showHistory($msgHistory); ?>
  529. <div style="clear:both"></div>
  530. </pre>
  531. </div>
  532. <pre id="Messagep" style="position:relative;top:-10px;margin-left:5px;padding:10px;padding-top:0px;border:0px;background:url('/res/console-bg.png'); background-size:cover; color: #000000;">
  533. <div id="MessageL" style="position:relative;top:-23px;border:0px solid black;"><div style="float:left;width:93%; position:relative; top:+40px;border:0px solid black;"><textarea id="MessageLine" name="MessageLine" type="text" autocomplete="off" rows="3" placeholder="Message" style="float:left;width:86%;resize:none; background-color: white; color:black; border:0px; border-bottom: 1px dashed #EEEEEE;"></textarea><div id="sendOptions" style="float:left;position:relative;top:-1px;width:14%;background-color:#49a1d6;height:59px;white-space:nowrap;padding:3px;border:0px solid green;background:url('/res/send-opts-bg.png');font-weight:900;"><input type="checkbox" name="chkSMS" value="sms">&nbsp;SMS&nbsp;<br><div onclick="upload();" style="position:relative;top:+5px;left:+45px;cursor:pointer;"><img src="/res/upload.png" style="width:28px;"></div><div id="del-attach" onclick="clearUpload()" style="position:relative;top:-48px;left:-60px;display:none;cursor:pointer;"><img src="/res/del-attach.png" style="width:48px;"></div></div></div><div style="float:left;width:7%;position:relative;top:+39px;cursor:pointer;border:0px solid red;" onclick="sendMessage()"><img src="/res/send.png" style="float:left;width:63px"></div></div>
  534. <div style="clear:both"></div>
  535. </pre>
  536. </div>
  537. <div class="footer">
  538. <div id="footerCont">&nbsp;</div>
  539. <div id="footer"><span style="background:#FFFFFF;opacity:1.0;margin-right:10px;">&nbsp;&nbsp;A <a href="http://5mode.com">5 Mode</a> project and <a href="http://wysiwyg.systems">WYSIWYG</a> system. Some rights reserved.</span></div>
  540. </div>
  541. <input type="hidden" id="CommandLine" name="CommandLine">
  542. <input type="hidden" name="pwd" value="<?php echo($curPath); ?>" style="color:black">
  543. <input type="hidden" id="userHint" name="userHint" value="<?php echo($userHint); ?>">
  544. <input type="hidden" name="hideSplash" value="<?php echo($hideSplash); ?>">
  545. <input type="hidden" name="hideHCSplash" value="1">
  546. </form>
  547. </body>
  548. </html>