Update of /cvsroot/openinteract/OpenInteract/OpenInteract/Template
In directory usw-pr-cvs1:/tmp/cvs-serv5848
Modified Files:
Plugin.pm
Log Message:
added 'is_admin' property, along with documentation
Index: Plugin.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/OpenInteract/Template/Plugin.pm,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Plugin.pm 2001/10/18 02:11:24 1.15
--- Plugin.pm 2001/10/24 16:05:43 1.16
***************
*** 348,351 ****
--- 348,356 ----
+ sub is_admin {
+ return OpenInteract::Request->instance->{auth}{is_admin};
+ }
+
+
sub return_url {
my $R = OpenInteract::Request->instance;
***************
*** 891,894 ****
--- 896,915 ----
[% IF OI.logged_in %]
<p>You are very special, logged-in user!</p>
+ [% END %]
+
+ B<is_admin()>
+
+ True/false depending on whether the user is an administrator. The
+ definition of 'is an administrator' depends on the authentication
+ class being used -- by default it means that the user is the superuser
+ or a member of the 'site admin' group. But you can modify this based
+ on your needs, and make the result available to all templates with
+ this property.
+
+ Example:
+
+ [% IF OI.is_admin %]
+ <p>You are an administrator -- you have the power! It feels great,
+ eh?</p>
[% END %]
|