forked from science-ation/science-ation
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:
parent
cd140c198a
commit
0b50b6b8f8
14
api.php
14
api.php
@ -747,11 +747,17 @@ switch($request[0]) {
|
|||||||
$q=mysql_query("SELECT * FROM roles ORDER BY name");
|
$q=mysql_query("SELECT * FROM roles ORDER BY name");
|
||||||
$reqroles=array();
|
$reqroles=array();
|
||||||
while($r=mysql_fetch_assoc($q)) {
|
while($r=mysql_fetch_assoc($q)) {
|
||||||
if($config[$r['type']."_registration_type"]) {
|
//if the whole type is not enabled, then report 'not available', no matter what the _registration_type says
|
||||||
$r['registration']=$config[$r['type']."_registration_type"];
|
if($config[$r['type']."_enable"]=="no") {
|
||||||
}
|
|
||||||
else
|
|
||||||
$r['registration']="not available";
|
$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;
|
$reqroles[]=$r;
|
||||||
}
|
}
|
||||||
$ret['status']="ok";
|
$ret['status']="ok";
|
||||||
|
Loading…
Reference in New Issue
Block a user