From 623d99adc387ac8bce241cce99aae43a400ff988 Mon Sep 17 00:00:00 2001 From: Xavier Beaudouin Date: Tue, 21 Mar 2023 11:14:25 +0100 Subject: [PATCH] Basic website --- _blank.gif | Bin 0 -> 42 bytes bsd/index.php | 3 + css/base.css | 162 ++++++++++++++++ energy/index.php | 3 + favicon.ico | Bin 0 -> 318 bytes include/bottom.inc.php | 4 + include/function.inc.php | 193 +++++++++++++++++++ include/header.inc.php | 17 ++ include/menu.ini | 15 ++ include/send_mail.inc.php | 390 ++++++++++++++++++++++++++++++++++++++ index.php | 16 ++ linux/index.php | 3 + network/index.php | 3 + 13 files changed, 809 insertions(+) create mode 100644 _blank.gif create mode 100644 bsd/index.php create mode 100644 css/base.css create mode 100644 energy/index.php create mode 100644 favicon.ico create mode 100644 include/bottom.inc.php create mode 100644 include/function.inc.php create mode 100644 include/header.inc.php create mode 100644 include/menu.ini create mode 100644 include/send_mail.inc.php create mode 100644 linux/index.php create mode 100644 network/index.php diff --git a/_blank.gif b/_blank.gif new file mode 100644 index 0000000000000000000000000000000000000000..da3a7a1c06ee1437b6854b63299659e31777ae34 GIT binary patch literal 42 rcmZ?wbhEHbWMp7uXkcJCbLI>K1B2pE7Dgb&paUX6G7OB2Mhw;fu diff --git a/css/base.css b/css/base.css new file mode 100644 index 0000000..2570e19 --- /dev/null +++ b/css/base.css @@ -0,0 +1,162 @@ +body { margin:0px; background-color:#fff; height:100% } +html { height:100% } +img { margin:0px; border-style:none } +button { margin:0px; border-style:none; padding:0px; background-color:transparent; vertical-align:top } +p:first-child { margin-top:0px } +table { empty-cells:hide } +em { font-style:italic } +h1 { font-size:18px } +h1:first-child { margin-top:0px } +strong { font-weight:bold } +.lapage { + color:#585769; + font-family:arial, helvetica; + text-align:center; + font-size: 13px; +} + +.menuhaut { + color:#000000; + font-family:arial, helvetica; + text-align:right; + font-size: 20px; +} + +.menubas { + color:#000000; + font-family:arial, helvetica; + text-align:right; + font-size: 20px; +} + +.menuon { + color:#585769; + font-family:arial, helvetica; + text-align:right; + font-size: 20px; +} + +.menuoff { + color:#828098; + font-family:arial, helvetica; + text-align:right; + font-size: 20px; +} + +.textetitre { + color:#eb6e08; + font-family:arial, helvetica; + font-weight:bold; + text-align:left; + font-size: 16px; +} + +.texte { + color:#585769; + font-family:arial, helvetica; + text-align:center; + font-size: 13px; +} + +.letrait { + position:absolute; + left:300px; + top:0px; + width:39px; + height:768px; + z-index:1; +} + +.logo { + position:absolute; + left:38px; + top:338px; + width:262px; + height:92px; + z-index:2; +} + +.illustration { + position:absolute; + left:699px; + top:0px; + width:325px; + height:768px; + z-index:3; +} +.divmenuhaut { + position:absolute; + left:38px; + top:0px; + width:262px; + height:338px; + z-index:4;i + padding-top: 38px; + overflow:visible; + line-height: 50px; +} + +.divmenubas { + position:absolute; + left:38px; + top:430px; + width:262px; + height:338px; + z-index:5; + padding-top: 10px; + overflow:visible; + line-height: 50px; +} + +.textebox { + position:absolute; + left:339px; + top:0px; + zzzwidth:360px; + width:685px; + zzheight:768px; + z-index:6; + padding-top: 38px; + overflow:visible; +} + +.textebox li { + text-align: left; +} + +.textebox a { + color:#eb6e08; + font-family:arial, helvetica; + font-size: 13px; + text-decoration: none; +} + +.textebox a:hover { + color:#eb6e08; + text-decoration: underline; +} + +.menu { + list-style-type: none; + text-align: right; +} + +.menu li { + text-align: right; +} + +.menu a { + font-family:arial, helvetica; + text-align:right; + font-size: 20px; + text-decoration: none; +} + +.menu a:hover { + color:#585769; + font-family:arial, helvetica; + text-align:right; + font-size: 20px; + text-decoration: underline; +} + diff --git a/energy/index.php b/energy/index.php new file mode 100644 index 0000000..da1a872 --- /dev/null +++ b/energy/index.php @@ -0,0 +1,3 @@ + diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..8cd15e79869e8af43e2913d8927a5655e77c2567 GIT binary patch literal 318 zcmZQzU<5(|0RaXO&|qX>5ChRb3=&ZQVnzlQAj!aR08C;M|NsAIXl`s|aCLHGICAJP zLuzs|!-MXmMuv+QE--xh_>m#d-=Cqsw}&A%I+|hD%$dlBRXVN! zarxbE&H&RtLLY;rZ-n-M>7u3!V7fK-1BjmDQlS8(xK^cQf#|BNRaxtRbhX>+Wh;R+ z_v&RSOMo<2)~+oenjvkKOD2eB$y(+Bq9Fk2bcR3t3=BV@7{vY~55XUR^aCJ102Bk^ P2T=S0NdEwegY*IboQX;! literal 0 HcmV?d00001 diff --git a/include/bottom.inc.php b/include/bottom.inc.php new file mode 100644 index 0000000..2f323c1 --- /dev/null +++ b/include/bottom.inc.php @@ -0,0 +1,4 @@ + + + + diff --git a/include/function.inc.php b/include/function.inc.php new file mode 100644 index 0000000..10bd73d --- /dev/null +++ b/include/function.inc.php @@ -0,0 +1,193 @@ +'.$input[$rand_keys[0]].' + '.$input[$rand_keys[1]].' = '; + $add = md5($input[$rand_keys[0]] + $input[$rand_keys[1]]); + + echo ' + + + + +
Anti-Spam : '. $question .' +
'; +} + +function valid_captcha() +{ +// if (md5($_POST['reponse']) == $_POST['captcha']) + if (md5(get_post('reponse')) == get_post('captcha')) + return true; + else + return false; +} + +// +// escape_string +// Action: Escape a string +// Call: escape_string (string string) +// +function escape_string ($string) +{ + if (get_magic_quotes_gpc () == 0) + { + $search = array ("/'/", "/\"/", "/;/"); + $replace = array ("\\\'", "\\\"", "\\;"); + $escaped_string = preg_replace ($search, $replace, $string); + } + else + { + $escaped_string = $string; + } + return $escaped_string; +} + +// +// get_post +// Action: Get a variable from POST +// Call: get_post('var'); +// +function get_post ($string) +{ + if (($_SERVER['REQUEST_METHOD'] == "POST") && isset($_POST[$string])) + { + return escape_string($_POST[$string]); + } + else + { + return NULL; + } +} + +// +// get_get +// Action: Get a variable from GET +// Call: get_get('var'); +// +function get_get ($string) +{ + if (($_SERVER['REQUEST_METHOD'] == "GET") && isset($_GET[$string])) + { + return escape_string($_GET[$string]); + } + else + { + return NULL; + } +} + +// Pour le menu parse_ini_file(); + +function searchini() { + return dirname(__FILE__)."/menu.ini"; +} + +function domenu() { + $menu = parse_ini_file(searchini(),true); + $topmenu = $menu['topmenu']; + $out = ""; // Out text for menu + if (count($topmenu)> 10) { + return "Error Too mutch lines in top menu (max 4)"; + } + // Top menu + $out .= "
\n"; + //$out .= "

 

 

\n"; + $out .= "

 

\n"; + $out .= "
\n"; + // Bottom menu +/* + $out .= "
\n"; + $out .= "
\n"; +*/ + + print $out; + +} + +// Page +// Do the page with the right title +function page($titre) { + printheader($titre); + domenu(); + print "
\n"; +} +function page2($titre) { + printheader2($titre); + domenu(); + print "
\n"; +} + +// finpage +// ajoute les tags en fin de page +function finpage(){ + require("bottom.inc.php"); +} + +?> diff --git a/include/header.inc.php b/include/header.inc.php new file mode 100644 index 0000000..2627301 --- /dev/null +++ b/include/header.inc.php @@ -0,0 +1,17 @@ + + + + + + + + + + + +RIS LSI Consulting - <?php print "$titre"; ?> + + + +
diff --git a/include/menu.ini b/include/menu.ini new file mode 100644 index 0000000..327af8d --- /dev/null +++ b/include/menu.ini @@ -0,0 +1,15 @@ +; menu file +; + +[topmenu] +; / = intro +intro=RIS LSI +bsd=BSD Unix +linux=GNU/Linux +network=Networking +energy=Energy Storage + +[bottommenu] +faq=FAQ + + diff --git a/include/send_mail.inc.php b/include/send_mail.inc.php new file mode 100644 index 0000000..9ba9547 --- /dev/null +++ b/include/send_mail.inc.php @@ -0,0 +1,390 @@ +errno) + die ($smail->errmsg()); + if (!$smail->SetFrom("$from")) + die ($smail->errmsg()); + if (!$smail->SetToTitle("$to")) + die ($smail->errmsg()); + if (!$smail->SetTo("$to")) + die ($smail->errmsg()); + // if (!$smail->SetTo('somebody@somewhere.com')) die ($smail->errmsg()); + if ($cc) { + if (!$smail->SetCC("$cc")) + die ($smail->errmsg()); + // if (!$smail->SetCC('somebody@something.com')) die ($smail->errmsg()); + } + if (!$smail->SetSubject("$subject")) + die ($smail->errmsg()); + if (!$smail->SetText("$message")) + die ($smail->errmsg()); + if (!$smail->sendmail($format)) + die ($smail->errmsg()); + if (!$smail->end()) + die ($smail->errmsg()); +} + +Class SMTP { + // global variables + +Var $errno = 0; +Var $errmsg = ''; +Var $errors=Array( + 1 => 'Invalid Input', + 2 => 'Unable to establish connection', + 3 => 'Connection timed out', + 4 => 'SMTP Error returned', + ); + +Var $server = ""; +Var $user = ""; +Var $sock = false; +Var $readlength = 1024; + +Var $mailto = array(); +Var $mailcc = array(); +Var $mailfrom = ""; +Var $mailfromtitle = ''; +Var $mailsubject = ""; +Var $mailtext = ""; +Var $attachments = array(); + +Var $deadmsg = ""; +Var $verbose = "0"; + //Modify this for verbose output of the transaction.. + //1 for verbose + //0 for silent + +Function SMTP($server, $smtpport=25, $timeout=10) + { + // Return false if we can't get an SMTP connection... + + if (strlen($server)<=0) + return $this->error(1, 'server'); + else $this->server=$server; + + if (!$this->sock = fsockopen($server, $smtpport, &$errno, &$errstr, $timeout)) + return $this->error(2); + + if (!socket_set_blocking($this->sock, true)) + return $this->error(4, 'set blocking'); + + if (!$this->GetFeedback()) + return $this->error(2, 'during onset'); + + return true; + } + +Function Error($errno, $message) + { + $this->errno=$errno; + $this->errmsg.=$message; + return false; + } + +Function ErrMsg($error=false) + { + if (false===$error) + { + $errno=$this->errno; + return $this->$errors[$errno].' '.$this->errmsg; + } + else return $this->$errors[$error]; + } + +Function ErrNo() + { + return $this->errno; + } + +Function SetSubject($subject) + { + if (strlen($subject)<=0) + return $this->Error(1, 'subject'); + $this->mailsubject = ereg_replace("\n"," ",$subject); + return true; + } + +Function setText($text) + { + if (strlen($text)<=0) + return $this->Error(1, 'message body'); + $text = ereg_replace("\n.\n", "\n. \n", $text); + $text = ereg_replace("\n.\r", "\n. \r", $text); + $this->mailtext = $text; + return true; + } + +Function SetTo($to) + { + // THIS CAN BE USED TO SET AS MANY "BCC" RECIPIENTS AS YOU LIKE. + if (strlen($to)<=0) + return $this->Error(1, '"to" too short'); + if (strlen($to)>=129) + return $this->Error(1, '"to" too long'); + $this->mailto[]=$to; + return true; + } + +Function SetToTitle($title) + { + if (strlen($title)<=0) + return $this->Error(1, 'totitle too short'); + if (strlen($title)>=128) + return $this->Error(1, 'totitle too long'); + $this->mailtotitle="<$title>"; + return true; + } + +function SetCC($to) + { + // THIS WORKS LIKE "SETTO" ABOVE, BUT TELLS EVERYBODY WHO'S INVOLVED. + // This is a potential privacy issue... + + if (!$this->setto($to)) + return false; + $this->mailcc[]=$to; + return true; + } + +Function SetFrom($from) + { + if (strlen($from)<=0) + return $this->Error(1, 'from too short'); + if (strlen($from)>=128) + return $this->Error(1, 'from too long'); + $this->mailfrom=$from; + return true; + } + +Function SetFromTitle($title) + { + if (strlen($title)<=0) + return $this->Error(1, 'fromtitle too short'); + if (strlen($title)>=128) + return $this->Error(1, 'fromtitle too long'); + $this->mailfromtitle=$title; + return true; + } + +function AddAttachment($type, $data, $name) + { + // THIS WILL TAKE ATTACHMENTS, BUT WON'T YET MAIL THEM. + $insert=sizeof($this->attachements); + $this->attachements[$insert][data]=$data; + $this->attachements[$insert][type]=$type; + $this->attachements[$insert][name]=$name; + return false; + } + +Function BuildBody($MIMEType) + { + $return = ""; + // Take the text, add any attachements, doc type, etc. + // attachments currently don't work. + + // SET MIME TYPE + if ($MIMEType=='text') + $return.="Content-Type: text/plain; charset=iso-8859-1\r\n"; + elseif($MIMEType=='html') + $return.="Content-Type: text/html; charset=iso-8859-1\r\n"; + else + $return.="Content-Type: text/plain; charset=iso-8859-1\r\n"; + + // SET TO HEADER + if (strlen($this->mailtotitle)>=1) + $return.="To: ".$this->mailtotitle."\r\n"; + + // SET FROM HEADER + if (strlen($this->mailfromtitle)>=1) + $return.="From: ".$this->mailfromtitle." <".$this->mailfrom.">\r\n"; + else $return.="From: ".$this->mailfrom."\r\n"; + + if (sizeof($this->mailcc)>=1) + { + $return.="Cc:"; + for ($i=0; $imailcc); $i++) + { + if ($i) + $return.=", "; + $return.=$this->mailcc[$i]; + } + $return.="\r\n"; + } + + if (strlen($this->mailsubject)>=1) + $return.="Subject: ".$this->mailsubject."\r\n"; + + $return .="X-Priority: 3\r\n"; + $return .= "\r\n" . $this->mailtext; + + return $return; + } + +Function sendmail($text_type='html') + { + if (!$this->sock) + return $this->error(2); + else { + if (!$body=$this->BuildBody($text_type)) + return $this->Error(1, 'BuildBody Failed'); + + $head[]="HELO ".$this->server; + $head[]="MAIL FROM:<".$this->mailfrom.">"; + while (list($key, $value)= each($this->mailto)) + { + $head[]="RCPT TO:<$value>"; + } + $head[]='DATA'; + + reset ($head); + + while (list($key, $value)=each ($head)) + { + fputs($this->sock, $value."\r\n"); + if (!$this->GetFeedback()) + return $this->error($this->errno(), "($value)"); + } + + fputs($this->sock, "$body\r\n.\r\n"); + if (!$this->GetFeedback()) + return false; + } + $this->ResetData(); + return true; + } + +function ResetData() + { + $mailto = array(); + $mailfrom = ""; + $mailfromtitle = ''; + $mailsubject = ""; + $mailtext = ""; + $attachments = array(); + return true; + } + + +Function GetFeedback() + { + if (!$response=fgets($this->sock, $this->readlength)) + return false; + if ($this->IsOK($response)) + return true; + else return false; + } + +Function IsOK ($input) + { + // Extract the return code from the SMTP server, and make sure it's a + // 'yahoo' instead of a 'shucks'. + + if (!ereg("((^[0-9])([0-9]*))", $input, $regs)) + return $this->error(1, 'input'); + + $code=$regs[1]; + + switch ($code) + { + case '220': + case '221': + case '250': + case '251': + case '354': + return true; + break; + default: + return $this->error(4, $input); + break; + } + } + +Function end() + { + if (!$this->sock) + return $this->error(3, 'function end'); + + fputs($this->sock, "QUIT\r\n"); + + if ($this->GetFeedback()) + { + fclose($this->sock); + return true; + } + else { + return false; + } + } + +} // END OF CLASS... + + +/* +I wanted a class that could be easily stretched into doing attachements +(intelligently!) wasn't cumbersome, and verified that stuff being flung +at the SMTP server made it. + +Something that would allow for intelligent error reporting and would +reliably fail +if something goes wrong, and do so w/o waiting for the PHP timeout... + +This has: + +- Bcc: support - now send the same mail to 100 people w/o sending + 100 emails! (repeatedly use function SetTo()) + +- Error code control - If the SMTP server complains, we trap that + and report the error - so the application can act on it properly. + +- MIME Support is but a small breath away - need to update only the + BuildBody() function as soon as an effective algorithm is figured out... + +- Broke out alot of the settings functions because I could never remember + what went where... feel free to create "wrapper" functions to set a bunch + all at once. + +- Greatly improved header support - though still not fully complete. (MIME + only partially supported) + +- block read support - to trap the SMTP server replies. + +- connection timeout() should be implemented - but I don't have a slow or + unreliable mailserver to test it on... + +- We can now send multiple e-mails with a single connection... when a mail + is sent, you can simply set the fields and send another! This **SHOULD** result + in better performance when sending alot of emails. This functionality should + mirror the "reset" SMTP command... + +- Lots of incrememental improvements - loops and functions used to turn + recycled code into reused code, etc. + +- CC: Support - works just like SetTo() but also writes the header(s) + in the e-mail body. + +CHANGES: + +v1.3.1 16 Sep 01 James McGlinn + Fixed bug in routine setting mail from title +v1.3.2 16 Sep 01 James McGlinn + Added new blank line between headers and message text to +prevent remote + server from inserting headers into middle of message +*/ +?> + diff --git a/index.php b/index.php index e69de29..2f7dc48 100644 --- a/index.php +++ b/index.php @@ -0,0 +1,16 @@ + +

RIS LSI Consulting SASU

+

+

+

Who I am ?

+

+

+

Social Media

+

+

+ diff --git a/linux/index.php b/linux/index.php new file mode 100644 index 0000000..da1a872 --- /dev/null +++ b/linux/index.php @@ -0,0 +1,3 @@ + diff --git a/network/index.php b/network/index.php new file mode 100644 index 0000000..da1a872 --- /dev/null +++ b/network/index.php @@ -0,0 +1,3 @@ +