17e631bc5e
Create OC_JSON class, for single point of creating json responses. No real logic change, this just cleans up the code a bit.
26 lines
597 B
PHP
26 lines
597 B
PHP
<?php
|
|
$RUNTIME_NOAPPS = true;
|
|
|
|
require_once('../../../lib/base.php');
|
|
|
|
OC_JSON::checkLoggedIn();
|
|
|
|
$users = array();
|
|
$ocusers = OC_User::getUsers();
|
|
$self = OC_User::getUser();
|
|
$groups = OC_Group::getUserGroups($self);
|
|
$users[] = "<optgroup label='Users'>";
|
|
foreach ($ocusers as $user) {
|
|
if ($user != $self) {
|
|
$users[] = "<option value='".$user."'>".$user."</option>";
|
|
}
|
|
}
|
|
$users[] = "</optgroup>";
|
|
$users[] = "<optgroup label='Groups'>";
|
|
foreach ($groups as $group) {
|
|
$users[] = "<option value='".$group."'>".$group."</option>";
|
|
}
|
|
$users[] = "</optgroup>";
|
|
OC_JSON::encodedPrint($users);
|
|
|
|
?>
|