print "<input type=\"hidden\" name=\"op\" value=\"rpc\">";
print "<input type=\"hidden\" name=\"subop\" value=\"sendEmail\">";
- $result = db_query($link, "SELECT email FROM ttrss_users WHERE
+ $result = db_query($link, "SELECT email, full_name FROM ttrss_users WHERE
id = " . $_SESSION["uid"]);
$user_email = htmlspecialchars(db_fetch_result($result, 0, "email"));
- $user_name = htmlspecialchars($_SESSION["name"]);
+ $user_name = htmlspecialchars(db_fetch_result($result, 0, "full_name"));
+
+ if (!$user_name) $user_name = $_SESSION['name'];
$_SESSION['email_replyto'] = $user_email;
$_SESSION['email_fromname'] = $user_name;
} else if ($subop == "change-email") {
$email = db_escape_string($_POST["email"]);
+ $full_name = db_escape_string($_POST["full_name"]);
+
$active_uid = $_SESSION["uid"];
- db_query($link, "UPDATE ttrss_users SET email = '$email'
- WHERE id = '$active_uid'");
+ db_query($link, "UPDATE ttrss_users SET email = '$email',
+ full_name = '$full_name' WHERE id = '$active_uid'");
- print __("E-mail has been changed.");
+ print __("Your personal data has been saved.");
return;
print "<table width=\"100%\" class=\"prefPrefsList\">";
print "<tr><td colspan='3'><h3>".__("Personal data")."</h3></tr></td>";
- $result = db_query($link, "SELECT email,access_level FROM ttrss_users
+ $result = db_query($link, "SELECT email,full_name,
+ access_level FROM ttrss_users
WHERE id = ".$_SESSION["uid"]);
- $email = db_fetch_result($result, 0, "email");
-
+ $email = htmlspecialchars(db_fetch_result($result, 0, "email"));
+ $full_name = htmlspecialchars(db_fetch_result($result, 0, "full_name"));
+
+ print "<tr><td width=\"40%\">".__('Full name')."</td>";
+ print "<td class=\"prefValue\"><input class=\"editbox\" name=\"full_name\"
+ onfocus=\"javascript:disableHotkeys();\"
+ onblur=\"javascript:enableHotkeys();\"
+ onkeypress=\"return filterCR(event, changeUserEmail)\"
+ value=\"$full_name\"></td></tr>";
+
print "<tr><td width=\"40%\">".__('E-mail')."</td>";
print "<td class=\"prefValue\"><input class=\"editbox\" name=\"email\"
onfocus=\"javascript:disableHotkeys();\"
print "</form>";
print "<p><button onclick=\"return changeUserEmail()\">".
- __("Change e-mail")."</button>";
+ __("Save data")."</button>";
print "<form onsubmit=\"return false\"
name=\"change_pass_form\" id=\"change_pass_form\">";
var query = Form.serialize("change_email_form");
- notify_progress("Trying to change e-mail...");
+ notify_progress("Saving...");
new Ajax.Request("backend.php", {
parameters: query,
require_once "functions.php";
define('EXPECTED_CONFIG_VERSION', 19);
- define('SCHEMA_VERSION', 69);
+ define('SCHEMA_VERSION', 70);
if (!file_exists("config.php")) {
print "<b>Fatal Error</b>: You forgot to copy
access_level integer not null default 0,
theme_id integer default null,
email varchar(250) not null default '',
+ full_name varchar(250) not null default '',
email_digest bool not null default false,
last_digest_sent datetime default null,
created datetime default null,
create table ttrss_version (schema_version int not null) TYPE=InnoDB DEFAULT CHARSET=UTF8;
-insert into ttrss_version values (69);
+insert into ttrss_version values (70);
create table ttrss_enclosures (id integer primary key auto_increment,
content_url text not null,
last_login timestamp default null,
access_level integer not null default 0,
email varchar(250) not null default '',
+ full_name varchar(250) not null default '',
email_digest boolean not null default false,
last_digest_sent timestamp default null,
created timestamp default null,
create table ttrss_version (schema_version int not null);
-insert into ttrss_version values (69);
+insert into ttrss_version values (70);
create table ttrss_enclosures (id serial not null primary key,
content_url text not null,
--- /dev/null
+alter table ttrss_users add column full_name varchar(250);
+update ttrss_users set full_name = '';
+alter table ttrss_users change full_name full_name varchar(250) not null;
+alter table ttrss_users alter column full_name set default '';
+
+update ttrss_version set schema_version = 70;
--- /dev/null
+alter table ttrss_users add column full_name varchar(250);
+update ttrss_users set full_name = '';
+alter table ttrss_users alter column full_name set not null;
+alter table ttrss_users alter column full_name set default '';
+
+update ttrss_version set schema_version = 70;