Ciao a tutti,
ho installato una applicazione PHP di upload/download, con un modulo che permette di inviare in automatico l'email con la password a chi fa richiesta di accesso all'area riservata.
Il sistema di upload/download funziona benissimo. L'unico problema si riscontra nell'invio di queste email.
Mi viene restituito il messaggio
PROBLEMI NELL'INVIO DELLA MAIL ALL'AMMINISTRATORE E' necessario mettersi in contatto con l'amministratore del sito
Inserisco alcune pagine dello script in questione. Se vi è di aiuto nella risoluzione del problema posso linkare anche la pagine originale presente sul server web.
Grazie mille a tutti quelli che mi sapranno aiutare in qualche modo
request-pwd.php
Codice PHP:
<?php
require_once "conf.inc.php";
require_once "lib.inc.php";
require _AuthDir."/domit/xml_domit_include.php";
if(!@include "./users_setting/$cook_login.php")
require "./users_setting/default.php";
if(!include "./lang/$Set_DefaultLang/$Set_DefaultLang.vars.php")
require "./lang/english/english.vars.php";
if(is_dir("./themes/$Set_DefaultTheme/"))
{
$ImageDir="./themes/$Set_DefaultTheme/img/" ;
$CssFile= "./themes/$Set_DefaultTheme/css.php";
}
else
{
$ImageDir="./themes/windows/img" ;
$CssFile= "./themes/windows/css.php";
}
$_FILEXML="./auth/simplev2/utenti.xml";
session_start();
$email=$_REQUEST['email'];
$motivo=$_REQUEST['motivo'];
if ($email!="")
$START=1;
if ($START)
{
$parser= & new DOMIT_Document;
$parser->loadXML($_FILEXML, true);
$logins= & $parser->getElementsByAttribute('email', $email);
$nlogins = $logins->getLength();
for($i=0;$i<$nlogins;$i++)
{
$utente= & $logins->item($i);
$_VALIDPERIOD=$utente->getAttribute('scadenza');
$today = getdate();
$month = $today['mon'];
$day = $today['mday'];
$year = $today['year'];
$start=mktime(0,0,0,$utente->getAttribute("m"),$utente->getAttribute("g"),$utente->getAttribute("a"));
$end=$start+mktime(0,0,0,1,$_VALIDPERIOD,1970);
$actual=mktime(0,0,0,$month,$day,$year);
if ($actual<=$end || $email=="admin")
$ERR=1;
}
if (!$ERR)
{
$titolo='RICHIESTA GENERAZIONE PASSWORD PER ACCESSO AL PORTALE';
$testo ="l'utente $email ha richiesto la password per l'accesso
\n";
$testo.="La motivazione é $motivo ";
$intestazioni = "MIME-Version: 1.0\r\n";
$intestazioni .= "Content-type: text/html; charset=iso-8859-1\r\n";
$ok=@mail(_WEBMASTER,$titolo,$testo,$intestazioni);
}
printf( "<HTML $DIRLANG ><HEAD>\n" );
printf( "<meta http-equiv='Content-Type' content='text/html; $charset; '>\n" );
printf( "<title>". $StrLang["CreatingPwd"]."</title>\n" );
include $CssFile;
printf( "</head>\n" );
printf( "<body ONLOAD=\"focuss()\">\n" );
printf( "
\n" );
printf( "<form name=\"form1\" id=abc method=\"post\" action=\"request-pwd.php\">\n" );
printf( "
<table width=\"50%%\" border=\"0\" align=\"center\">
\n" ); printf( "
<tr><td colspan=2>\n" );
echo "<div align=center >[img]$ImageDir/cat-head.gif[/img]</div>" ;
if($ERR)
{
echo "<div align=center>";
Puterror( $StrLang["psw_still_valid"]);
echo "</div>";
}
printf( " </td>\n" );
printf( " </tr>\n" );
if ($start)
{
printf( " <tr>\n" );
printf( " <td width='45%%' align=right>". $StrLang["email"] ."</td>\n" );
printf( " <td width='55%%'><input name=\"email\" type=\"text\" id=\"login\" value=\"". $_COOKIE["cook_login"] ."\"></td>\n" );
printf( " </tr>\n" );
printf( " <tr>\n" );
printf( " <td colspan=\"2\" height=\"50px\" align=\"center\">
MOTIVO
<textarea name=\"motivo\" rows=\"8\"></textarea></td>\n" );
printf( " </tr>\n" );
printf( " <tr>\n" );
printf( " <td colspan=\"2\" align=\"center\"><input name=\"submit\" type=\"submit\" id=\"submit\" value=\"".$StrLang["RequestPw"]."\"></td>\n" );
printf( " </tr>\n" );
}
else
{
printf( " <tr>\n" );
printf( " <td colspan=\"2\" align=\"center\">");
if ($ok)
printf( "MAIL INVIATA CORRETTAMENTE" );
else
{
printf( "PROBLEMI NELL'INVIO DELLA MAIL ALL'AMMINISTRATORE
\n" );
printf( "E' necessario mettersi in contatto con l'amministratore del sito\n" );
}
printf( " </td>\n" );
printf( " </tr>\n" );
}
printf( " <tr>\n" );
printf( " <td colspan=\"2\" align=\"center\"><a id=\"bottone\" href=\"login-form.php\" style=\"background: #FFF6BF; color: #514721; border: 1px solid #FFD324; padding: 5px;\"> ".$StrLang["Login"]." </a></td>\n" );
printf( " </tr>\n" );
printf( "</table>\n" );
printf( "</form></body></html>\n" );
}
else
{
printf( " <HTML$DIRLANGHEAD>\n" );
printf( "<meta http-equiv='Content-Type' content='text/html; $charset'>\n" );
printf( "<title>".$StrLang["Authentification"]."</title>\n" );
include $CssFile;
printf( "</head>\n" );
printf( "<body ONLOAD=\"focuss()\">\n" );
printf( "
<form name=\"form1\" id=abc method=\"post\" action=\"request-pwd.php\">\n" );
printf( "<table width=\"50%%\" border=\"0\" align=\"center\">\n" );
printf( " <tr><td colspan=2>\n" );
printf( "<div align=center >[img]$ImageDir/cat-head.gif[/img]</div>");
printf( " </td>\n" );
printf( " </tr>\n" );
printf( " <tr>\n" );
printf( " <td width='45%%' align=right>".$StrLang["email"]."</td>\n" );
printf( " <td width='55%%'><input name=\"email\" type=\"text\" id=\"login\" value=\"".$_COOKIE["cook_login"]."\"></td>\n" );
printf( " </tr>\n" );
printf( " <tr>\n" );
printf( " <td colspan=\"2\" align=\"center\">MOTIVO
<textarea name=\"motivo\"></textarea></td>\n" );
printf( " </tr>\n" );
printf( " <tr>\n" );
printf( " <td colspan=\"2\" align=\"center\"><input name=\"submit\" type=\"submit\" id=\"submit\" value=\"". $StrLang["RequestPw"]."\"></td>\n" );
printf( " </tr>\n" );
printf( " <tr>\n" );
printf( " <td colspan=\"2\" height=\"50\" align=\"center\"><a id=\"bottone\" href=\"login-form.php\" style=\"background: #FFF6BF; color: #514721; border: 1px solid #FFD324; margin-top: 10px; padding: 5px;\"> ".$StrLang["Login"]." </a></td>\n" );
printf( " </tr>\n" );
printf( "</table>\n" );
printf( "</form></body></html>\n" );
}
------------------------------------------------
conf.inc.php
Codice PHP:
<?php
//error_reporting (E_ALL ^ E_NOTICE);
ini_set('display_errors', 0);
#_UseMultiusers
# - true or 1 to use session
# - false or 0 to not
#
define ('_UseMultiusers' ,1);
#_AuthMode
# look at ./auth to view what methods are allowed
# mysql xml ldap pgsql ...
$diff_auth=array(
"A" => "simple",
"B" => "mysql",
"C" => "ldap",
"D" => "mssql", // notavailable
"E" => "pgsql",
"F" => "oracle", // notavailable
"G" => "xml", // notavailable
"H" => "access",
"I" => "simplev2"
); // WARNING : YOU MUST SET LOGIN CONF BEFORE
define ('_AuthMode', $diff_auth["I"]);
# if you don't use multiusers you must set _DefaultBaseDir
define ('_DefaultBaseDir' ,"..") ;
#define ('_DefaultBaseDir' ,"..") ;
# ---------------------------------------
define ('_ScriptDir' ,realpath(".")) ;
# set OS type
if (strtoupper(substr(php_uname(), 0, 3)) == "WIN")
define ('_OS', 'windows');
else
define ('_OS', 'other');
define ('_AuthDir',_ScriptDir."/auth/"._AuthMode);
# uncoment this if u r problem with session
#session_save_path("./temp");
//define (_SEPARATOR_, '/');
# init -> check if gzlib is available
if(@function_exists('bzcompress')) define('_bzlibexist',true);
else define('_bzlibexist',false);
if(@function_exists('gzencode')) define('_gzlibexist',true);
else define('_gzlibexist',false);
define('FTPBASEDIR', '../ftproot/folder');
define('_WEBMASTER', 'pippo@libero.it'); // indirizzo desinazione omesso ora
?>