Changeset 5306

Show
Ignore:
Timestamp:
02/20/08 11:24:05 (8 months ago)
Author:
inureyes
Message:

#819

* 비밀번호를 저장할 때 무조건 저장되던 문제 수정

Location:
trunk/interface/owner/setting/account
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/interface/owner/setting/account/index.php

    r5285 r5306  
    9090                                    var pwd = document.getElementById('pwd'); 
    9191                                    var pwd2 = document.getElementById('pwd2'); 
    92                                     var apiPasswd = document.getElementById('TCApiPassword'); 
    9392                                     
    9493                                    if(pwd.value != '' || prevPwd.value != '') { 
     
    106105                                            return false; 
    107106                                        } 
     107                                    } else { 
     108                                        PM.showMessage("<?php echo _t('비밀번호를 입력해 주십시오.');?>","center","top"); 
     109                                        return false; 
    108110                                    } 
    109111                                    var request = new HTTPRequest("POST", "<?php echo $blogURL;?>/owner/setting/account/password/"); 
     
    117119                                        PM.showErrorMessage("<?php echo _t('변경하지 못했습니다.');?>", "center", "bottom"); 
    118120                                    } 
    119                                     request.send("prevPwd=" + encodeURIComponent(prevPwd.value) + "&pwd=" + encodeURIComponent(pwd.value) + "&APIKey=" + encodeURIComponent(apiPasswd.value)); 
    120                                 } 
    121  
     121                                    request.send("prevPwd=" + encodeURIComponent(prevPwd.value) + "&pwd=" + encodeURIComponent(pwd.value)); 
     122                                } 
     123                                 
     124                                function saveAPIKey() { 
     125                                    var apiPasswd = document.getElementById('TCApiPassword'); 
     126                                     
     127                                    var request = new HTTPRequest("POST", "<?php echo $blogURL;?>/owner/setting/account/apikey/"); 
     128                                    request.onSuccess = function() { 
     129                                        PM.showMessage("<?php echo _t('변경했습니다.');?>", "center", "bottom"); 
     130                                    } 
     131                                    request.onError = function() { 
     132                                        PM.showErrorMessage("<?php echo _t('변경하지 못했습니다.');?>", "center", "bottom"); 
     133                                    } 
     134                                    request.send("APIKey=" + encodeURIComponent(apiPasswd.value)); 
     135                                } 
     136                                 
    122137                                function clearBlogPassword() { 
    123138                                    document.getElementById('TCApiPassword').value = ""; 
     
    333348                                            <dd><input type="password" id="pwd2" class="input-text" onkeydown="if(event.keyCode == 13) savePwd();" /></dd> 
    334349                                        </dl> 
     350                                    </fieldset> 
     351                                    <div class="button-box"> 
     352                                        <input type="submit" class="save-button input-button" value="<?php echo _t('변경하기');?>" onclick="savePwd(); return false;" /> 
     353                                    </div> 
     354                                </form> 
     355                                <form id="apikey-section" class="section" method="post" action="<?php echo $blogURL;?>/owner/setting/apikey"> 
     356                                    <fieldset class="container"> 
    335357                                        <legend><?php echo _t('API Key 설정');?></legend> 
    336358                                         
     
    349371                                    </fieldset> 
    350372                                    <div class="button-box"> 
    351                                         <input type="submit" class="save-button input-button" value="<?php echo _t('변경하기');?>" onclick="savePwd(); return false;" /> 
     373                                        <input type="submit" class="save-button input-button" value="<?php echo _t('변경하기');?>" onclick="saveAPIKey(); return false;" /> 
    352374                                    </div> 
    353375                                </form> 
  • trunk/interface/owner/setting/account/password/index.php

    r5285 r5306  
    66    'POST' => array( 
    77        'pwd' => array('string','default'=>''), 
    8         'prevPwd' => array('string','default'=>''), 
    9         'APIKey' => array('string', 'default'=>'') 
     8        'prevPwd' => array('string','default'=>'') 
    109    ) 
    1110); 
     
    1514if($_POST['pwd'] != '' && $_POST['prevPwd'] != '') { 
    1615    $result = changePassword(getUserId(), $_POST['pwd'], $_POST['prevPwd']); 
    17      
    1816} 
    19 $result = changeAPIKey(getUserId(), $_POST['APIKey']); 
    2017if($result) respond::ResultPage(0); 
    2118else respond::ResultPage(-1);