/** * 入力値チェック */ function validate() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); // パラメータ取得 $params =& $request->getParameters(); $result = TRUE; // メールアドレスのチェック if ($params['community_ml_address']) { // 英数字-_のチェック if (!ereg("^[a-z|A-Z|0-9|_|\\-]+\$", $params['community_ml_address'])) { $request->setError("community_ml_address", ACSMsg::get_msg('Community', 'CreateCommunityAction.class.php', 'M051')); $result = FALSE; } // 英数字始まりのチェック if (!ereg("^[a-z|A-Z|0-9]+", $params['community_ml_address'])) { $request->setError("community_ml_address", ACSMsg::get_msg('Community', 'CreateCommunityAction.class.php', 'M052')); $result = FALSE; } // 利用できない名前のチェック $ng_name_array = explode(",", ACS_COMMUNITY_ML_ADDR_NGNAMES); if (in_array(strtolower($params['community_ml_address']), $ng_name_array)) { $request->setError("community_ml_address", ACSMsg::get_msg('Community', 'CreateCommunityAction.class.php', 'M053') . ACS_COMMUNITY_ML_ADDR_NGNAMES); $result = FALSE; } // 既存のメールアドレス if (ACSCommunity::is_exists_ml_addr(ACS_COMMUNITY_ML_ADDR_PREFIX . $params['community_ml_address'] . ACS_COMMUNITY_ML_ADDR_SUFFIX)) { $request->setError("community_ml_address", ACSMsg::get_msg('Community', 'CreateCommunityAction.class.php', 'M054')); $result = FALSE; } } return $result; }