[Home]Projects/Usemod10NeedUsernameLoginLogoutBar

JKWiki | Projects | RecentChanges | New Login | Login
This page is read-only | View other revisions

Functionality

This patch has been extracted from [LoginRework], which does much more than this one, and sligthly modified, to extend the already existing functionality from Projects/Usemod10LoginLogout:

Installation

--- wiki.1.0.0.plThu Sep 12 10:53:14 2002
+++ wikipatch.LoginRework.plThu Jan 15 17:04:44 2004
@@ -1212,7 +1212,23 @@
 }
 
 sub GetPrefsLink {
-  return &ScriptLink("action=editprefs", T('Preferences'));
+  if ($UserID > 400) {
+      return &ScriptLink("action=editprefs", T('Preferences'));
+  }
+  return "";
+}
+
+sub GetLoginLink {
+  my $result = '';
+  my $userName = &GetParam("username","");
+  if ($UserID <= 400) {
+    $result = &ScriptLink("action=editprefs", T('New Login')) . " | " . &ScriptLink("action=login", T('Login'));  
+  } else {
+    if (!($userName =~ /^[0-9]+$/)) {
+      $result = " | " . &GetPageLink($userName, Ts('%s' , $userName)) . "(".$UserID.")" . " | " . &ScriptLink("action=login", T('Logout'));
+    }
+  }
+  return $result;
 }
 
 sub GetRandomLink {
@@ -1487,6 +1503,7 @@
   if (&GetParam("linkrandom", 0)) {
     $bartext .= " | " . &GetRandomLink();
   }
+  $bartext .= &GetLoginLink(); 
   if ($UserGotoBar ne '') {
     $bartext .= " | " . $UserGotoBar;
   }
@@ -3178,6 +3223,12 @@
   my ($header, $editRows, $editCols, $userName, $revision, $oldText);
   my ($summary, $isEdit, $pageTime);
 
+  if( &GetParam("username","") eq "" ) {
+    print &GetHeader("", T('Editing Denied'), "");
+    print Ts('Editing not allowed without a username. Please Login.', $SiteName);
+    print &GetCommonFooter();
+    return;
+  }
   if ($FreeLinks) {
     $id = &FreeToNormal($id);  # Take care of users like Markus Lude :-)
   }


JKWiki | Projects | RecentChanges | New Login | Login
This page is read-only | View other revisions | login=&lt;anonymous&gt;
Last edited November 10, 2005 1:07 am by JohannKlasek (diff)
Search: