1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 11:20:25 +02:00

Added clearer Login options and labels (LANS). username/password, email/password and username or email/password.

This commit is contained in:
CaMer0n
2009-03-06 20:09:08 +00:00
parent 28bf4b7f86
commit 5f5dc41a42
9 changed files with 126 additions and 81 deletions

View File

@@ -9,9 +9,9 @@
* Administration - Site Preferences
*
* $Source: /cvs_backup/e107_0.8/e107_admin/prefs.php,v $
* $Revision: 1.28 $
* $Date: 2009-03-02 21:55:27 $
* $Author: e107steved $
* $Revision: 1.29 $
* $Date: 2009-03-06 20:09:08 $
* $Author: e107coders $
*
*/
require_once ("../class2.php");
@@ -63,12 +63,14 @@ if(isset($_POST['updateprefs']))
$_POST['siteurl'] = trim($_POST['siteurl']) ? trim($_POST['siteurl']) : SITEURL;
$_POST['siteurl'] = substr($_POST['siteurl'], - 1) == "/" ? $_POST['siteurl'] : $_POST['siteurl']."/";
// If email verification, email address is required!
if($_POST['user_reg_veri'] == 1)
// If email verification or Email/Password Login Method - email address is required!
if($_POST['user_reg_veri'] == 1 && $_POST['allowEmailLogin'] == 1)
{
$_POST['disable_emailcheck'] = 0;
}
// Table of range checking values - min and max for numerics. Only do the important ones
$pref_limits = array('loginname_maxlength' => array('min' => 10, 'max' => 100, 'default' => 30),
$pref_limits = array('loginname_maxlength' => array('min' => 10, 'max' => 100, 'default' => 30),
'displayname_maxlength' => array('min' => 5, 'max' => 30, 'default' => 15),
'antiflood_timeout' => array('min' => 3, 'max' => 300, 'default' => 10),
'signup_pass_len' => array('min' => 2, 'max' => 100, 'default' => 4)
@@ -469,33 +471,42 @@ $text .= "
<div class='smalltext field-help'>".PRFLAN_30."</div>
</td>
</tr>
<tr>
<td class='label'>".PRFLAN_141."</td>
<td class='control'>
".$frm->radio_switch('xup_enabled', $pref['xup_enabled'])."
</td>
</tr>
<tr>
<td class='label'>".PRFLAN_154."</td>
<td class='control'>
".$frm->select_open('user_reg_veri');
$veri_list = array(PRFLAN_152,PRFLAN_31,PRFLAN_153);
$veri_list[0] = PRFLAN_152;
$veri_list[1] = PRFLAN_31;
$veri_list[2] = PRFLAN_153;
foreach($veri_list as $v => $v_title)
{
$text .= $frm->option($v_title, $v, ($pref['user_reg_veri'] == $v));
}
foreach($veri_list as $v => $v_title)
{
$text .= "
".$frm->option($v_title, $v, ($pref['user_reg_veri'] == $v))."
";
}
$text .= "
$text .= "
</select>
<div class='field-help'>".PRFLAN_154a."</div>
</td>
</tr>
<tr>
<td class='label'>".PRFLAN_184."</td>
<td class='control'>".$frm->select_open('allowEmailLogin');
$login_list = array(PRFLAN_201,PRFLAN_202,PRFLAN_203);
foreach($login_list as $l => $l_title)
{
$text .= $frm->option($l_title, $l, ($pref['allowEmailLogin'] == $l));
}
$text .= "
</select></td>
</tr>
<tr>
<td class='label'>".PRFLAN_141."</td>
<td class='control'>
".$frm->radio_switch('xup_enabled', $pref['xup_enabled'])."
</td>
</tr>
<tr>
<td class='label'>".PRFLAN_160."</td>
<td class='control'>
@@ -508,13 +519,7 @@ $text .= "
".$frm->radio_switch('disable_emailcheck', $pref['disable_emailcheck'])."
</td>
</tr>
<tr>
<td class='label'>".PRFLAN_32."</td>
<td class='control'>
".$frm->radio_switch('anon_post', $pref['anon_post'])."
<div class='field-help'>".PRFLAN_33."</div>
</td>
</tr>
<tr>
<td class='label'>".PRFLAN_45."</td>
<td class='control'>
@@ -529,6 +534,14 @@ $text .= "
<div class='field-help'>".PRFLAN_59."</div>
</td>
</tr>
<tr>
<td class='label'>".PRFLAN_197.": </td>
<td class='control'>
".$frm->radio_switch('autologinpostsignup', $pref['autologinpostsignup'])."
<div class='smalltext field-help'>".PRFLAN_198."</div>
</td>
</tr>
<tr>
<td class='label'>".CUSTSIG_16."</td>
<td class='control'>
@@ -711,6 +724,7 @@ $text .= "
<div class='smalltext field-help'>".PRFLAN_110."</div>
</td>
</tr>
<tr>
<td class='label'>".PRFLAN_116.":</td>
<td class='control'>
@@ -854,13 +868,7 @@ $text .= "
".$frm->radio_switch('user_reg_secureveri', $pref['user_reg_secureveri'])."
</td>
</tr>
<tr>
<td class='label'>".PRFLAN_197.": </td>
<td class='control'>
".$frm->radio_switch('autologinpostsignup', $pref['autologinpostsignup'])."
<div class='smalltext field-help'>".PRFLAN_198."</div>
</td>
</tr>
<tr>
<td class='label'>".PRFLAN_129.":</td>
<td class='control'>
@@ -868,13 +876,7 @@ $text .= "
<div class='smalltext field-help'>".PRFLAN_130."</div>
</td>
</tr>
<tr>
<td class='label'>".PRFLAN_184.":</td>
<td class='control'>
".$frm->radio_switch('allowEmailLogin', $pref['allowEmailLogin'], LAN_YES, LAN_NO)."
<div class='smalltext field-help'>".PRFLAN_185."</div>
</td>
</tr>
<tr>
<td class='label'>".PRFLAN_48.":</td>
<td class='control'>
@@ -917,6 +919,7 @@ $text .= "
<div class='smalltext field-help'>".PRFLAN_41."</div>
</td>
</tr>
<tr>
<td class='label'>".PRFLAN_42.":</td>
<td class='control'>
@@ -989,6 +992,13 @@ $text .= "
<col class='col-control' />
</colgroup>
<tbody>
<tr>
<td class='label'>".PRFLAN_32."</td>
<td class='control'>
".$frm->radio_switch('anon_post', $pref['anon_post'], LAN_YES, LAN_NO)."
<div class='field-help'>".PRFLAN_33."</div>
</td>
</tr>
<tr>
<td class='label'>".PRFLAN_89.": </td>
<td class='control'>
@@ -1019,6 +1029,7 @@ $text .= "
".$frm->radio_switch('comments_emoticons', $pref['comments_emoticons'], LAN_YES, LAN_NO)."
</td>
</tr>
</tbody>
</table>
".pref_submit('comments')."

View File

@@ -12,9 +12,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/login.php,v $
| $Revision: 1.21 $
| $Date: 2009-01-17 21:42:54 $
| $Author: e107steved $
| $Revision: 1.22 $
| $Date: 2009-03-06 20:09:08 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -117,9 +117,15 @@ class userlogin
return $this->invalidLogin($username,LOGIN_BAD_USERNAME,$fip);
}
$lookemail = !$forceLogin && varset($pref['allowEmailLogin'],0) && (strpos($username,'@') !== FALSE); // See if we look up against email or user name
// Look up user in DB - even if email addresses allowed, still look up by user name as well - user could have specified email address for their login name
if ($sql->db_Select('user', '*', "`user_loginname`= '".$tp -> toDB($username)."'".($lookemail ? " OR `user_email` = '".$tp -> toDB($username)."'" : '') ) !== 1) // Handle duplicate emails as well
$qry[0] = "`user_loginname`= '".$tp -> toDB($username)."'"; // username only (default)
$qry[1] = "`user_email` = '".$tp -> toDB($username)."'"; // email only
$qry[2] = (strpos($username,'@') !== FALSE ) ? "`user_loginname`= '".$tp -> toDB($username)."' OR `user_email` = '".$tp -> toDB($username)."'" : $qry[0]; //username or email
// Look up user in DB - even if email addresses allowed, still look up by user name as well - user could have specified email address for their login name
$query = (!$forceLogin && varset($pref['allowEmailLogin'],0)) ? $qry[$pref['allowEmailLogin']] : $qry[0];
if ($sql->db_Select('user', '*', $query) !== 1) // Handle duplicate emails as well
{ // Invalid user
return $this->invalidLogin($username,LOGIN_BAD_USER,$fip);
}

View File

@@ -12,9 +12,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_prefs.php,v $
| $Revision: 1.17 $
| $Date: 2009-01-09 17:25:50 $
| $Author: secretr $
| $Revision: 1.18 $
| $Date: 2009-03-06 20:09:08 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -36,14 +36,14 @@ define("PRFLAN_15", "Display render time?");
define("PRFLAN_16", "Display sql queries?");
define("PRFLAN_17", "Compress Site Output Using gzip");
define("PRFLAN_19", "Signup Page Options");
define("PRFLAN_21", "Date display options");
define("PRFLAN_21", "Date Display options");
define("PRFLAN_22", "Short date format");
define("PRFLAN_23", "Long date format");
define("PRFLAN_24", "Forum date format");
define("PRFLAN_25", "For more information on date formats see the");
define("PRFLAN_26", "Time offset");
define("PRFLAN_27", "Example, if you set this to +2, all times on your site will have two hours added to them");
define("PRFLAN_28", "User registration/posting");
define("PRFLAN_28", "User Registration/Login");
define("PRFLAN_29", "Activate user registration system?");
define("PRFLAN_30", "allow users to register as members on your site");
//define("PRFLAN_31", "Use email verification for signups?");
@@ -78,7 +78,7 @@ define("PRFLAN_78", "Leave blank to disable");
define("PRFLAN_80", "Click here to view");
define("PRFLAN_81", "Enable Image-code verification during login");
define("PRFLAN_83", "example");
define("PRFLAN_87", "Comments");
define("PRFLAN_87", "Comments/Posting");
define("PRFLAN_88", "Turn on nested comments");
define("PRFLAN_89", "Display new comment icon");
define("PRFLAN_90", "Allow posters to edit their comments");
@@ -109,7 +109,7 @@ define("PRFLAN_95", "Display plugins info:");
define("PRFLAN_96", "Will display info on all admin pages for each plugin supporting this type of feature");
define("PRFLAN_97", "Unique 'Plugins info' menu:");
define("PRFLAN_98", "If disabled, each plugin will display its own info in an individual menu. If enabled all info will be displayed in one menu.");
define("PRFLAN_101", "Text rendering");
define("PRFLAN_101", "Text Rendering");
define("PRFLAN_102", "Replace clickable URLs");
define("PRFLAN_103", "If ticked, and 'Make Clickable' (above) is also ticked, posted URLs are displayed as a hyperlink using text from the textbox below. This keeps very long URLs from breaking layout.");
define("PRFLAN_104", "URL replacement text");
@@ -192,7 +192,7 @@ define('PRFLAN_180', 'Plaintext');
define('PRFLAN_181', 'CHAP, plaintext fallback');
define('PRFLAN_182', 'CHAP only');
define('PRFLAN_183', ' CHAP requires JS enabled in user\'s browser');
define('PRFLAN_184', 'Allow login by email address');
define('PRFLAN_184', 'User login method');
define('PRFLAN_185', '(as well as login name)');
define('PRFLAN_186', 'Yes');
define('PRFLAN_187', 'No');
@@ -215,4 +215,7 @@ define('PRFLAN_196a', 'Log directory:');
define("PRFLAN_199", "Show Admin Sub-links");
define("PRFLAN_200", "If enabled, Admin slide down navigation menu (if supported by the current theme) will render sub-links when needed (e.g. News - Create news item).");
define("PRFLAN_201", "Username and Password");
define("PRFLAN_202", "Email and Password");
define("PRFLAN_203", "Username/Email and Password");
?>

View File

@@ -4,9 +4,9 @@
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_login.php,v $
| $Revision: 1.3 $
| $Date: 2008-06-13 20:20:22 $
| $Author: e107steved $
| $Revision: 1.4 $
| $Date: 2009-03-06 20:09:08 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
define("LAN_LOGIN_1", "User name");
@@ -36,5 +36,6 @@ define("LAN_LOGIN_24", "That username/password combination is already in use.");
define("LAN_LOGIN_25", "Banned user attempted to login");
define("LAN_LOGIN_26", "Login fail - reason unknown");
define('LAN_LOGIN_27', 'User attempted to log in before responding to confirmation email');
define('LAN_LOGIN_28', 'Email');
define('LAN_LOGIN_29', 'Username or Email');
?>

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/login_menu/languages/English.php,v $
| $Revision: 1.4 $
| $Date: 2008-02-06 00:23:28 $
| $Author: secretr $
| $Revision: 1.5 $
| $Date: 2009-03-06 20:09:08 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -75,5 +75,7 @@ define('LOGIN_MENU_L45b', 'plugin'); //post
define('LOGIN_MENU_L46', 'recent items -');
define('LOGIN_MENU_L47', 'Login menu - Recent plugin additions');
define('LOGIN_MENU_L48', 'Menu Config');
define('LOGIN_MENU_L49', 'Email: ');
define('LOGIN_MENU_L50', 'Username or Email: ');
?>

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/login_menu/login_menu_shortcodes.php,v $
| $Revision: 1.6 $
| $Date: 2008-06-13 20:20:22 $
| $Author: e107steved $
| $Revision: 1.7 $
| $Date: 2009-03-06 20:09:08 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
@@ -21,10 +21,24 @@ global $tp;
$login_menu_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
/*
SC_BEGIN LM_USERNAME_INPUT
global $pref;
return "<input class='tbox login user' type='text' name='username' id='username' size='15' value='' maxlength='".varset($pref['loginname_maxlength'],30)."' />\n";
global $pref;
return "<input class='tbox login user' type='text' name='username' id='username' size='15' value='' maxlength='".varset($pref['loginname_maxlength'],30)."' />\n";
SC_END
SC_BEGIN LM_USERNAME_LABEL
if($pref['allowEmailLogin']==1)
{
return LOGIN_MENU_L49;
}
if($pref['allowEmailLogin']==2)
{
return LOGIN_MENU_L50;
}
return LOGIN_MENU_L1;
SC_END
SC_BEGIN LM_PASSWORD_INPUT
global $pref;
$t_password = "<input class='tbox login pass' type='password' name='userpass' id='userpass' size='15' value='' maxlength='30' />\n";
@@ -32,6 +46,11 @@ if (!USER && isset($_SESSION['challenge']) && varset($pref['password_CHAP'],0))
return $t_password;
SC_END
SC_BEGIN LM_PASSWORD_LABEL
return LOGIN_MENU_L2;
SC_END
SC_BEGIN LM_IMAGECODE
global $use_imagecode, $sec_img;
//DEPRECATED - use LM_IMAGECODE_NUMBER, LM_IMAGECODE_BOX instead

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/login_menu/login_menu_template.php,v $
| $Revision: 1.6 $
| $Date: 2008-12-10 16:37:17 $
| $Author: mcfly_e107 $
| $Revision: 1.7 $
| $Date: 2009-03-06 20:09:08 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -72,9 +72,9 @@ if (!isset($LOGIN_MENU_FORM)){
}
$LOGIN_MENU_FORM .= "
".LOGIN_MENU_L1."<br />
{LM_USERNAME_LABEL}<br />
{LM_USERNAME_INPUT}<br />
".LOGIN_MENU_L2."<br />
{LM_PASSWORD_LABEL}<br />
{LM_PASSWORD_INPUT}<br />
{LM_IMAGECODE_NUMBER}{LM_IMAGECODE_BOX}
{LM_LOGINBUTTON}

View File

@@ -1,5 +1,5 @@
<?php
// $Id: login_template.php,v 1.5 2008-06-13 20:20:23 e107steved Exp $
// $Id: login_template.php,v 1.6 2009-03-06 20:09:08 e107coders Exp $
if (!defined('e107_INIT')) { exit; }
@@ -42,12 +42,12 @@ if(!isset($LOGIN_TABLE))
}
$LOGIN_TABLE .=
"<table class='fborder' style='width:60%' >\n
"<table class='fborder' style='width:60%;margin-right:auto;margin-left:auto' >\n
<tr>\n
<td class='forumheader' style='text-align:center;' colspan='3'>".LAN_LOGIN_4."</td>\n
</tr>\n
<tr>\n
<td class='forumheader3' style='width:40%'>".LAN_LOGIN_1."</td>\n
<td class='forumheader3' style='width:40%'>{LOGIN_USERNAME_LABEL}</td>\n
<td class='forumheader3' style='width:40%'>{LOGIN_TABLE_USERNAME}</td>\n
<td class='forumheader3' rowspan='".($LOGIN_TABLE_SECIMG_SECIMG ? 3 : 2)."' style='width:20%; vertical-align: middle; margin-left: auto; margin-right: auto; text-align: center;'>".(file_exists(THEME."images/password.png") ? "<img src='".THEME_ABS."images/password.png' alt='' />\n" : "<img src='".e_IMAGE."packs/".$imode."/generic/password.png' alt='' />\n" )."</td>\n</tr>\n
<tr>\n<td class='forumheader3'>".LAN_LOGIN_2."</td>\n<td class='forumheader3'>{LOGIN_TABLE_PASSWORD}

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/login.php,v $
| $Revision: 1.5 $
| $Date: 2008-06-16 19:37:44 $
| $Author: e107steved $
| $Revision: 1.6 $
| $Date: 2009-03-06 20:09:08 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -33,7 +33,10 @@ if (!USER)
require_once(e_HANDLER."form_handler.php");
$rs = new form;
$text = "";
$allowEmailLogin = varset($pref['allowEmailLogin'],0);
$ulabel = array(LAN_LOGIN_1,LAN_LOGIN_28,LAN_LOGIN_29);
$LOGIN_USERNAME_LABEL = $ulabel[$allowEmailLogin];
$LOGIN_TABLE_LOGINMESSAGE = LOGINMESSAGE;
$LOGIN_TABLE_USERNAME = "<input class='tbox' type='text' name='username' id='username' size='40' maxlength='100' />";
$LOGIN_TABLE_PASSWORD = "<input class='tbox' type='password' name='userpass' id='userpass' size='40' maxlength='100' />";