校验用户输入的验证码是否正确
@param controller 控制器
@param userInputString 用户输入的字符串
@return 验证通过返回 true, 否则返回 false
556008
public static boolean validate(Controller controller, String userInputString) {
		String captchaKey = controller.getCookie(captchaName);
		if (validate(captchaKey, userInputString)) {
			controller.removeCookie(captchaName);
			return true;
		}
		return false;
	}
292760
private boolean doUserPasswordAuthentication(Socket s,
                                                InputStream in,
                                                OutputStream out) 
                                                throws IOException{
     int version = in.read();
     if(version != 1) return false;
     int ulen = in.read();
     if(ulen < 0) return false;
     byte[] user = new byte[ulen];
     in.read(user);
     int plen = in.read();
     if(plen < 0) return false;
     byte[] password = new byte[plen];
     in.read(password);

     if(validator.isUserValid(new String(user), new String(password),s)){
       //System.out.println("user valid");
       out.write(new byte[]{1,0});
     }else{
       //System.out.println("user invalid");
       out.write(new byte[]{1,1});
       return false;
     }

     return true;
   }
707076
public HandlerRegistration addController(final I_CmsDNDController controller) {

        m_controllers.add(controller);
        return new HandlerRegistration() {

            public void removeHandler() {

                m_controllers.remove(controller);
            }
        };
    }
319190
@Override
    public Renderable<?> render(Controller controller) {
        return render(controller, Collections.<String, Object>emptyMap());
    }
1189972
private void validateInput(AuthenticationService authenticationService, String username) throws AuthenticationException {
        if (authenticationService == null) {
            throw new AuthenticationException("authenticationService cannot be null.");
        } else if (username == null) {
            throw new AuthenticationException("username cannot be null.");
        }
    }
470484
function InboxPage(controller, vox, view) {
  this.controller = controller;
  this.vox = vox;
  this.view = view;
  this.visible = false;
  this._unreadCounts = {};
  this._readStream = this.vox.createReadStream({
        type: 'MESSAGE',
        startSeq: 1,
        checkpointKey: SYNC_CHECKPOINT
    })
    .on('data', this._incrementUnreadCount.bind(this))
    .on('error', this._onReadStreamError.bind(this));
}
944488
@Override
    public void visit(ClassOrInterfaceDeclaration declaration, ControllerModel controller) {
        controller.setName(declaration.getName());

        LOGGER.info("[controller]Visit " + controller.getName());
        //Go on with the methods and annotations
        super.visit(declaration,controller);
    }
88132
public static void createToken(Controller controller, String tokenName, int secondsOfTimeOut) {
		if (tokenCache == null) {
			String tokenId = String.valueOf(random.nextLong());
			controller.setAttr(tokenName, tokenId);
			controller.setSessionAttr(tokenName, tokenId);
			createTokenHiddenField(controller, tokenName, tokenId);
		}
		else {
			createTokenUseTokenIdGenerator(controller, tokenName, secondsOfTimeOut);
		}
	}
675181
protected static boolean isMissingUserDefaultMessages(ModuleConfig mc)
    {
        if (mc != null) {
            ControllerConfig cc = mc.getControllerConfig();

            if (cc instanceof PageFlowControllerConfig) {
                return ((PageFlowControllerConfig) cc).isMissingDefaultMessages();
            }
        }

        return false;
    }
66296
private static boolean match(String regExp, String userInput) {
        Pattern pattern = Pattern.compile(regExp);
        Matcher matcher = pattern.matcher(userInput);
        if (matcher.find())
            return true;
        else
            return false;
    }
445856
protected function _validatePost(Controller $controller)
    {
        $token = $this->_validToken($controller);
        $hashParts = $this->_hashParts($controller);
        $check = hash_hmac('sha1', implode('', $hashParts), Security::getSalt());

        if (hash_equals($check, $token)) {
            return true;
        }

        $msg = self::DEFAULT_EXCEPTION_MESSAGE;
        if (Configure::read('debug')) {
            $msg = $this->_debugPostTokenNotMatching($controller, $hashParts);
        }

        throw new AuthSecurityException($msg);
    }
538415
def equals(self, controller):
        
        if controller is None:
            return False

        return self.user == controller.user and self.enterprise == controller.enterprise and self.url == controller.url
1220532
public function check($controller, array $arguments = [])
    {
        if ($this->controller !== $controller) {
            return false;
        }

        foreach ($this->requirements as $key => $regex) {
            $value = isset($arguments[$key]) ? $arguments[$key] : null;

            if (!preg_match('/^' . $regex . '$/i', $value)) {
                return false;
            }
        }

        return true;
    }
1304487
public static function is_token_user_input($t) {
		if (parent::is_token_user_input($t))
			return TRUE;

		if ($t['code'] == T_VARIABLE) {
			if (in_array($t['content'], array(
					'$form', '$form_state'
				)))	return TRUE;
		} elseif ($t['code'] == T_STRING) {
			if (in_array($t['content'], array(
					'arg', 'drupal_get_query_parameters', 'field_view_value'
				))) return TRUE;
		}

		return FALSE;
	}
1231708
@Override
	public void validate()
	{

		boolean flagA = !controller.isEnableSQLDatabaseOutput();
		boolean flagB = controller.isMultipleOutputFiles();

		OutputCompressionEnum oce = controller.getOutputCompression();

		enableZipEncodingCompression.setSelected(controller
				.isZipCompressionEnabled());

		disableOutputCompression.setSelected(oce == OutputCompressionEnum.None);

		enableBZip2OutputCompression
				.setSelected(oce == OutputCompressionEnum.BZip2);

		activateDataFileOutput.setSelected(controller.isEnableDataFileOutput());

		outputLabel.setEnabled(flagA);
		outputPathField.setEnabled(flagA);

		enableZipEncodingCompression.setEnabled(flagA);

		outputCompression.setEnabled(flagA);
		disableOutputCompression.setEnabled(flagA);

		enable7ZipOutputCompression.setEnabled(flagA
				&& controller.is7ZipEnabled());

		enable7ZipOutputCompression
			.setSelected(oce == OutputCompressionEnum.SevenZip);

		enableBZip2OutputCompression.setEnabled(flagA);

		//Enable multiple output files only for uncompressed output
		enableMultipleOutputFiles.setEnabled(flagA&&(oce == OutputCompressionEnum.None));
		enableMultipleOutputFiles.setSelected(flagB);

		outputSizeLimitLabel.setEnabled(flagA && flagB&&(oce == OutputCompressionEnum.None));
		outputSizeLimitField.setEnabled(flagA && flagB&&(oce == OutputCompressionEnum.None));


	}
1361502
private void verifyInput() {
        if (inData == null || inStations == null) {
            throw new NullPointerException(msg.message("kriging.stationproblem"));
        }
        if (pMode < 0 || pMode > 1) {
            throw new IllegalArgumentException(msg.message("kriging.defaultMode"));
        }

        if (defaultVariogramMode != 0 && defaultVariogramMode != 1) {
            throw new IllegalArgumentException(msg.message("kriging.variogramMode"));
        }
        if (defaultVariogramMode == 0) {
            if (pVariance == 0 || pIntegralscale[0] == 0 || pIntegralscale[1] == 0 || pIntegralscale[2] == 0) {

                pm.errorMessage(msg.message("kriging.noParam"));
                pm.errorMessage("varianza " + pVariance);
                pm.errorMessage("Integral scale x " + pIntegralscale[0]);
                pm.errorMessage("Integral scale y " + pIntegralscale[1]);
                pm.errorMessage("Integral scale z " + pIntegralscale[2]);
            }
        }
        if (defaultVariogramMode == 1) {
            if (pNug == 0 || pS == 0 || pA == 0) {
                pm.errorMessage(msg.message("kriging.noParam"));
                pm.errorMessage("Nugget " + pNug);
                pm.errorMessage("Sill " + pS);
                pm.errorMessage("Range " + pA);
            }
        }

        if ((pMode == 0) && inInterpolate == null) {
            throw new ModelsIllegalargumentException(msg.message("kriging.noPoint"), this, pm);
        }
        if (pMode == 1 && inInterpolationGrid == null) {
            throw new ModelsIllegalargumentException("The gridded interpolation needs a gridgeometry in input.", this, pm);
        }

    }
364067
private boolean isLetter(final char paramInput) {

        return (paramInput >= '0' && paramInput <= '9') || (paramInput >= 'a' && paramInput <= 'z')
            || (paramInput >= 'A' && paramInput <= 'Z') || (paramInput == '_') || (paramInput == '-')
            || (paramInput == '.');

    }