Use Discourse SSO with Mediawiki

Anyone using this “as is” ? in addNonce function, the query

$this->mysqli->query("INSERT INTO ".SSO_DB_TABLE." (`id`, `nonce`, `logged`, `expire`) VALUES (NULL, '$nonce', '0', '".$expire."');");

fails because : #1364 - Field 'admin' doesn't have a default value and actually, the definition for the field in $sqlStructure says admin Tinyint(1) NOT NULL :frowning:

(same for “moderator” field BTW)

Working code :slight_smile:

$this->mysqli->query("INSERT INTO ".SSO_DB_TABLE." (`id`, `nonce`, `logged`, `expire`,`admin`,`moderator`) VALUES (NULL, '$nonce', '0', '".$expire."',0,0);");`