Index: /branches/version-2_5-dev/data/class/helper/SC_Helper_Customer.php
===================================================================
--- /branches/version-2_5-dev/data/class/helper/SC_Helper_Customer.php	(revision 20085)
+++ /branches/version-2_5-dev/data/class/helper/SC_Helper_Customer.php	(revision 20089)
@@ -222,5 +222,5 @@
      */
     function sfGetUniqSecretKey() {
-        $objQuery   = new SC_Query();
+        $objQuery   =& SC_Query::getSingletonInstance();
         $count      = 1;
         while ($count != 0) {
@@ -230,3 +230,24 @@
         return $uniqid;
     }
+
+
+    /**
+     * sfGetCustomerId
+     *
+     * @param mixed $uniqid
+     * @param mixed $check_status
+     * @access public
+     * @return void
+     */
+    function sfGetCustomerId($uniqid, $check_status = false) {
+        $objQuery   =& SC_Query::getSingletonInstance();
+        $where      = "secret_key = ?";
+
+        if ($check_status) {
+            $where .= ' AND status = 1 AND del_flg = 0';
+        }
+
+        return $objQuery->get("customer_id", "dtb_customer", $where, array($uniqid));
+    }
+
 }
Index: /branches/version-2_5-dev/data/class/pages/regist/LC_Page_Regist.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/regist/LC_Page_Regist.php	(revision 20044)
+++ /branches/version-2_5-dev/data/class/pages/regist/LC_Page_Regist.php	(revision 20089)
@@ -36,7 +36,4 @@
     // {{{ properties
 
-    /** 設定情報 */
-    var $CONF;
-
     // }}}
     // {{{ functions
@@ -68,8 +65,4 @@
      */
     function action() {
-        $objSiteInfo = $objView->objSiteInfo;
-        $objCustomer = new SC_Customer();
-        $objDb = new SC_Helper_DB_Ex();
-        $this->CONF = $objDb->sfGetBasisData();
 
         switch ($this->getMode()) {
@@ -77,20 +70,11 @@
         //--　本登録完了のためにメールから接続した場合
             //-- 入力チェック
-            $this->arrErr = $this->lfErrorCheck($_GET);
-            if ($this->arrErr) {
-                SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, $this->arrErr["id"]);
+            $this->arrErr       = $this->lfErrorCheck($_GET);
+            if ($this->arrErr) SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, $this->arrErr["id"]);
 
-            } else {
-                $registSecretKey = $this->lfRegistData($_GET);			//本会員登録（フラグ変更）
-                $this->lfSendRegistMail($registSecretKey);				//本会員登録完了メール送信
+            $registSecretKey    = $this->lfRegistData($_GET);		//本会員登録（フラグ変更）
+            $this->lfSendRegistMail($registSecretKey);				//本会員登録完了メール送信
 
-                // ログイン済みの状態にする。
-                $objQuery = new SC_Query();
-                $arrRet = $objQuery->select("customer_id, email", "dtb_customer", "secret_key = ?", array($registSecretKey));
-                $objCustomer->setLogin($arrRet[0]['email']);
-                $etc_val['ci'] = $arrRet[0]['customer_id'];
-                SC_Response_Ex::sendRedirect('complete.php', $etc_val);
-                exit;
-            }
+            SC_Response_Ex::sendRedirect('complete.php', array("ci" => SC_Helper_Customer_Ex::sfGetCustomerId($registSecretKey)));
             break;
         //--　それ以外のアクセスは無効とする
@@ -110,52 +94,40 @@
     }
 
-    //---- 登録
+    /**
+     * lfRegistData
+     *
+     * 仮会員を本会員にUpdateする
+     *
+     * @param mixed $array
+     * @access public
+     * @return void
+     */
     function lfRegistData($array) {
         $objQuery = new SC_Query();
 
-        do {
-            $secret = SC_Utils_Ex::sfGetUniqRandomId("r");
-        } while( ($result = $objQuery->getOne("SELECT COUNT(*) FROM dtb_customer WHERE secret_key = ?", array($secret)) ) != 0);
-
-        $sql = "SELECT email FROM dtb_customer WHERE secret_key = ? AND status = 1";
-        $email = $objQuery->getOne($sql, array($array["id"]));
+        $arrRegist["secret_key"]    = SC_Helper_Customer_Ex::sfGetUniqSecretKey(); //　本登録ID発行
+        $arrRegist["status"]        = 2;
+        $arrRegist["update_date"]   = "NOW()";
 
         $objQuery->begin();
-        $arrRegist["secret_key"] = $secret;	//　本登録ID発行
-        $arrRegist["status"] = 2;
-        $arrRegist["update_date"] = "NOW()";
-
-        $where = "secret_key = ? AND status = 1";
-
-        $arrRet = $objQuery->select("point", "dtb_customer", $where, array($array["id"]));
-
-        $objQuery->update("dtb_customer", $arrRegist, $where, array($array["id"]));
-
+        $objQuery->update("dtb_customer", $arrRegist, "secret_key = ? AND status = 1", array($array["id"]));
         $objQuery->commit();
 
-        return $secret;		// 本登録IDを返す
+        return $arrRegist["secret_key"];		// 本登録IDを返す
     }
 
     //---- 入力エラーチェック
     function lfErrorCheck($array) {
-        $objQuery = new SC_Query();
-        $objErr = new SC_CheckError($array);
+        $objErr     = new SC_CheckError($array);
 
-        $objErr->doFunc(array("仮登録ID", 'id'), array("EXIST_CHECK"));
-        if (! EregI("^[[:alnum:]]+$",$array["id"] )) {
+        if (preg_match("/^[[:alnum:]]+$/", $array["id"])) {
+
+            if (!is_numeric(SC_Helper_Customer_Ex::sfGetCustomerId($array["id"], true))) {
+                $objErr->arrErr["id"] = "※ 既に会員登録が完了しているか、無効なURLです。<br>";
+            }
+
+        } else {
             $objErr->arrErr["id"] = "無効なURLです。メールに記載されている本会員登録用URLを再度ご確認ください。";
         }
-        if (! $objErr->arrErr["id"]) {
-
-            $sql = "SELECT customer_id FROM dtb_customer WHERE secret_key = ? AND status = 1 AND del_flg = 0";
-            $result = $objQuery->getOne($sql, array($array["id"]));
-
-            if (! is_numeric($result)) {
-                $objErr->arrErr["id"] = "※ 既に会員登録が完了しているか、無効なURLです。<br>";
-                return $objErr->arrErr;
-
-            }
-        }
-
         return $objErr->arrErr;
     }
@@ -163,14 +135,16 @@
     //---- 正会員登録完了メール送信
     function lfSendRegistMail($registSecretKey) {
-        $objQuery = new SC_Query();
-        $objHelperMail = new SC_Helper_Mail_Ex();
+        $objCustomer    = new SC_Customer();
+        $objQuery       = new SC_Query();
+        $objHelperMail  = new SC_Helper_Mail_Ex();
+        $this->CONF     = SC_Helper_DB_Ex::sfGetBasisData();
 
-        //-- 姓名を取得
-        $sql = "SELECT email, name01, name02 FROM dtb_customer WHERE secret_key = ?";
-        $result = $objQuery->getAll($sql, array($registSecretKey));
-        $data = $result[0];
+        //-- 会員データを取得
+        $result         = $objQuery->select("*", "dtb_customer", "secret_key = ?", array($registSecretKey));
+        $data           = $result[0];
+        $objCustomer->setLogin($data['email']);
 
         //--　メール送信
-        $objMailText = new SC_SiteView();
+        $objMailText    = new SC_SiteView();
         $objMailText->assign("CONF", $this->CONF);
         $objMailText->assign("name01", $data["name01"]);
Index: /branches/version-2_5-dev/data/class/pages/entry/LC_Page_Entry.php
===================================================================
--- /branches/version-2_5-dev/data/class/pages/entry/LC_Page_Entry.php	(revision 20088)
+++ /branches/version-2_5-dev/data/class/pages/entry/LC_Page_Entry.php	(revision 20089)
@@ -149,5 +149,5 @@
 
                 // 完了ページに移動させる。
-                SC_Response_Ex::sendRedirect('complete.php', array("ci" => $this->lfGetCustomerId($uniqid)));
+                SC_Response_Ex::sendRedirect('complete.php', array("ci" => SC_Helper_Customer_Ex::sfGetCustomerId($uniqid)));
             }
             break;
@@ -267,11 +267,10 @@
         $this->name02   = $arrRet['name02'];
         $this->uniqid   = $uniqid;
+        $CONF           = SC_Helper_DB_Ex::sfGetBasisData();
+        $this->CONF     = $CONF;
         $objMailText    = new SC_SiteView();
         $objMailText->assignobj($this);
 
         $objHelperMail  = new SC_Helper_Mail_Ex();
-        $objCustomer    = new SC_Customer();
-        $CONF           = SC_Helper_DB_Ex::sfGetBasisData();
-        $this->CONF     = $CONF;
 
         // 仮会員が有効の場合
@@ -283,4 +282,5 @@
             $toCustomerMail = $objMailText->fetch("mail_templates/customer_regist_mail.tpl");
             // ログイン状態にする
+            $objCustomer = new SC_Customer();
             $objCustomer->setLogin($arrRet["email"]);
         }
@@ -367,16 +367,3 @@
         }
     }
-
-
-    /**
-     * lfGetCustomerId
-     *
-     * @param mixed $uniqid
-     * @access public
-     * @return void
-     */
-    function lfGetCustomerId($uniqid) {
-        $objQuery = new SC_Query();
-        return $objQuery->get("customer_id", "dtb_customer", "secret_key = ?", array($uniqid));
-    }
 }
