Puffin mobile v1.2

Discussioni sul sito della Lega generato da FantaManager, sulle skin e su tutti plugin, ufficiali e sviluppati dagli utenti
Rispondi
Avatar utente
lucatk
Messaggi: 237
Iscritto il: 28 ago 2016, 17:21

Puffin mobile v1.2

Messaggio da lucatk »

Scusate, ragazzi, sapreste dirmi dove posso trovare (o se qualcuno ce l'ha) il download di puffin mobile, visto che mi è sparito inspiegabilmente sendmailMob.php e non va, quindi, l'invio formazione dal sito mobile, appunto?
Avatar utente
lukesky
Messaggi: 1257
Iscritto il: 03 ago 2016, 09:02
Località: Perugia
Contatta:

Re: Puffin mobile v1.2

Messaggio da lukesky »

lucatk ha scritto: 15 set 2018, 16:01 Scusate, ragazzi, sapreste dirmi dove posso trovare (o se qualcuno ce l'ha) il download di puffin mobile, visto che mi è sparito inspiegabilmente sendmailMob.php e non va, quindi, l'invio formazione dal sito mobile, appunto?
Non posso aiutarti su dove trovare il puffin mobile. Ti posso postare il mio sendmailMob.php, che però ho modificato per farlo funzionare anche sul php7 e non so se può andar bene anche per te. Però tentar non nuoce.....

Codice: Seleziona tutto

<?php

//-----------------------------------------------------------------------------
// sendmail.php
//
// Copyright (C) 2005 Marcello 'John Doe' Puri
//
// Versione 0.9.0 (15/09/2005)
// Versione 0.9.5 (28/09/2005)
//  * aggiunto il modulo di salvataggio automatico delle formazioni
// Versione 0.9.6 (07/10/2005)
//  * modificata la modalità di passaggio parametri al modulo d'invio e
//    salvataggio formazione per garantire la compatibilità anche con
//    Internet Explorer
//  * la pagina HTML generata dal modulo d'invio e salvataggio formazione
//    è completa anche in caso di errore
// Versione 1.0.0 (02/12/2005)
//  * aggiunto messaggio di debug visualizzato se nessun parametro
//    viene specificato
// Versione 1.1.0 (08/09/2006)
// Versione 1.1.1 (09/09/2009)
//  * corretto funzionamento nel caso in cui sia impostato
//    magic_quotes_gpc=off
//-----------------------------------------------------------------------------
// saveLineUp() e' liberamente ispirata a SalvaFormazione.php di
// Giuseppe "mR`gImO" (http://www.legadeiforti.info/skindownload.htm)
//-----------------------------------------------------------------------------

require('class.phpmailer.php');

$fantasquadra = '';
$competizione = '';
$lega = '';

//print("<html>\n");
//print("<head>\n");
//print("<link href=\"../style/Pskin08Tot.css\" rel=\"stylesheet\" type=\"text/css\">\n");
//print("<link href=\"invform.css\" rel=\"stylesheet\" type=\"text/css\">\n");
//print("</head>\n");
//print("<body id='invio'>\n");
// FORMATTAZIONE BY PUFFIN
//print ("<div class='conferma'>");
// FORMATTAZIONE BY PUFFIN
print("<HTML xmlns='http://www.w3.org/1999/xhtml'><HEAD><TITLE>Fantacalcio - Invio Formazione</TITLE>\n");
print("<META content='text/html; charset=iso-8859-1' http-equiv=Content-Type>\n");
print("<META name=viewport content='width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;'>\n");
print("<link href='../styles_mobile.css' rel='stylesheet' type='text/css'>\n");
print("</HEAD>\n");
print("<body>\n");
print("<TABLE width='100%' cellPadding=0 cellSpacing=0 class=f><TBODY><TR><TD>\n");
if (sizeof($_REQUEST) == 0)
    showAlert("sendmail.php versione 1.0.0\nCopyright &copy; 2005 Marcello &quot;John Doe&quot; Puri");
	//print('<h3>sendmail.php versione 1.0.0</h3><p>Copyright &copy; 2005 Marcello &quot;John Doe&quot; Puri</p>');
else {
	$result = checkPassword();
	if ($result != '')
	    showAlert($result);
		//print("<center><span class='form_errore_pwd'>$result</span></center>\n");
	else {
		$result = gatherData();
		showAlert(date("d/m/Y - H:i:s")."\n ".$lega."\n ".$fantasquadra."\n $competizione");
        //print("<span class='data'>".date("d/m/Y - H:i:s")."</span>");
		//print("<span class='lega'><p><b>Lega: </b>$lega</span>\n");
		//print("<span class='squadra_compet'><span class='nomi'>Fantasquadra: </span>$fantasquadra</span>\n");
		//print("<span class='squadra_compet'><span class='nomi'>Competizione: </span>$competizione</span>\n");

		$result = sendMail();
		if ($result != '')
		    showAlert($result);
			//print("<span class='form_errore'>$result</span>\n");
		else {
		    showAlert("Formazione inviata correttamente!");
			//print("<span class='form_inviata'>Formazione inviata correttamente!</span>\n");

			if ($_REQUEST['saveData']) {
				$result = saveLineUp();

				if ($result != '')
					showAlert($result);
					//print("<span class='form_errore'>$result</span>\n");
				else 
					showAlert("Formazione salvata correttamente!");
					//print("<span class='form_inviata'>Formazione salvata correttamente!</span>\n");
		
			}
		}
	}
}

print("<center><b><a href=\"Javascript: window.close()\">Chiudi</a></b></center>\n");


print("</TD></TR></TBODY></TABLE>\n");
// FORMATTAZIONE BY MAELSTROM

print("</body>\n");
print("</html>\n");

// FORMATTAZIONE BY PUFFIN
//print ("</div>");
// FORMATTAZIONE BY PUFFIN

//print("</body>\n");
//print("</html>\n");

//Modifica per sito MOB
function showAlert($text) { ?>
<script language="javascript">
<!-- Hide Script
alert("<?php echo $text; ?>")
//End Hide Script-->
</script> <?php } 
//Fine Modifica per sito MOB

function saveLineUp()
{
	$idSquadra = $_REQUEST['idSquadra'];
	$giornataDiA = $_REQUEST['giornataDiA'];
	$idIncontro = $_REQUEST['idIncontro'];

	if (($fp = fopen("../js/fcmFormazioniDati$giornataDiA.js", 'r+')) == false)
		return 'Impossibile aprire il file formazioni!';
	if (!flock($fp, LOCK_EX)) {
		return 'Impossibile bloccare il file formazioni!';
		fclose($fp);
	}

	$oldStaticLines = array();
	$oldLineUpsLines = array();
	while (!feof ($fp)) {
		$l = fgets($fp, 4096);
		if (!preg_match('/^a\[\d+\]=new Z\((\d+),(\d+),([^\)]+)\)/', $l, $regs)) array_push($oldStaticLines, $l);
		else if ($regs[1] != $idIncontro || $regs[2] != $idSquadra) array_push($oldLineUpsLines, "$regs[1],$regs[2],$regs[3]");
	}

	fseek($fp, 0);

	$i = 1;
	foreach($oldStaticLines as $l) if (trim($l) != '') fputs($fp, $l);
	foreach($oldLineUpsLines as $l) {
		fputs($fp, "a[$i]=new Z($l)\n");
		$i++;
	}
	$newLineUpsLines = explode('|', $_REQUEST['saveData']);
	foreach($newLineUpsLines as $l) {
		fputs($fp, "a[$i]=new Z($l)\n");
		$i++;
	}

	ftruncate($fp, ftell($fp));

	flock($fp, LOCK_UN);
	fclose($fp);
}


function gatherData()
{
	global $fantasquadra, $competizione, $lega;

	$body = explode("\n", magicQuotes($_REQUEST['body']));
	list($null, $competizione, $null) = explode(', ', $_REQUEST['subject'], 3);
	if (preg_match('/^Lega: (.+)$/', $body[0], $regs)) $lega = $regs[1];
	if (preg_match('/^Squadra: (.+)$/', $body[1], $regs)) $fantasquadra = $regs[1];
}

function sendMail()
{
	global $fantasquadra, $competizione, $lega;

	$mail = new PHPMailer();
	$mail->From = $_REQUEST['sender'];
	$mail->FromName = '';
	$mail->Subject = $_REQUEST['subject'];
	$mail->Body = magicQuotes($_REQUEST['body']);
	foreach (explode('; ', $_REQUEST['recipient']) as $add) $mail->AddAddress($add);

	return $mail->Send() ? '' : 'Errore durante durante l\'invio della e-mail!';
}

function checkPassword()
{
	$username = $_REQUEST['username'];
	$password = $_REQUEST['password'];

	if (($fp = fopen('../js/fcmInvioFormazioneDati.js', 'rt')) == false)
		return 'File password non trovato!';

	$found = false;
	while (!feof ($fp) && !$found) {
		$buffer = fgets($fp, 4096);
		$found = preg_match('\'^a=passwords;\'', $buffer);
	}

	if (!$found)
		return 'File password non valido!';

	$found = false;
	$passwords = array();
	while (!feof ($fp) && !$found) {
		$buffer = fgets($fp, 4096);
		if ($buffer == "\n")
			$found = true;
		else {
			$result = preg_match('\'a\\[(.+)\\]=\\"(.+)\\"\'', $buffer, $regs);
			if ($result) $passwords[$regs[1]] = $regs[2];
		}
	}

	if (crypt($password, 'jd') != $passwords[$username])
		return 'Password non valida!';

	return '';
}

function magicQuotes($var)
{
	$out = $var;

	if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() == 1) {
		$mqs = strtolower(ini_get('magic_quotes_sybase'));
		if (empty($mqs) || $mqs == 'off') 
			$out = stripslashes($var);
		else
			$out = str_replace("''", "'", $var);
	}
	return $out;
}

?>
Rispondi