daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Jun 5th, 2017 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from util import logger, plugin
  2.  
  3. class MyTestModule(plugin.Plugin):
  4.     name = "User info"
  5.     permission_name = ""
  6.     url = "user_info"
  7.     author = "Me"
  8.     icon = plugin.Icon("key.png")
  9.     version = 0.1
  10.     allowedMethods = ["GET"]
  11.    
  12.  
  13.     def render_GET(self, user, request):
  14.         r = "Username: %s<br>"%user.username
  15.         r+= "Password: %s<br>"%user.password
  16.         r+= "Root: %s<br>"%user.permissions.isRoot()
  17.         r+= "Permissions:<br>"
  18.         if not user.permissions.isRoot():
  19.             for i in user.permissions.perms:
  20.                 # if you are root all permissions are enabled. So ignore the config values.
  21.                 r+=" - %s = %s<br>"%(i.getName(),[["Disabled","Enabled"][i.isEnabled()],"Enabled"][user.permissions.isRoot()])
  22.         else:
  23.             r+= "<i>You are root, all permissions are enabled</i>"
  24.         return r
  25.        
  26.  
  27. plugins = [MyTestModule]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top