Provide access to Input::post
Usage: {input_post index='' default=''}

@return  string
966586
public function input_post($params) {
        $index = isset($params['index']) ? $params['index'] : null;
        $default = isset($params['default']) ? $params['default'] : null;
        return Input::post($index, $default);
    }
143040
protected function getPost($str_key, $str_default = NULL)
    {
        return (isset($_POST[$str_key]) ? $_POST[$str_key] : $str_default);
    }
1152394
protected function getFormValues() {
    $input = array();
    foreach ($this->getInputParameters() as $parameter) {
      if (isset($_POST[$parameter['name']])) {
        $input[$parameter['name']] = $_POST[$parameter['name']];
      }
    }
    return $input;
  }
1327680
public function peek(): string
    {
        if ($this->atEnd()) {
            return self::END;
        }

        return $this->input[$this->index];
    }
1344417
protected function pullPost() {
		if (!is_array($this->postVars)) {
			$this->postVars = $this->request->getParsedBody();
			
			if (!is_array($this->postVars)) {
				$this->postVars = [];
			}
		}
		
		return $this->postVars;
	}
1271457
public function getInput()
    {
        $this->htmlOptions['class'] = (isset($this->htmlOptions['class']) ? $this->htmlOptions['class'] . ' ' : '') . 'input markdown-input';
        $this->htmlOptions['ajax-url'] = $this->previewURL ?: WebApp::get()->request()->getCurrentURL();
        $this->htmlOptions['csrf-key'] = WebApp::get()->request()->getCsrfKey();
        $this->htmlOptions['csrf-value'] = WebApp::get()->request()->getCsrfValue();
        return Form::get()->textarea($this->getName(), $this->getValue(), $this->htmlOptions);
    }
43384
public function form_val($params) {
        $index = isset($params['index']) ? $params['index'] : null;
        $default = isset($params['default']) ? $params['default'] : null;
        return Input::param($index, $default);
    }
489745
protected function getInputSource()
    {
        if ($this->isJson()) {
            return $this->json();
        }

        return in_array($this->getRealMethod(), ['GET', 'HEAD']) ? $this->query : $this->request;
    }
165179
protected function parseInput()
    {
        foreach ($this->input as $key=>$value) {
            $this->applyParameter($key, $value);
        }
    }
345837
protected function getInput() {

        $js = "";

        $locale   = $this->element['locale'] ? (string) $this->element['locale'] : (new LanguageFactory())->getLanguage()->get('iso');
        $format   = $this->element['format'] ? (string) $this->element['format'] : 'L';
        $valueFormat = $this->element['valueFormat'] ? (string) $this->element['valueFormat'] : 'YYYY-MM-DD HH:mm:ss';
        $minDate  = $this->element['minDate'] ? (string) $this->element['minDate'] : null;
        $maxDate  = $this->element['maxDate'] ? (string) $this->element['maxDate'] : null;
        $placeholder  = $this->element['placeholder'] ? ' placeholder="' . htmlspecialchars((string) $this->element['placeholder']) . '"' : null;
        $class    = $this->element['class'] ? ' ' . (string) $this->element['class'] : '';
        $dayOnly  = $this->element['dayOnly'] ? ((string) $this->element['dayOnly'] == "true") : false;
        $readonly = ((string) $this->element['readonly'] == 'true') ? ' readonly="readonly"' : '';
        $disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';

        $options = array(
            'locale'  => $locale,
            'format'  => $format,
            'icons' => array(
                'time' => 'fa fa-clock-o',
                'date' => 'fa fa-calendar',
                'up' => 'fa fa-chevron-up',
                'down' => 'fa fa-chevron-down',
                'previous' => 'fa fa-chevron-left',
                'next' => 'fa fa-chevron-right',
                'today' => 'fa fa-dot-circle-o',
                'clear' => 'fa fa-trash',
                'close' => 'fa fa-times'
            )
        );

	    if ($this->element['showClose']) {
		    $options['showClose'] = ($this->element['showClose'] == "true");
	    }

	    if ($this->element['showClear']) {
		    $options['showClear'] = ($this->element['showClear'] == "true");
	    }

	    if ($this->element['showTodayButton']) {
		    $options['showTodayButton'] = ($this->element['showTodayButton'] == "true");
	    }

	    if ($this->element['calendarWeeks']) {
		    $options['calendarWeeks'] = ($this->element['calendarWeeks'] == "true");
	    }

	    if ($this->element['useCurrent']) {
		    $options['useCurrent'] = ($this->element['useCurrent'] == "true");
	    }

	    if ($this->element['collapse']) {
		    $options['collapse'] = ($this->element['collapse'] == "true");
	    }

	    if ($this->element['collapse']) {
		    $options['collapse'] = ($this->element['collapse'] == "true");
	    }

	    if (isset($this->element['stepping'])) {
		    $options["stepping"] = (string) $this->element['stepping'];
	    }

	    if (isset($this->element['viewMode'])) {
		    $options["viewMode"] = (string) $this->element['viewMode'];
	    }

	    if (isset($this->element['toolbarPlacement'])) {
		    $options["toolbarPlacement"] = (string) $this->element['toolbarPlacement'];
	    }

        if (isset($this->element['default'])) {
            $options["defaultDate"] = (string) $this->element['default'];
        }

        if (isset($this->element['widgetParent'])) {
            $options["widgetParent"] = (string) $this->element['widgetParent'];
        }

        if (isset($this->element['disabledDates'])) {
	    	if (is_array($this->element['disabledDates'])) {
			    $options["disabledDates"] = (array) $this->element['disabledDates'];
		    } else {
			    $options["disabledDates"] = explode(",", (string) $this->element['disabledDates']);
		    }
        }

	    if (isset($this->element['enabledDates'])) {
		    if (is_array($this->element['enabledDates'])) {
			    $options["enabledDates"] = (array) $this->element['enabledDates'];
		    } else {
			    $options["enabledDates"] = explode(",", (string) $this->element['enabledDates']);
		    }
	    }

	    if (isset($this->element['daysOfWeekDisabled'])) {
		    if (is_array($this->element['daysOfWeekDisabled'])) {
			    $options["daysOfWeekDisabled"] = (array) $this->element['daysOfWeekDisabled'];
		    } else {
			    $options["daysOfWeekDisabled"] = explode(",", (string) $this->element['daysOfWeekDisabled']);
		    }
	    }

        if (isset($this->element['sideBySide'])) {
            $options["sideBySide"] = ((string) $this->element['sideBySide'] == "true");
        }

        if (isset($this->element['useStrict'])) {
            $options["useStrict"] = ((string) $this->element['useStrict'] == "true");
        }

        if (isset($this->element['keepOpen'])) {
            $options["keepOpen"] = ((string) $this->element['keepOpen'] == "true");
        }

        if (isset($this->element['inline'])) {
            $options["inline"] = ((string) $this->element['inline'] == "true");
        }

        if (isset($this->element['keepInvalid'])) {
            $options["keepInvalid"] = ((string) $this->element['keepInvalid'] == "true");
        }

        if (isset($this->element['debug'])) {
            $options["debug"] = ((string) $this->element['debug'] == "true");
        }

        if (isset($this->element['ignoreReadonly'])) {
            $options["ignoreReadonly"] = ((string) $this->element['ignoreReadonly'] == "true");
        }

        if (isset($this->element['allowInputToggle'])) {
            $options["allowInputToggle"] = ((string) $this->element['allowInputToggle'] == "true");
        }

        if (isset($this->element['focusOnShow'])) {
            $options["focusOnShow"] = ((string) $this->element['focusOnShow'] == "true");
        }

        if (isset($minDate)) {
            if (strpos($minDate, 'field:') !== false) {

                $fieldName = substr($minDate, 6);
                $field     = $this->form->getField($fieldName);

                if ($field !== false) {

                    $js .= "$('#" . $field->id . "_picker').on('dp.change', function(e) {
    if (e.oldDate) {
        $('#" . $this->id . "_picker').data('DateTimePicker').minDate(e.date);
    }
});\n";

                }

            } else {
                $options['minDate'] = $minDate;
            }
        }

        if (isset($maxDate)) {
            if (strpos($maxDate, 'field:') !== false) {

                $fieldName = substr($maxDate, 6);
                $field     = $this->form->getField($fieldName);

                if ($field !== false) {

                    $js .= "$('#" . $field->id . "_picker').on('dp.change', function(e) {
    if (e.oldDate) {
        $('#" . $this->id . "_picker').data('DateTimePicker').maxDate(e.date);
    }
});\n";

                }

            } else {
                $options['maxDate'] = $maxDate;
            }
        }

        // Si on a une valeur.
        if (!empty($this->value) && $this->value != $this->form->getDb()->getNullDate() && $this->value != '0000-00-00') {

            // La date venant du système est en UTC.
            // On la formate avec le fuseau horaire de l'utilisateur.
            $value = (new DateUtility($this->form->getApplication()->get('timezone')))->format($this->value, 'APP_GLOBAL_DATE_ISO');
            $options['defaultDate'] = $value;

        }

        $js .= "$('#" . $this->id . "_picker').datetimepicker(" . json_encode($options) .").on('dp.change', function(e) {
    if (e.date) $('#" . $this->id . "').val(e.date";

        if ($dayOnly) {
            $js .= ".startOf('day')";
        } else {
            $js .= ".utc()";
        }

    $js .= ".format('" . $valueFormat . "'))
    else $('#" . $this->id . "').val('');
    $('#" . $this->id . "').trigger('change');
});
$('#" . $this->id . "_btn').on('click', function() {
    $('#" . $this->id . "_picker').data('DateTimePicker').show();
});";

        (new RequireJSUtility())
            ->addRequireJSModule("moment", "js/vendor/moment.min", true, array("jquery"))
            ->addRequireJSModule("bsdatetimepicker", "js/vendor/bootstrap-datetimepicker.min", true, array("jquery", "bootstrap", "moment"))
            ->addDomReadyJS($js, false, "bsdatetimepicker, css!/css/vendor/bootstrap-datetimepicker.min.css");

        $html = array();

        $html[] = '<div class="input-group date' . $class . '">';
        $html[] = '<input type="text" id="' . $this->id . '_picker" class="form-control"' . $readonly . $placeholder . $disabled . '>';
        $html[] = '<span class="input-group-addon" id="' . $this->id . '_btn">';
        $html[] = '<span class="fa fa-calendar"></span>';
        $html[] = '</span>';
        $html[] = '</div>';
        $html[] = '<input type="hidden" id="' . $this->id . '" name="' . $this->name . '" value="' . htmlspecialchars($this->value) . '">';

        return implode($html);

    }
1340638
protected function getCommandInput()
    {
        $input = new ResourceInput(Config::getDefaultMapperFileName());
        $input->viewsDirectory = trim($this->option('views-directory'));
        $input->perPage = intval($this->option('models-per-page'));
        $input->formRequest = $this->option('with-form-request');
        $input->controllerDirectory = $this->option('controller-directory');
        $input->controllerExtends = $this->option('controller-extends') ?: null;
        $input->withMigration = $this->option('with-migration');
        $input->force = $this->option('force');
        $input->modelDirectory = $this->option('model-directory');
        $input->primaryKey = $this->option('primary-key');
        $input->withSoftDelete = $this->option('with-soft-delete');
        $input->withoutTimeStamps = $this->option('without-timestamps');
        $input->connectionName = $this->option('connection-name');
        $input->engineName = $this->option('engine-name');
        $input->template = $this->getTemplateName();
        $input->layoutName = $this->option('layout-name') ?: 'layouts.app';
        $input->tableExists = $this->option('table-exists');
        $input->translationFor = $this->option('translation-for');
        $input->withAuth = $this->option('with-auth');
        $input->formRequestDirectory = $this->option('form-request-directory');

        return $input;
    }
182326
public function getPostFromInput()
    {
        $ct = $_SERVER['CONTENT_TYPE'];
        $position = stripos($ct, "boundary=");
        $jsonCheck = "application/json";

        $input = file_get_contents("php://input");

        $this->rawData = $input;

        $postVars = array();
        if ($position !== false) {

            $exp = explode("boundary=", $ct);
            if (isset($exp[1])) {
                $boundary = trim($exp[1]);

                $variables = explode("--" . $boundary, $input);

                foreach ($variables as $var) {
                    $var = urldecode($var);
                    if (trim($var) != "" && trim($var) != "--") {
                        preg_match('/Content-Disposition:[ _]*form-data;[ _]*name="([^\"]*)"(.*)/si', $var, $result);
                        $postVars[trim($result[1])] = trim($result[2]);
                    }
                }
            }
        } else if (substr($ct, 0, strlen($jsonCheck)) === $jsonCheck) {
            $postVars = json_decode($input, true);
        } else {
            parse_str($input, $postVars);
        }

        if (count($_POST) > 0 && count($postVars) === 0) {
            $postVars = $_POST;
        }

        return $postVars;
    }
216642
protected function getPostedData()
    {
        $resourcePostedDataMode = $this->getResource()->getPostedDataMethod();
        $endpointPostedDataMode = $this->getEndpoint()->getPostedDataMethod();

        $postedDataMode = $resourcePostedDataMode;
        if ($endpointPostedDataMode != PostedDataMethods::AUTO) {
            $postedDataMode = $endpointPostedDataMode;
        }

        $postedData = null;

        switch ($postedDataMode) {

            case PostedDataMethods::POST:
                $postedData = $this->request->getPost();
                break;

            case PostedDataMethods::JSON_BODY:
                $postedData = $this->request->getJsonRawBody(true);
                break;

            case PostedDataMethods::AUTO:
            default:
                $postedData = $this->request->getPostedData($this->getEndpoint()->getHttpMethod());
        }

        return $postedData;
    }
1265766
public function &_getPost() {
        $global = &$_POST;
        $json = file_get_contents('php://input');
        if (empty($global) && !empty($json)) {
            $global = (array)json_decode($json, true);
        }
        return $global;
    }
265563
public function getPost($key, $default = false)
    {
        $value = ee()->input->get_post($key);
        if (! $value) {
            $value = $default;
        }
        
        return $value;
    }
544172
protected function getInput()
	{
		// Initialize variables.
		$html = array();
		$groups = $this->getGroups();
		$excluded = $this->getExcluded();
		$link = 'index.php?option=com_members&amp;layout=modal&amp;tmpl=component&amp;field=' . $this->id
			. (isset($groups) ? ('&amp;groups=' . base64_encode(json_encode($groups))) : '')
			. (isset($excluded) ? ('&amp;excluded=' . base64_encode(json_encode($excluded))) : '');

		// Initialize some field attributes.
		$attr  = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
		$attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';

		// Initialize JavaScript field attributes.
		$onchange = (string) $this->element['onchange'];

		// Load the modal behavior script.
		Behavior::modal('a.modal_' . $this->id);

		// Build the script.
		$script = array();
		$script[] = '	function jSelectUser_' . $this->id . '(id, title) {';
		$script[] = '		var old_id = document.getElementById("' . $this->id . '_id").value;';
		$script[] = '		if (old_id != id) {';
		$script[] = '			document.getElementById("' . $this->id . '_id").value = id;';
		$script[] = '			document.getElementById("' . $this->id . '_name").value = title;';
		$script[] = '			' . $onchange;
		$script[] = '		}';
		$script[] = '		$.fancybox.close();';
		$script[] = '	}';

		// Add the script to the document head.
		App::get('document')->addScriptDeclaration(implode("\n", $script));

		// Load the current username if available.
		if ($this->value)
		{
			$model = UserModel::oneOrNew($this->value);
		}
		else
		{
			$model = UserModel::blank();
			$model->set('name', App::get('language')->txt('JLIB_FORM_SELECT_USER'));
		}

		// Create a dummy text field with the user name.
		//$html[] = '<div class="fltlft">';
		if ($this->element['readonly'] != 'true')
		{
			$html[] = '<div class="input-modal">';
			$html[] = '<span class="input-cell">';
		}
		$html[] = '	<input type="text" id="' . $this->id . '_name"' . ' value="' . htmlspecialchars($model->get('name'), ENT_COMPAT, 'UTF-8') . '" disabled="disabled"' . $attr . ' />';

		// Create the user select button.
		if ($this->element['readonly'] != 'true')
		{
			$html[] = '</span><span class="input-cell">';
			$html[] = '		<a class="button modal_' . $this->id . '" title="' . App::get('language')->txt('JLIB_FORM_CHANGE_USER') . '"' . ' href="' . $link . '" rel="{handler: \'iframe\', size: {x: 800, y: 500}}">';
			$html[] = '			' . App::get('language')->txt('JLIB_FORM_CHANGE_USER') . '</a>';
			$html[] = '</span></div>';
		}

		// Create the real field, hidden, that stored the user id.
		$html[] = '<input type="hidden" id="' . $this->id . '_id" name="' . $this->name . '" value="' . (int) $this->value . '" />';

		return implode("\n", $html);
	}
634279
public function postIndex()
    {
        $oInput            = Factory::service('Input');
        $oHttpCodes        = Factory::service('HttpCodes');
        $oAuthModel        = Factory::model('Auth', 'nails/module-auth');
        $oAccessTokenModel = Factory::model('UserAccessToken', 'nails/module-auth');
        $sIdentifier       = $oInput->post('identifier');
        $sPassword         = $oInput->post('password');
        $sScope            = $oInput->post('scope');
        $sLabel            = $oInput->post('label');
        $bIsValid          = $oAuthModel->verifyCredentials($sIdentifier, $sPassword);

        if (!$bIsValid) {
            throw new ApiException(
                'Invalid login credentials',
                $oHttpCodes::STATUS_UNAUTHORIZED
            );
        }

        /**
         * User credentials are valid, but a few other tests are still required:
         * - User is not suspended
         * - Password is not temporary
         * - Password is not expired
         * - @todo: handle 2FA, perhaps?
         */

        $oUserModel         = Factory::model('User', 'nails/module-auth');
        $oUserPasswordModel = Factory::model('UserPassword', 'nails/module-auth');
        $oUser              = $oUserModel->getByIdentifier($sIdentifier);
        $bIsSuspended       = $oUser->is_suspended;
        $bPwIsTemp          = $oUser->temp_pw;
        $bPwIsExpired       = $oUserPasswordModel->isExpired($oUser->id);

        if ($bIsSuspended) {
            throw new ApiException(
                'User account is suspended',
                $oHttpCodes::STATUS_UNAUTHORIZED
            );
        } elseif ($bPwIsTemp) {
            throw new ApiException(
                'Password is temporary',
                $oHttpCodes::STATUS_UNAUTHORIZED
            );
        } elseif ($bPwIsExpired) {
            throw new ApiException(
                'Password has expired',
                $oHttpCodes::STATUS_UNAUTHORIZED
            );
        }

        $oToken = $oAccessTokenModel->create([
            'user_id' => $oUser->id,
            'label'   => $sLabel,
            'scope'   => $sScope,
        ]);

        if (!$oToken) {
            throw new ApiException(
                'Failed to generate access token. ' . $oAccessTokenModel->lastError(),
                $oHttpCodes::STATUS_INTERNAL_SERVER_ERROR
            );
        }

        return Factory::factory('ApiResponse', 'nails/module-api')
                      ->setData([
                          'token'   => $oToken->token,
                          'expires' => $oToken->expires,
                      ]);
    }