function remove($userid) { $pool = DBModel::getInstance(); if ($userid == 1) { return false; } if (!isset($userid)) { return false; } $blogs = User::getOwnedBlogs($userid); $pool->reset("Comments"); $pool->setAttribute("replier", NULL); $pool->setQualifier("replier", "eq", $userid); $pool->update(); foreach ($blogs as $ownedBlog) { Blog::changeOwner($ownedBlog, 1); // 관리자 uid로 변경 } $blogs = User::getBlogs($userid); foreach ($blogs as $joinedBlog) { Blog::deleteUser($joinedBlog, $userid); } User::removePermanent($userid); return true; }
function remove($userid) { global $database; if ($userid == 1) { return false; } if (!isset($userid)) { return false; } $blogs = User::getOwnedBlogs($userid); $sql = "UPDATE {$database['prefix']}Comments SET replier = NULL WHERE replier = " . $userid; POD::execute($sql); foreach ($blogs as $ownedBlog) { Blog::changeOwner($ownedBlog, 1); // 관리자 uid로 변경 } $blogs = User::getBlogs($userid); foreach ($blogs as $joinedBlog) { Blog::deleteUser($joinedBlog, $userid); } User::removePermanent($userid); return true; }
function changeBlogOwner($blogid, $userid) { return Blog::changeOwner($blogid, $userid); }