function saveRoutingAction() { $translate = DevblocksPlatform::getTranslationService(); $worker = CerberusApplication::getActiveWorker(); if (!$worker || !$worker->is_superuser) { echo $translate->_('common.access_denied'); return; } if (DEMO_MODE) { DevblocksPlatform::setHttpResponse(new DevblocksHttpResponse(array('config', 'mail'))); return; } @($deletes = DevblocksPlatform::importGPC($_REQUEST['deletes'], 'array', array())); @($sticky_ids = DevblocksPlatform::importGPC($_REQUEST['sticky_ids'], 'array', array())); @($sticky_order = DevblocksPlatform::importGPC($_REQUEST['sticky_order'], 'array', array())); @($active_worker = CerberusApplication::getActiveWorker()); if (!$active_worker->is_superuser) { return; } // Deletes if (!empty($deletes)) { DAO_MailToGroupRule::delete($deletes); } // Reordering if (is_array($sticky_ids) && is_array($sticky_order)) { foreach ($sticky_ids as $idx => $id) { @($order = intval($sticky_order[$idx])); DAO_MailToGroupRule::update($id, array(DAO_MailToGroupRule::STICKY_ORDER => $order)); } } // Default group @($default_group_id = DevblocksPlatform::importGPC($_REQUEST['default_group_id'], 'integer', '0')); DAO_Group::setDefaultGroup($default_group_id); DevblocksPlatform::setHttpResponse(new DevblocksHttpResponse(array('config', 'parser'))); }