DrupalBin
Submit Code
About
Recent Posts
Failed relationship
7 hours 22 min
ago
Fix for Code
8 hours 36 min
ago
Fix for Code
8 hours 40 min
ago
Fix for Code
8 hours 59 min
ago
more
Tags
CCK
fapi
jquery
menu
module
Panels
php
simpletest
template.php
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
Fix for Code
View
Download
Fix
This fix will not be saved to the database until you submit.
Summary:
Tags:
Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Source code:
*
@decorator def reqire_user(f, *args, **kws): if users.get_current_user() is None: redirect_to(users.create_login_url(request.path_info)) else: return f(*args, **kws) @decorator def require_admin_user(f, *args, **kws): if users.get_current_user() is None: redirect_to(users.create_login_url(request.path_info)) elif not users.is_current_user_admin(): return render('/need_admin.mako') else: return f(*args, **kws)
Syntax highlighting mode:
ActionScript
ColdFusion
Diff
Drupal
Drupal 5
Drupal 6
HTML
Javascript
MySQL
PHP
Python
robots.txt
SQL
Text
Select the syntax highlighting mode to use.