getPrefixedDBkey() ); // form header $out = '
' . '' . wfMsg( 'grouplevels-editgroup-name' ) . ' '; $out .= wfMsg( 'specialloguserlabel' ) . ' '; // OK button, end of form. $out .= '
'; // congratulations the form is now build return $out; } function getSQL() { $dbr =& wfGetDB( DB_SLAVE ); /* system showing possible actions for users $user = $dbr->tableName( 'user' ); $user_rights = $dbr->tableName( 'user_rights' ); $userspace = Namespace::getUser(); return "SELECT ur_rights as type, $userspace as namespace, user_name as title, " . "user_name as value FROM $user LEFT JOIN $user_rights ON user_id = ur_user"; */ /** Show groups instead */ $user = $dbr->tableName( 'user' ); $group = $dbr->tableName( 'group' ); $user_groups = $dbr->tableName( 'user_groups' ); $userspace = NS_USER; $sql = "SELECT group_name as type, $userspace AS namespace, user_name AS title, user_name as value " . "FROM $user ". "LEFT JOIN $user_groups ON user_id =ug_user " . "LEFT JOIN $group ON ug_group = group_id "; if($this->requestedGroup != '') { $sql .= "WHERE group_id= '" . IntVal( $this->requestedGroup ) . "' "; if($this->requestedUser != '') { $sql .= "AND user_name = " . $dbr->addQuotes( $this->requestedUser ) . ' '; } } else { if($this->requestedUser !='') { $sql .= "WHERE user_name = " . $dbr->addQuotes( $this->requestedUser ) . ' '; } } return $sql; } /** * When calling formatResult we output the previous result instead of the * current one. We need an additional step to flush out the last result. */ function tryLastResult( ) { return true; } function sortDescending() { return false; } function appendGroups($group) { $this->concatGroups .= $group.' '; } function clearGroups() { $this->concatGroups = ''; } /* var $previousResult = false; var $concatGroups = ''; */ function formatResult( $skin, $result ) { global $wgContLang; $name = false; if( is_object( $this->previousResult ) && (is_null( $result ) || ( $this->previousResult->title != $result->title ) ) ) { // Different username, give back name(group1,group2) $name = $skin->makeLink( $wgContLang->getNsText($this->previousResult->namespace) . ':' . $this->previousResult->title, $this->previousResult->title ); $name .= $this->concatGroups ? ' ('.substr($this->concatGroups,0,-1).')' : ''; $this->clearGroups(); } if( is_object( $result ) && $result->type != '') { $this->appendGroups( $skin->makeLink( wfMsgForContent( 'administrators' ), $result->type ) ); } $this->previousResult = $result; return $name; } } /** * constructor */ function wfSpecialListusers() { global $wgRequest; list( $limit, $offset ) = wfCheckLimits(); $slu = new ListUsersPage(); /** * Get some parameters */ $slu->requestedGroup = $wgRequest->getVal('group'); $slu->requestedUser = $wgRequest->getVal('username'); return $slu->doQuery( $offset, $limit ); } ?>