X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile%2Fdecos.inc.php;h=9d4634787c21ff7d35a40cb6bc06e0cd152f357c;hb=5660032ac785d410f90e3f5b0d6948dc90b0cfea;hp=31d68cdee64106488319168d7b784a6d06be5dfd;hpb=f9bebf66a51f0920e55eb6d2c60c88e2eafbc598;p=platal.git diff --git a/modules/profile/decos.inc.php b/modules/profile/decos.inc.php index 31d68cd..9d46347 100644 --- a/modules/profile/decos.inc.php +++ b/modules/profile/decos.inc.php @@ -30,7 +30,7 @@ class ProfileDeco implements ProfileSetting FROM profile_medals_sub AS s INNER JOIN profile_medals AS m ON ( s.mid = m.id ) WHERE s.uid = {?}", - S::i('uid')); + $page->pid()); $value = array(); while (list($id, $grade) = $res->next()) { $value[$id] = array('grade' => $grade, @@ -63,7 +63,7 @@ class ProfileDeco implements ProfileSetting if ($val['valid']) { XDB::execute("DELETE FROM profile_medals_sub WHERE uid = {?} AND mid = {?}", - S::i('uid'), $id); + $page->pid(), $id); } else { $req = MedalReq::get_request(S::i('uid'), $id); if ($req) { @@ -98,20 +98,20 @@ class ProfileDecos extends ProfilePage protected function _fetchData() { - $res = XDB::query("SELECT profile_medals_pub - FROM auth_user_quick - WHERE user_id = {?}", - S::i('uid')); + $res = XDB::query("SELECT medals_pub + FROM profiles + WHERE pid = {?}", + $this->pid()); $this->values['medals_pub'] = $res->fetchOneCell(); } protected function _saveData() { if ($this->changed['medals_pub']) { - XDB::execute("UPDATE auth_user_quick - SET profile_medals_pub = {?} - WHERE user_id = {?}", - $this->values['medals_pub'], S::i('uid')); + XDB::execute("UPDATE profiles + SET medals_pub = {?} + WHERE pid = {?}", + $this->values['medals_pub'], $this->pid()); } }