chg: [internal] Deprecate Org::getUUIDs endpoint

pull/7742/head
Jakub Onderka 2021-09-09 14:17:57 +02:00
parent dbc8882b7f
commit 5b623198ca
2 changed files with 15 additions and 16 deletions

View File

@ -372,19 +372,15 @@ class OrganisationsController extends AppController
}
$idList = json_decode($idList, true);
$id_exclusion_list = array_merge($idList, array($this->Auth->user('Organisation')['id']));
$temp = $this->Organisation->find('all', array(
'conditions' => array(
'local' => $local,
'id !=' => $id_exclusion_list,
),
'recursive' => -1,
'fields' => array('id', 'name'),
'order' => array('lower(name) ASC')
$orgs = $this->Organisation->find('list', array(
'conditions' => array(
'local' => $local,
'id !=' => $id_exclusion_list,
),
'recursive' => -1,
'fields' => array('id', 'name'),
'order' => array('lower(name) ASC')
));
$orgs = array();
foreach ($temp as $org) {
$orgs[] = array('id' => $org['Organisation']['id'], 'name' => $org['Organisation']['name']);
}
$this->set('local', $local);
$this->layout = false;
$this->autoRender = false;
@ -402,10 +398,13 @@ class OrganisationsController extends AppController
$this->render('ajax/sg_org_row_empty');
}
/**
* @deprecated Probably not used anywhere.
*/
public function getUUIDs()
{
if (!$this->Auth->user('Role')['perm_sync']) {
throw new MethodNotAllowedException(__('This action is restricted to sync users'));
if (Configure::read('Security.hide_organisation_index_from_users')) {
throw new MethodNotAllowedException(__('This action is not enabled on this instance.'));
}
$temp = $this->Organisation->find('all', array(
'recursive' => -1,

View File

@ -7,8 +7,8 @@
<p><?php echo __('Available Organisations');?></p>
<select id="leftValues" size="5" multiple style="width:285px;">
<?php
foreach ($orgs as $org) {
echo '<option value="' . h($org['id']) . '" selected>' . h($org['name']) . '</option>';
foreach ($orgs as $orgId => $orgName) {
echo '<option value="' . intval($orgId) . '" selected>' . h($orgName) . '</option>';
}
?>
</select>