2011-07-24 23:47:37 +04:00
|
|
|
<?php
|
2011-11-30 02:11:42 +04:00
|
|
|
//$RUNTIME_NOAPPS = true;
|
2011-07-24 23:47:37 +04:00
|
|
|
|
|
|
|
require_once('../../../lib/base.php');
|
|
|
|
|
2011-09-24 00:22:59 +04:00
|
|
|
OC_JSON::checkLoggedIn();
|
2011-10-01 01:05:10 +04:00
|
|
|
OC_JSON::checkAppEnabled('files_sharing');
|
2011-09-24 00:22:59 +04:00
|
|
|
|
2011-07-24 23:47:37 +04:00
|
|
|
$users = array();
|
2012-03-29 05:18:17 +04:00
|
|
|
$groups = array();
|
2011-07-31 03:40:19 +04:00
|
|
|
$self = OC_User::getUser();
|
2012-03-29 05:18:17 +04:00
|
|
|
$userGroups = OC_Group::getUserGroups($self);
|
2011-08-09 18:34:00 +04:00
|
|
|
$users[] = "<optgroup label='Users'>";
|
2012-03-29 05:18:17 +04: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 23:47:37 +04:00
|
|
|
}
|
2012-03-29 05:18:17 +04:00
|
|
|
$groups[] = "<option value='".$group."'>".$group."</option>";
|
2011-07-24 23:47:37 +04:00
|
|
|
}
|
2011-08-09 18:34:00 +04:00
|
|
|
$users[] = "</optgroup>";
|
2012-03-29 05:18:17 +04:00
|
|
|
$groups[] = "</optgroup>";
|
|
|
|
$users = array_merge($users, $groups);
|
2011-09-24 00:22:59 +04:00
|
|
|
OC_JSON::encodedPrint($users);
|
2011-07-24 23:47:37 +04:00
|
|
|
|
|
|
|
?>
|