function addItem_postInsertion()
 {
     /* controllare reload */
     $skin = new Skin("dipartimento");
     $mail = new Skinlet("user.mail");
     $mail->setContent("name", $_REQUEST['name']);
     $mail->setContent("username", $_REQUEST['username']);
     $mail->setContent("password", $_REQUEST['password']);
     $mail->setContent("message", $_REQUEST['message']);
     $mail->setContent("email", $_REQUEST['email']);
     if (isset($_REQUEST['home'])) {
         $mail->setContent("home", "http://www.di.univaq.it/home.php?username={$_REQUEST['username']}");
         /*	$GLOBALS['homeEntity']->insertItem(NULL, 
         											  "{$_REQUEST['username']}",
         											  date('YmdHi'), 
         											  date('YmdHi'),
         											  "Generale", 
         											  "General",
         											  "Home",
         											  "Home",
         											  "Pagina provvisoria di {$_REQUEST['name']} {$_REQUEST['surname']}", 
         											  "Temporary page of {$_REQUEST['name']} {$_REQUEST['surname']}", 
         											  "*", 
         											  1); 
         											  
         											  
         
         		*/
     }
     /* --- The following line has been uncommented by Gulyx --- */
     aux::mail($_REQUEST['email'], "{$GLOBALS['config']['website']['name']} Login data", $mail->get(), $GLOBALS['config']['website']['email']);
 }
Example #2
0
 function send2()
 {
     $uid = strtoupper(md5(uniqid(time())));
     $header = "From: " . $this->from . "\nReply-To: " . $this->from . "\n";
     if ($this->cc != "") {
         $header .= "CC: " . $this->cc . "\n";
     }
     $header .= "MIME-Version: 1.0\n";
     $header .= "Content-Type: multipart/mixed; boundary={$uid}\n";
     $header .= "--{$uid}\n";
     $header .= "Content-Type: text/plain\n";
     $header .= "Content-Transfer-Encoding: 8bit\n\n";
     $header .= $this->message . "\n";
     if (is_array($this->file)) {
         foreach ($this->file as $k => $v) {
             $content = fread(fopen($this->file[$k], "r"), filesize($this->file[$k]));
             $content = chunk_split(base64_encode($content));
             $header .= "--{$uid}\n";
             $header .= "Content-Type: " . $this->file_type[$k] . "; name=\"" . $this->file_name[$k] . "\"\n";
             $header .= "Content-Transfer-Encoding: base64\n";
             $header .= "Content-Disposition: attachment; filename=\"" . $this->file_name[$k] . "\"\n\n";
             $header .= "{$content}\n";
         }
     }
     if (is_array($this->buffer)) {
         foreach ($this->buffer as $k => $v) {
             $content = chunk_split(base64_encode($v));
             $header .= "--{$uid}\n";
             $header .= "Content-Type: " . $this->buffer_type[$k] . "; name=\"" . $this->buffer_name[$k] . "\"\n";
             $header .= "Content-Transfer-Encoding: base64\n";
             $header .= "Content-Disposition: attachment; filename=\"" . $this->buffer_name[$k] . "\"\n\n";
             $header .= "{$content}\n";
         }
     }
     aux::mail($this->to, $this->subject, $this->message, $header);
     return true;
 }
}
$database = new DB($config['database'][$_SERVER['SERVER_NAME']]['host'], $config['database'][$_SERVER['SERVER_NAME']]['database'], $config['database'][$_SERVER['SERVER_NAME']]['username'], $config['database'][$_SERVER['SERVER_NAME']]['password']);
$message = new Message($config['language']);
if (file_exists("include/entities.inc.php")) {
    require "include/entities.inc.php";
} else {
    require "../include/entities.inc.php";
}
$database->init();
if (isset($_REQUEST['action'])) {
    switch ($_REQUEST['action']) {
        case "password":
            $skin = new Skin("dipartimento");
            $mail = new Skinlet("password.mail");
            #echo "QUI";
            $data = aux::getResult("SELECT * FROM {$usersEntity->name} WHERE email = '{$_REQUEST['email']}'");
            if (mysql_affected_rows() == 0) {
                $_REQUEST['id'] = NOTIFICATION_ERROR;
            } else {
                $password = substr(md5(time()), 0, 8);
                $oid = mysql_query("UPDATE {$usersEntity->name} \n\t\t\t            \t           SET password = MD5('{$password}') \n\t\t\t             \t        WHERE username='******'username']}'");
                $data[0]['password'] = $password;
                foreach ($data[0] as $k => $v) {
                    $mail->setContent($k, $v);
                }
                aux::mail($data[0]['email'], "Login data", $mail->get(), $GLOBALS['config']['website']['email']);
                $_REQUEST['id'] = NOTIFICATION;
            }
            break;
    }
}