Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "bulk user functionality, user activate, deactivate and delete"

This reverts commit 1de1c7d.
  • Loading branch information...
commit 365232597801a718c34d5a0000040d05a0fad531 1 parent 6b647e0
@tylerryan tylerryan authored
View
22 web/concrete/elements/users/confirm_list.php
@@ -1,22 +0,0 @@
-<?php defined('C5_EXECUTE') or die("Access Denied.");
-// used when confirming bulk user operations.. would you like to do xyz to the following users??
-if(is_array($users)) { ?>
-<table class="zebra-striped" width="100%" cellspacing="0" cellpadding="0" border="0">
- <thead>
- <tr>
- <th><?php echo t('Username')?></th>
- <th><?php echo t('Email')?></th>
- <th><?php echo t('# Logins')?></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($users as $ui) { ?>
- <tr>
- <td><?php echo $ui->getUserName(); ?></td>
- <td><?php echo $ui->getUserEmail(); ?></td>
- <td><?php echo number_format($ui->getNumLogins(),0); ?></td>
- </tr>
- <?php } ?>
- </tbody>
-</table>
-<?php } ?>
View
3  web/concrete/elements/users/search_results.php
@@ -32,9 +32,6 @@
<select id="ccm-<?=$searchInstance?>-list-multiple-operations" class="span3" disabled>
<option value="">** <?=t('With Selected')?></option>
<option value="properties"><?=t('Edit Properties')?></option>
- <option value="activate"><?=t('Activate')?></option>
- <option value="deactivate"><?=t('Deactivate')?></option>
- <option value="delete"><?=t('Delete')?></option>
<? if ($mode == 'choose_multiple') { ?>
<option value="choose"><?=t('Choose')?></option>
<? } ?>
View
2  web/concrete/js/ccm.app.js
1 addition, 1 deletion not shown
View
54 web/concrete/js/ccm_app/ui.js
@@ -471,59 +471,7 @@ ccm_setupUserSearch = function() {
href: CCM_TOOLS_PATH + '/users/bulk_properties?' + uIDstring,
title: ccmi18n.properties
});
- break;
- case "activate":
- uIDstring = '';
- $("td.ccm-user-list-cb input[type=checkbox]:checked").each(function() {
- uIDstring=uIDstring+'&uID[]='+$(this).val();
- });
- jQuery.fn.dialog.open({
- width: 630,
- height: 450,
- modal: false,
- href: CCM_TOOLS_PATH + '/users/bulk_activate?' + uIDstring,
- title: ccmi18n.user_activate
- });
- break;
- case "deactivate":
- uIDstring = '';
- $("td.ccm-user-list-cb input[type=checkbox]:checked").each(function() {
- uIDstring=uIDstring+'&uID[]='+$(this).val();
- });
- jQuery.fn.dialog.open({
- width: 630,
- height: 450,
- modal: false,
- href: CCM_TOOLS_PATH + '/users/bulk_deactivate?' + uIDstring,
- title: ccmi18n.user_deactivate
- });
- break;
- case "password_reset":
- uIDstring = '';
- $("td.ccm-user-list-cb input[type=checkbox]:checked").each(function() {
- uIDstring=uIDstring+'&uID[]='+$(this).val();
- });
- jQuery.fn.dialog.open({
- width: 630,
- height: 450,
- modal: false,
- href: CCM_TOOLS_PATH + '/users/bulk_password_reset?' + uIDstring,
- title: ccmi18n.user_password_reset
- });
- break;
- case "delete":
- uIDstring = '';
- $("td.ccm-user-list-cb input[type=checkbox]:checked").each(function() {
- uIDstring=uIDstring+'&uID[]='+$(this).val();
- });
- jQuery.fn.dialog.open({
- width: 630,
- height: 450,
- modal: false,
- href: CCM_TOOLS_PATH + '/users/bulk_delete?' + uIDstring,
- title: ccmi18n.user_delete
- });
- break;
+ break;
}
$(this).get(0).selectedIndex = 0;
View
6 web/concrete/tools/i18n_js.php
@@ -68,11 +68,7 @@
ok: "<?=t('Ok')?>",
newsflowLoading: "<?=t("Checking for updates.")?>",
authoredBy: "<?=t('by')?>",
- x: "<?=t('x')?>",
- user_activate: "<?=t('Activate Users')?>",
- user_deactivate: "<?=t('Deactivate Users')?>",
- user_password_reset: "<?=t('Reset Passwords')?>",
- user_delete: "<?=t('Delete')?>"
+ x: "<?=t('x')?>"
}
var ccmi18n_sitemap = {
View
59 web/concrete/tools/users/bulk_activate.php
@@ -1,59 +0,0 @@
-<?php defined('C5_EXECUTE') or die("Access Denied.");
-$form = Loader::helper('form');
-$ih = Loader::helper('concrete/interface');
-$tp = new TaskPermission();
-if (!$tp->canAccessUserSearch()) {
- die(t("Access Denied."));
-}
-
-$users = array();
-if (is_array($_REQUEST['uID'])) {
- foreach($_REQUEST['uID'] as $uID) {
- $ui = UserInfo::getByID($uID);
- $users[] = $ui;
- }
-}
-
-if ($_POST['task'] == 'activate') {
- foreach($users as $ui) {
- if(!$ui->isActive()) {
- $ui->activate();
- }
- }
- echo Loader::helper('json')->encode(array('error'=>false));
- exit;
-}
-
-if (!isset($_REQUEST['reload'])) { ?>
- <div id="ccm-user-bulk-activate-wrapper">
-<? } ?>
-
- <div id="ccm-user-activate" class="ccm-ui">
- <form method="post" id="ccm-user-bulk-activate" action="<?php echo REL_DIR_FILES_TOOLS_REQUIRED ?>/users/bulk_activate">
- <?php
- echo $form->hidden('task','activate');
- foreach($users as $ui) {
- echo $form->hidden('uID[]' , $ui->getUserID());
- }
- ?>
- <?php echo t('Are you sure you would like to activate the following users?');?><br/><br/>
- <?php Loader::element('users/confirm_list',array('users'=>$users)); ?>
- </form>
- </div>
- <div class="dialog-buttons">
- <?=$ih->button_js(t('Cancel'), 'jQuery.fn.dialog.closeTop()', 'left', 'btn')?>
- <?=$ih->button_js(t('Activate'), 'ccm_userBulkActivate()', 'right', 'btn primary')?>
- </div>
-<?
-if (!isset($_REQUEST['reload'])) { ?>
-</div>
-<? } ?>
-
-<script type="text/javascript">
-ccm_userBulkActivate = function() {
- $("#ccm-user-bulk-activate").ajaxSubmit(function(resp) {
- });
- jQuery.fn.dialog.closeTop();
- ccm_setupUserSearch();
-};
-</script>
View
59 web/concrete/tools/users/bulk_deactivate.php
@@ -1,59 +0,0 @@
-<?php defined('C5_EXECUTE') or die("Access Denied.");
-$form = Loader::helper('form');
-$ih = Loader::helper('concrete/interface');
-$tp = new TaskPermission();
-if (!$tp->canAccessUserSearch()) {
- die(t("Access Denied."));
-}
-
-$users = array();
-if (is_array($_REQUEST['uID'])) {
- foreach($_REQUEST['uID'] as $uID) {
- $ui = UserInfo::getByID($uID);
- $users[] = $ui;
- }
-}
-
-if ($_POST['task'] == 'deactivate') {
- foreach($users as $ui) {
- if($ui->isActive()) {
- $ui->deactivate();
- }
- }
- echo Loader::helper('json')->encode(array('error'=>false));
- exit;
-}
-
-if (!isset($_REQUEST['reload'])) { ?>
- <div id="ccm-user-bulk-deactivate-wrapper">
-<? } ?>
-
- <div id="ccm-user-deactivate" class="ccm-ui">
- <form method="post" id="ccm-user-bulk-deactivate" action="<?php echo REL_DIR_FILES_TOOLS_REQUIRED ?>/users/bulk_deactivate">
- <?php
- echo $form->hidden('task','deactivate');
- foreach($users as $ui) {
- echo $form->hidden('uID[]' , $ui->getUserID());
- }
- ?>
- <?php echo t('Are you sure you would like to deactivate the following users?');?><br/><br/>
- <?php Loader::element('users/confirm_list',array('users'=>$users)); ?>
- </form>
- </div>
- <div class="dialog-buttons">
- <?=$ih->button_js(t('Cancel'), 'jQuery.fn.dialog.closeTop()', 'left', 'btn')?>
- <?=$ih->button_js(t('Deactivate'), 'ccm_userBulkDeactivate()', 'right', 'btn primary')?>
- </div>
-<?
-if (!isset($_REQUEST['reload'])) { ?>
-</div>
-<? } ?>
-
-<script type="text/javascript">
-ccm_userBulkDeactivate = function() {
- $("#ccm-user-bulk-deactivate").ajaxSubmit(function(resp) {
- });
- jQuery.fn.dialog.closeTop();
- ccm_setupUserSearch();
-};
-</script>
View
75 web/concrete/tools/users/bulk_delete.php
@@ -1,75 +0,0 @@
-<?php defined('C5_EXECUTE') or die("Access Denied.");
-$form = Loader::helper('form');
-$ih = Loader::helper('concrete/interface');
-$tp = new TaskPermission();
-$u = new User();
-if (!$tp->canAccessUserSearch()) {
- die(t("Access Denied."));
-}
-
-$users = array();
-$excluded = false;
-$excluded_user_ids = array();
-$excluded_user_ids[] = $u->getUserID(); // can't delete yourself
-$excluded_user_ids[] = USER_SUPER_ID; // can't delete the super user (admin)
-
-if (is_array($_REQUEST['uID'])) {
- foreach($_REQUEST['uID'] as $uID) {
- $ui = UserInfo::getByID($uID);
-
- if((in_array($ui->getUserID(),$excluded_user_ids))) {
- $excluded = true;
- } else {
- $users[] = $ui;
- }
- }
-}
-
-
-if ($_POST['task'] == 'delete') {
- foreach($users as $ui) {
- if(!(in_array($ui->getUserID(),$excluded_user_ids))) {
- $ui->delete();
- }
- }
- echo Loader::helper('json')->encode(array('error'=>false));
- exit;
-}
-
-if (!isset($_REQUEST['reload'])) { ?>
- <div id="ccm-user-bulk-delete-wrapper">
-<? } ?>
-
- <div id="ccm-user-delete" class="ccm-ui">
- <form method="post" id="ccm-user-bulk-delete" action="<?php echo REL_DIR_FILES_TOOLS_REQUIRED ?>/users/bulk_delete">
- <?php
- echo $form->hidden('task','delete');
- foreach($users as $ui) {
- echo $form->hidden('uID[]' , $ui->getUserID());
- }
- if($excluded) { ?>
- <div class="alert-message info">
- <?php echo t("Users you don't have permission to bulk-delete have been removed from this list."); ?>
- </div>
- <?php } ?>
- <?php echo t('Are you sure you would like to delete the following users?');?><br/><br/>
- <?php Loader::element('users/confirm_list',array('users'=>$users)); ?>
- </form>
- </div>
- <div class="dialog-buttons">
- <?=$ih->button_js(t('Cancel'), 'jQuery.fn.dialog.closeTop()', 'left', 'btn')?>
- <?=$ih->button_js(t('Delete'), 'ccm_userBulkActivate()', 'right', 'btn error')?>
- </div>
-<?
-if (!isset($_REQUEST['reload'])) { ?>
-</div>
-<? } ?>
-
-<script type="text/javascript">
-ccm_userBulkActivate = function() {
- $("#ccm-user-bulk-delete").ajaxSubmit(function(resp) {
- });
- jQuery.fn.dialog.closeTop();
- ccm_setupUserSearch();
-};
-</script>
Please sign in to comment.
Something went wrong with that request. Please try again.