mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:15:51 +00:00
add service class restrictions to access_tokens
This commit is contained in:
parent
01fe7d6620
commit
8e667866fd
2 changed files with 11 additions and 1 deletions
|
@ -132,6 +132,16 @@ class Settings extends \Zotlabs\Web\Controller {
|
|||
$expires = datetime_convert(date_default_timezone_get(),'UTC',$_POST['expires']);
|
||||
else
|
||||
$expires = NULL_DATE;
|
||||
$max_atokens = service_class_fetch(local_channel(),'access_tokens');
|
||||
if($max_atokens) {
|
||||
$r = q("select count(atoken_id) as total where atoken_uid = %d",
|
||||
intval(local_channel())
|
||||
);
|
||||
if($r && intval($r[0]['total']) >= $max_tokens) {
|
||||
notice( sprintf( t('This channel is limited to %d tokens'), $max_tokens) . EOL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($token_errs) {
|
||||
notice( t('Name and Password are required.') . EOL);
|
||||
|
|
|
@ -56,7 +56,7 @@ if($argc == 3) {
|
|||
echo "service_class $oclass\t\t\033[1m" . $argv[2] . "\033[0m\n";
|
||||
|
||||
$new = get_config('service_class', $argv[2]);
|
||||
foreach(array('photo_upload_limit','total_items','total_pages','total_identities','total_channels','total_feeds','attach_upload_limit','minimum_feedcheck_minutes','chatrooms','chatters_inroom') as $prop) {
|
||||
foreach(array('photo_upload_limit','total_items','total_pages','total_identities','total_channels','total_feeds','attach_upload_limit','minimum_feedcheck_minutes','chatrooms','chatters_inroom','access_tokens') as $prop) {
|
||||
echo $prop . str_repeat(' ',26 - strlen($prop)) . (($old && $old[$prop]) ? $old[$prop] : 'unlimited') . "\t\t\033[1m" . (($new && $new[$prop]) ? $new[$prop] : 'unlimited') . "\033[0m\n";
|
||||
}
|
||||
$r = '';
|
||||
|
|
Loading…
Reference in a new issue