Example #1
0
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this package; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA  02110-1301  USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
Session::logcheck_by_asset_type('asset');
Session::logcheck('environment-menu', 'EventsHidsConfig');
$action = REQUEST('action');
$allowed_action = array('show_unsupported' => 1, 'remove_unsupported' => 2, 'deploy_all_agents' => 3);
if (empty($allowed_action[$action])) {
    Util::response_bad_request(_('Error! Action not allowed'));
}
$db = new Ossim_db();
$conn = $db->connect();
switch ($action) {
    case 'show_unsupported':
        $data['status'] = 'success';
        $data['data'] = _('Your request has been processed');
        try {
            //Number of assets in the system
            list($assets, $total_assets) = Asset_host::get_list($conn, '', array('limit' => 1));
Example #2
0
 * @autor      AlienVault INC
 * @license    http://www.gnu.org/licenses/gpl-2.0.txt
 * @copyright  2003-2006 ossim.net
 * @copyright  2007-2013 AlienVault
 * @link       https://www.alienvault.com/
 */
require_once 'av_init.php';
$asset_id = POST('asset_id');
$asset_type = POST('asset_type');
$maxrows = POST('iDisplayLength') != '' ? POST('iDisplayLength') : 8;
$from = POST('iDisplayStart') != '' ? POST('iDisplayStart') : 0;
$order = POST('iSortCol_0') != '' ? POST('iSortCol_0') : '';
$torder = POST('sSortDir_0');
$search_str = POST('sSearch') != '' ? POST('sSearch') : '';
$sec = POST('sEcho');
Session::logcheck_by_asset_type($asset_type);
Session::logcheck_ajax('environment-menu', 'EventsVulnerabilities');
// Close session write for real background loading
session_write_close();
ossim_valid($asset_id, OSS_HEX, 'illegal: ' . _('Asset ID'));
ossim_valid($asset_type, OSS_LETTER, OSS_SCORE, OSS_NULLABLE, 'illegal: ' . _('Asset Type'));
ossim_valid($maxrows, OSS_DIGIT, 'illegal: iDisplayLength');
ossim_valid($from, OSS_DIGIT, 'illegal: iDisplayStart');
ossim_valid($order, OSS_ALPHA, 'illegal: iSortCol_0');
ossim_valid($torder, OSS_LETTER, 'illegal: sSortDir_0');
ossim_valid($search_str, OSS_INPUT, OSS_NULLABLE, 'illegal: sSearch');
ossim_valid($sec, OSS_DIGIT, 'illegal: sEcho');
if (ossim_error()) {
    Util::response_bad_request(ossim_get_error_clean());
}
// Check Asset Type
Example #3
0
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
$action = POST('action');
//Action to perform.
$data = POST('data');
//Data related to the action.
ossim_valid($action, OSS_INPUT, 'illegal:' . _("Action"));
check_ossim_error(FALSE);
Session::logcheck_by_asset_type($data['asset_type']);
function check_ossim_error($throw_excep = TRUE)
{
    if (ossim_error()) {
        $error = ossim_get_error();
        ossim_clean_error();
        if ($throw_excep) {
            Av_exception::throw_error(Av_exception::USER_ERROR, $error);
        } else {
            Util::response_bad_request($error);
        }
    }
}
function save_list_selection($conn, $data)
{
    $asset_type = $data['asset_type'];