osmium-org / osmium

Online collaborative fitting tool.
https://o.smium.org/
GNU Affero General Public License v3.0
76 stars 25 forks source link

Disallow saving fits for non whitelisted users #115

Closed sredbull closed 8 years ago

sredbull commented 8 years ago

If you dont want users to save their fits if they are not in the whitelist I had to edit the osmium/src/new_loadout.php script.

Add these lines:

$a = \Osmium\State\get_state('a');
if(isset($a['notwhitelisted']) && $a['notwhitelisted']) {
        $save->setAttribute('disabled', 'disabled');
        $save->setAttribute('title', 'Your account needs to be in the whitelist before you can save loadouts.');
        $save->addClass('force');
        $save->setAttribute('value', $save->getAttribute('value').' (requires whitelisted account)');
}

AFTER:

if(!\Osmium\State\is_logged_in()) {
    $save->setAttribute('disabled', 'disabled');
    $save->setAttribute('title', 'You need to sign in before you can save loadouts.');
    $save->addClass('force');
    $save->setAttribute('value', $save->getAttribute('value').' (requires account)');
}

I dunno if there is a better workaround for this but so far its working for me.

Artefact2 commented 8 years ago

Made moot by 53fa96c8531d6805f2d50eed5c8b33bad276f53c.