public function interactiveConsumersControlPanel()
    {
        /* clean request values */
        $name = (empty($_POST['name']) ? null : trim($_POST['name']));
        $key = (empty($_POST['key']) ? null : trim($_POST['key']));
        $secret = (empty($_POST['secret']) ? null : trim($_POST['secret']));
        $enabled = (empty($_POST['enabled']) ? false : (boolean) $_POST['enabled']);
        $action = (empty($_POST['action']) ? false : strtolower(trim($_POST['action'])));

        /* load requested consumer (or create new if none requested) */
        $consumer = $this->interactiveConsumersControlPanel_loadConsumer($key);

        /* what are we asked to do with this consumer? */
        switch ($action) {
            case 'update':
            case 'insert':
                $consumer->name = $name;
                $consumer->secret = $secret;
                $consumer->enabled = $enabled;
                if (!$consumer->save()) {
                    $this->smarty_addMessage(
                        'Error saving consumer',
                        'There was an error attempting to save your new or ' .
                        'updated consumer information to the database.',
                        NotificationMessage::DANGER
                    );
                }
                break;
            case 'delete':
                $consumer->delete();
                break;
            case 'select':
                $this->smarty_assign('key', $key);
                break;
        }

        /*
         * if action was anything other than 'select', create a new empty
         * consumer to fill the form with
         */
        if ($action && $action !== 'select') {
            $consumer = $this->interactiveConsumersControlPanel_loadConsumer();
        }

        /* display a list of consumers */
        $consumers = $this->lti_getConsumers();
        $this->smarty_assign([
            'name' => 'Consumers',
            'category' => 'Control Panel',
            'consumers' => $consumers,
            'consumer' => $consumer,
            'formAction' => $_SERVER['PHP_SELF'],
            'appUrl' => $this->metadata['APP_URL']
        ]);
        $this->smarty_display('consumers-control-panel.tpl');
    }