Beispiel #1
0
        $_POST['response_priv'] = 'no';
        if (isset($_POST['response_priv'])) {
            $_POST['response_priv'] = 'yes';
        }
        // Set the rights values
        $_POST['active'] = 'no';
        if (isset($_POST['active'])) {
            $_POST['active'] = 'yes';
        }
        // Check igcmds_rights
        if (!in_array($_POST['rights'], range(0, 100))) {
            $errors[] = $lang['tool_igcmds_err1'];
        }
        // Check errors and stuff
        if (count($errors) == 0) {
            $result = $igc->updateCommand($cmd['cmd_id'], array('cmd_name' => strtolower($_POST['cmd']), 'cmd_function' => $_POST['func'], 'cmd_response' => $_POST['response'], 'cmd_response_private' => $_POST['response_priv'], 'cmd_rights' => $_POST['rights'], 'cmd_active' => $_POST['active']));
            if ($result == 'OK') {
                $status = '<div class="alert alert-success alert-block"><h4><i class="fa fa-check"></i> ' . $lang['word_ok'] . '</h4><p>' . $lang['msg_settings_saved'] . '</p></div>';
                $cmd = $igc->getCommand($_GET['id']);
                $cmd = $cmd['cmd'];
                $log->insertActionLog($userInfo['user_id'], 'Command ' . strtolower($_POST['cmd']) . ' updated');
            } else {
                $status = '<div class="alert alert-danger alert-block"><h4><i class="fa fa-times"></i> ' . $lang['word_error'] . '</h4><p>' . $result . '</p></div>';
            }
        } else {
            $status = '<div class="alert alert-danger alert-block"><h4><i class="fa fa-times"></i> ' . $lang['word_error'] . '</h4><p>' . $lang['msg_error'] . '</p><ul><li>' . implode('</li><li>', $errors) . '</li></ul></div>';
        }
    }
    ?>
			
			<div class="row">