Changeset 21144


Ignore:
Timestamp:
2011/08/08 14:25:53 (9 years ago)
Author:
nanasess
bzr:base-revision:
svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_11-dev:21143
bzr:committer:
Kentaro Ohkouchi <ohkouchi@loop-az.jp>
bzr:file-ids:

data/Smarty/templates/sphone/mypage/login.tpl login.tpl-20101209134550-lsv02w9wikfx9cj3-22
data/class/pages/frontparts/LC_Page_FrontParts_LoginCheck.php 15367@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Ffrontparts%2FLC_Page_FrontParts_LoginCheck.php
bzr:mapping-version:
v4
bzr:merge:

ohkouchi@loop-az.jp-20110808052447-3ycohnin9dx0r9l9
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
ohkouchi@loop-az.jp-20110808052550-xv2dl1dt6p95bgjf
bzr:revno:
3847
bzr:revprop:branch-nick:
branches/version-2_11-dev
bzr:root:
branches/version-2_11-dev
bzr:testament:

bazaar-ng testament short form 2.1
revision-id: ohkouchi@loop-az.jp-20110808052550-xv2dl1dt6p95bgjf
sha1: 0b5745575a51ec3c912b3586a44bd5056ca01a93
bzr:text-parents:

data/Smarty/templates/sphone/mypage/login.tpl svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_11-dev:21107
data/class/pages/frontparts/LC_Page_FrontParts_LoginCheck.php ohkouchi@loop-az.jp-20110805141429-q4uvtjkhv4f7km3u
bzr:timestamp:
2011-08-08 14:25:50.316999912 +0900
bzr:user-agent:
bzr2.3.1+bzr-svn1.1.0dev0
Message:

#1413 ログインエラーを alert に

  • mypage/login.php を対応
Location:
branches/version-2_11-dev/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/Smarty/templates/sphone/mypage/login.tpl

    r21107 r21144  
    2323*}--> 
    2424<!--▼CONTENTS--> 
     25<script> 
     26  function ajaxLogin() { 
     27      var postData = new Object; 
     28      postData['<!--{$smarty.const.TRANSACTION_ID_NAME}-->'] = "<!--{$transactionid}-->"; 
     29      postData['mode'] = 'login'; 
     30      postData['login_email'] = $('input[type=email]').val(); 
     31      postData['login_pass'] = $('input[type=password]').val(); 
     32      postData['url'] = $('input[name=url]').val(); 
     33 
     34      $.ajax({ 
     35          type: "POST", 
     36          url: "<!--{$smarty.const.HTTPS_URL}-->frontparts/login_check.php", 
     37          data: postData, 
     38          cache: false, 
     39          dataType: "json", 
     40          error: function(XMLHttpRequest, textStatus, errorThrown){ 
     41              alert(textStatus); 
     42          }, 
     43          success: function(result){ 
     44              if (result.success) { 
     45                  location.href = result.success; 
     46              } else { 
     47                  alert(result.login_error); 
     48              } 
     49          } 
     50      }); 
     51  } 
     52</script> 
    2553<section id="slidewindow"> 
    2654 
    2755<h2 class="title"><!--{$tpl_title|h}--></h2> 
    28      <form name="login_mypage" id="login_mypage" method="post" action="<!--{$smarty.const.HTTPS_URL}-->frontparts/login_check.php" onsubmit="return fnCheckLogin('login_mypage')"> 
     56     <form name="login_mypage" id="login_mypage" method="post" action="javascript:;" onsubmit="return ajaxLogin();"> 
    2957        <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> 
    3058        <input type="hidden" name="mode" value="login" /> 
    31         <input type="hidden" name="url" value="<!--{$smarty.server.PHP_SELF|h}-->" /> 
     59        <input type="hidden" name="url" value="<!--{$smarty.server.REQUEST_URI|h}-->" /> 
     60 
    3261<div class="login_area"> 
    3362 
  • branches/version-2_11-dev/data/class/pages/frontparts/LC_Page_FrontParts_LoginCheck.php

    r20970 r21144  
    140140 
    141141                    // --- ログインに成功した場合 
    142                     SC_Response_Ex::sendRedirect($_POST['url']); 
     142                    if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { 
     143                        echo SC_Utils_Ex::jsonEncode(array('success' => $_POST['url'])); 
     144                    } else { 
     145                        SC_Response_Ex::sendRedirect($_POST['url']); 
     146                    } 
    143147                    exit; 
    144148                } else { 
     
    156160                } 
    157161            } else { 
     162                // XXX 到達しない? 
    158163                // 入力エラーの場合、元のアドレスに戻す。 
    159164                SC_Response_Ex::sendRedirect($_POST['url']); 
Note: See TracChangeset for help on using the changeset viewer.