Skip to content

Commit 29772cb

Browse files
committed
Batch operations JS + PHP
1 parent 2e3a1b7 commit 29772cb

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

web/js/actions.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,19 @@ App.Actions.update_cs_value = function(evt)
5353
App.Actions.mass_delete = function()
5454
{
5555
App.Actions.mass_action('massiveDelete');
56+
App.Actions.reset_batch();
5657
}
5758

5859
App.Actions.mass_suspend = function()
5960
{
6061
App.Actions.mass_action('massiveSuspend');
62+
App.Actions.reset_batch();
6163
}
6264

6365
App.Actions.mass_unsuspend = function()
6466
{
6567
App.Actions.mass_action('massiveUnsuspend');
68+
App.Actions.reset_batch();
6669
}
6770

6871
App.Actions.mass_action = function(method_name)
@@ -80,6 +83,13 @@ App.Actions.mass_action = function(method_name)
8083
}
8184
}
8285

86+
App.Actions.reset_batch = function()
87+
{
88+
$('#batch-processor .selector-title').html('NONE');
89+
$('.styled.do_action_toggle_batch_selector.style-applied').attr('checked', false);
90+
$('.checkbox.do_action_toggle_batch_selector').css('background-position', '0 0');
91+
}
92+
8393
App.Actions.do_change_password = function()
8494
{
8595

@@ -533,7 +543,7 @@ App.Actions.add_form_ns = function(evt)
533543

534544
$(form).find('.ns-entry').each(function(i, o)
535545
{
536-
$(o).find('label').text('NameServer #' + (i + 1));
546+
$(o).find('label').text('NS #' + (i + 1));
537547
$(o).find('input').attr('name', 'NS' + (i + 1));
538548
});
539549
}
@@ -581,7 +591,7 @@ App.Actions.view_template_info = function(evt)
581591
$.each(reply.data, function(key) {
582592
html += '<li><strong>'+key+':</strong> '+reply.data[key]+'</li>';
583593
});
584-
App.Helpers.openInnerPopup(elm, '<ul>'+html+'</ul>', 'Template Settings');
594+
App.Helpers.openInnerPopup(elm, '<ul>'+html+'</ul>', 'Template Info');
585595
}
586596
});
587597
}

web/vesta/api/IP.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getListExecute(Request $request)
4545
public function getListUserIpsExecute(Request $request)
4646
{
4747
$reply = array();
48-
$result = Vesta::execute(Vesta::V_LIST_SYS_IPS, array(Config::get('response_type')));
48+
$result = Vesta::execute(Vesta::V_LIST_USER_IPS, array(Config::get('response_type')));
4949
foreach ($result['data'] as $ip => $details) {
5050
$reply[] = array_merge(
5151
array(

web/vesta/api/USER.class.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,14 @@ public function massiveDeleteExecute(Request $request)
367367
public function loginAsExecute(Request $request)
368368
{
369369
$_user = $request->getParameter('user');
370-
VestaSession::loginAs($_user);
371370

372-
return $this->reply(TRUE, '');
371+
if(Vesta::hasRights(VestaSession::getInstance()->getUserRole(), 'login_as'))
372+
{
373+
VestaSession::loginAs($_user);
374+
return $this->reply(TRUE, '');
375+
}
376+
377+
return $this->reply(FALSE, '');
373378
}
374379

375380
public function logoutAsExecute(Request $request)

web/vesta/core/Vesta.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ static function execute($cmd_command, $parameters = array(), $reply = '')
219219
*/
220220
public function hasRights($role, $command)
221221
{
222-
return TRUE;
223-
echo 'role - '.$role;
224-
exit();
222+
// return TRUE;
223+
// echo 'role - '.$role;
224+
// exit();
225225

226226
$rights = array(
227227
self::ADMIN => array(),

0 commit comments

Comments
 (0)