function userdetails() {
- header("Content-Type: text/xml");
- print "<dlg>";
-
$uid = sprintf("%d", $_REQUEST["id"]);
- print "<title>".__('User details')."</title>";
-
- print "<content><![CDATA[";
-
$result = db_query($this->link, "SELECT login,
".SUBSTRING_FOR_DATE."(last_login,1,16) AS last_login,
access_level,
<button onclick=\"closeInfoBox()\">".__("Close this window").
"</button></div>";
- print "]]></content></dlg>";
-
return;
}
function edit() {
global $access_level_names;
- header("Content-Type: text/xml");
-
$id = db_escape_string($this->link, $_REQUEST["id"]);
-
- print "<dlg id=\"$method\">";
- print "<title>".__('User Editor')."</title>";
- print "<content><![CDATA[";
-
print "<form id=\"user_edit_form\" onsubmit='return false'>";
print "<input type=\"hidden\" name=\"id\" value=\"$id\">";
<button onclick=\"return userEditCancel()\">".
__('Cancel')."</button></div>";
- print "]]></content></dlg>";
-
return;
}
$uid = db_escape_string($this->link, $_REQUEST["id"]);
$access_level = (int) $_REQUEST["access_level"];
$email = db_escape_string($this->link, trim($_REQUEST["email"]));
- $password = db_escape_string($this->link, trim($_REQUEST["password"]));
+ $password = $_REQUEST["password"];
if ($password) {
$salt = substr(bin2hex(get_random_bytes(125)), 0, 250);
WHERE id = '$uid'");
if ($show_password) {
- print T_sprintf("Changed password of user <b>%s</b>
- to <b>%s</b>", $login, $tmp_user_pwd);
+ print T_sprintf("Changed password of user <b>%s</b> to <b>%s</b>", $login, $tmp_user_pwd);
} else {
- print T_sprintf("Sending new password of user <b>%s</b>
- to <b>%s</b>", $login, $email);
+ print_notice(T_sprintf("Sending new password of user <b>%s</b> to <b>%s</b>", $login, $email));
}
- require_once 'lib/phpmailer/class.phpmailer.php';
+ require_once 'classes/ttrssmailer.php';
if ($email) {
require_once "lib/MiniTemplator.class.php";
$tpl->generateOutputToString($message);
- $mail = new PHPMailer();
-
- $mail->PluginDir = "lib/phpmailer/";
- $mail->SetLanguage("en", "lib/phpmailer/language/");
-
- $mail->CharSet = "UTF-8";
-
- $mail->From = SMTP_FROM_ADDRESS;
- $mail->FromName = SMTP_FROM_NAME;
- $mail->AddAddress($email, $login);
-
- if (SMTP_HOST) {
- $mail->Host = SMTP_HOST;
- $mail->Mailer = "smtp";
- $mail->SMTPAuth = SMTP_LOGIN != '';
- $mail->Username = SMTP_LOGIN;
- $mail->Password = SMTP_PASSWORD;
- }
-
- $mail->IsHTML(false);
- $mail->Subject = __("[tt-rss] Password change notification");
- $mail->Body = $message;
+ $mail = new ttrssMailer();
- $rc = $mail->Send();
+ $rc = $mail->quickMail($email, $login,
+ __("[tt-rss] Password change notification"),
+ $message, false);
if (!$rc) print_error($mail->ErrorInfo);
}