[geeklog-cvs] geeklog: Hide "New user" option from "Login required" form when ...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Jan 17 10:38:46 EST 2010


changeset 7603:db8cbc27e03b
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/db8cbc27e03b
user: Dirk Haun <dirk at haun-online.de>
date: Sun Jan 17 11:26:51 2010 +0100
description:
Hide "New user" option from "Login required" form when new user registration is disabled (bug #0000933)

diffstat:

 public_html/docs/english/theme.html                              |   4 ++
 public_html/docs/history                                         |   7 ++-
 public_html/layout/professional/submit/submitloginrequired.thtml |   6 ++-
 system/lib-security.php                                          |  22 ++++++++++-
 4 files changed, 34 insertions(+), 5 deletions(-)

diffs (79 lines):

diff -r ec4f2b07a916 -r db8cbc27e03b public_html/docs/english/theme.html
--- a/public_html/docs/english/theme.html	Sun Jan 17 10:53:04 2010 +0100
+++ b/public_html/docs/english/theme.html	Sun Jan 17 11:26:51 2010 +0100
@@ -198,6 +198,10 @@
 <h2><a name="changes">Theme changes in Geeklog 1.6.2</a></h2>
 
 <ul>
+<li>The "Login required" message form, <tt>submit/submitloginrequired.thtml</tt>, has been simplified by using new variables, <code>{login_link}</code> and
+    <code>{newuser_link}</code>, for the links. Using these variables, the new
+    user option will now also be hidden when registration for new users is
+    disabled (this change was required to address <a href="http://project.geeklog.net/tracking/view.php?id=933">bug #0000933</a>).</li>
 <li>In the topic editor template, <tt>admin/topic/topiceditor.thtml</tt>,
     display the max. size of the topic icon and whether it will be scaled down
     (new variable <code>{icon_max_dimensions}</code>).</li>
diff -r ec4f2b07a916 -r db8cbc27e03b public_html/docs/history
--- a/public_html/docs/history	Sun Jan 17 10:53:04 2010 +0100
+++ b/public_html/docs/history	Sun Jan 17 11:26:51 2010 +0100
@@ -1,8 +1,10 @@
 Geeklog History/Changes:
 
-??? ??, 2010 (1.6.2)
-------------
-
+Apr ??, 2010 (1.6.2)
+------------
+
+- Hide "New user" option from "Login required" form when new user registration
+  is disabled (bug #0000933) [Dirk]
 - Show the block name in the list of blocks (feature request #0000819) [Dirk]
 - Added an option (under My Account > Layout & Language) for users to select
   whether they want to use the Advanced Editor or not. The option is on by
diff -r ec4f2b07a916 -r db8cbc27e03b public_html/layout/professional/submit/submitloginrequired.thtml
--- a/public_html/layout/professional/submit/submitloginrequired.thtml	Sun Jan 17 10:53:04 2010 +0100
+++ b/public_html/layout/professional/submit/submitloginrequired.thtml	Sun Jan 17 11:26:51 2010 +0100
@@ -1,2 +1,4 @@
-                            {login_message}<br{xhtml}><br{xhtml}>
-                            [ <a href="{site_url}/users.php" rel="nofollow">{lang_login}</a> | <a href="{site_url}/users.php?mode=new" rel="nofollow">{lang_newuser}</a> ]<br{xhtml}><br{xhtml}>
+    <p>{lang_login_message}</p>
+
+    <p>[ {login_link} <span{hide_bar}|</span> {newuser_link} ]</p>
+
diff -r ec4f2b07a916 -r db8cbc27e03b system/lib-security.php
--- a/system/lib-security.php	Sun Jan 17 10:53:04 2010 +0100
+++ b/system/lib-security.php	Sun Jan 17 11:26:51 2010 +0100
@@ -1598,13 +1598,33 @@
 
     $loginreq = new Template($_CONF['path_layout'] . 'submit');
     $loginreq->set_file('loginreq', 'submitloginrequired.thtml');
+
     $loginreq->set_var('xhtml', XHTML);
     $loginreq->set_var('site_url', $_CONF['site_url']);
     $loginreq->set_var('site_admin_url', $_CONF['site_admin_url']);
     $loginreq->set_var('layout_url', $_CONF['layout_url']);
-    $loginreq->set_var('login_message', $LANG_LOGIN[2]);
+
+    $loginreq->set_var('lang_login_message', $LANG_LOGIN[2]);
+    $loginreq->set_var('login_message', $LANG_LOGIN[2]); // deprecated
     $loginreq->set_var('lang_login', $LANG_LOGIN[3]);
     $loginreq->set_var('lang_newuser', $LANG_LOGIN[4]);
+
+    $login_link = COM_createLink($LANG_LOGIN[3],
+                                 $_CONF['site_url'] . '/users.php',
+                                 array('rel' => 'nofollow'));
+    $loginreq->set_var('login_link', $login_link);
+
+    if ($_CONF['disable_new_user_registration'] == 1) {
+        $loginreq->set_var('newuser_link', '');
+        $loginreq->set_var('hide_bar', ' style="display:none"');
+    } else {
+        $newuser_link = COM_createLink($LANG_LOGIN[4], $_CONF['site_url']
+                                                       . '/users.php?mode=new',
+                                       array('rel' => 'nofollow'));
+        $loginreq->set_var('newuser_link', $newuser_link);
+        $loginreq->set_var('hide_bar', '');
+    }
+
     $loginreq->parse('output', 'loginreq');
     $retval .= $loginreq->finish($loginreq->get_var('output'));
 



More information about the geeklog-cvs mailing list