Changeset 3425

Show
Ignore:
Timestamp:
06/10/07 18:09:50 (18 months ago)
Author:
inureyes
Message:

#408

  • 헤더 메뉴에 acl 도입
  • 팀블로그 메뉴를 acl 기반으로 새로 짤 준비 및 테스트.
  • acl component 관련 변수명 오타들 수정
Location:
trunk
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/blog/checkup/index.php

    r3424 r3425  
    482482            teams int(11) NOT NULL default 0, 
    483483            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, 
     484            acl int(11) NOT NULL default 0, 
    487485            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, 
    493486            created int(11) NOT NULL default 0, 
    494487            lastLogin int(11) NOT NULL default 0, 
     
    502495            if ($users = $query->getAll('userid, name, created')) { 
    503496                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')"); 
     497                    DBQuery::execute("INSERT INTO `{$database['prefix']}Teamblog` VALUES('".$user['userid']."', '".$user['userid']."','9', '".$user['name']."','".$user['created']."', '0')"); 
    505498                } 
    506499            } 
     
    558551} 
    559552 
    560 if (DBQuery::queryExistence("DESC {$database['prefix']}Teamblog font_color")) { 
     553if (DBQuery::queryExistence("DESC {$database['prefix']}Teamblog enduser")) { 
    561554    $changed = true; 
    562555    echo '<li>', _text('팀블로그 테이블의 유저 출력 설정 필드를 삭제합니다.'), ': '; 
    563556    if(DBQuery::execute("ALTER TABLE {$database['prefix']}Teamblog DROP logo") && 
     557    DBQuery::execute("ALTER TABLE {$database['prefix']}Teamblog DROP enduser") && 
     558    DBQuery::execute("ALTER TABLE {$database['prefix']}Teamblog DROP admin") && 
     559    DBQuery::execute("ALTER TABLE {$database['prefix']}Teamblog DROP posting") && 
    564560    DBQuery::execute("ALTER TABLE {$database['prefix']}Teamblog DROP font_style") && 
    565561    DBQuery::execute("ALTER TABLE {$database['prefix']}Teamblog DROP font_color") && 
    566562    DBQuery::execute("ALTER TABLE {$database['prefix']}Teamblog DROP font_size") && 
    567     DBQuery::execute("ALTER TABLE {$database['prefix']}Teamblog DROP font_bold")) 
     563    DBQuery::execute("ALTER TABLE {$database['prefix']}Teamblog DROP font_bold") && 
     564    DBQuery::execute("ALTER TABLE {$database['prefix']}Teamblog ADD acl int(11) not null AFTER userid")) 
    568565        echo '<span style="color:#33CC33;">', _text('성공'), '</span></li>'; 
    569566    else 
  • trunk/blog/owner/setting/account/index.php

    r3424 r3425  
    240240 
    241241                        <div id="part-setting-account" class="part"> 
    242                             <h2 class="caption"><span class="main-text"><?php echo _t('회원정보를 관리합니다');?></span></h2> 
     242                            <h2 class="caption"><span class="main-text"><?php echo _t('팀블로그 구성원 목록');?></span></h2> 
    243243                             
    244244                            <div class="data-inbox"> 
  • trunk/blog/owner/setting/teamblog/index.php

    r3424 r3425  
    2828                                    sInString = sInString.replace( /^\s+/g, "" );// strip leading 
    2929                                    return sInString.replace( /\s+$/g, "" );// strip trailing 
    30                                 } 
    31                                  
    32                                 function Trim(sInString) { 
    33                                     sInString = sInString.replace( /^\s+/g, "" );// strip leading 
    34                                     return sInString.replace( /\s+$/g, "" );// strip trailing 
    35                                 } 
    36                                  
    37                                 function saveName() { 
    38                                     try{ 
    39                                         var Astyle = document.getElementById('admin_style'); 
    40                                         var Apos = document.getElementById('stylePos'); 
    41                                         var Ais_style = document.getElementById('is_style'); 
    42                                          
    43                                         var Sbold = document.getElementById('font_bold'); 
    44                                         var Sitalic = document.getElementById('font_i'); 
    45                                         var Ssize = document.getElementById('font_size'); 
    46                                         var Scolor = document.getElementById('font_color'); 
    47  
    48                                         var request = new HTTPRequest("POST", "<?php echo $blogURL;?>/owner/setting/teamblog/nameStyle/"); 
    49                                         request.onSuccess = function() { 
    50                                             PM.showMessage("<?php echo _t('저장되었습니다.');?>", "center", "bottom"); 
    51                                         } 
    52                                         request.onError = function() { 
    53                                             alert("<?php echo _t('저장하지 못했습니다.');?>"); 
    54                                         } 
    55                                          
    56                                         var SendValue; 
    57                                         SendValue = "&bold=" + encodeURIComponent(Sbold.checked); 
    58                                         SendValue += "&italic=" + encodeURIComponent(Sitalic.checked); 
    59                                         SendValue += "&size=" + encodeURIComponent(Ssize.value); 
    60                                         SendValue += "&color=" + encodeURIComponent(Scolor.value); 
    61                                          
    62                                         if(Astyle){ 
    63                                             SendValue += "&style=" + encodeURIComponent(Astyle.checked); 
    64                                         } 
    65                                         if(Apos){ 
    66                                             SendValue += "&pos=" + encodeURIComponent(Apos.value); 
    67                                         } 
    68                                         if(Ais_style){ 
    69                                             SendValue += "&is_style=" + encodeURIComponent(Ais_style.checked); 
    70                                         } 
    71                                          
    72                                         request.send(SendValue); 
    73                                     }catch(e){ 
    74                                     } 
    7530                                } 
    7631 
     
    298253                                    if(mycheck == 0) alert("선택된 사용자가 없습니다."); 
    299254                                } 
    300 <?php 
    301 }?>                         //]]> 
     255 
     256                                function buttonchange(){ 
     257                                    if( document.getElementById('target-role').value == 'delete'){ 
     258                                        document.getElementById('apply-button').value = '<?php echo _t('탈퇴');?>'; 
     259                                    } else { 
     260                                        document.getElementById('apply-button').value = '<?php echo _t('적용');?>'; 
     261                                    } 
     262                                } 
     263<?php 
     264} 
     265?> 
     266                        //]]> 
    302267                        </script> 
    303268 
    304  
     269                        <div id="part-setting-account" class="part"> 
     270                            <h2 class="caption"><span class="main-text"><?php echo _t('팀블로그를 관리합니다');?></span></h2> 
     271                            <div id="list-section" class="section"> 
     272                                <table cellspacing="0" cellpadding="0"> 
     273                                    <thead> 
     274                                        <tr> 
     275                                            <th class="status"><input type="checkbox" name="Aclick" onclick="Check_rev()"></th> 
     276                                            <th class="acl"><span class="text"><?php echo _t('권한 ');?></span></th> 
     277                                            <th class="name"><span class="text"><?php echo _t('이름 ');?></span></th> 
     278                                            <th class="blog"><span class="text"><?php echo _t('대표 블로그');?></span></th>                                           
     279                                            <th class="email"><span class="text"><?php echo _t('이메일');?></span></th> 
     280                                            <th class="date"><span class="text"><?php echo _t('가입일');?></span></th> 
     281                                            <th class="date"><span class="text"><?php echo _t('작성한 글 수');?></span></th> 
     282                                            <th class="cancel"><span class="text"><?php echo _t('초대취소');?></span></th> 
     283                                        </tr> 
     284                                    </thead> 
     285                                    <tbody> 
    305286<?php 
    306287    $teamblog_owner = DBQuery::queryRow("SELECT * FROM {$database['prefix']}Teamblog  
     
    308289                AND teams='".$owner."'"); 
    309290    $teamblog_user = DBQuery::queryRow("SELECT a.*, b.name  
    310             FROM {$database['prefix']}Teamblog a, {$database['prefix']}Users b   
     291            FROM {$database['prefix']}Teamblog a,  
     292                {$database['prefix']}Users b   
    311293            WHERE a.userid = '".$_SESSION['admin']."'  
    312294                AND a.teams = '".$_SESSION['userid']."'  
    313295                AND b.userid = a.userid"); 
    314     $invited_user = DBQuery::queryAll("SELECT a.*, b.*  
    315         FROM {$database['prefix']}Teamblog a,  
    316             {$database['prefix']}Users b  
    317         WHERE teams = '$owner'  
    318             AND b.userid = a.userid  
    319             AND a.userid != '$owner' 
    320         ORDER BY b.created DESC");  
    321 ?> 
    322                         <div id="part-setting-account" class="part"> 
    323                             <h2 class="caption"><span class="main-text"><?php echo _t('팀블로그를 관리합니다');?></span></h2> 
    324                             <div id="list-section" class="section"> 
    325                                 <dl> 
    326                                     <dt class="title"><span class="label"><?php echo _t('팀원 명단');?></span></dt> 
    327                                     <dd> 
    328                                         <table cellspacing="0" cellpadding="0"> 
    329                                             <thead> 
    330                                                 <tr> 
    331                                                     <th class="status"><input type="checkbox" name="Aclick" onclick="Check_rev()"></th> 
    332                                                     <th class="email"><span class="text"><?php echo _t('이름 (e-mail)');?></span></th> 
    333                                                     <th class="date"><span class="text"><?php echo _t('초대일');?></span></th> 
    334                                                     <th class="status"><span class="text"><?php echo _t('경과');?></span></th> 
    335                                                     <th class="password"><span class="text"><?php echo _t('비밀번호');?> / <?php echo _t('권한 관리');?></span></th> 
    336                                                     <th class="cancel"><span class="text"><?php echo _t('초대취소');?></span></th> 
    337                                                 </tr> 
    338                                             </thead> 
    339                                             <tbody> 
    340 <?php 
     296    $invited_user = DBQuery::queryAll("SELECT t.*, u.*  
     297        FROM {$database['prefix']}Teamblog t,  
     298            {$database['prefix']}Users u  
     299        WHERE t.teams = '$owner'  
     300            AND u.userid = t.userid  
     301            AND t.userid != '$owner' 
     302        ORDER BY u.created DESC");  
     303 
    341304    $count=0; 
     305 
    342306    if(isset($invited_user)) { 
    343307        foreach($invited_user as $value) { 
    344             $className=($count%2)==1?'even-line':'odd-line'; 
    345             $className.=($count==sizeof($invited_user)-1)?' last-line':''; 
     308            $className= ($count%2)==1 ? 'even-line' : 'odd-line'; 
     309            $className.=($count==sizeof($invited_user)-1) ? ' last-line':''; 
    346310?> 
    347311                                                <tr class="<?php echo $className;?> inactive-class"> 
    348312                                                    <td class="status"><input type="checkbox" id="check_<?php echo $count; ?>"><input type="hidden" name="chh<?php echo $count; ?>" value="<?php echo $value['userid']; ?>"><input type="hidden" name="cht<?php echo $count; ?>" value="<?php if($value['last'] == '0' && $value['lastLogin'] =='0') echo "0"; else echo "1"; ?>"></td> 
    349                                                     <td class="email"><?php     echo htmlspecialchars($value['name']);?>(<?php echo htmlspecialchars($value['loginid']);?>)</td> 
    350                                                     <td class="date"><?php echo Timestamp::format5($value['create']);?></td> 
     313                                                    <td class="acl">test</td> 
     314                                                    <td class="name"><?php echo $value['name'];?></td> 
     315                                                    <td class="blog">test</td> 
     316                                                    <td class="email"><?php     echo  htmlspecialchars($value['loginid']);?></td> 
     317                                                    <td class="date"><?php echo Timestamp::format5($value['created']);?></td> 
     318                                                    <td class="posting"><?php echo $value['posting'];?></td> 
    351319<?php 
    352320            if($value['lastLogin'] == 0) { 
    353 ?> 
    354                                                     <td class="status"><?php echo _f('%1 전',timeInterval($value['created'],time()));?></td> 
    355                                                     <td class="password"><?php echo DBQuery::queryCell("SELECT password FROM {$database['prefix']}Users WHERE userid = {$value['userid']} AND host = $owner AND lastLogin = 0");?></td> 
    356                                                     <?php if($value['lastLogin'] == 0){ ?><td class="cancel"><a class="cancel-button button" href="#void" onclick="cancelInvite(<?php   echo $value['userid'];?>);return false;" title="<?php echo _t('초대에 응하지 않은 사용자의 계정을 삭제합니다.');?>"><span class="text"><?php echo _t('초대취소');?></span></a></td> 
    357                                                     <?php } else{ ?><td class="cancel"><a class="cancel-button button" href="#void" onclick="deleteUser(<?php   echo $value['userid'];?>,0);return false;" title="<?php echo _t('초대에 응하지 않은 사용자의 계정을 삭제합니다.');?>"><span class="text"><?php echo _t('초대 취소');?></span></a></td> 
    358                                                         <?php } ?> 
    359 <?php 
     321                if($value['lastLogin'] == 0) {  
     322?> 
     323                                                    <td class="cancel"><a class="cancel-button button" href="#void" onclick="cancelInvite(<?php echo $value['userid'];?>);return false;" title="<?php echo _t('초대에 응하지 않은 사용자의 계정을 삭제합니다.');?>"><span class="text"><?php echo _t('초대취소');?></span></a></td> 
     324<?php 
     325                } else { 
     326?> 
     327                                                    <td class="cancel"><a class="cancel-button button" href="#void" onclick="deleteUser(<?php   echo $value['userid'];?>,0);return false;" title="<?php echo _t('초대에 응하지 않은 사용자의 계정을 삭제합니다.');?>"><span class="text"><?php echo _t('초대 취소');?></span></a></td> 
     328<?php 
     329                }  
    360330            } else { 
    361331                $pblog = $value['enduser'] - $value['userid']; 
     
    397367?> 
    398368                                            </tbody> 
    399 <?php  
    400     if($count) { 
    401 ?> 
    402                                             <tr> 
    403                                                 <td colspan="6"><input type="button" value="<?php echo _t('선택된 사용자 삭제');?>" onclick="deleteSelectedUsers(<?php echo $count;?>)";></td> 
    404                                             </tr> 
    405 <?php 
    406     } 
    407 ?> 
    408369                                        </table> 
    409                                     </dd> 
    410                                 </dl> 
     370                            </div> 
     371                             
     372                            <div id="role-action" class="part" > 
     373                                <span class="text" >선택한 구성원을 </span> 
     374                                <select name="t-role" id="target-role" onchange="buttonchange();" > 
     375                                    <option value=''>행동을 지정합니다</option> 
     376                                    <optgroup label="다음 권한으로 변경합니다"> 
     377                                        <option value='manager'>관리자</option> 
     378                                        <option value='editor'>편집자</option> 
     379                                        <option value='writer'>필자</option> 
     380                                    </optgroup> 
     381                                    <optgroup label="탈퇴 처리 합니다"> 
     382                                        <option value='delete'>탈퇴</option> 
     383                                    </optgroup> 
     384                                </select> 
     385                                <input type="submit" id="apply-button" class="apply-button input-button" value="적용"  /> 
    411386                            </div> 
    412387                        </div> 
     388 
     389                         
     390                         
     391                         
     392                         
    413393<?php 
    414394if($owner == $_SESSION['admin'] && empty($enduser)) { 
  • trunk/components/Textcube.Core.php

    r3416 r3425  
    5151/* Access Control Object: i.e. uri, components, functions */ 
    5252class Aco { 
    53     var $predefiend; 
     53    var $predefined; 
    5454 
    5555    function Aco( $predefined = null ) { 
     
    7474        } 
    7575 
    76         /* Adujsting access controll object from plugins */ 
     76        /* Adjusting access control object from plugins */ 
    7777        $aco = Aco::adjust($aco, $aco_action); 
    7878 
    79         /* Adujsting required object from plugins by aco*/ 
     79        /* Adjusting required object from plugins by aco*/ 
    8080        $aro = Aro::adjust($aco, $aco_action); 
    8181 
     
    166166                WHERE teams='$owner' AND userid='$owner' " ); 
    167167     
    168         $is_style = $res['font_style'] & 1;  
    169         $is_admin = $res['font_style'] & 2;  
    170         $font_style = $res['font_style'] & 4; 
    171         $isname = $res['font_style'] & 8; 
    172         $is_ch = $res['font_style'] & 16; 
    173168        $name = array(4); 
    174169        $name[0] = ''; 
  • trunk/lib/auth.php

    r3416 r3425  
    4040             
    4141            // 팀블로그 :: 로그인 성공시 로그인한 시간을 DB 에 기록한다. 
    42             DBQuery::execute("UPDATE  {$database['prefix']}Teamblog SET last = unix_timestamp() WHERE teams='$owner' AND userid='$session[userid]'"); 
     42            DBQuery::execute("UPDATE  {$database['prefix']}Teamblog SET last = unix_timestamp() WHERE teams='$owner' AND userid='".$session['userid']); 
    4343            // End TeamBlog 
    4444             
     
    120120     
    121121    // 팀블로그 :: 팀원 확인 
    122     $result=DBQuery::query("select a.userid from {$database['prefix']}Users a, {$database['prefix']}Teamblog b where b.teams = $userid and a.loginid = '$loginid' and b.userid=a.userid"); 
     122    $result=DBQuery::query("select a.userid  
     123            from {$database['prefix']}Users a,  
     124                {$database['prefix']}Teamblog b  
     125            where b.teams = $userid  
     126                and a.loginid = '$loginid'  
     127                and b.userid=a.userid"); 
    123128    // End TeamBlog 
    124129     
  • trunk/lib/piece/owner/contentMenu.php

    r3372 r3425  
    33    switch($blogMenu['topMenu']) { 
    44        case 'center': 
    5             if(!empty($ac)){ 
     5            if(Acl::Check('group.administrators')){ 
    66                $blogContentMenuItem = array( 
    77                    array('menu'=>'dashboard','title'=>_t('조각보'),'link'=>'/owner/center/dashboard'), 
     
    2020        break; 
    2121        case 'entry': 
    22             if(!empty($pc)){ 
     22            if(Acl::Check('group.blogwriters')){ 
    2323                $blogContentMenuItem = array( 
    2424                    array('menu'=>'post','title'=>_t('글쓰기'),'link'=>'/owner/entry/post'), 
     
    3030                    array('menu'=>'trash','title'=>_t('휴지통'),'link'=>'/owner/entry/trash') 
    3131                ); 
    32             } 
    33             else{ 
     32            } else { 
    3433                $blogContentMenuItem = array( 
    3534                    array('menu'=>'post','title'=>_t('글쓰기'),'link'=>'/owner/entry/post'), 
     
    3938        break; 
    4039        case 'link': 
    41         if(!empty($ac)){ 
     40        if(Acl::Check('group.administrators')){ 
    4241            $blogContentMenuItem = array( 
    4342                array('menu'=>'add','title'=>_t('링크 추가'),'link'=>'/owner/link/add'), 
     
    4746        break; 
    4847        case 'skin': 
    49         if(!empty($ac)){ 
     48        if(Acl::Check('group.administrators')){ 
    5049            $blogContentMenuItem = array( 
    5150                array('menu'=>'skin','title'=>_t('스킨 선택'),'link'=>'/owner/skin'), 
     
    5756        break; 
    5857        case 'plugin': 
    59         if(!empty($ac)){ 
     58        if(Acl::Check('group.administrators')){ 
    6059            $blogContentMenuItem = array( 
    6160                array('menu'=>'plugin','title'=>_t('플러그인 목록'),'link'=>'/owner/plugin'), 
     
    6665        case 'setting': 
    6766        case 'data': 
    68         if(!empty($ac)){ 
     67        if($service['type']=='single'){ 
     68            $blogContentMenuItem = array( 
     69                array('menu'=>'blog','title'=>_t('블로그'),'link'=>'/owner/setting/blog'), 
     70                array('menu'=>'entry','title'=>_t('글 작성'),'link'=>'/owner/setting/entry'), 
     71                array('menu'=>'account','title'=>_t('계정 정보'),'link'=>'/owner/setting/account'), 
     72                array('menu'=>'filter','title'=>_t('스팸 필터'),'link'=>'/owner/setting/filter'), 
     73                array('menu'=>'data','title'=>_t('데이터 관리'),'link'=>'/owner/data') 
     74            ); 
     75        } else if(Acl::Check('group.administrators')){ 
    6976            $blogContentMenuItem = array( 
    7077                array('menu'=>'blog','title'=>_t('블로그'),'link'=>'/owner/setting/blog'), 
  • trunk/lib/piece/owner/header.php

    r3355 r3425  
    1414} 
    1515 
    16 if(!empty($ac)){ 
     16if(Acl::Check('group.administrators')){ 
    1717    $blogTopMenuItem = array( 
    1818        array('menu'=>'center','title'=>_t('센터'),'link'=>'/owner/center/dashboard'), 
  • trunk/setup.php

    r3406 r3425  
    13451345  teams int(11) NOT NULL default 0, 
    13461346  userid int(11) NOT NULL default 1, 
    1347   enduser int(11) NOT NULL default 0, 
    1348   admin int(11) NOT NULL default 0, 
    1349   posting int(11) NOT NULL default 0, 
    1350   profile text NULL default '', 
    1351   logo varchar(15) default '', 
    1352   font_style int(11) NOT NULL default 0, 
    1353   font_color varchar(10) NOT NULL default '#000000', 
    1354   font_size int(11) NOT NULL default 10, 
    1355   font_bold int(11) NOT NULL default 0, 
     1347  acl int(11) NOT NULL default 0, 
    13561348  created int(11) NOT NULL default 0, 
    13571349  lastLogin int(11) NOT NULL default 0, 
     
    13671359INSERT INTO {$_POST['dbPrefix']}Users VALUES (1, '$loginid', '$password', '$name', UNIX_TIMESTAMP(), 0, 0); 
    13681360INSERT INTO {$_POST['dbPrefix']}UserSettings VALUES (1, 'defaultEditor', 'modern'), (1, 'defaultFormatter', 'ttml'); 
    1369 INSERT INTO {$_POST['dbPrefix']}Teamblog VALUES (1, 1, 1, 1, 1, '', '', 0, '#000000', 10, 0, UNIX_TIMESTAMP(), 0); 
     1361INSERT INTO {$_POST['dbPrefix']}Teamblog VALUES (1, 1, 9, UNIX_TIMESTAMP(), 0); 
    13701362INSERT INTO {$_POST['dbPrefix']}ServiceSettings (name, value) VALUES ('newlineStyle', '1.1');  
    13711363INSERT INTO {$_POST['dbPrefix']}BlogSettings (owner, name, language, blogLanguage, timezone) VALUES (1, '$blog', '$baseLanguage', '$baseLanguage', '$baseTimezone');