/** * Removes the user data from the Latch server and the Mediawiki DB (unpairs the service) * @ret 1: unpairing OK, -1: unpairing error */ public static function doUnpair() { $toRet = -1; //return value=-1, error during unpairing process global $wgUser; //mediawiki global var to get the userID that is currently logged into mediawiki //if( dbHelper::isPaired( $wgUser->getId() ) ) //{ $api = dbHelper::getLatchApi(); $accountId = dbHelper::getAccountId($wgUser->getId()); if ($accountId != null) { $api->unpair($accountId); dbHelper::removeAccountId($wgUser->getId()); $toRet = 1; //return value=1, unpairing process successful } //} return $toRet; }