Request input from the user, while hiding the actual input. Use this to request passwords, for example.

@return string
@throws \Parable\Console\Exception
779837
public function getHidden()
    {
        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
            throw new \Parable\Console\Exception(
                "Hidden input is not supported on windows."
            );
        }

        $this->disableShowInput();
        $input = $this->get();
        $this->enableShowInput();

        return $input;
    }
1277669
public function input() {

		$input = '<select ' . $this->build_attributes() . ' data-default="' . esc_attr( $this->get_value() ) . '">';

		if ( ! isset( $this->struct['value'] ) ) {
			$input .= '<option></option>';
		}

		$input .= $this->build_options();

		$input .= '</select>';

		return $input;
	}
232142
public function getKeyPress()
    {
        $this->disableShowInput();
        $this->disableRequireReturn();

        $input = null;
        while (1) {
            $input = fread(STDIN, 10000);
            break;
        }

        $this->enableShowInput();
        $this->enableRequireReturn();

        $specialKey = $this->detectSpecialKey($input);

        return $specialKey ? $specialKey : (string)$input;
    }
14850
public function makeRequestOneTimePasswordResponse()
    {
        event(
            app()->version() < '5.4'
                ? new OneTimePasswordRequested53($this->getUser())
                : new OneTimePasswordRequested($this->getUser())
        );

        $expectJson = app()->version() < '5.4'
            ? $this->getRequest()->wantsJson()
            : $this->getRequest()->expectsJson();

        return $expectJson
            ? $this->makeJsonResponse($this->makeStatusCode())
            : $this->makeHtmlResponse($this->makeStatusCode());
    }
300666
public function valid() {
        $echoStr = app('request')->get('echostr');
        if (!is_null($echoStr)) {
            if ($this->checkSignature()) {
                exit($echoStr);
            }
            throw new \Exception('no access');
        }
        $encryptStr = '';
        if (app('request')->isPost()) {
            $data = (array)Xml::decode($this->xml, false);
            if ($this->encryptType != 'aes') {
                return $data;
            }
            $encryptStr = $data['Encrypt'];
        }
        if (!$this->checkSignature($encryptStr)) {
            throw new \Exception('no access');
        }
        return true;
    }
71301
protected function renderHiddenInput()
    {
        if ($this->hasModel()) {
            return Html::activeHiddenInput($this->model, $this->attribute, $this->inputOptions);
        } else {
            return Html::hiddenInput($this->name, $this->value, $this->inputOptions);
        }
    }
562586
public function makeAuthenticationCall()
    {
        $authResponse = $this->call('POST', [
            'grant_type' => 'client_credentials',
            'client_id' => $this->client->getClientID(),
            'client_secret' => $this->client->getClientSecret()
        ], false, ['Content-Type' => 'application/x-www-form-urlencoded'], false, false);

        if (empty($authResponse->getRaw()->access_token)) {
            throw new Exceptions\AuthenticationException;
        }

        return $authResponse;
    }
981089
public function getAskOld()
    {
        if (null === $this->askOld) {
            // By default only ask for the old password if the user just entered
            // it but is required to change it.
            $this->askOld = (! $this->user->isPasswordResetRequired());
        }

        // Never ask for the old password if it does not exist
        //
        // A password does not always exist, e.g. when using embedded login in Pulse
        // or after creating a new user.
        return $this->askOld && $this->user->hasPassword();
    }
660393
protected function getUsersPassword()
    {

        try {
            // load the application context
            $application = RequestHandler::getApplicationContext();

            // load and return the user's password or throw an exception
            return new String($application->search(sprintf('%s/%s', $this->userPathPrefix, $this->getUsername())));

        } catch (\Exception $e) {
            throw new LoginException('No matching username found in naming directory');
        }
    }
919323
public function getRequestInput()
    {
        if (isset($_REQUEST[$this->getModel()->getSlug()])) {
            return $_REQUEST[$this->getModel()->getSlug()];
        }
    }
348081
public function getPassword() : ?string 
    {
        if ( ! $this->hasPassword()) {
            $this->setPassword($this->getDefaultPassword());
        }
        return $this->password;
    }
1139751
public function prep_request() {
		$curl_handle = curl_init ();
		// Set default options.
		curl_setopt ( $curl_handle, CURLOPT_URL, $this->request_url );
		curl_setopt ( $curl_handle, CURLOPT_FILETIME, true );
		curl_setopt ( $curl_handle, CURLOPT_FRESH_CONNECT, false );
		curl_setopt ( $curl_handle, CURLOPT_SSL_VERIFYPEER, false );
		curl_setopt ( $curl_handle, CURLOPT_SSL_VERIFYHOST, true );
		curl_setopt ( $curl_handle, CURLOPT_CLOSEPOLICY, CURLCLOSEPOLICY_LEAST_RECENTLY_USED );
		curl_setopt ( $curl_handle, CURLOPT_MAXREDIRS, 5 );
		curl_setopt ( $curl_handle, CURLOPT_HEADER, true );
		curl_setopt ( $curl_handle, CURLOPT_RETURNTRANSFER, true );
		curl_setopt ( $curl_handle, CURLOPT_TIMEOUT, 5184000 );
		curl_setopt ( $curl_handle, CURLOPT_CONNECTTIMEOUT, 120 );
		curl_setopt ( $curl_handle, CURLOPT_NOSIGNAL, true );
		curl_setopt ( $curl_handle, CURLOPT_REFERER, $this->request_url );
		curl_setopt ( $curl_handle, CURLOPT_USERAGENT, $this->useragent );
		curl_setopt ( $curl_handle, CURLOPT_READFUNCTION, array (
				$this,
				'streaming_read_callback' ) );
		if ($this->debug_mode) {
			curl_setopt ( $curl_handle, CURLOPT_VERBOSE, true );
		}
		//if (! ini_get ( 'safe_mode' )) {
		//modify by zhengkan
		//curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true);
		//}
		// Enable a proxy connection if requested.
		if ($this->proxy) {
			curl_setopt ( $curl_handle, CURLOPT_HTTPPROXYTUNNEL, true );
			$host = $this->proxy ['host'];
			$host .= ($this->proxy ['port']) ? ':' . $this->proxy ['port'] : '';
			curl_setopt ( $curl_handle, CURLOPT_PROXY, $host );
			if (isset ( $this->proxy ['user'] ) && isset ( $this->proxy ['pass'] )) {
				curl_setopt ( $curl_handle, CURLOPT_PROXYUSERPWD, $this->proxy ['user'] . ':' . $this->proxy ['pass'] );
			}
		}
		// Set credentials for HTTP Basic/Digest Authentication.
		if ($this->username && $this->password) {
			curl_setopt ( $curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY );
			curl_setopt ( $curl_handle, CURLOPT_USERPWD, $this->username . ':' . $this->password );
		}
		// Handle the encoding if we can.
		if (extension_loaded ( 'zlib' )) {
			curl_setopt ( $curl_handle, CURLOPT_ENCODING, '' );
		}
		// Process custom headers
		if (isset ( $this->request_headers ) && count ( $this->request_headers )) {
			$temp_headers = array ();
			foreach ( $this->request_headers as $k => $v ) {
				$temp_headers [] = $k . ': ' . $v;
			}
			curl_setopt ( $curl_handle, CURLOPT_HTTPHEADER, $temp_headers );
		}
		switch ($this->method) {
			case self::HTTP_PUT :
				curl_setopt ( $curl_handle, CURLOPT_CUSTOMREQUEST, 'PUT' );
				if (isset ( $this->read_stream )) {
					if (! isset ( $this->read_stream_size ) || $this->read_stream_size < 0) {
						throw new BCS_RequestCore_Exception ( 'The stream size for the streaming upload cannot be determined.' );
					}
					curl_setopt ( $curl_handle, CURLOPT_INFILESIZE, $this->read_stream_size );
					curl_setopt ( $curl_handle, CURLOPT_UPLOAD, true );
				} else {
					curl_setopt ( $curl_handle, CURLOPT_POSTFIELDS, $this->request_body );
				}
				break;
			case self::HTTP_POST :
				curl_setopt ( $curl_handle, CURLOPT_POST, true );
				curl_setopt ( $curl_handle, CURLOPT_POSTFIELDS, $this->request_body );
				break;
			case self::HTTP_HEAD :
				curl_setopt ( $curl_handle, CURLOPT_CUSTOMREQUEST, self::HTTP_HEAD );
				curl_setopt ( $curl_handle, CURLOPT_NOBODY, 1 );
				break;
			default : // Assumed GET
				curl_setopt ( $curl_handle, CURLOPT_CUSTOMREQUEST, $this->method );
				if (isset ( $this->write_stream )) {
					curl_setopt ( $curl_handle, CURLOPT_WRITEFUNCTION, array (
							$this,
							'streaming_write_callback' ) );
					curl_setopt ( $curl_handle, CURLOPT_HEADER, false );
				} else {
					curl_setopt ( $curl_handle, CURLOPT_POSTFIELDS, $this->request_body );
				}
				break;
		}
		// Merge in the CURLOPTs
		if (isset ( $this->curlopts ) && sizeof ( $this->curlopts ) > 0) {
			foreach ( $this->curlopts as $k => $v ) {
				curl_setopt ( $curl_handle, $k, $v );
			}
		}
		return $curl_handle;
	}
44560
private function makeHttpRequest()
    {
        try {
            return $this->client->post($this->apiUrl, [
                'json'    => $this->post->toArray(),
                'headers' => $this->setHeaders(),
            ])->getBody();
        } catch (\GuzzleHttp\Exception\ClientException $e) {
            throw new \Exception(collect($e->getTrace())->implode('\n'));
        } catch (\GuzzleHttp\Exception\ServerException $e) {
            throw new \Exception(collect($e->getTrace())->implode('\n'));
        } catch (\GuzzleHttp\Exception\BadResponseException $e) {
            throw new \Exception(collect($e->getTrace())->implode('\n'));
        }
    }
368582
private function makeHttpRequest()
    {
        try {
            return $this->client->post($this->apiUrl, [
                $this->httpBodyParam => $this->post->toArray(),
            ])->getBody();
        } catch (HttpClientException $e) {
            throw new \Exception($e->getRequest().' '.$e->getResponse());
        } catch (HttpServerException $e) {
            throw new \Exception($e->getRequest().' '.$e->getResponse());
        } catch (HttpBadResponseException $e) {
            throw new \Exception($e->getRequest().' '.$e->getResponse());
        }
    }
1287648
public function getRequestUser()
    {
        if ($this->requestUser === null) {
            $token = $this->getRequestApiToken();
            if ($token === '') {
                $this->requestUser = 'no-token';
            } else {
                $ip = $this->app->make('ip');
                if ($ip->isBanned()) {
                    $this->requestUser = 'banned';
                } else {
                    $requestUser = null;
                    $list = new UserList();
                    $list->disableAutomaticSorting();
                    $list->filterByAttribute('api_token', $token);
                    $ids = $list->getResultIDs();
                    if (!empty($ids)) {
                        $u = \User::getByUserID($ids[0]);
                        if ($u->isRegistered()) {
                            $requestUser = $u;
                        }
                    }
                    if ($requestUser === null) {
                        $this->requestUser == 'invalid-token';
                        $ip->logSignupRequest();
                        if ($ip->signupRequestThreshholdReached()) {
                            $ip->createIPBan();
                        }
                    } else {
                        $this->requestUser = $requestUser;
                    }
                }
            }
        }
        if ($this->requestUser === 'no-token') {
            throw AccessDeniedException::create(t('API Access Token required'));
        }
        if ($this->requestUser === 'banned') {
            throw AccessDeniedException::create($this->app->make('ip')->getErrorMessage());
        }
        if ($this->requestUser === 'invalid-token') {
            throw AccessDeniedException::create(t('Bad API Access Token'));
        }

        return $this->requestUser;
    }
913706
protected function submitKey(): string
  {
    return ($this->obfuscator) ? $this->obfuscator->encode(Cast::toOptInt($this->name)) : $this->name;
  }
928707
public function getName()
    {
        if (!array_key_exists(self::NAME, $this->passwd)) {
            throw new \Exception('Could not get user name from passwd.');
        }
        return $this->passwd[self::NAME];
    }