Пример #1
0
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
global $conf;
if (isset($_REQUEST['maxperpage'])) {
    $maxperpage = $_REQUEST['maxperpage'];
} else {
    $maxperpage = $conf["global"]["maxperpage"];
}
$filter = $_GET["filter"];
if (isset($_GET["start"])) {
    $start = $_GET["start"];
} else {
    $start = 0;
}
list($usercount, $users) = get_users_detailed($error, $filter, $start, $start + $maxperpage);
$arrUser = array();
$arrSnUser = array();
$homeDirArr = array();
$mails = array();
$phones = array();
$css = array();
for ($idx = 0; $idx < count($users); $idx++) {
    if ($users[$idx]["enabled"]) {
        $css[$idx] = "userName";
    } else {
        $css[$idx] = "userNameDisabled";
    }
    $arrUser[] = $users[$idx]['uid'];
    $arrSnUser[] = $users[$idx]['givenName'] . ' ' . $users[$idx]['sn'];
    if (strlen($users[$idx]["mail"]) > 0) {
Пример #2
0
$d->display();
?>

<script src="jsframework/lib/angular.min.js"></script>
<script>
'use strict';

angular.module('mmc.samba.perms', [])

.controller('permsCtrl', function($scope) {
    $scope.perms = <?php 
echo json_encode($perms);
?>
;
    var users = <?php 
echo json_encode(get_users_detailed($error, 'objectClass=sambaSamAccount', 0, 200000));
?>
;
    var groups = <?php 
echo json_encode(search_groups('*'));
?>
;
    // build a list of entities (users, groups)
    $scope.entities = groups.map(function(arr) {
        return {name: '@' + arr[0], label: arr[0]}
    });
    $scope.entities = $scope.entities.concat(users[1].map(function(obj) {
        var name = function() {
            if (obj.givenName && obj.sn && (obj.givenName != obj.sn))
                return obj.givenName + " " + obj.sn;
            else
Пример #3
0
    header("Location: " . urlStrRedirect("base/computers/list"));
    exit;
} else {
    $list = $group->shareWith();
    $members = array();
    foreach ($list as $member) {
        $members[$member['user']['type'] . "##" . $member['user']['login']] = $member['user']['login'];
        $listOfMembers[$member['user']['login']] = $member;
    }
    if (!$members) {
        $members = array();
    }
    if (!$listOfMembers) {
        $listOfMembers = array();
    }
    list($count, $users) = get_users_detailed($error, '', 0, 10000);
    $listOfUsers = array();
    foreach ($users as $u) {
        $listOfUsers[$u['uid']] = array('user' => array('login' => $u['uid'], 'type' => 0));
    }
    $listOfUsers['root'] = array('user' => array('login' => 'root', 'type' => 0));
    $groups = search_groups('');
    foreach ($groups as $u) {
        $listOfUsers[$u[0]] = array('user' => array('login' => $u[0], 'type' => 1));
    }
    $nonmemb = array();
    foreach ($listOfUsers as $user) {
        $nonmemb[$user['user']['type'] . "##" . $user['user']['login']] = $user['user']['login'];
    }
}
ksort($members);