]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pref/users.php
remove obsolete xml stuff in pref-users infoboxes
[tt-rss.git] / classes / pref / users.php
index b4f043775c082d31effc3b7c49bfec34de58c9ec..891a69a52b68b11759733d0e6de1a5e69ad05c6c 100644 (file)
@@ -19,15 +19,8 @@ class Pref_Users extends Handler_Protected {
 
                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,
@@ -106,22 +99,13 @@ class Pref_Users extends Handler_Protected {
                                <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\">";
@@ -193,8 +177,6 @@ class Pref_Users extends Handler_Protected {
                                <button onclick=\"return userEditCancel()\">".
                                        __('Cancel')."</button></div>";
 
-                       print "]]></content></dlg>";
-
                        return;
                }
 
@@ -203,7 +185,7 @@ class Pref_Users extends Handler_Protected {
                        $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);
@@ -288,14 +270,12 @@ class Pref_Users extends Handler_Protected {
                                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";
@@ -313,30 +293,11 @@ class Pref_Users extends Handler_Protected {
 
                                $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);
                        }