[Yapcom-commit] rev 101 - in yapcom/trunk: lib/YAPC templates

[prev] [thread] [next] [lurker] [Date index for 2003/12/2]

From: svn
Subject: [Yapcom-commit] rev 101 - in yapcom/trunk: lib/YAPC templates
Date: 22:08 on 02 Dec 2003
Author: gabor
Date: 2003-12-02 22:08:04 +0200 (Tue, 02 Dec 2003)
New Revision: 101

Modified:
   yapcom/trunk/lib/YAPC/Organizer.pm
   yapcom/trunk/templates/logout.tmpl
   yapcom/trunk/templates/user_account.tmpl
Log:
add the fname and lname of the logged in user to their internal page

Modified: yapcom/trunk/lib/YAPC/Organizer.pm
===================================================================
--- yapcom/trunk/lib/YAPC/Organizer.pm	2003-11-30 21:50:47 UTC (rev 100)
+++ yapcom/trunk/lib/YAPC/Organizer.pm	2003-12-02 20:08:04 UTC (rev 101)
@@ -25,7 +25,7 @@
                    user_account logout list_my_proposals edit_my_proposal);  
 
 # list of pages accessible to administrators only
-my @admin_pages = qw(admin admin_list_proposals); 
+my @admin_pages = qw(admin_list_proposals); 
 
 # other pages that can be directly access but which don't need any authentication
 my @other_pages = qw(list_people login registration validation lost_validation lost_password
@@ -122,6 +122,10 @@
       $t->param(ADMIN => 1);
    }
 
+   if ($id) {
+     $t->param(fname => $id->fname);
+     $t->param(lname => $id->lname);
+   }
    return $t->output;
 }
 
@@ -703,10 +707,18 @@
    my $q = $self->query;
 
    my $id = $self->is_logged_in;
+   my $admin = $self->is_admin_user($id);
+
    return $self->send_message('no_such_person') if not $q->param('id'); 
    my $p;
+
+   # for administrators get back everyone, for non admins only validated people
+   my %search = (id => $q->param('id'));
+   if (not $admin) {
+      $search{acked} = 1;
+   }
    eval {
-      ($p) = YAPC::Person->search(id => $q->param('id'), acked => 1);
+      ($p) = YAPC::Person->search(%search);
    };
    return $self->send_message('no_such_person') if not $p;
 

Modified: yapcom/trunk/templates/logout.tmpl
===================================================================
--- yapcom/trunk/templates/logout.tmpl	2003-11-30 21:50:47 UTC (rev 100)
+++ yapcom/trunk/templates/logout.tmpl	2003-12-02 20:08:04 UTC (rev 101)
@@ -4,7 +4,8 @@
 <TMPL_IF NAME="ERROR">
 <font color="red">Error logging out</font>
 <TMPL_ELSE>
-You have successfully loged out
+You have successfully loged out<p />
+<a href="login.html">Login again</a>
 </TMPL_IF>
 <TMPL_INCLUDE NAME="footer.tmpl">
 

Modified: yapcom/trunk/templates/user_account.tmpl
===================================================================
--- yapcom/trunk/templates/user_account.tmpl	2003-11-30 21:50:47 UTC (rev 100)
+++ yapcom/trunk/templates/user_account.tmpl	2003-12-02 20:08:04 UTC (rev 101)
@@ -1,5 +1,8 @@
 <TMPL_VALUE NAME="title" VALUE="My YAPC">
 <TMPL_INCLUDE NAME="header.tmpl">
+Logged in as <TMPL_VAR NAME="fname"> <TMPL_VAR NAME="lname"><br>
+<TMPL_IF NAME="admin"><font color="red">This is an administrative account</font></TMPL_IF>
+<p>
 Some user information will be here.
 <p>
 <a href="./proposal.html">Submit a proposal</a><br />

Generated at 23:05 on 02 Dec 2003 by mariachi 0.51