X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile%2Fgeneral.inc.php;h=cd3b394fc2319bce6e1eee546a448c606a28e626;hb=bf9202eda9d81179f0e575aee7a33e71434dd82f;hp=66d94b3e9d26d7cb2a2f2f228ab750f521768f7a;hpb=245923e335d0da5bec9495991a7846be9f0563ab;p=platal.git diff --git a/modules/profile/general.inc.php b/modules/profile/general.inc.php index 66d94b3..cd3b394 100644 --- a/modules/profile/general.inc.php +++ b/modules/profile/general.inc.php @@ -574,7 +574,11 @@ class ProfilePageGeneral extends ProfilePage $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(*) @@ -636,7 +640,7 @@ class ProfilePageGeneral extends ProfilePage 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 = {?} @@ -661,7 +665,7 @@ class ProfilePageGeneral extends ProfilePage } } } - 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',