def auth(self): #self.log("In auth") while self.usr==None and self.pwd==None: #self.log("Waiting in auth...") time.sleep(.1) self.p=phpBB("http://forum.ubuntu-it.org/") try: self.user_id=self.p.login(self.usr, self.pwd) except: pass if(self.user_id=="1"): self.log("Something went wrong during authentication. Please, check user and password") self.show_settings(error="User or Password Wrong") else: self.log("Authenticated with user n."+self.user_id)
# Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import sys from phpbb import phpBB if __name__ == "__main__": if len(sys.argv) < 2: print(("Usage: %s <limit>" % sys.argv[0])) sys.exit(1) p = phpBB("http://mydomain.com/forum/") p.login("username", "password") limit = int(sys.argv[1]) ulist = p.getUserList(limit) res = list() for u in ulist: r = p.queryJoinIP(u["id"]) if r: r["user"] = u["name"] r["id"] = u["id"] r["posts"] = u["posts"] r["group"] = u["group"] res.append(r) p._table_print( res, [
# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import sys from phpbb import phpBB if __name__ == '__main__': if len(sys.argv) < 2: print(('Usage: %s <limit>' % sys.argv[0])) sys.exit(1) p = phpBB("http://mydomain.com/forum/") p.login("username", "password") limit = int(sys.argv[1]) ulist = p.getUserList(limit) res = list() for u in ulist: r = p.queryJoinIP(u['id']) if r: r['user'] = u['name'] r['id'] = u['id'] r['posts'] = u['posts'] r['group'] = u['group'] res.append(r) p._table_print(res, [('id', 'ID'), ('user', 'User'), ('group', 'Group'), ('posts', 'Posts'), ('user_ip', 'User IP'), ('country_name', 'Country name')])
cfg_opts = [ 'host', 'username', 'password', 'forum_id', 'topic_id', 'message', 'join_msg', 'extra_msg', 'user_agent', 'add_signature', 'ban_tab' ] if __name__ == '__main__': import sys if len(sys.argv) < 3: print(('Usage: %s <config-name> <profile url>' % sys.argv[0])) sys.exit(1) user = int(sys.argv[2]) cfg = Settings('ban.cfg') if cfg.load(sys.argv[1], cfg_opts): forum = phpBB(cfg.host) forum.setUserAgent(cfg.user_agent) if forum.login(cfg.username, cfg.password): username = forum.getUsername(user) print('> Processing user %s\n' % username) posts = forum.searchPosts(user) post_info = None if posts: post_info = forum.queryPostInfo(posts[0]['f'], posts[0]['p']) forum.showPosts(posts) print() if input( 'Do you want to delete those posts? type "delete" to confirm: ' ) == 'delete': print()
"user_agent", "add_signature", "ban_tab", ] if __name__ == "__main__": import sys if len(sys.argv) < 3: print(("Usage: %s <config-name> <profile url>" % sys.argv[0])) sys.exit(1) user = int(sys.argv[2]) cfg = Settings("ban.cfg") if cfg.load(sys.argv[1], cfg_opts): forum = phpBB(cfg.host) forum.setUserAgent(cfg.user_agent) if forum.login(cfg.username, cfg.password): username = forum.getUsername(user) print("> Processing user %s\n" % username) posts = forum.searchPosts(user) post_info = None if posts: post_info = forum.queryPostInfo(posts[0]["f"], posts[0]["p"]) forum.showPosts(posts) print() if input('Do you want to delete those posts? type "delete" to confirm: ') == "delete": print() def callback_msg(post, msg): print("Delete post #%i: %s" % (post, msg))