home.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  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. global $userHintResolved;
  274. if (!empty($message)) {
  275. if ($user == "MASTER") {
  276. $fileName = date("Ymd-Hm") . "-" . mt_rand(100000, 999999) . "-master.msg";
  277. } else {
  278. $fileName = date("Ymd-Hm") . "-" . mt_rand(100000, 999999) . "-$userName.msg";
  279. }
  280. $msg = HTMLencode($message);
  281. if (right($msg,1)!="\n") {
  282. $msg = $msg . "\n";
  283. }
  284. // Creating the msg file..
  285. file_put_contents($curPath . DIRECTORY_SEPARATOR . "msgs" . DIRECTORY_SEPARATOR . $fileName, $msg);
  286. // Updating message history..
  287. $output = [];
  288. $output[] = $fileName . "\n";
  289. updateHistory($output, HISTORY_MAX_ITEMS);
  290. if ($user == "MASTER") {
  291. $smsUser = $userHintResolved;
  292. } else {
  293. $smsUser = "MASTER";
  294. }
  295. // Sending out the sms notifcation..
  296. if ($sendSMS && SMS_USERNAME!=PHP_STR) {
  297. $message = array(
  298. 'To'=>$CONFIG['AUTH'][$smsUser]['PHONE'],
  299. 'MessagingServiceSid'=>SMS_MESSAGING_SERVICE,
  300. 'Body'=>SMS_BODY
  301. );
  302. sendSMS($message, SMS_API_URL, SMS_USERNAME, SMS_PASSWORD);
  303. }
  304. }
  305. }
  306. $password = filter_input(INPUT_POST, "Password");
  307. $command = filter_input(INPUT_POST, "CommandLine");
  308. $message = filter_input(INPUT_POST, "MessageLine");
  309. $sendSMS1 = filter_input(INPUT_POST, "chkSMS");
  310. if ($sendSMS1!="") {
  311. $sendSMS = true;
  312. } else {
  313. $sendSMS = false;
  314. }
  315. $pwd = PHP_STR;
  316. $userHint = filter_input(INPUT_POST, "userHint");
  317. $userHintResolved = PHP_STR;
  318. if ($userHint!=PHP_STR) {
  319. $found=false;
  320. foreach ($CONFIG['AUTH'] as $key => $val) {
  321. if ($userHint==$val['USERNAME']) {
  322. $userHintResolved = $key;
  323. $found=true;
  324. break;
  325. }
  326. }
  327. if (!$found) {
  328. die("Invalid chat!");
  329. }
  330. }
  331. $hideSplash = filter_input(INPUT_POST, "hideSplash");
  332. $hideHCSplash = filter_input(INPUT_POST, "hideHCSplash");
  333. //echo "password=*$password*<br>";
  334. if ($password != PHP_STR) {
  335. $hash = hash("sha256", $password . APP_SALT, false);
  336. $found=false;
  337. foreach ($CONFIG['AUTH'] as $key => $val) {
  338. //echo ("username=".$val['USERNAME']."<br>");
  339. if ($hash==$val['HASH']) {
  340. $user = $key;
  341. if ($userHintResolved==PHP_STR) {
  342. $userHintResolved = $key;
  343. }
  344. $found=true;
  345. break;
  346. }
  347. }
  348. if (!$found) {
  349. $password=PHP_STR;
  350. }
  351. if ($password != PHP_STR) {
  352. $userName = $CONFIG['AUTH'][$user]['USERNAME'];
  353. $pwd = APP_REPO_PATH . DIRECTORY_SEPARATOR . $CONFIG['AUTH'][$userHintResolved]['REPO_FOLDER'];
  354. $picPath = APP_PIC_PATH . DIRECTORY_SEPARATOR . $CONFIG['AUTH'][$userHintResolved]['PIC_FOLDER'];
  355. }
  356. }
  357. $curPath = APP_REPO_PATH;
  358. if ($pwd!==PHP_STR) {
  359. if (left($pwd, strlen(APP_REPO_PATH)) === APP_REPO_PATH) {
  360. $curPath = $pwd;
  361. chdir($curPath);
  362. if (!file_exists($curPath . DIRECTORY_SEPARATOR . ".HMM_history")) {
  363. $output = [];
  364. file_put_contents($curPath . DIRECTORY_SEPARATOR . ".HMM_history", $output);
  365. }
  366. if (!file_exists($curPath . DIRECTORY_SEPARATOR . "msgs")) {
  367. mkdir("msgs", 0777);
  368. }
  369. }
  370. }
  371. $ipos = strripos($curPath, PHP_SLASH);
  372. $curDir = substr($curPath, $ipos);
  373. if ($password !== PHP_STR) {
  374. $msgHistory = file($curPath . DIRECTORY_SEPARATOR . ".HMM_history");
  375. parseCommand($command);
  376. //echo("cmd=" . $cmd . "<br>");
  377. //echo("opt=" . $opt . "<br>");
  378. //echo("param1=" . $param1 . "<br>");
  379. //echo("param2=" . $param2 . "<br>");
  380. //upload();
  381. if (mb_stripos(CMDLINE_VALIDCMDS, "|" . $command . "|")) {
  382. if ($command === "sendmsg") {
  383. if (trim($message,"\n")!==PHP_STR) {
  384. myExecSendMessage();
  385. upload();
  386. }
  387. }
  388. } else if (mb_stripos(CMDLINE_VALIDCMDS, "|" . $cmd . "|")) {
  389. } else {
  390. // if I'm not saving data..
  391. //if (empty($editBoardParams) || $editBoardParams[0]['location']===PHP_STR) {
  392. // if (empty($_FILES['files']['tmp_name'][0])) {
  393. // updateHistoryWithErr("invalid command");
  394. // }
  395. //}
  396. }
  397. } else {
  398. $msgHistory = [];
  399. }
  400. ?>
  401. <!DOCTYPE html>
  402. <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
  403. <head>
  404. <meta charset="UTF-8"/>
  405. <meta name="style" content="day1"/>
  406. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  407. <!--
  408. Copyright 2021, 2024 5 Mode
  409. This file is part of Homomm.
  410. Homomm is free software: you can redistribute it and/or modify
  411. it under the terms of the GNU General Public License as published by
  412. the Free Software Foundation, either version 3 of the License, or
  413. (at your option) any later version.
  414. Homomm is distributed in the hope that it will be useful,
  415. but WITHOUT ANY WARRANTY; without even the implied warranty of
  416. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  417. GNU General Public License for more details.
  418. You should have received a copy of the GNU General Public License
  419. along with Homomm. If not, see <https://www.gnu.org/licenses/>.
  420. -->
  421. <title>Homomm: every person its messages..</title>
  422. <link rel="shortcut icon" href="./res/favicon.ico?v=<?php echo(time()); ?>" />
  423. <meta name="description" content="Welcome to <?php echo(APP_NAME); ?>"/>
  424. <meta name="author" content="5 Mode"/>
  425. <meta name="robots" content="noindex"/>
  426. <script src="./js/jquery-3.1.0.min.js" type="text/javascript"></script>
  427. <script src="./js/common.js" type="text/javascript"></script>
  428. <script src="./js/bootstrap.min.js" type="text/javascript"></script>
  429. <script src="./js/sha.js" type="text/javascript"></script>
  430. <script src="./js/home.js" type="text/javascript" defer></script>
  431. <link href="./css/bootstrap.min.css" type="text/css" rel="stylesheet">
  432. <link href="./css/style.css?v=<?php echo(time()); ?>" type="text/css" rel="stylesheet">
  433. <script>
  434. function upload() {
  435. <?PHP if ($password!==PHP_STR): ?>
  436. $("input#files").click();
  437. <?PHP endif; ?>
  438. }
  439. window.addEventListener("load", function() {
  440. <?php if($password===PHP_STR):?>
  441. $("#Password").addClass("emptyfield");
  442. <?php endif; ?>
  443. maxY = document.getElementById("Console").scrollHeight;
  444. //alert(maxY);
  445. document.getElementById("MessageLine").focus();
  446. document.getElementById("Console").scrollTop=maxY;
  447. }, true);
  448. function hideTitle() {
  449. $("#myh1").hide("slow");
  450. }
  451. function startApp() {
  452. $("#HCsplash").hide("slow");
  453. $(document.body).css("background","#ffffff");
  454. $("#frmHC").show();
  455. <?php if (APP_SPLASH): ?>
  456. $(document.body).css("overflow-y","auto");
  457. <?php endif; ?>
  458. }
  459. <?php if($hideHCSplash!=="1"): ?>
  460. window.addEventListener("load", function() {
  461. //$("#HCsplash").show();
  462. //setTimeout("startApp()", 5000);
  463. $(document.body).css("background","#000000");
  464. $("#HCsplash").show("slow");
  465. setTimeout("hideTitle()", 2000);
  466. setTimeout("startApp()", 4000);
  467. }, true);
  468. <?php else: ?>
  469. window.addEventListener("load", function() {
  470. startApp();
  471. });
  472. <?php endif; ?>
  473. </script>
  474. </head>
  475. <body>
  476. <div id="HCsplash" style="padding-top: 160px; text-align:center;color:#ffffff;display:none;">
  477. <div id="myh1"><H1>Homomm</H1></div><br>
  478. <img src="./Public/static/res/HMMlogo2.png" style="width:310px;">
  479. </div>
  480. <form id="frmHC" method="POST" action="/" target="_self" enctype="multipart/form-data" style="display:<?php echo(($hideHCSplash==="1"?"inline":"none"));?>;">
  481. <div class="header">
  482. <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>
  483. </div>
  484. <div style="clear:both; float:left; padding:8px; width:15%; height:100%; text-align:center;">
  485. <?php if ($user!="MASTER"): ?>
  486. <br><br>
  487. <img src="/res/HMMgenius.png" alt="HC Genius" title="HC Genius" style="position:relative; left:+6px; width:90%; border: 1px dashed #EEEEEE;">
  488. <?php else: ?>
  489. <div style="text-align:left;">&nbsp;Friends</div><br>
  490. <div style="position:relative;top:-10px;left:+6px; width:90%; overflow-y:auto; height:244px; border: 1px dashed #EEEEEE;">
  491. <?php foreach($CONFIG['AUTH'] as $key => $val):
  492. $myusername = $val['USERNAME'];
  493. echo("<div class=\"friend\" onclick=\"changeChat('$myusername')\" style=\"text-align:left;cursor:pointer;\">&nbsp;&nbsp;$myusername</div>");
  494. endforeach; ?>
  495. </div>
  496. <?php endif; ?>
  497. <div id="upload-cont"><input id="files" name="files[]" type="file" accept=".gif,.png,.jpg,.jpeg" style="visibility: hidden;"></div>
  498. &nbsp;<br><br>
  499. &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>
  500. &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>
  501. &nbsp;<a href="#" onclick="showEncodedPassword();" style="position:relative; left:-2px; top:+5px; color:#000000; font-size:12px;">Hash Me!</a>
  502. </div>
  503. <div style="float:left; width:85%;height:600px; padding:8px; border-left: 1px solid #2c2f34;">
  504. <?php if (APP_SPLASH): ?>
  505. <?php if ($hideSplash !== PHP_STR): ?>
  506. <div id="splash" style="border-radius:20px; position:relative; left:+3px; width:98%; background-color: #33aced; padding: 20px; margin-bottom:8px;">
  507. <button type="button" class="close" aria-label="Close" onclick="closeSplash();" style="position:relative; left:-10px;">
  508. <span aria-hidden="true">&times;</span>
  509. </button>
  510. Hello and welcome to Homomm!<br><br>
  511. Homomm is a light and simple software on premise to exchange multimedia messages with friends.<br><br>
  512. Homomm is released under GPLv3 license, it is supplied AS-IS and we do not take any responsibility for its misusage.<br><br>
  513. Homomm name comes from the two words, "homines" meaning our choise to give chance to the human beings to come first,
  514. and "mm" for "multimedia messaging".<br><br>
  515. Homomm doesn't want to be a replacement of Whats App, Telegram, Wechat, etc. but simply want to be their alter ago.<br><br>
  516. 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>
  517. 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>
  518. <ol>
  519. <li>Check the permissions of your "Repo" folder in your web app private path; and set its path in the config file.</li>
  520. <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>
  521. <li>In the config file, set every "user" information appropriately like in the examples given.</li>
  522. <li>Configure your Twilio account information appropriately to send out sms notification.</li>
  523. <li>Configure the max history items and max recall history items as required (default: 50).</li>
  524. </ol>
  525. <br>
  526. Hope you can enjoy it and let us know about any feedback: <a href="mailto:info@homemm.org" style="color:#e6d236;">info@homemm.org</a>
  527. </div>
  528. <?php endif; ?>
  529. <?php endif; ?>
  530. &nbsp;Message board<br>
  531. <div id="Console" style="height:433px; overflow-y:auto; margin-top:10px;">
  532. <!--<div id="Console" style="height:493px; margin-top:10px;">-->
  533. <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;">
  534. <?php showHistory($msgHistory); ?>
  535. <div style="clear:both"></div>
  536. </pre>
  537. </div>
  538. <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;">
  539. <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>
  540. <div style="clear:both"></div>
  541. </pre>
  542. </div>
  543. <div class="footer">
  544. <div id="footerCont">&nbsp;</div>
  545. <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>
  546. </div>
  547. <input type="hidden" id="CommandLine" name="CommandLine">
  548. <input type="hidden" name="pwd" value="<?php echo($curPath); ?>" style="color:black">
  549. <input type="hidden" id="userHint" name="userHint" value="<?php echo($userHint); ?>">
  550. <input type="hidden" name="hideSplash" value="<?php echo($hideSplash); ?>">
  551. <input type="hidden" name="hideHCSplash" value="1">
  552. </form>
  553. </body>
  554. </html>