If a registration role type is completely disabled (via "{$type}_enable"="no") then report "not available" for that role, regardless of what the registration_type says

This commit is contained in:
james 2011-03-03 02:18:15 +00:00
parent cd140c198a
commit 0b50b6b8f8

14
api.php
View File

@ -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";