12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064 |
- <?php
- /**
- * Copyright 2021, 2024 5 Mode
- *
- * This file is part of StarWorth.
- *
- * StarWorth is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * StarWorth is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with StarWorth. If not, see <https://www.gnu.org/licenses/>.
- *
- * index.php
- *
- * StarWorth home page.
- *
- * @author Daniele Bonini <my25mb@aol.com>
- * @copyrights (c) 2021, 2024, 5 Mode
- */
-
- require "init.inc";
-
- // echo(" " . time());
-
- $contextType = PUBLIC_CONTEXT_TYPE;
-
- $signHistory = [];
- $cmd = PHP_STR;
- $opt = PHP_STR;
- $param1 = PHP_STR;
- $param2 = PHP_STR;
- $param3 = PHP_STR;
-
- $curLocale = APP_LOCALE;
- function doAging($param1) {
- global $signHistory;
- global $curPath;
-
- $mysign= trim($param1,"'");
-
- $ret = $mysign;
-
- if ($signHistory) {
-
- $ipos = stripos($mysign, PHP_PIPE);
- $oldTimestamp = (int)left($mysign, $ipos);
-
- if ((time() -$oldTimestamp) > APP_MAX_AGE) {
- $newval = str_repeat("0",strlen(time())).PHP_PIPE.substr($mysign,$ipos+1);
- //echo("**$newval**");
- $ret = $newval;
-
- $key = array_search($mysign."\n", $signHistory);
- if ($key !== false) {
- $signHistory[$key] = $newval . "\n";
- // Writing out $signHistory on disk..
- $filepath = $curPath . DIRECTORY_SEPARATOR . ".SW_history";
- file_put_contents($filepath, implode('', $signHistory));
- }
- }
- }
- return $ret;
- }
- function showHistory() {
- global $signHistory;
- global $curPath;
- global $CONFIG;
- global $curLocale;
- global $LOCALE;
- global $password;
- global $contextType;
-
- $signHistoryCopy = $signHistory;
-
- rsort($signHistoryCopy);
- echo("<div id='events'>");
-
- $m = 1;
- foreach($signHistoryCopy as $val) {
-
- $val = rtrim($val, "\n");
- $val = doAging($val);
-
- $mytag = PHP_STR;
- $myccounter = PHP_STR;
- $mydate = PHP_STR;
- $mytime = PHP_STR;
- $mydesc = PHP_STR;
- $myflag = PHP_STR;
-
- $aFields = explode(PHP_PIPE, $val);
-
- $mytag = $aFields[0]??"0000";
- $myccounter = (int)$aFields[1]??PHP_STR;
- $mydate = $aFields[2]??PHP_STR;
- $mytime = $aFields[3]??PHP_STR;
- $mydesc = $aFields[4]??PHP_STR;
- $myflag = $aFields[5]??PHP_STR;
-
- if ($mydate==PHP_STR && $mydesc==PHP_STR) {
- continue;
- }
-
- //$mytag = date("Hi", $mytag); //right($mytag??"0000", 4);
- //$mytag = left($mytag, 2).":".right($mytag, 2);
- $myoritag = right($mytag??"0000", 4);
- $mytag = date("Hi", $mytag);
- $mytag = left($mytag, 2).":".right($mytag, 2);
- $yesStar = ($myoritag==="0000")?false:true;
- $myccounter = left($myccounter,6);
-
- // If I'm in admin
- if ($contextType === PERSONAL_CONTEXT_TYPE) {
- $star= PHP_STR;
- if ($yesStar) {
- $starFnc= " <a href='#' onclick=\"setStar('" . $val . "')\"><img src='/SW_res/star.png' style='width:26px;'></a>";
- } else {
- $starFnc = " <a href='#' onclick=\"setStar('" . $val . "')\"><img src='/SW_res/setstar.png' style='width:26px;'></a>";
- }
-
- $adminFnc = PHP_STR;
- if ($myflag === "u") {
- $adminFnc = "<a href='#' onclick=\"confSign('" . $val . "')\"><img src='/SW_res/confirm.png' style='width:26px;'></a>";
- } else {
- $adminFnc = "<a href='#' onclick=\"delSign('" . $val . "')\"><img src='/SW_res/del.png' style='width:26px;'></a>";
- }
-
- // Display event/calendar list
-
- echo("<table class='table-event' align='center'>");
- echo("<tr>");
- echo("<td class='td-data-date'>");
- echo("<span class='data-date' style='font-family:".DISPLAY_DATE_FONT.";'>".$mydate."</span>");
- echo("</td>");
- echo("<td class='td-data-time'>");
- echo("<span class='data-time' style='font-family:".DISPLAY_DATE_FONT.";'>".$mytime."</span>");
- echo("</td>");
- echo("<td class='td-data-desc'>");
- echo("<span class='data-desc'>".$mydesc."</span>");
- echo("</td>");
- echo("<td class='td-star'>");
- echo($starFnc);
- echo("</td>");
- echo("<td class='td-admin'>");
- echo($adminFnc);
- echo("</td>");
- echo("</tr>");
- echo("</table>");
-
- // If I'm not in admin
- } else {
-
- $mydesc = enableLinks($mydesc);
-
- if ($myflag !== "u") {
- $star= PHP_STR;
- if ($yesStar) {
- $star= "<img src='/SW_res/star.png' style='width:26px;'> (".$mytag.")";
- } else {
- $star = "<a href='#' onclick='showSideBar();'><img src='/SW_res/setstar.png' style='width:26px;'></a>";
- }
- // Display event list
- echo("<table class='table-event' align='center'>");
- echo("<tr>");
- echo("<td class='td-data-star'>");
- echo("$star");
- echo("</td>");
- echo("<td class='td-data-date'>");
- echo("<span class='data-date' style='font-family:".DISPLAY_DATE_FONT.";'>".$mydate."</span>");
- echo("</td>");
- echo("<td class='td-data-time'>");
- echo("<span class='data-time' style='font-family:".DISPLAY_DATE_FONT.";'>".$mytime."</span>");
- echo("</td>");
- echo("<td class='td-data-desc' style='width:76%;'>");
- echo("<span class='data-desc'>".$mydesc." (".$myccounter.")</span>");
- echo("</td>");
- echo("</tr>");
- echo("</table>");
- }
- }
-
- $m++;
- }
-
- echo("</div>");
- }
- function updateHistory(&$update, $maxItems) {
- global $signHistory;
- global $curPath;
-
- // Making enough space in $signHistory for the update..
- $shift = (count($signHistory) + count($update)) - $maxItems;
- if ($shift > 0) {
- $signHistory = array_slice($signHistory, $shift, $maxItems);
- }
- // Adding $signHistory update..
- if (count($update) > $maxItems) {
- $beginUpd = count($update) - ($maxItems-1);
- } else {
- $beginUpd = 0;
- }
- $update = array_slice($update, $beginUpd, $maxItems);
- foreach($update as $val) {
- $signHistory[] = $val;
- }
-
- // Writing out $signHistory on disk..
- $filepath = $curPath . DIRECTORY_SEPARATOR . ".SW_history";
- file_put_contents($filepath, implode('', $signHistory));
- }
- function updatecaptchaHistory(&$update) {
- global $captchaHistory;
- global $curPath;
-
- foreach($update as $val) {
- $captchaHistory[] = $val;
- }
-
- // Writing out $captchaHistory on disk..
- $filepath = $curPath . DIRECTORY_SEPARATOR . ".SW_captchahistory";
- file_put_contents($filepath, implode('', $captchaHistory));
- }
- function parseCommand() {
- global $command;
- global $cmd;
- global $opt;
- global $param1;
- global $param2;
- global $param3;
-
- $str = trim($command);
-
- $ipos = stripos($str, PHP_SPACE);
- if ($ipos > 0) {
- $cmd = left($str, $ipos);
- $str = substr($str, $ipos+1);
- } else {
- $cmd = $str;
- return;
- }
-
- if (left($str, 1) === "-") {
- $ipos = stripos($str, PHP_SPACE);
- if ($ipos > 0) {
- $opt = left($str, $ipos);
- $str = substr($str, $ipos+1);
- } else {
- $opt = $str;
- return;
- }
- }
-
- if (left($str, 1) === "'") {
- $ipos = stripos($str, "'", 1);
- if ($ipos > 0) {
- $param1 = substr($str, 0, $ipos+1);
- $str = substr($str, $ipos+1);
- } else {
- $param1 = $str;
- return;
- }
- } else {
- $ipos = stripos($str, PHP_SPACE);
- if ($ipos > 0) {
- $param1 = left($str, $ipos);
- $str = substr($str, $ipos+1);
- } else {
- $param1 = $str;
- return;
- }
- }
-
- $ipos = stripos($str, PHP_SPACE);
- if ($ipos > 0) {
- $param2 = left($str, $ipos);
- $str = substr($str, $ipos+1);
- } else {
- $param2 = $str;
- return;
- }
-
- $ipos = stripos($str, PHP_SPACE);
- if ($ipos > 0) {
- $param3 = left($str, $ipos);
- $str = substr($str, $ipos+1);
- } else {
- $param3 = $str;
- return;
- }
-
- }
- function signParamValidation() {
-
- global $opt;
- global $param1;
- global $param2;
- global $param3;
- global $date;
- global $hour;
- global $min;
- global $desc;
- global $captchacount;
- global $captchasign;
- global $captchaHistory;
-
- //opt!=""
- if ($opt!==PHP_STR) {
- echo("WARNING: invalid options<br>");
- return false;
- }
- //param1==""
- if ($param1!==PHP_STR) {
- echo("WARNING: invalid parameters<br>");
- return false;
- }
- //param2==""
- if ($param2!==PHP_STR) {
- echo("WARNING: invalid parameters<br>");
- return false;
- }
- //param3==""
- if ($param3!==PHP_STR) {
- echo("WARNING: invalid parameters<br>");
- return false;
- }
- //date!=""
- if ($date===PHP_STR || strlen($date)<4) {
- //echo("WARNING: invalid date<br>");
- return false;
- }
- if ($hour===PHP_STR || strlen($hour)>2) {
- //echo("WARNING: invalid hour<br>");
- return false;
- }
- if ($min===PHP_STR || strlen($min)>2) {
- //echo("WARNING: invalid min<br>");
- return false;
- }
-
- //place!=""
- if ($desc===PHP_STR || strlen($desc)<4) {
- //echo("WARNING: invalid desc<br>");
- return false;
- }
-
- $rescaptcha1=$captchacount>=4;
- $rescaptcha2=count(array_filter($captchaHistory, "odd")) > (APP_MAX_FROM_IP - 1);
- //if ($rescaptcha1) {
- // echo("WARNING: captcha expired #1<br>");
- //}
-
- //if ($rescaptcha2) {
- // echo("WARNING: captcha expired #2<br>");
- //}
-
- ///if ($rescaptcha1 || $rescaptcha2) {
-
- //if ($rescaptcha1) {
- // return false;
- //}
-
- return true;
- }
- function odd($val) {
-
- global $captchasign;
-
- return rtrim($val,"\n") == $captchasign;
- }
-
-
- function myExecSignCommand() {
-
- global $date;
- global $hour;
- global $min;
- global $desc;
- global $curPath;
- global $lastMessage;
- global $captchacount;
- global $captchasign;
- global $captchaHistory;
-
- $newSign = time() . PHP_PIPE . "000001X" . PHP_PIPE . HTMLencodeF($date,false) . PHP_PIPE . HTMLencodeF($hour.":".((strlen($min)==1)?"0".$min:$min)) . PHP_PIPE . HTMLencodeF($desc,false) . "|v";
- $newSignChk = HTMLencodeF($date,false) . PHP_PIPE . HTMLencodeF($hour.":".((strlen($min)==1)?"0".$min:$min)) . PHP_PIPE . HTMLencodeF($desc,false) . "|v";
-
- $signHChk = file($curPath . DIRECTORY_SEPARATOR . ".SW_history");
- $lastMsgChk = $signHChk[count($signHChk)-1];
- $doubleChk = (stripos($lastMsgChk,"|$desc|")===false)?false:true;
-
- if (hash("sha256", $newSignChk . APP_SALT, false) !== $lastMessage && !$doubleChk) {
- // Updating message history..
- $output = [];
- $output[] = $newSign . "\n";
- updateHistory($output, HISTORY_MAX_ITEMS);
- // Updating captcha history..
- $output = [];
- $output[] = $captchasign . "\n";
- updatecaptchaHistory($output);
- $lastMessage = hash("sha256", $newSignChk . APP_SALT, false);
- }
-
- }
- function confParamValidation() {
-
- global $opt;
- global $param1;
- global $param2;
- global $param3;
- global $signHistory;
-
- //opt!=""
- if ($opt!==PHP_STR) {
- echo("WARNING: invalid options<br>");
- return false;
- }
-
- $myval = trim($param1,"'");
-
- //param1!=""
- if ($myval===PHP_STR) {
- echo("WARNING: invalid parameters<br>");
- return false;
- }
- //param1 in $signHistory
- if (!in_array($myval."\n",$signHistory)) {
- echo("WARNING: invalid parameters<br>");
- return false;
- }
-
- //param2==""
- if ($param2!==PHP_STR) {
- echo("WARNING: invalid parameters<br>");
- return false;
- }
- //param3==""
- if ($param3!==PHP_STR) {
- echo("WARNING: invalid parameters<br>");
- return false;
- }
-
- return true;
- }
- function myExecConfSignCommand() {
-
- global $param1;
- global $signHistory;
- global $curPath;
-
- $mysign = trim($param1,"'");
-
- if ($signHistory) {
-
- //echo("inside myExecConfSignCommand()");
-
- $newval = left($mysign, strlen($mysign)-2) . "|v";
-
- $key = array_search($mysign."\n", $signHistory);
- if ($key !== false) {
- $signHistory[$key] = $newval . "\n";
-
- // Writing out $signHistory on disk..
- $filepath = $curPath . DIRECTORY_SEPARATOR . ".SW_history";
- file_put_contents($filepath, implode('', $signHistory));
- }
- }
- }
- function delParamValidation() {
-
- global $opt;
- global $param1;
- global $param2;
- global $param3;
- global $signHistory;
-
- //opt!=""
- if ($opt!==PHP_STR) {
- echo("WARNING: invalid options<br>");
- return false;
- }
-
- $myval = trim($param1,"'");
-
- //param1!=""
- if ($myval===PHP_STR) {
- echo("WARNING: invalid parameters<br>");
- return false;
- }
- //param1 in $signHistory
- if (!in_array($myval."\n",$signHistory)) {
- echo("WARNING: invalid parameters<br>");
- return false;
- }
-
- //param2==""
- if ($param2!==PHP_STR) {
- echo("WARNING: invalid parameters<br>");
- return false;
- }
- //param3==""
- if ($param3!==PHP_STR) {
- echo("WARNING: invalid parameters<br>");
- return false;
- }
-
- return true;
- }
- function myExecDelSignCommand() {
-
- global $param1;
- global $signHistory;
- global $curPath;
-
- $mysign = trim($param1,"'");
-
- if ($signHistory) {
-
- //echo("inside myExecDelSignCommand()");
-
- $newval = left($mysign, strlen($mysign)-2) . "|u";
-
- $key = array_search($mysign."\n", $signHistory);
- if ($key !== false) {
- $signHistory[$key] = $newval . "\n";
-
- // Writing out $signHistory on disk..
- $filepath = $curPath . DIRECTORY_SEPARATOR . ".SW_history";
- file_put_contents($filepath, implode('', $signHistory));
- }
- }
- }
- function myExecSetStarCommand() {
-
- global $param1;
- global $signHistory;
- global $curPath;
-
- $val = trim($param1,"\n'");
-
- $mytag = PHP_STR;
- $myccounter = PHP_STR;
- $mydate = PHP_STR;
- $mytime = PHP_STR;
- $mydesc = PHP_STR;
- $myflag = PHP_STR;
-
- $aFields = explode(PHP_PIPE, $val);
-
- $mytag = $aFields[0]??"0000";
- $myccounter = $aFields[1]??PHP_STR;
- $mydate = $aFields[2]??PHP_STR;
- $mytime = $aFields[3]??PHP_STR;
- $mydesc = $aFields[4]??PHP_STR;
- $myflag = $aFields[5]??PHP_STR;
- $mytagnew = time();
- $myccounter = (int)left($myccounter,6);
- $myccounter = (string)($myccounter+1);
- $myccounternew = str_repeat("0", 6-strlen($myccounter)).$myccounter."X";
- if ($signHistory) {
-
- //echo("inside myExecConfSignCommand()");
-
- $newval = $mytagnew.PHP_PIPE.$myccounternew.PHP_PIPE.$mydate.PHP_PIPE.$mytime.PHP_PIPE.$mydesc.PHP_PIPE."v";
-
- $key = array_search($val."\n", $signHistory);
- if ($key !== false) {
- $signHistory[$key] = $newval . "\n";
-
- // Writing out $signHistory on disk..
- $filepath = $curPath . DIRECTORY_SEPARATOR . ".SW_history";
- file_put_contents($filepath, implode('', $signHistory));
- }
- }
- }
- function setParamValidation() {
-
- global $opt;
- global $param1;
- global $param2;
- global $param3;
- global $signHistory;
-
- //opt!=""
- if ($opt!==PHP_STR) {
- echo("WARNING: invalid options<br>");
- return false;
- }
-
- $myval = trim($param1,"'");
-
- //param1!=""
- if ($myval===PHP_STR) {
- echo("WARNING: invalid parameters<br>");
- return false;
- }
-
- //param1 in $signHistory
- if (!in_array($myval."\n",$signHistory)) {
- echo("WARNING: invalid parameters<br>");
- return false;
- }
-
- //param2==""
- if ($param2!==PHP_STR) {
- echo("WARNING: invalid parameters<br>");
- return false;
- }
-
- //param3==""
- if ($param3!==PHP_STR) {
- echo("WARNING: invalid parameters<br>");
- return false;
- }
-
- return true;
- }
- $curPath = APP_DATA_PATH;
- chdir($curPath);
- $signHistory = file($curPath . DIRECTORY_SEPARATOR . ".SW_history");
- $captchaHistory = file($curPath . DIRECTORY_SEPARATOR . ".SW_captchahistory");
- $password = filter_input(INPUT_POST, "Password")??"";
- $password = strip_tags($password);
- if ($password==PHP_STR) {
- $password = filter_input(INPUT_POST, "Password2")??"";
- $password = strip_tags($password);
- }
- $command = filter_input(INPUT_POST, "CommandLine")??"";
- $command = strip_tags($command);
-
- //$pwd = filter_input(INPUT_POST, "pwd");
- $hideSplash = filter_input(INPUT_POST, "hideSplash")??"";
- $hideSplash = strip_tags($hideSplash);
- $hideHCSplash = filter_input(INPUT_POST, "hideHCSplash")??"";
- $hideHCSplash = strip_tags($hideHCSplash);
- $date = filter_input(INPUT_POST, "date")??"";
- $date = strip_tags($date);
- $hour = filter_input(INPUT_POST, "hour")??"";
- $hour = strip_tags($hour);
- $min = filter_input(INPUT_POST, "min")??"";
- $min = strip_tags($min);
- $desc = filter_input(INPUT_POST, "desc")??"";
- $desc = strip_tags($desc);
- $captchasign = hash("sha256", $_SERVER["REMOTE_ADDR"] . date("Y") . APP_SALT, false);
-
- $lastMessage = filter_input(INPUT_POST, "last_message")??"";
- $lastMessage = strip_tags($lastMessage);
- $totsigns = count($signHistory);
- //print_r($totsigns);
- //exit(0);
- if ($totsigns > 0) {
- $lastMessage = hash("sha256", rtrim($signHistory[$totsigns-1],"\n") . APP_SALT, false);
- }
- $captchacount = (int)filter_input(INPUT_POST, "captcha_count")??"";
- $captchacount = strip_tags($captchacount);
- //if ($captchacount === 0) {
- // $captchacount = 1;
- //}
- if ($password !== PHP_STR) {
- $hash = hash("sha256", $password . APP_SALT, false);
- if ($hash !== APP_HASH) {
- $password=PHP_STR;
- }
- }
-
- parseCommand($command);
- //echo("cmd=" . $cmd . "<br>");
- //echo("opt=" . $opt . "<br>");
- //echo("param1=" . $param1 . "<br>");
- //echo("param2=" . $param2 . "<br>");
-
- if ($password !== PHP_STR) {
-
- if (mb_stripos(CMDLINE_VALIDCMDS, "|" . $command . "|")) {
-
- if ($cmd === "sign") {
- $captchacount = $captchacount + 1;
- if (signParamValidation()) {
- myExecSignCommand();
- }
- } else if ($command === "refresh") {
- // refreshing Msg Board..
- }
-
- } else if (mb_stripos(CMDLINE_VALIDCMDS, "|" . $cmd . "|")) {
-
- if ($cmd === "del") {
- if (delParamValidation()) {
- myExecDelSignCommand();
- }
- } else if ($cmd === "conf") {
- if (confParamValidation()) {
- myExecConfSignCommand();
- }
- } else if ($cmd === "set") {
- if (setParamValidation()) {
- myExecSetStarCommand();
- }
- }
- } else {
-
- }
-
- $contextType = PERSONAL_CONTEXT_TYPE;
-
- } else {
-
- /*
- if (mb_stripos(CMDLINE_VALIDCMDS, "|" . $command . "|")) {
- if ($cmd === "sign") {
- $captchacount = $captchacount + 1;
- if (signParamValidation()) {
- myExecSignCommand();
- }
- }
- }*/
- }
-
- ?>
- <!DOCTYPE html>
- <head>
-
- <meta charset="UTF-8"/>
-
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
-
- <!--
- Copyright 2021, 2024 5 Mode
- This file is part of StarWorth.
- StarWorth is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- StarWorth is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with StarWorth. If not, see <https://www.gnu.org/licenses/>.
- -->
-
-
- <title><?php echo(APP_TITLE); ?></title>
-
- <link rel="shortcut icon" href="/favicon.ico?v=<?php echo(time()); ?>>" />
-
- <meta name="description" content="<?php echo(APP_DESCRIPTION); ?>"/>
- <meta name="keywords" content="<?php echo(APP_KEYWORDS); ?>"/>
- <meta name="author" content="5 Mode"/>
- <meta name="robots" content="index,follow"/>
-
- <script src="/SW_js/jquery-3.6.0.min.js" type="text/javascript"></script>
- <script src="/SW_js/sha.js" type="text/javascript"></script>
- <script src="/SW_js/common.js" type="text/javascript"></script>
- <script src="/SW_js/bootstrap.min.js" type="text/javascript"></script>
-
- <script src="/SW_js/index.js" type="text/javascript" defer></script>
-
- <link href="/SW_css/bootstrap.min.css" type="text/css" rel="stylesheet">
- <link href="/SW_css/style.css?r=<?PHP echo(time());?>" type="text/css" rel="stylesheet">
-
- <style>
- @import url('https://fonts.googleapis.com/css2?family=<?php echo(str_ireplace(" ","+",DISPLAY_DATE_FONT));?>');
- </style>
-
- </head>
- <body>
- <?php if (file_exists(APP_PATH . DIRECTORY_SEPARATOR . "jscheck.html")): ?>
- <?php include("jscheck.html"); ?>
- <?php endif; ?>
- <form id="frmHC" method="POST" action="/" target="_self" enctype="multipart/form-data">
- <?php if(APP_USE === "PRIVATE"): ?>
- <div class="header">
- <a id="burger-menu" href="#" style="display:none;"><img src="/SW_res/burger-menu2.png" style="width:58px;"></a><a id="ahome" href="http://homolog.5mode-foss.eu" target="_blank"><img id="logo-hmm" src="/SW_res/SWlogo.png" style="width:28px;"> StarWorth</a> <a id="agithub" href="https://github.com/par7133/StarWorth" style="color:#000000"><span style="color:#119fe2">on</span> github</a> <a id="afeedback" href="mailto:posta@elettronica.lol" style="color:#000000"><span style="color:#119fe2">for</span> feedback</a> <a id="asupport" href="tel:+39-378-0812391" style="font-size:13px;background-color:#15c60b;border:2px solid #15c60b;color:black;height:27px;text-decoration:none;"> get support </a><div id="pwd2" style="float:right;position:relative;top:+13px;display:none"><input type="password" id="Password2" name="Password2" placeholder="password" style="font-size:13px; background:#393939; color:#ffffff; width: 125px; border-radius:3px;" value="" autocomplete="off"></div>
- </div>
- <?php else: ?>
- <div class="header2">
- <?php echo(APP_CUSTOM_HEADER); ?>
- </div>
- <?php endif; ?>
- <div style="clear:both;margin:auto"> </div>
- <?php
- $callSideBarTOP = 1;
- if(APP_USE === "PRIVATE") {
- $callSideBarTOP = 65;
- }
- ?>
- <div id="call-sidebar" style="top:<?php echo($callSideBarTOP);?>px;">
-
- </div>
- <div id="sidebar">
-
- <button id="sidebar-close" type="button" class="close" aria-label="Close" onclick="closeSideBar();">
- <span aria-hidden="true">×</span>
- </button>
-
- <br><br>
- <img id="genius" src="/SW_res/SWgenius.png" alt="HL Genius" title="HL Genius">
- <br><br>
- <div style="text-align:left;white-space:nowrap;">
- <input id="Password" name="Password" class="sidebarcontrol" type="password" placeholder="password" value="<?php echo($password);?>" autocomplete="off"> <input type="submit" class="sidebarcontrol" value="<?php echo(getResource("Go", $curLocale));?>" style="width:24%; height: 25px;background-color:lightgray;color:#000000;"><br>
- <input id="Salt" class="sidebarcontrol" type="text" placeholder="salt" autocomplete="off"><br>
- <div style="text-align:center;">
- <a id="butHashMe" href="#" onclick="showEncodedPassword();"><?php echo(getResource("Hash Me", $curLocale));?>!</a>
-
- <br><br><br>
- </div>
- </div>
- </div>
- <div id="content-bar">
- <?php if (APP_SPLASH): ?>
- <?php if ($hideSplash !== PHP_STR): ?>
- <div id="splash">
-
- <button id="butCloseSplash" type="button" class="close" aria-label="Close" onclick="closeSplash();">
- <span aria-hidden="true">×</span>
- </button>
-
- Hello and welcome to StarWorth!<br><br>
-
- StarWorth is a light and simple software on premise to log calendar and events.<br><br>
-
- StarWorth is released under GPLv3 license, it is supplied AS-IS and we do not take any responsibility for its misusage.<br><br>
-
- StarWorth name comes from a prank on "Star War" meaning our intention to make stars/projects "worth".<br><br>
-
- 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>
-
- As you are going to run StarWorth 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>
- <ol>
- <li>Check the permissions of your "data" folder in your web app private path; and set its path in the config file.</li>
- <li>In the data path create a ".SW_history" and ".SW_captchahistory" files and give them the write permission.</li>
- <li>Finish to setup the configuration file apporpriately, in the specific:</li>
- <ul>
- <li>Configure the APP_USE appropriately.</li>
- <li>Configure the DISPLAY attributes as required.</li>
- <li>Configure the max history items as required (default: 1000).</li>
- </ul>
- </ol>
-
- <br>
-
- Hope you can enjoy it and let us know about any feedback: <a href="mailto:posta@elettronica.lol" style="color:#e6d236;">posta@elettronica.lol</a>
-
- </div>
- <?php endif; ?>
- <?php endif; ?>
- <div style="width:100%; padding: 0px; text-align:center; font-size:12px; border:0px solid red;">
-
- <?php if (APP_DEFAULT_CONTEXT === "PRIVATE"): ?>
-
- <div id="content-header">
-
- <?php if ($contextType === PUBLIC_CONTEXT_TYPE): ?>
-
- <div id="guest-msg"><h1><?php echo(APP_GUEST_MSG??" "); ?></h1></div>
-
- <?php else: ?>
-
- <div id="welcome-msg"><h1><?php echo(APP_WELCOME_MSG??" "); ?></h1></div>
-
- <br>
-
- <div style="clear:both;margin:auto;"><br><br></div>
-
- <hr>
-
- <br>
-
- </div>
- <div id="insertBar">
-
- <input id="date" name="date" type="text" class="standardfield standardcontrol" placeholder="Date" value="<?php echo(date("Y-m-d"));?>">
- <select id="hour" name="hour" class="standardfield standardcontrol">
- <?PHP for($i=0;$i<=24;$i++):?>
- <option value="<?PHP echo($i);?>" <?PHP echo(($i==date("G"))?"selected":"")?>><?PHP echo((strlen($i)===1)?"0".$i:$i);?></option>
- <?PHP endfor; ?>
- </select>:<select id="min" name="min" class="standardfield standardcontrol">
- <?PHP for($i=0;$i<=59;$i++):?>
- <option value="<?PHP echo($i);?>" <?PHP echo(($i==ltrim(date("i"),'0'))?"selected":"");?>><?PHP echo((strlen($i)===1)?"0".$i:$i);?></option>
- <?PHP endfor; ?>
- </select>
- <input id="desc" name="desc" type="text" class="standardfield standardcontrol" placeholder="Description" maxlength="300"><br>
- <input id="send" name="send" type="text" value=" <?php echo(DISPLAY_SUBMIT_BUTTON);?> " title="<?php echo(DISPLAY_SUBMIT_BUTTON);?>">
- </div>
-
- <div style="clear:both;margin:auto;"><br><br><br></div>
-
- <?php showHistory(); ?>
-
- <?php endif; ?>
-
- <?php else: ?>
-
- <div id="content-header">
-
- <?php if ($contextType === PUBLIC_CONTEXT_TYPE): ?>
-
- <div id="welcome-msg"><h1><?php echo(APP_WELCOME_MSG??" "); ?></h1></div>
-
- <br>
-
- <hr>
- <br>
-
- <?php showHistory(); ?>
-
- <?php else: ?>
- <div id="welcome-msg"><h1><?php echo(APP_WELCOME_MSG??" "); ?></h1></div>
-
- <br>
- <div style="clear:both;margin:auto;"><br><br></div>
-
- <hr>
-
- <br>
-
- </div>
- <div id="insertBar">
-
- <input id="date" name="date" type="text" class="standardfield standardcontrol" placeholder="Date" value="<?php echo(date("Y-m-d"));?>">
- <select id="hour" name="hour" class="standardfield standardcontrol" style="background-color:#FFFFFF;">
- <?PHP for($i=0;$i<=24;$i++):?>
- <option value="<?PHP echo($i);?>" <?PHP echo(($i==date("G"))?"selected":"")?>><?PHP echo((strlen($i)===1)?"0".$i:$i);?></option>
- <?PHP endfor; ?>
- </select>:<select id="min" name="min" class="standardfield standardcontrol">
- <?PHP for($i=0;$i<=59;$i++):?>
- <option value="<?PHP echo($i);?>" <?PHP echo(($i==ltrim(date("i"),'0'))?"selected":"")?>><?PHP echo((strlen($i)===1)?"0".$i:$i);?></option>
- <?PHP endfor; ?>
- </select>
- <input id="desc" name="desc" type="text" class="standardfield standardcontrol" placeholder="Description" maxlength="300">
- <input id="send" name="send" type="button" value=" <?php echo(DISPLAY_SUBMIT_BUTTON);?> " title="<?php echo(DISPLAY_SUBMIT_BUTTON);?>">
- </div>
-
- <div style="clear:both;margin:auto;"><br><br><br></div>
-
- <?php showHistory(); ?>
- <?php endif; ?>
-
- <?php endif; ?>
-
- <br><br><br><br><br><br><br>
- <?php if(APP_USE === "BUSINESS"): ?>
- <div id="footer2">
- <a id="ahome" href="http://starworth.5mode-foss.eu" target="_blank"><img id="logo-hl" src="/SW_res/SWlogo.png">Powered by StarWorth</a>
- </div>
- <?php endif; ?>
-
- </div>
- </div>
- <input type="hidden" id="CommandLine" name="CommandLine">
- <input type="hidden" name="hideSplash" value="<?php echo($hideSplash); ?>">
- <input type="hidden" name="hideHCSplash" value="1">
- <input type="hidden" name="captcha_count" value="<?php echo($captchacount); ?>">
- <input type="hidden" name="last_message" value="<?php echo($lastMessage); ?>">
- </form>
- <div class="footer">
- <div id="footerCont"> </div>
- <div id="footer"><span style="background:#FFFFFF;opacity:1.0;margin-right:10px;"> A <a href="http://5mode.com">5 Mode</a> project <span class="no-sm">and <a href="http://wysiwyg.systems">WYSIWYG</a> system</span>. Some rights reserved.</span></div>
- </div>
- <?php if (file_exists(APP_PATH . DIRECTORY_SEPARATOR . "skinner.html")): ?>
- <?php include("skinner.html"); ?>
- <?php endif; ?>
- <?php if (file_exists(APP_PATH . DIRECTORY_SEPARATOR . "metrics.html")): ?>
- <?php include("metrics.html"); ?>
- <?php endif; ?>
- <script>
- /*
- <?PHP if ($password !== PHP_STR): ?>
- $(".td-data-time")
- .css("display", "none")
- <?PHP endif; ?>
- */
- </script>
- </body>
- </html>
|