Add a flag "Must be validated" for medals instead of hard-coding this
[platal.git] / include / validations / medals.inc.php
index 92a615e..d2c8ec5 100644 (file)
@@ -81,6 +81,21 @@ class MedalReq extends Validate
     }
 
     // }}}
+    // {{{ function submit()
+
+    function submit()
+    {
+        $res = XDB::query("SELECT  FIND_IN_SET(flags, 'validation')
+                             FROM  profile_medals
+                            WHERE  id = {?}", $this->mid);
+        if ($res->fetchOneCell()) {
+            parent::submit();
+        } else {
+            $this->commit();
+        }
+    }
+    
+    // }}}
     // {{{ function commit()
 
     function commit ()