$res = XDB::query("SELECT pub
FROM profile_photos
WHERE pid = {?}", $this->pid());
- $this->values['photo_pub'] = $res->fetchOneCell();
+ if ($res->numRows() == 0) {
+ $this->values['photo_pub'] = 'private';
+ } else {
+ $this->values['photo_pub'] = $res->fetchOneCell();
+ }
if ($this->owner) {
$res = XDB::query("SELECT COUNT(*)
WHERE pid = {?}",
$this->values['photo_pub'], $this->pid());
}
- if ($this->changed['yourself']) {
+ if (S::user()->isMe($this->owner) && $this->changed['yourself']) {
if ($this->owner) {
XDB::execute('UPDATE accounts
SET display_name = {?}
}
}
}
- if ($this->changed['deathdate']) {
+ if (!S::user()->isMe($this->owner) && $this->changed['deathdate']) {
XDB::execute('UPDATE profiles
SET deathdate = {?}, deathdate_rec = NOW()
WHERE pid = {?} AND deathdate_rec IS NULL',