2011-07-24 23:47:37 +04:00
|
|
|
<?php
|
|
|
|
$RUNTIME_NOAPPS = true;
|
|
|
|
|
|
|
|
require_once('../../../lib/base.php');
|
|
|
|
|
2011-07-31 03:40:19 +04:00
|
|
|
if (!OC_User::isLoggedIn()) {
|
2011-07-25 00:07:39 +04:00
|
|
|
echo json_encode(array("status" => "error", "data" => array("message" => "Authentication error")));
|
2011-07-24 23:47:37 +04:00
|
|
|
exit();
|
|
|
|
}
|
|
|
|
$users = array();
|
2011-07-31 03:40:19 +04:00
|
|
|
$ocusers = OC_User::getUsers();
|
|
|
|
$self = OC_User::getUser();
|
2011-08-14 19:44:37 +04:00
|
|
|
$groups = OC_Group::getUserGroups($self);
|
2011-08-09 18:34:00 +04:00
|
|
|
$users[] = "<optgroup label='Users'>";
|
2011-07-24 23:47:37 +04:00
|
|
|
foreach ($ocusers as $user) {
|
2011-08-09 18:34:00 +04:00
|
|
|
if ($user != $self) {
|
|
|
|
$users[] = "<option value='".$user."'>".$user."</option>";
|
2011-07-24 23:47:37 +04:00
|
|
|
}
|
|
|
|
}
|
2011-08-09 18:34:00 +04:00
|
|
|
$users[] = "</optgroup>";
|
|
|
|
$users[] = "<optgroup label='Groups'>";
|
2011-07-25 00:07:39 +04:00
|
|
|
foreach ($groups as $group) {
|
2011-08-09 18:34:00 +04:00
|
|
|
$users[] = "<option value='".$group."'>".$group."</option>";
|
2011-07-25 00:07:39 +04:00
|
|
|
}
|
2011-08-09 18:34:00 +04:00
|
|
|
$users[] = "</optgroup>";
|
2011-07-24 23:47:37 +04:00
|
|
|
echo json_encode($users);
|
|
|
|
|
|
|
|
?>
|