Did I find the right examples for you? yes no

All Samples(419)  |  Call(419)  |  Derive(0)  |  Import(0)

src/s/e/seo-ranking-engine-HEAD/handlers/pages.py   seo-ranking-engine(Download)
    def get_common_template_values(self):
 
        return({
                'user' : users.get_current_user(),
                'is_admin' : users.is_current_user_admin(),
            return
 
        if config.admin_only and not users.is_current_user_admin():
            self.redirect(users.create_logout_url(self.url("signup_forbidden")))
            return
            return
 
        if config.admin_only and not users.is_current_user_admin():
            self.redirect(self.url("home"))
            return
            account = models.Account()
            account.user = user
            if config.moderate_signups and not users.is_current_user_admin():
                account.enabled = False
            else:

src/d/e/devfest-site-HEAD/devfest-site/pages/EventPages.py   devfest-site(Download)
    user = users.get_current_user()
    form = EventForm()
    if not users.is_current_user_admin():
      del form.approved
    self.values['form'] = form
  def get(self,event_id):
    event = CEvent(event_id).get()
    user = users.get_current_user()
    if user and event:
      if user in event.organizers or users.is_current_user_admin():
    event = CEvent(event_id).get()
    if user and event:
      if user in event.organizers or users.is_current_user_admin():
        self.values['event'] = event
        form = EventForm(obj=event)
        form.gdg_chapters.process_formdata([','.join(event.gdg_chapters)])
        form.organizers.process_formdata([','.join([u.email() for u in event.organizers])])
        # special handling: if not admin of application then remove the field
        # 'approved'
        if not users.is_current_user_admin():
    # special handling: if not admin of application then remove the field
    # 'approved'
    if not users.is_current_user_admin():
      del form.approved
    if self.request.get('event') != '':

src/k/u/kumo-HEAD/kumo.py   kumo(Download)
      'account_url_linktext': url_linktext,
      'loggedin': loggedin,
      'administrator': users.is_current_user_admin(),
      'administratorview': isAdminView(self),
      'title': 'kumo',
  def get(self,arg1=None,arg2=None,arg3=None):
    page_text = ''
 
    if not users.is_current_user_admin():
      return self.error('You are not authorized to view this page.')
      'title': 'kumo management panel',
      'page_text': page_text,
      'administrator': users.is_current_user_admin(),
    }
 
def isAdminView(self):
    user = users.get_current_user()
    if user:
      if users.is_current_user_admin() and self.request.get('admin', None) == "view":
        return True

src/p/y/python-blog-system-HEAD/main.py   python-blog-system(Download)
  def get(self, key = ""):
    if users.get_current_user() == None:
      self.response.out.write("<a href=\"%s\">Sign in or register</a>." % users.create_login_url("/admin"))
    elif users.is_current_user_admin() != True:
      self.response.out.write('Your account %s is not admin. <a href=\"%s\">Log out</a> and log in with an admin account.' % (users.get_current_user(), users.create_logout_url("/admin")))
  def post(self, key = ""):
    if users.is_current_user_admin():
      if key:
        self.post2(key)
      else:
  def get(self, key):
    entry = Entry.get(key);
    if users.is_current_user_admin() or (entry.datetime > datetime.datetime.now() and entry.public):
      print_with_template(self, 'index.html', {'entries':[Entry.get(key)], 'detail':True})
    else:
def print_with_template(self, view, params = {}):
  params.update({
    'login': users.is_current_user_admin(),
    'logout_url': users.create_logout_url("/"),
    'google_analytics': google_analytics,
def filter_entries(entries):
  if not users.is_current_user_admin():
    entries = entries.filter("datetime <", datetime.datetime.now()).filter("public =", True)
  return entries
 

src/b/u/buckethandle-HEAD/app/controllers/main.py   buckethandle(Download)
                         categories = categories, 
                         user = users.get_current_user(),
                         is_user_admin = users.is_current_user_admin() ,
                         login_url = users.create_login_url("/"),
                         logout_url = users.create_logout_url("/"),
                                            selected_category = category, 
                                            pagination = utils.Pagination(posts_count, page, POSTS_PER_PAGE),
                                            is_user_admin = users.is_current_user_admin()),
                                            title = "%s" % (category if category else i18ns['TITLE_HOME']))
 
                                               next_post, 
                                               utils.ContentDiscoverer(post.link, post.category).get_content_block(),
                                               is_user_admin = users.is_current_user_admin()), 
                                               title = post.title,
                                               canonical = "%s/%s" % (i18ns['ROUTE_POST'],post.get_path()),
                                            category, 
                                            pagination = utils.Pagination(posts_count, page, POSTS_PER_PAGE),
                                            is_user_admin = users.is_current_user_admin()),
                                            title = "%s %s" % (category if category else '',' '.join(tags) if tags else (i18ns['TITLE_POST'] if not category else '')),
                                            canonical = canonical)
   def GET(self):
       featured_posts = models.Post.get_featured_posts()
 
       return render_template(render.featured(featured_posts, is_user_admin = users.is_current_user_admin()),
                              title = i18ns['TITLE_FEATURED'])

src/e/z/ezproxy-db-HEAD/ezproxy_db.py   ezproxy-db(Download)
            'logout_url': users.create_logout_url('/'),
            'is_logged_in': user is not None,
            'is_admin': users.is_current_user_admin(),
        }
 
        if users.is_current_user_admin():
                name=self.request.get('name'),
                url=self.request.get('url'),
                approved=users.is_current_user_admin(),
            )
            proxy.put()
    def post(self):
        if not users.is_current_user_admin():
            self.redirect('/')
 
        try:

src/a/p/appscale-original-HEAD/AppServer/lib/webapp2/webapp2_extras/appengine/users.py   appscale-original(Download)
        if not user:
            return self.redirect(users.create_login_url(self.request.url))
        elif not users.is_current_user_admin():
            self.abort(403)
        else:

src/b/u/Buckley-HEAD/buckley/reqhandlers.py   Buckley(Download)
  def get_user_object(self):
    user = {
      'admin': users.is_current_user_admin(),
      'logout': users.create_logout_url('/'),
      'login': users.create_login_url('/'),
  def pre_hook(self):
    user = users.get_current_user()
    if not user or not users.is_current_user_admin():
      raise sketch.exception.Forbidden()
 
  def initialize(self, request, response):
    self.request = request
    self.response = response
    user = users.get_current_user()
    if not user or not users.is_current_user_admin():

src/h/d/hd-signup-HEAD/main.py   hd-signup(Download)
    def get(self):
      user = users.get_current_user()
      if not user:
        self.redirect(users.create_login_url('/debug_users'))
      if users.is_current_user_admin():
    def get(self):
      user = users.get_current_user()
      if not user:
        self.redirect(users.create_login_url('/leavereasonlist'))
      if users.is_current_user_admin():
    def get(self):
      user = users.get_current_user()
      if not user:
        self.redirect(users.create_login_url('/joinreasonlist'))
      if users.is_current_user_admin():
    def get(self):
      user = users.get_current_user()
      if not user:
        self.redirect(users.create_login_url('/suspended'))
      if users.is_current_user_admin():
    def get(self):
      user = users.get_current_user()
      if not user:
        self.redirect(users.create_login_url('/userlist'))
      if users.is_current_user_admin():

src/a/p/appscale-original-HEAD/AppServer/google/appengine/ext/appstats/ui.py   appscale-original(Download)
  def __call__(self, environ, start_response):
    if not environ.get('SERVER_SOFTWARE', '').startswith('Dev'):
      if not users.is_current_user_admin():
        if users.get_current_user() is None:
          start_response('302 Found',

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next