Changeset 5220
- Timestamp:
- 02/11/08 03:12:26 (9 months ago)
- Location:
- trunk
- Files:
-
- 6 modified
-
components/Textcube.Core.php (modified) (1 diff)
-
interface/owner/control/action/blog/changeOwner/index.php (modified) (2 diffs)
-
interface/owner/control/blog/detail/index.php (modified) (1 diff)
-
interface/owner/control/user/detail/index.php (modified) (2 diffs)
-
lib/model/blog.teamblog.php (modified) (1 diff)
-
script/control.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/components/Textcube.Core.php
r5194 r5220 194 194 } 195 195 } 196 197 function deleteUser($userid) { 198 global $database; 199 if ($userid == 1) 200 return false; 201 if (!isset($userid)) 202 return false; 203 $blogs = User::getOwnedBlogs($userid); 204 $sql = "UPDATE `{$database['prefix']}Comments` SET replier = NULL WHERE replier = ".$userid; 205 POD::execute($sql); 206 foreach ($blogs as $ownedBlog) { 207 changeBlogOwner($ownedBlog,1); // 관리자 uid로 변경 208 } 209 $blogs = User::getBlogs($userid); 210 foreach ($blogs as $joinedBlog) { 211 deleteTeamblogUser($userid,$joinedBlog); 212 } 213 deleteUser($userid); 214 return true; 215 } 196 216 } 197 217 -
trunk/interface/owner/control/action/blog/changeOwner/index.php
r5107 r5220 3 3 /// All rights reserved. Licensed under the GPL. 4 4 /// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) 5 require ROOT . '/lib/includeForBlogOwner.php';6 5 7 6 $IV = array( … … 11 10 ) 12 11 ); 12 13 require ROOT . '/lib/includeForBlogOwner.php'; 13 14 requireStrictRoute(); 14 15 15 $blogid=$_GET['blogid']; 16 $userid=$_GET['owner']; 17 18 $sql = "UPDATE `{$database['prefix']}Teamblog` SET acl = 3 WHERE blogid = ".$blogid." and acl = " . BITWISE_OWNER; 19 POD::execute($sql); 20 21 $acl = POD::queryCell("SELECT acl FROM {$database['prefix']}Teamblog WHERE blogid='$blogid' and userid='$userid'"); 22 23 if( $acl === null ) { // If there is no ACL, add user into the blog. 24 POD::query("INSERT INTO `{$database['prefix']}Teamblog` 25 VALUES('$blogid', '$userid', '".BITWISE_OWNER."', UNIX_TIMESTAMP(), '0')"); 16 if (changeBlogOwner($_GET['blogid'],$_GET['owner'])) { 17 return respond::ResultPage(true); 26 18 } 27 else { 28 $sql = "UPDATE `{$database['prefix']}Teamblog` SET acl = ".BITWISE_OWNER." 29 WHERE blogid = ".$blogid." and userid = " . $userid; 30 POD::execute($sql); 31 } 32 33 respond::PrintResult(array('error' => 0)); 19 respond::ResultPage(false); 34 20 ?> -
trunk/interface/owner/control/blog/detail/index.php
r5129 r5220 121 121 <thead> 122 122 <tr> 123 <th class="name"><?php echo _t(' 사용자');?></th>123 <th class="name"><?php echo _t('Action');?></th> 124 124 </tr> 125 125 </thead> -
trunk/interface/owner/control/user/detail/index.php
r5118 r5220 3 3 /// All rights reserved. Licensed under the GPL. 4 4 /// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) 5 6 $service['admin_script']='control.js'; 5 7 6 8 require ROOT . '/lib/includeForBlogOwner.php'; … … 45 47 </thead> 46 48 <tbody> 49 <tr> 50 <?php echo "<td class=\"name\"><a href=\"".$blogURL."/owner/control/action/user/delete/?userid=" . $userid . "\" onclick = \"cleanUser(".$userid.");return false;\">사용자 삭제</a></td>";?> 51 </tr> 47 52 </tbody> 48 53 </table> -
trunk/lib/model/blog.teamblog.php
r5212 r5220 85 85 return true; 86 86 } 87 88 function changeBlogOwner($blogid,$userid) { 89 global $database; 90 $sql = "UPDATE `{$database['prefix']}Teamblog` SET acl = 3 WHERE blogid = ".$blogid." and acl = " . BITWISE_OWNER; 91 POD::execute($sql); 92 93 $acl = POD::queryCell("SELECT acl FROM {$database['prefix']}Teamblog WHERE blogid='$blogid' and userid='$userid'"); 94 95 if( $acl === null ) { // If there is no ACL, add user into the blog. 96 POD::query("INSERT INTO `{$database['prefix']}Teamblog` 97 VALUES('$blogid', '$userid', '".BITWISE_OWNER."', UNIX_TIMESTAMP(), '0')"); 98 } 99 else { 100 $sql = "UPDATE `{$database['prefix']}Teamblog` SET acl = ".BITWISE_OWNER." 101 WHERE blogid = ".$blogid." and userid = " . $userid; 102 POD::execute($sql); 103 } 104 105 return true; 106 } 87 107 ?> -
trunk/script/control.js
r5185 r5220 373 373 request.send(); 374 374 } 375 376 function cleanUser(uid) { 377 if (!confirm(_t('모든 글과 블로그가 관리자의 소유로 옮겨집니다.') + '\t\n\n' + _t('되돌릴 수 없습니다.') + '\t\n\n' + _t('계속 진행하시겠습니까?'))) return false; 378 var request = new HTTPRequest(blogURL + "/owner/control/action/user/delete/?userid="+uid); 379 request.onSuccess = function() { 380 PM.removeRequest(this); 381 window.location.href = '../'; 382 } 383 request.onError = function() { 384 PM.removeRequest(this); 385 msg = this.getText("/response/result"); 386 alert(_t('사용자 삭제에 실패하였습니다.') + "\r\nError : " + msg); 387 } 388 PM.addRequest(request, _t("사용자 삭제중")); 389 request.send(); 390 } 391 375 392 function ctlRefresh() { 376 393 window.location.reload();
