Changeset 5894

Show
Ignore:
Timestamp:
05/07/08 18:21:23 (8 months ago)
Author:
inureyes
Message:

#956

  • 기능 추가
  • 테스트가 약간은 필요하겠죠?
Location:
trunk
Files:
2 added
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/interface/owner/control/server/index.php

    r5888 r5894  
    66require ROOT . '/lib/piece/owner/header.php'; 
    77require ROOT . '/lib/piece/owner/contentMenu.php'; 
     8 
     9$htaccessContent = ''; 
     10if (file_exists(ROOT . "/.htaccess")) { 
     11    $htaccessContent = @file_get_contents(ROOT . "/.htaccess"); 
     12} 
     13 
    814?> 
    915                        <script type="text/javascript"> 
     
    2632                                    request.send("&useCustomSMTP="+useCustomSMTP+"&smtpHost="+encodeURIComponent(smtpHost)+"&smtpPort="+smtpPort); 
    2733                                } 
     34<?php 
     35if(!defined('__TEXTCUBE_NO_FANCY_URL__')) { 
     36?> 
     37                                function setRewrite() { 
     38                                    var htaccess = document.getElementById('rewrite'); 
    2839 
    29  
     40                                    var request = new HTTPRequest("POST", "<?php echo $blogURL;?>/owner/control/server/rewrite/"); 
     41                                    request.onSuccess = function() { 
     42                                        PM.showMessage("<?php echo _t('저장되었습니다.');?>", "center", "bottom"); 
     43                                    } 
     44                                    request.onError = function() { 
     45                                        if (this.getText("/response/msg")) 
     46                                            alert(this.getText("/response/msg")); 
     47                                        else 
     48                                            alert('<?php echo _t('실패했습니다.');?>'); 
     49                                    } 
     50                                    request.send('body='+encodeURIComponent(htaccess.value)); 
     51                                } 
     52<?php 
     53} 
     54?> 
    3055                            //]]> 
    3156                        </script> 
    3257 
    33                         <div id="part-setting-mailhost" class="part"> 
     58                        <div id="part-control-mailhost" class="part"> 
    3459                            <h2 class="caption"><span class="main-text"><?php   echo _t('메일 보낼 서버를 지정합니다');?></span></h2> 
    3560                             
     
    5782                            </div> 
    5883                        </div> 
     84                         
     85                        <hr class="hidden" /> 
     86<?php 
     87if(!defined('__TEXTCUBE_NO_FANCY_URL__')) { 
     88?> 
     89                        <div id="part-control-rewrite" class="part"> 
     90                            <h2 class="caption"><span class="main-text"><?php   echo _t('rewrite 규칙을 편집합니다');?></span></h2> 
     91                            <div class="main-explain-box"> 
     92                                <p class="explain"><?php echo _t('rewrite 모듈의 동작을 조정하는 .htaccess 파일을 변경합니다.').' '._t('변경시 텍스트큐브의 동작에 큰 영향을 줄 수 있으므로 주의하시기 바랍니다.');?></p> 
     93                            </div> 
     94                            <div class="data-inbox"> 
     95                                <form id="rewriteSectionForm" class="section" method="post" action="<?php echo $blogURL;?>/owner/control/server/rewrite/"> 
     96 
     97                                    <div id="rewrite-container"> 
     98                                        <textarea id="rewrite" name="htaccess" cols="100" rows="20" onkeyup="htaccessSaved=false"><?php echo htmlspecialchars($htaccessContent);?></textarea> 
     99                                    </div> 
     100                                    <div class="button-box"> 
     101                                        <input type="reset" class="reset-button input-button" value="<?php echo _t('되돌리기');?>" /> 
     102                                        <input type="submit" class="save-button input-button" value="<?php echo _t('저장하기');?>" onclick="setRewrite(); return false" /> 
     103                                    </div> 
     104                                </form>                      
     105                            </div> 
     106                        </div> 
     107                        <hr class="hidden" /> 
    59108<?php  
     109} 
    60110if (isset($_GET['message'])) { 
    61111    $msg = escapeJSInCData($_GET['message']); 
  • trunk/lib/model/blog.service.php

    r5285 r5894  
    141141    return 'http://help.tattertools.com/'.$blog['language'].'/Textcube/Menu/'.$path; 
    142142} 
     143 
     144function writeHtaccess($contents) { 
     145    if (!is_writable(ROOT . "/.htaccess")) 
     146        return ROOT . _f('파일 쓰기 권한이 없습니다. 웹서버가 %1 파일의 쓰기 권한을 가지고 있는지 확인하세요.','.htaccess'); 
     147    $handler = fopen(ROOT . "/.htaccess", 'w'); 
     148    if (fwrite($handler, $contents) === false) { 
     149        fclose($handler); 
     150        return _t('실패했습니다.'); 
     151    } else { 
     152        fclose($handler); 
     153        @chmod(ROOT . "/.htaccess", 0666); 
     154        return true; 
     155    } 
     156} 
    143157?> 
  • trunk/style/admin/whitedream/control.css

    r5859 r5894  
    1212.button-box input.input-button 
    1313{ 
    14     background-color                 : #fff; 
    15     background-image                 : none !important; 
    16     font-weight                      : bold; 
    17     height                           : 30px !important; 
    18     margin                           : 0 auto; 
    19     padding                          : 0 !important; 
     14       background-color                 : #FFFFFF; 
     15       background-image                 : none; 
     16       border                           : 1px solid #BBBBBB; 
     17       color                            : #000000; 
     18       font-weight                      : bold; 
     19       height                           : 2.5em; 
     20       line-height                      : 2.5em; 
     21       vertical-align                   : middle; 
     22       margin-bottom                    : 10px; 
    2023} 
    2124 
     
    322325/* Server ****************************************************************************************/ 
    323326 
    324 #part-setting-mailhost .button-box 
     327#part-control-mailhost .button-box 
    325328{ 
    326329    border-top                       : 1px solid #DDDDDD; 
     
    329332} 
    330333 
    331 #part-setting-mailhost 
     334#part-control-mailhost 
    332335{ 
    333336    margin-bottom: 30px; 
    334337} 
     338 
     339#part-control-rewrite textarea 
     340{ 
     341    background-color                 : #FFFFFF; 
     342    border                           : 1px solid #999999; 
     343    font-family                      : Courier, 'Courier New', monospace; 
     344    font-size                        : 12px; 
     345    height                           : 250px; 
     346    margin-left                      : 5px !important; 
     347    padding                          : 0 0 0 2px; 
     348    width                            : 920px !important; 
     349} 
     350 
    335351 
    336352/* System ****************************************************************************************/