projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix SU on account.
[platal.git]
/
include
/
validations
/
medals.inc.php
diff --git
a/include/validations/medals.inc.php
b/include/validations/medals.inc.php
index
e448358
..
16f5b99
100644
(file)
--- a/
include/validations/medals.inc.php
+++ b/
include/validations/medals.inc.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-20
09
Polytechnique.org *
+ * Copyright (C) 2003-20
10
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-77,8
+77,8
@@
class MedalReq extends Validate
//var_dump($this);
$r = XDB::query("
SELECT IF (g.text IS NOT NULL, CONCAT(m.text,' - ', g.text), m.text)
//var_dump($this);
$r = XDB::query("
SELECT IF (g.text IS NOT NULL, CONCAT(m.text,' - ', g.text), m.text)
- FROM profile_medal
s
AS m
- LEFT JOIN profile_medal
s
_grades AS g ON(g.mid = m.id AND g.gid = {?})
+ FROM profile_medal
_enum
AS m
+ LEFT JOIN profile_medal
_enum
_grades AS g ON(g.mid = m.id AND g.gid = {?})
WHERE m.id = {?}", $this->gid, $this->mid);
return $r->fetchOneCell();
}
WHERE m.id = {?}", $this->gid, $this->mid);
return $r->fetchOneCell();
}
@@
-89,7
+89,7
@@
class MedalReq extends Validate
public function submit()
{
$res = XDB::query("SELECT FIND_IN_SET('validation', flags)
public function submit()
{
$res = XDB::query("SELECT FIND_IN_SET('validation', flags)
- FROM profile_medal
s
+ FROM profile_medal
_enum
WHERE id = {?}", $this->mid);
if ($res->fetchOneCell()) {
parent::submit();
WHERE id = {?}", $this->mid);
if ($res->fetchOneCell()) {
parent::submit();
@@
-103,11
+103,9
@@
class MedalReq extends Validate
public function commit ()
{
public function commit ()
{
- require_once 'notifs.inc.php';
- register_watch_op($this->user->id(), WATCH_FICHE, '', 'medals');
- return XDB::execute('REPLACE INTO profile_medals_sub
+ return XDB::execute('REPLACE INTO profile_medals
VALUES ({?}, {?}, {?})',
VALUES ({?}, {?}, {?})',
- $this->user->id(), $this->mid,
+ $this->user->
profile()->
id(), $this->mid,
is_null($this->gid) ? 0 : $this->gid);
}
is_null($this->gid) ? 0 : $this->gid);
}