2011-07-24 19:47:37 +00:00
|
|
|
<?php
|
2011-11-29 22:11:42 +00:00
|
|
|
//$RUNTIME_NOAPPS = true;
|
2011-07-24 19:47:37 +00:00
|
|
|
|
2012-04-17 17:31:29 +00:00
|
|
|
|
2011-07-24 19:47:37 +00:00
|
|
|
|
2011-09-23 20:22:59 +00:00
|
|
|
OC_JSON::checkLoggedIn();
|
2011-09-30 21:05:10 +00:00
|
|
|
OC_JSON::checkAppEnabled('files_sharing');
|
2011-09-23 20:22:59 +00:00
|
|
|
|
2011-07-24 19:47:37 +00:00
|
|
|
$users = array();
|
2012-03-29 01:18:17 +00:00
|
|
|
$groups = array();
|
2012-05-01 16:50:31 +00:00
|
|
|
$self = OCP\USER::getUser();
|
2012-03-29 01:18:17 +00:00
|
|
|
$userGroups = OC_Group::getUserGroups($self);
|
2011-08-09 14:34:00 +00:00
|
|
|
$users[] = "<optgroup label='Users'>";
|
2012-03-29 01:18:17 +00:00
|
|
|
$groups[] = "<optgroup label='Groups'>";
|
|
|
|
foreach ($userGroups as $group) {
|
|
|
|
$groupUsers = OC_Group::usersInGroup($group);
|
|
|
|
foreach ($groupUsers as $user) {
|
|
|
|
if ($user != $self) {
|
|
|
|
$users[] = "<option value='".$user."'>".$user."</option>";
|
|
|
|
}
|
2011-07-24 19:47:37 +00:00
|
|
|
}
|
2012-03-29 01:18:17 +00:00
|
|
|
$groups[] = "<option value='".$group."'>".$group."</option>";
|
2011-07-24 19:47:37 +00:00
|
|
|
}
|
2011-08-09 14:34:00 +00:00
|
|
|
$users[] = "</optgroup>";
|
2012-03-29 01:18:17 +00:00
|
|
|
$groups[] = "</optgroup>";
|
|
|
|
$users = array_merge($users, $groups);
|
2011-09-23 20:22:59 +00:00
|
|
|
OC_JSON::encodedPrint($users);
|
2011-07-24 19:47:37 +00:00
|
|
|
|
|
|
|
?>
|