Changeset 3313

Show
Ignore:
Timestamp:
05/23/07 16:44:06 (20 months ago)
Author:
inureyes
Message:

#408

Files:
58 modified
42 copied

Legend:

Unmodified
Added
Removed
  • branches/1.5/blog/checkup/index.php

    r3124 r3313  
    475475} 
    476476 
     477if (!doesExistTable($database['prefix'] . 'Teamblog')) { 
     478    $changed = true; 
     479    echo '<li>', _text('팀블로그 기능을 위한 테이블을 추가합니다.'), ': '; 
     480    $query = " 
     481        CREATE TABLE {$database['prefix']}Teamblog ( 
     482            teams int(11) NOT NULL default 0, 
     483            userid int(11) NOT NULL default 1, 
     484            enduser int(11) NOT NULL default 0, 
     485            admin int(11) NOT NULL default 0, 
     486            posting int(11) NOT NULL default 0, 
     487            profile text NULL default '', 
     488            logo varchar(15) default '', 
     489            font_style int(11) NOT NULL default 0, 
     490            font_color varchar(10) NOT NULL default '#000000', 
     491            font_size int(11) NOT NULL default 10, 
     492            font_bold int(11) NOT NULL default 0, 
     493            created int(11) NOT NULL default 0, 
     494            lastLogin int(11) NOT NULL default 0, 
     495            PRIMARY KEY (teams,userid,admin) 
     496        ) TYPE=MyISAM 
     497    "; 
     498    if (DBQuery::execute($query . ' DEFAULT CHARSET=utf8') || DBQuery::execute($query)) { 
     499        $query = new TableQuery($database['prefix'] . 'Users'); 
     500        if($query->doesExist()) { 
     501            $changed = true; 
     502            if ($users = $query->getAll('userid, name, created')) { 
     503                foreach($users as $user) { 
     504                    DBQuery::execute("INSERT INTO `{$database['prefix']}Teamblog` VALUES('".$user['userid']."', '".$user['userid']."','0','1','1', '".$user['name']."', '', '0', '#000000', '10', '0', '".$user['created']."', '0')"); 
     505                } 
     506            } 
     507            unset($users); 
     508            echo '<span style="color:#33CC33;">', _text('성공'), '</span></li>'; 
     509        } 
     510    } else 
     511        echo '<span style="color:#FF0066;">', _text('실패'), '</span></li>'; 
     512} 
     513 
     514if (!doesExistTable($database['prefix'] . 'TeamEntryRelations')) { 
     515    $changed = true; 
     516    echo '<li>', _text('팀블로그 연관글 기능을 위한 테이블을 추가합니다.'), ': '; 
     517    $query = " 
     518        CREATE TABLE {$database['prefix']}TeamEntryRelations ( 
     519            owner int(11) NOT NULL default 1, 
     520            id int(11) NOT NULL default 1, 
     521            team int(11) NOT NULL default 1, 
     522            PRIMARY KEY (owner,id,team) 
     523        ) TYPE=MyISAM 
     524    "; 
     525    if (DBQuery::execute($query . ' DEFAULT CHARSET=utf8') || DBQuery::execute($query)) { 
     526        $query = new TableQuery($database['prefix'] . 'Entries'); 
     527        if($query->doesExist()) { 
     528            $changed = true; 
     529            if ($entries = $query->getAll('owner, id')) { 
     530                foreach($entries as $entry) { 
     531                    DBQuery::execute("INSERT INTO   `{$database['prefix']}TeamEntryRelations`  VALUES('".$entry['owner']."', '".$entry['id']."','".$entry['owner']."')"); 
     532                 
     533                } 
     534            } 
     535            unset($entries); 
     536            echo '<span style="color:#33CC33;">', _text('성공'), '</span></li>'; 
     537        } 
     538         
     539    } else 
     540        echo '<span style="color:#FF0066;">', _text('실패'), '</span></li>'; 
     541} 
     542 
    477543$filename = ROOT . '/.htaccess'; 
    478544$fp = fopen($filename, "r"); 
  • branches/1.5/blog/comment/delete/item.php

    r3305 r3313  
    1616); 
    1717require ROOT . '/lib/includeForBlog.php'; 
     18list($replier)=getCommentAttributes($owner,$suri['id'],'replier'); 
     19$ch_res = mysql_fetch_array(mysql_query("SELECT Posting FROM `{$database['prefix']}Teamblog` WHERE teams='$owner' and userid='$_SESSION[admin]'")); 
     20if(empty($ch_res['Posting']) && $owner != $_SESSION['admin']){ 
     21    if(!empty($replier)){ 
     22        if($owner != $_SESSION['admin']){ 
     23            if($replier != $_SESSION['admin']){ 
     24                echo _t('<script> alert("권한이 없습니다."); window.close(); </script>'); 
     25                exit;    
     26            } 
     27        } 
     28    } 
     29    else{ 
     30        if($owner != $_SESSION['admin'] && !empty($_SESSION['admin'])){ 
     31            echo _t('<script> alert("권한이 없습니다."); window.close(); </script>'); 
     32            exit;    
     33        } 
     34    } 
     35} 
    1836if (false) { 
    1937    fetchConfigVal(); 
  • branches/1.5/blog/login/index.php

    r3124 r3313  
    1717        'requestURI' => array('string', 'default' => null), 
    1818        'reset' => array(array('on') ,'default' => null), 
    19         'save' => array('any', 'default' => null) 
     19        'save' => array('any', 'default' => null), 
     20        'teamblogPatch' => array('string', 'default' => null) 
    2021    ) 
    2122); 
     
    4243        $message = _text('권한이 없습니다.'); 
    4344} else if (!empty($_POST['loginid']) && !empty($_POST['password'])) { 
    44     if (!login($_POST['loginid'], $_POST['password'])) { 
     45    // 팀블로그 :: 로그인 
     46    $isLogin = login($_POST['loginid'],$_POST['password']); 
     47    if (!$isLogin) { 
    4548        $message = _text('아이디 또는 비밀번호가 틀렸습니다.'); 
    4649        if (!doesHaveMembership() && isLoginId($owner, $_POST['loginid'])) 
    4750            $showPasswordReset = true; 
     51    } 
     52    else if($isLogin == 2){ 
     53        $message=_t('권한이 없습니다.'); 
    4854    } 
    4955} 
  • branches/1.5/blog/owner/center/dashboard/index.php

    r3144 r3313  
    458458} 
    459459 
     460// 팀블로그 :: 관리자 권한이 없으면 센터를 편집할수없다. 
     461 
     462if(!empty($ac)){ 
     463 
    460464if (!isset($_REQUEST['edit'])) { 
    461465?> 
     
    508512} 
    509513 
     514} // End TeamBlog 
     515 
    510516require ROOT . '/lib/piece/owner/footer.php'; 
    511517?> 
  • branches/1.5/blog/owner/entry/delete/index.php

    r3124 r3313  
    1212requireStrictRoute(); 
    1313foreach(explode(',', $_POST['targets']) as $target) { 
     14    // TeamBlog check 
     15    if(empty($pc)){ 
     16        $isPosting = DBQuery::queryCell("SELECT team FROM {$database['prefix']}TeamEntryRelations WHERE owner='$owner' and team='".$_SESSION['admin']."' and id='".$suri['id']."'" ); 
     17        if(empty($isPosting)) { 
     18            respondResultPage(-1); 
     19            exit; 
     20        } 
     21    } 
     22    // End TeamBlog 
     23     
    1424    if (!deleteEntry($owner, $target)) 
    1525        respondResultPage(-1); 
  • branches/1.5/blog/owner/entry/delete/item.php

    r3124 r3313  
    88 
    99$isAjaxRequest = checkAjaxRequest(); 
     10 
     11// TeamBlog check. 
     12if(empty($pc)){ 
     13    $isPosting = DBQuery::queryCell("SELECT team FROM {$database['prefix']}TeamEntryRelations WHERE owner='".$owner."' and team='".$_SESSION['admin']."' and id='".$suri['id']."'" ); 
     14    if(empty($isPosting)) { 
     15        respondResultPage(-1); 
     16        exit; 
     17    } 
     18} 
     19// End TeamBlog 
    1020 
    1121if ($isAjaxRequest) { 
  • branches/1.5/blog/owner/entry/edit/item.php

    r3225 r3313  
    2929    $isKeyword = ($entry['category'] == -1); 
    3030} 
     31 
     32 
     33// 팀블로그 :: 현재 포스트를 내가 편집할 수 있는지 권한확인 
     34if(empty($pc) && !empty($suri['id'])){ 
     35    $isPosting = DBQuery::queryCell("SELECT Team FROM {$database['prefix']}TeamEntryRelations WHERE Owner='$owner' and Team='$_SESSION[admin]' and Id='$suri[id]' " ); 
     36    if(empty($isPosting)) { @header("location:".$blogURL ."/owner/entry"); exit; } 
     37} 
     38// End TeamBlog 
    3139 
    3240if (isset($_GET['popupEditor'])) { 
     
    659667                                                    <div id="status-protected" class="status-protected"<?php if($isKeyword) echo _t('style="display: none"');?>><input type="radio" id="visibility_protected" class="radio" name="visibility" value="1"<?php echo (abs($entry['visibility']) == 1 ? ' checked="checked"' : '');?> /><label for="visibility_protected"><?php echo _t('보호');?></label></div> 
    660668                                                    <div id="status-public" class="status-public"><input type="radio" id="visibility_public" class="radio" name="visibility" value="2"<?php echo (abs($entry['visibility']) == 2 ? ' checked="checked"' : '');?> /><label for="visibility_public"><?php echo _t('공개');?></label></div> 
    661                                                     <div id="status-syndicated" class="status-syndicated"<?php if($isKeyword) echo _t('style="display: none"');?>><input type="radio" id="visibility_syndicated" class="radio" name="visibility" value="3"<?php echo $countResult == false ? ' onclick="viewWhatIsEolin()"' : NULL; echo (abs($entry['visibility']) == 3 ? ' checked="checked"' : '');?> /><label for="visibility_syndicated"><?php echo _t('발행');?><?php echo $countResult == true ? ' (<a href="#void" onclick="viewWhatIsEolin()">'._t('설명').'</a>)' : NULL;?></label></div> 
     669                                                    <div id="status-syndicated" class="status-syndicated"<?php if($isKeyword) echo _t('style="display: none"');?>><input type="radio" id="visibility_syndicated" class="radio" name="visibility" value="3"<?php echo $countResult == false ? ' onclick="viewWhatIsEolin();return false;"' : NULL; echo (abs($entry['visibility']) == 3 ? ' checked="checked"' : '');?> /><label for="visibility_syndicated"><?php echo _t('발행');?><?php echo $countResult == true ? ' (<a href="#void" onclick="viewWhatIsEolin()">'._t('설명').'</a>)' : NULL;?></label></div> 
    662670                                                </dd> 
    663671                                            </dl> 
  • branches/1.5/blog/owner/entry/visibility/item.php

    r3124 r3313  
    1414require ROOT . '/lib/includeForBlogOwner.php'; 
    1515requireStrictRoute(); 
     16 
     17// TeamBlog ACL check whether or not current user can edit this post. 
     18if(empty($pc) && !empty($suri['id'])){ 
     19    $isPosting = DBQuery::queryCell("SELECT team FROM {$database['prefix']}TeamEntryRelations WHERE owner='".$owner."' and team='".$_SESSION['admin']."' and id='".$suri['id']."'" ); 
     20    if(empty($isPosting)) { 
     21        exit; 
     22    } 
     23} 
     24// End TeamBlog 
    1625 
    1726//$isAjaxRequest = checkAjaxRequest(); 
  • branches/1.5/blog/owner/setting/account/index.php

    r3144 r3313  
    228228?>                          //]]> 
    229229                        </script> 
    230                          
     230 
     231 
     232<?php 
     233// Teamblog :: Get username. 
     234 $teamblog_user = DBQuery::queryRow("SELECT name, loginid  
     235     FROM {$database['prefix']}Users  
     236     WHERE userid='".$_SESSION['admin']."'"); 
     237// End TeamBlog 
     238?> 
     239 
     240 
    231241                        <div id="part-setting-account" class="part"> 
    232242                            <h2 class="caption"><span class="main-text"><?php echo _t('회원정보를 관리합니다');?></span></h2> 
     
    239249                                        <dl id="blogger-name-line" class="line"> 
    240250                                            <dt><label for="nickname"><?php echo _t('필명');?></label></dt> 
    241                                             <dd><input type="text" id="nickname" class="input-text" value="<?php echo htmlspecialchars($user['name']);?>" onkeydown="if(event.keyCode == 13) save();" /></dd> 
     251                                            <dd><input type="text" id="nickname" class="input-text" value="<?php echo htmlspecialchars($teamblog_user['name']);?>" onkeydown="if(event.keyCode == 13) save();" /></dd> 
    242252                                        </dl> 
    243253                                        <dl id="blogger-email-line" class="line"> 
    244254                                            <dt><label for="email"><?php echo _t('e-mail');?></label></dt> 
    245255                                            <dd> 
    246                                                 <input type="text" id="email" class="input-text" value="<?php echo htmlspecialchars(User::getEmail());?>" /> 
     256                                                <input type="text" id="email" class="input-text" value="<?php echo htmlspecialchars($teamblog_user['loginid']);?>" /> 
    247257                                                <em><?php echo _t('(로그인시 ID로 사용됩니다)');?></em> 
    248258                                            </dd> 
     
    281291                                 
    282292<?php 
    283 if (($service['type'] != 'single') && (getUserId() == 1)) { 
     293if (($service['type'] != 'single') && (getUserId() == 1) && ($_SESSION['admin'] == 1)) { 
    284294    $urlRule = getBlogURLRule(); 
    285295?> 
  • branches/1.5/blog/owner/setting/account/invite/index.php

    r3124 r3313  
    1919    respondResultPage(false); 
    2020$result = addUser($_POST['email'], $_POST['name'], $_POST['identify'], $_POST['comment'], $_POST['senderName'], $_POST['senderEmail']); 
     21 
    2122respondResultPage($result); 
    2223?> 
  • branches/1.5/blog/owner/setting/account/password/index.php

    r3124 r3313  
    1212require ROOT . '/lib/includeForBlogOwner.php'; 
    1313requireStrictRoute(); 
    14 if (changePassword($owner, $_POST['pwd'], $_POST['prevPwd'])) { 
     14if (changePassword($_SESSION['admin'], $_POST['pwd'], $_POST['prevPwd'])) { 
    1515    respondResultPage(0); 
    1616} 
  • branches/1.5/blog/owner/setting/account/profile/index.php

    r3124 r3313  
    66$IV = array( 
    77    'POST' => array( 
    8         'email' => array('email'), 
    9         'nickname' => array('string') 
     8        'userid'=>array('id') 
    109    ) 
    1110); 
    1211require ROOT . '/lib/includeForBlogOwner.php'; 
    1312requireStrictRoute(); 
    14 if (changeSetting($owner, $_POST['email'], $_POST['nickname'])) { 
     13if (changeSetting($_SESSION['admin'], $_POST['email'], $_POST['nickname'])) { 
    1514    respondResultPage(0); 
    1615} 
  • branches/1.5/components/Textcube.Control.Auth.php

    r3124 r3313  
    77        global $database, $owner; 
    88        $loginid = mysql_tt_escape_string($loginid); 
    9         $result = mysql_query("SELECT userid FROM {$database['prefix']}Users WHERE userid = $owner AND loginid = '$loginid' AND password = '" . md5($password) . "'"); 
     9        $result = mysql_query("SELECT a.userid FROM {$database['prefix']}Users a, {$database['prefix']}Teamblog b WHERE b.teams = $owner AND a.userid=b.userid AND a.loginid = '$loginid' AND a.password = '" . md5($password) . "'"); 
    1010        if ($result && (mysql_num_rows($result) == 1)) { 
    1111            mysql_query("UPDATE {$database['prefix']}Users SET lastLogin = UNIX_TIMESTAMP() WHERE loginid = '$loginid'"); 
  • branches/1.5/components/Textcube.Core.php

    r3124 r3313  
    3636    } 
    3737} 
     38 
     39 
     40class teamblogUser{ 
     41    function name(){ 
     42        requireComponent('Eolin.PHP.Core'); 
     43        global $database, $owner, $entry; 
     44 
     45        $res = DBQuery::queryRow("SELECT * FROM ".$database['prefix']."Teamblog  
     46                WHERE teams='$owner' AND userid='$owner' " ); 
     47     
     48        $is_style = $res['font_style'] & 1;  
     49        $is_admin = $res['font_style'] & 2;  
     50        $font_style = $res['font_style'] & 4; 
     51        $isname = $res['font_style'] & 8; 
     52        $is_ch = $res['font_style'] & 16; 
     53        $name = array(4); 
     54        $name[0] = ''; 
     55        $name[1] = ''; 
     56        $name[2] = 0; 
     57        $name[3] = ''; 
     58  
     59        $styleS = ''; 
     60        $styleE = ''; 
     61        if(!isset($_SESSION['admin'])) $_SESSION['admin'] = $owner; 
     62 
     63        $ttmp = DBQuery::queryRow("SELECT *  
     64                FROM ".$database['prefix']."Teamblog  
     65                WHERE teams='".$owner."'  
     66                    and userid='".$_SESSION['admin']."'"); 
     67        $stmp = DBQuery::queryRow("SELECT *  
     68                FROM ".$database['prefix']."TeamEntryRelations  
     69                WHERE owner='".$owner."'  
     70                    and id='".$entry['id']."'"); 
     71        $itmp = DBQuery::queryRow("SELECT a.*, b.name  
     72                FROM {$database['prefix']}Teamblog a,  
     73                    {$database['prefix']}Users b  
     74                WHERE a.teams='".$owner."'  
     75                    AND a.userid='".$stmp['team']."'  
     76                    AND a.userid=b.userid"); 
     77  
     78        if(empty($font_style)){ 
     79            if(empty($is_style)){ 
     80