Location: PHPKode > projects > Aratix > admin/inc/send_pass.php
<?php
/*
** Aratix
** Version 0.1.0beta8 (Anubis)
**
** Autor: Manuel Burghammer
** E-Mail: hide@address.com
** Homepage: http://www.xitara.net
**
** File: send_pass.php - Version 0.1.0 build 44
** Position: /admin/inc/
** Last Modified: 27.05.2006 - 21:22:10
*/
define('ARATIX_ADMIN_PART', 1);

$current_path = dirname(__FILE__) . "/../../";
include $current_path . 'inc/init.inc.php';
include $current_path . 'admin/inc/core.inc.php';

$user_status = update_session($db, get('session'), get('ident'));

if($user_status == FALSE)
	echo "Fehler in der Session.<br />";

$reply_mail = ereg_replace("{domain}", $url, $config->get('reply_mail'));
$from_mail = ereg_replace("{domain}", $url, $config->get('from_mail'));
$new_pass = get('new_pass');
$user_id = get('user_id');
$user_mail = get('email');

$user_data = $db->read(TB_USER, "last_name, name, login", "id='" . $user_id . "'");

$mail_subject_ = $db->read(TB_LANG . "_" . get_language($config, $user_id), "text", "var='mail_sendpass_subject'");
$mail_text_ = $db->read(TB_LANG . "_" . get_language($config, $user_id), "text", "var='mail_sendpass'");
$mail_signature_ = $db->read(TB_LANG . "_" . get_language($config, $user_id), "text", "var='mail_signature'");
$mail_subject = $mail_subject_['text'];
$mail_text = $mail_text_['text'];
$mail_signature = $mail_signature_['text'];

$mail_subject = ereg_replace("{domain}", $url, $mail_subject);

$mail_text = ereg_replace("{last_name}", $user_data['last_name'], $mail_text);
$mail_text = ereg_replace("{name}", $user_data['name'], $mail_text);
$mail_text = ereg_replace("{domain}", $url, $mail_text);
$mail_text = ereg_replace("{login}", $user_data['login'], $mail_text);
$mail_text = ereg_replace("{password}", $new_pass, $mail_text);

$mail_headers = "From: " . $from_mail . "\r\n";
$mail_headers .= "Reply-To: " . $reply_mail . "\r\n";
$mail_headers .= "X-Mailer: " . $config->get('generator') . " " . $config->get('version') . "\r\n";

$db->update(TB_USER, "password", md5($new_pass), "id=" . $user_id);
mail($user_mail, $mail_subject, $mail_text . "\n\n-- \n" . $mail_signature, $mail_headers);

echo "<html><body>";
echo "<script type=\"text/javascript\">";
echo "self.close()";
echo "</script>";
echo "</body></html>";
?>
Return current item: Aratix