public function releaseArticles(&$aids, $langCode, WAPUser &$wu) { if (!empty($aids) && !empty($langCode)) { $aids = array_unique($aids); $ids = "(" . implode(",", $aids) . ")"; $conds = array("ct_page_id IN {$ids}", "ct_lang_code" => $langCode); // If not a staff user, only allow updates to rows which user is assigned to if (!$wu->inGroup('staff')) { $conds["ct_user_id"] = $wu->getId(); } $dbw = wfGetDB(DB_MASTER); $articleTable = $this->getWAPConfig()->getArticleTableName(); $articleTagTable = $this->getWAPConfig()->getArticleTagTableName(); $dbw->update($articleTable, array('ct_completed' => 0, 'ct_reserved_timestamp' => '', 'ct_user_id' => 0, 'ct_user_text' => ''), $conds, __METHOD__); $dbw->update($articleTagTable, array('ca_reserved' => 0), array("ca_page_id IN {$ids}", "ca_lang_code" => $langCode), __METHOD__); } }
public function getViewableTags(WAPUser &$user) { if ($user->inGroup(WAPDB::getInstance($this->dbType)->getWAPConfig()->getWikiHowAdminGroupName())) { return $this->getTags(); } else { $tags = array(); foreach ($this->getTags() as $aTag) { foreach ($user->getTags() as $uTag) { if ($aTag['raw_tag'] == $uTag['raw_tag']) { $tags[] = $aTag; } } } return $tags; } }