diff --git a/api.php b/api.php index 7fbc276..3d37206 100644 --- a/api.php +++ b/api.php @@ -747,11 +747,17 @@ switch($request[0]) { $q=mysql_query("SELECT * FROM roles ORDER BY name"); $reqroles=array(); while($r=mysql_fetch_assoc($q)) { - if($config[$r['type']."_registration_type"]) { - $r['registration']=$config[$r['type']."_registration_type"]; - } - else + //if the whole type is not enabled, then report 'not available', no matter what the _registration_type says + if($config[$r['type']."_enable"]=="no") { $r['registration']="not available"; + } + else { + if($config[$r['type']."_registration_type"]) { + $r['registration']=$config[$r['type']."_registration_type"]; + } + else + $r['registration']="not available"; + } $reqroles[]=$r; } $ret['status']="ok";