]> source.dussan.org Git - nextcloud-server.git/commitdiff
Reverts last commit, implements user in group count.
authorraghunayyar <me@iraghu.com>
Tue, 28 Jan 2014 16:06:48 +0000 (21:36 +0530)
committerArthur Schiwon <blizzz@owncloud.com>
Mon, 2 Jun 2014 10:52:52 +0000 (12:52 +0200)
settings/ajax/grouplist.php [deleted file]
settings/css/settings.css
settings/routes.php
settings/templates/users.php
settings/users.php

diff --git a/settings/ajax/grouplist.php b/settings/ajax/grouplist.php
deleted file mode 100644 (file)
index 99acf50..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-
-/**
- * ownCloud - Core
- *
- * @author Morris Jobke
- * @author Raghu Nayyar 
- * @copyright 2014 Morris Jobke morris.jobke@gmail.com
- * @copyright 2014 Raghu Nayyar raghu.nayyar.007@gmail.com
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-// This file is repsonsible for the Ajax Request for Group list
-// Outputs are Names of Groups and IDs of users which are a part of them
-
-OC_JSON::checkSubAdminUser();
-
-$users = array();
-$groupname = array();
-$useringroup = array();
-$userUid = OC_User::getUser();
-$isAdmin = OC_User::isAdminUser($userUid);
-
-if (isset($_GET['offset'])) {
-       $offset = $_GET['offset'];
-} else {
-       $offset = 0;
-}
-if (isset($_GET['limit'])) {
-       $limit = $_GET['limit'];
-} else {
-       $limit = 10;
-}
-
-if ($isAdmin) {
-       $groups = OC_Group::getGroups();
-       $batch = OC_User::getDisplayNames('', $limit, $offset);
-       foreach ($batch as $user) {
-               $users['users'][] = array( 'user' => $user );
-       }
-}
-else {
-       $groups = OC_SubAdmin::getSubAdminsGroups($userUid);
-       $batch = OC_Group::usersInGroups($groups, '', $limit, $offset);
-       foreach ($batch as $user) {
-               $users['users'][] = array( 'user' => $user );
-       }
-}
-
-// convert them to the needed format
-foreach( $groups as $gid ) {
-       $groupname[] = array(
-               'id' => str_replace(' ','', $gid ),
-               'name' => $gid,
-               'useringroup' => OC_Group::usersInGroup($gid, '', $limit, $offset),
-               'isAdmin' => !OC_User::isAdminUser($gid),
-       );
-}
-
-OCP\JSON::success(array('result' => $groupname ));
-
-?>
\ No newline at end of file
index 37cd1b6f1323083d57a443af105cb54d0b1f8292..39290308cbe66e7d00c7e37e6f6c445d2ab9af75 100644 (file)
@@ -51,6 +51,7 @@ table.nostyle label { margin-right: 2em; }
 table.nostyle td { padding: 0.2em 0; }
 
 /* USERS */
+.usercount { float: right; margin:6px;}
 form { display:inline; }
 table.grid th { height:2em; color:#999; }
 table.grid th, table.grid td { border-bottom:1px solid #ddd; padding:0 .5em; padding-left:.8em; text-align:left; font-weight:normal; }
index 77a10f68d6f92dde93b6d9b806759d160257cf7c..0e0f293b9be32534f812de6ee4dfbdba79b7c300 100644 (file)
@@ -25,8 +25,6 @@ $this->create('settings_admin', '/settings/admin')
 // users
 $this->create('settings_ajax_userlist', '/settings/ajax/userlist')
        ->actionInclude('settings/ajax/userlist.php');
-$this->create('settings_ajax_grouplist', '/settings/ajax/grouplist')
-       ->actionInclude('settings/ajax/grouplist.php'); 
 $this->create('settings_ajax_createuser', '/settings/ajax/createuser.php')
        ->actionInclude('settings/ajax/createuser.php');
 $this->create('settings_ajax_removeuser', '/settings/ajax/removeuser.php')
index 83b54543b02e405e092aa8f3cd36cfd75eef5325..a56c7229c1ac8d5dea9cf182eaf26f253c27d2e2 100644 (file)
@@ -29,7 +29,10 @@ $_['subadmingroups'] = array_flip($items);
                <!--List of Groups-->
                <?php foreach($_["groups"] as $group): ?>
                <li>
-                       <a href="#"><?php p($group['name']);?></a>
+                       <a href="#"><?php p($group['name']); ?></a>
+                       <span class="utils">
+                               <span class="usercount"><?php p(count($group['useringroup'])); ?></span>
+                       </span>
                </li>
        <?php endforeach; ?>
        </ul>
index f09d0e90d3c6bde5265a085450163153af0db743..31a54b05c02afe84471474edb30df5a5489dfc3e 100644 (file)
@@ -18,6 +18,17 @@ OC_App::setActiveNavigationEntry( 'core_users' );
 $users = array();
 $groups = array();
 
+if (isset($_GET['offset'])) {
+       $offset = $_GET['offset'];
+} else {
+       $offset = 0;
+}
+if (isset($_GET['limit'])) {
+       $limit = $_GET['limit'];
+} else {
+       $limit = 10;
+}
+
 $isadmin = OC_User::isAdminUser(OC_User::getUser());
 $recoveryAdminEnabled = OC_App::isEnabled('files_encryption') &&
                                            OC_Appconfig::getValue( 'files_encryption', 'recoveryAdminEnabled' );
@@ -65,9 +76,13 @@ foreach($accessibleusers as $uid => $displayName) {
        );
 }
 
-foreach( $accessiblegroups as $i ) {
-       // Do some more work here soon
-       $groups[] = array( "name" => $i );
+foreach( $accessiblegroups as $gid ) {
+       $groups[] = array(
+               'id' => str_replace(' ','', $gid ),
+               'name' => $gid,
+               'useringroup' => OC_Group::usersInGroup($gid, '', $limit, $offset),
+               'isAdmin' => !OC_User::isAdminUser($gid),
+       );
 }
 
 $tmpl = new OC_Template( "settings", "users", "user" );