| 제목 | 실명인증 모듈 붙이는 방법.. | ||
|---|---|---|---|
| 글쓴이 | 휴~한숨쟁이 | 작성시각 | 2010/04/07 10:50:53 | 
|  | |||
| ci에서는 실명인증 모듈 같은것을 어떻게 붙여야 될지... | |||
| 다음글 | 새로고침시 Post 값이 계속 DB에 적용되는데요.. (1) | ||
| 이전글 | null, 공백 체크 방법? (2) | ||
| 
                                변종원(웅파)
                                /
                                2010/04/07 11:01:55 /
                                추천
                                0
                             | 
| 
                                휴~한숨쟁이
                                /
                                2010/04/07 15:15:06 /
                                추천
                                0
                             
 /// ############################################################################# $strDelimeter    = "!#!"; $strDomain     = "secure.nuguya.com"; $strPingUrl     = "http://" . $strDomain . ":" . $strPort . "/nuguya/rlnmPing.do"; // ----------------------------------------------------- $proxies = new proxies(); // function WSService() {}  function serviceCall( $arg )  function getService()  function getPing() // function proxies() {}  function makeResponse( $msg, $back )  //   $chunkend = strpos( $buffer, "\r\n" ) + 2;   while( $chunk_size > 0 )    if ( $chunkend == FALSE )    $chunk = substr( $buffer, $chunkstart, $chunkend - $chunkstart ); $chunkstart = $chunkend + 2;    $chunkend = strpos( $buffer, "\r\n", $chunkstart ) + 2;    $temp = substr( $buffer, $chunkstart, $chunkend - $chunkstart );   return $new;  //   // Remove 100 Header   // Separate Content from Header   $header_data = trim( substr( $data, 0, $pos ) );   // Clean Header   foreach( $header_array as $header_line )   // decode transfer-encoding   // decode content-encoding   if ( strlen( $data ) == 0 )   return $data;  function callTransport( $domain, $port, $reqest )   $sock = @fsockopen( $domain, (int) $port, $errno, $errstr, 10 ); fwrite( $sock, $reqest );   // Get Response Data fclose( $sock );   if ( $respData == '' )   $this->returnValue = $respData;   return true;  //   $reqData = "";   if ( ! $this->callTransport( $p->service->domain, (int) $p->service->port, $reqData ) ) $this->makeResponse( $this->errorMsg, -1 );   return true;  //   $reqData = "";   if ( ! $this->callTransport( $p->service->domain, (int) $p->service->port, $reqData ) ) $this->makeResponse( "한국신용정보 서비스에서 필요한 정보를 수신하지 못하였습니다. [nice.nuguya.oivs : callPing]\\n\\n서비스 점검중일 수 있습니다.\\n상태가 지속되면 한국신용정보(주) (1588-2486)로 연락하십시오.", -1 );   return true;  //   $sendMsg = "<?xml version='1.0' encoding='utf-8'?>";   // parameters     // envelope end $sendMsg = stripslashes( $sendMsg );   $reqData = "";   if ( ! $this->callTransport( $p->service->domain, (int) $p->service->port, $reqData ) ) $this->makeResponse( $this->errorMsg, -1 );   $this->returnValue = strip_tags( $this->returnValue ); // ----------------------------------------------------- $cryptoObject = new CryptoObject(); class CryptoObject   // create the 16 or 48 subkeys we will need     // set up the loops for single and triple des $message .= (chr(0) . chr(0) . chr(0) . chr(0) . chr(0) . chr(0) . chr(0) . chr(0)); //pad the message out with null bytes     // store the result here     if ($mode == 1)     // loop through each 64 bit chunk of the message       // for Cipher Block Chaining mode, xor the message with the previous result       // first each 64 but chunk of the message must be permuted according to IP       $left = (($left << 1) | ($left >> 31 & $masks[31]));       // do this either 1 or 3 times for each chunk of the message     // now go through and perform the encryption or decryption          $temp = $left; $left = $right; $right = $temp; //unreverse left and right       // move then each one bit to the right       // now perform IP-1, which is IP in the opposite direction       // for Cipher Block Chaining mode, xor the message with the previous result       $chunk += 8;     // return the result as an array  //     // how many iterations (1 for des, 3 for triple des)     for ($j=0; $j<$iterations; $j++)       $temp = (($left >> 4 & $masks[4]) ^ $right) & 0x0f0f0f0f; $right ^= $temp; $left ^= ($temp << 4);       // the right side needs to be shifted and to get the last four bits of the left side       //now go through and perform these shifts on the left and right keys          //now apply PC-2, in such a way that E is easier when encrypting or decrypting     // return the keys we've created  //   do   return($rndKey); // ----------------------------------------------------- // Ping Service $proxies->NuguyaPingService->getPingInfo = new WSService; // Secure Service $proxies->NuguyaSecureService->getServiceProxy = new WSService; $retVal = $proxies->NuguyaSecureService->getServiceProxy->getService(); if ( $retVal ) // Web Service Proxy $proxies->NuguyaProxyService->getServiceProxy = new WSService; $retVal = $proxies->NuguyaProxyService->getServiceProxy->getService(); // ----------------------------------------------------- $oivsObject = new OivsObject(); class OivsObject  function OivsObject()  function makeResponse( $message, $back ) 
   $strCDESInfo = base64_decode( $this->clientData );   // 클라이언트 정보를 수신하여 설정한다.    $strCDESInfo = $cryptoObject->des( $this->ckData, $strCDESInfo, 0, 1, $this->ckData );   if ( count( $aryValues ) < 4 )   $this->userNm   = urldecode( trim( $aryValues[0] ) );  //   // 한신정 서비스와 연계하기 위한 정보를 설정한다.   $strCHashedInfo = md5( $this->niceId . $this->pingInfo );   $proxies->SecureServiceService->getServiceKey->func = null;   if ( ( ! $retVal ) || $proxies->errorCode != "" ) $aryRtnValues = $this->resolveReturnValue( $proxies->returnValue );   if ( count( $aryRtnValues ) < 5 )   $this->retCd  = trim( $aryRtnValues[1] );   if ( $this->retCd == "0" && $this->retDtlCd == "0" )    $this->skData = $cryptoObject->des( $this->ckData, base64_decode( $this->skData ), 0, 1, $this->ckData );    $proxies->RealNameServiceService->checkRealName->func = null;    if ( ( ! $retVal ) || $proxies->errorCode != "" ) $aryRtnValues = $this->resolveReturnValue( $proxies->returnValue );    if ( count( $aryRtnValues ) < 5 )    if ( $aryRtnValues[0] != md5( $this->resIdNo ) )    $this->retCd = trim( $aryRtnValues[1] );  // $aryValues = split( $strDelimeter, $returnValue );   if ( count( $aryValues ) < 5 )   if ( ! ( strpos( $aryValues[4], "_E_" ) === false ) )   return( $aryValues );  //   $aryValues = split( $strDataDelimeter, $returnValue ); ?> | 
| 
                                변종원(웅파)
                                /
                                2010/04/07 15:42:52 /
                                추천
                                0
                             
                                헬퍼로 만들어야 할 것이 있고 라이브러리로 만들어야 할 것이 있는데 대상이 잘못 됐네요. http://codeigniter-kr.org/user_guide/general/helpers.html 참고하시고 application/libraries 에 라이브러리로 저장하고 테스트 해보시기 바랍니다. | 
| 
                                최용운
                                /
                                2010/04/07 16:30:30 /
                                추천
                                0
                             
                                 우훔 .. 덧글에 저렇게 길게도 붙여지는군요 .ㅎㅎㅎㅎ
                             | 
| 
                                휴~한숨쟁이
                                /
                                2010/04/07 16:55:24 /
                                추천
                                0
                             라이브러리로 저장할시 클래스별로 라이브러리를 만들어 줘야하나요? | 
| 
                                변종원(웅파)
                                /
                                2010/04/07 17:14:28 /
                                추천
                                0
                             
                                클래스별로 저장해서 쓰시면 됩니다. ^^ | 
보통 한 페이지에서 처리하던 데이터 불러오는 부분(m), 보여주는 부분(v), 그리고 폼 넘겼을 경우 처리하던 부분(c)이 ci에서 controller, model, view로 나눠서 처리하고 있을 뿐입니다.
뷰를 보여주려면 먼저 컨트롤러가 있어야 하니 컨트롤러 생성하고 뷰 호출.
뷰(회원가입 뷰)에서 실명인증버튼 클릭시 처리할 컨트롤러와 뷰 생성하여 팝업으로 처리.
개념이 잘 안잡히시면 일단 컨트롤러, 뷰 나누지 마시고 컨트롤러에서 모두 처리를 하게 만드시고
나중에 리팩토링하셔도 됩니다.