mirror of
https://github.com/e107inc/e107.git
synced 2025-08-18 12:21:45 +02:00
Fix for login/signup message on comment form. Allow login page to load if social signup is active.
This commit is contained in:
@@ -14,10 +14,13 @@ if (!defined('e107_INIT')) { exit; }
|
||||
class login_shortcodes extends e_shortcode
|
||||
{
|
||||
var $secImg = false;
|
||||
|
||||
protected $userReg = false; // user registration pref.
|
||||
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$pref = e107::getPref();
|
||||
$this->userReg = intval($pref['user_reg']);
|
||||
$this->secImg = ($pref['logcode'] && extension_loaded("gd")) ? true : false;
|
||||
}
|
||||
|
||||
@@ -31,11 +34,22 @@ class login_shortcodes extends e_shortcode
|
||||
|
||||
function sc_login_table_loginmessage($parm='')
|
||||
{
|
||||
return LOGINMESSAGE;
|
||||
if(empty($this->userReg))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return LOGINMESSAGE;
|
||||
}
|
||||
|
||||
function sc_login_table_username($parm='') //FIXME use $frm
|
||||
{
|
||||
|
||||
if(empty($this->userReg))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$pref = e107::getPref();
|
||||
$allowEmailLogin = varset($pref['allowEmailLogin'],0);
|
||||
$ulabel = array(LAN_LOGIN_1,LAN_LOGIN_28,LAN_LOGIN_29);
|
||||
@@ -47,6 +61,11 @@ class login_shortcodes extends e_shortcode
|
||||
|
||||
function sc_login_table_password($parm='') //FIXME use $frm
|
||||
{
|
||||
if(empty($this->userReg))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$pref = e107::getPref();
|
||||
$text = "<input class='tbox form-control input-block-level' type='password' name='userpass' id='userpass' size='40' maxlength='100' placeholder=\"".LAN_LOGIN_2."\" />";
|
||||
|
||||
@@ -59,6 +78,11 @@ class login_shortcodes extends e_shortcode
|
||||
|
||||
function sc_login_table_secimg_lan($parm='')
|
||||
{
|
||||
if(empty($this->userReg))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if(!$this->secImg){ return; }
|
||||
return e107::getSecureImg()->renderLabel();
|
||||
// return LAN_LOGIN_13;
|
||||
@@ -73,6 +97,11 @@ class login_shortcodes extends e_shortcode
|
||||
|
||||
function sc_login_table_secimg_secimg($parm='')
|
||||
{
|
||||
if(empty($this->userReg))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if(!$this->secImg){ return; }
|
||||
return e107::getSecureImg()->renderImage();
|
||||
// return e107::getSecureImg()->r_image();
|
||||
@@ -80,6 +109,11 @@ class login_shortcodes extends e_shortcode
|
||||
|
||||
function sc_login_table_secimg_textboc($parm='')
|
||||
{
|
||||
if(empty($this->userReg))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if(!$this->secImg){ return; }
|
||||
return e107::getSecureImg()->renderInput();
|
||||
// return "<input class='tbox' type='text' name='code_verify' size='15' maxlength='20' />";
|
||||
@@ -87,24 +121,43 @@ class login_shortcodes extends e_shortcode
|
||||
|
||||
function sc_login_table_autologin($parm='')//FIXME use $frm
|
||||
{
|
||||
if(empty($this->userReg))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return "<input type='checkbox' name='autologin' value='1' />";
|
||||
}
|
||||
|
||||
|
||||
function sc_login_table_autologin_lan($parm='')
|
||||
{
|
||||
if(empty($this->userReg))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return LAN_LOGIN_8;
|
||||
}
|
||||
|
||||
function sc_login_table_rememberme($parm=null)
|
||||
{
|
||||
if(empty($this->userReg))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return e107::getForm()->checkbox('autologin',1,false,LAN_LOGIN_8);
|
||||
|
||||
}
|
||||
|
||||
function sc_login_table_submit($parm="") //FIXME use $frm
|
||||
{
|
||||
|
||||
if(empty($this->userReg))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$class = ($parm == 'large') ? "btn-large btn-lg" : "";
|
||||
return "<input class='btn btn-primary ".$class." button' type='submit' name='userlogin' value=\"".LAN_LOGIN_9."\" />";
|
||||
}
|
||||
@@ -112,18 +165,17 @@ class login_shortcodes extends e_shortcode
|
||||
|
||||
function sc_login_table_footer_userreg($parm='')
|
||||
{
|
||||
$pref = e107::getPref();
|
||||
//$pref = e107::getPref();
|
||||
|
||||
if(empty($this->userReg))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($pref['user_reg'])
|
||||
{
|
||||
$text = "<a href='".e_SIGNUP."'>".LAN_LOGIN_11."</a>";
|
||||
$text .= " <a href='".e_BASE."fpw.php'>".LAN_LOGIN_12."</a>";
|
||||
return $text;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ' '; // In case no registration system enabled
|
||||
}
|
||||
$text = "<a href='".e_SIGNUP."'>".LAN_LOGIN_11."</a>";
|
||||
$text .= " <a href='".e_BASE."fpw.php'>".LAN_LOGIN_12."</a>";
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -112,8 +112,9 @@ $LOGIN_WRAPPER['page']['LOGIN_TABLE_SUBMIT'] = "<div class='form-group'>{---}</d
|
||||
$LOGIN_WRAPPER['page']['LOGIN_TABLE_FOOTER_USERREG'] = "<div class='form-group'>{---}</div>";
|
||||
|
||||
$LOGIN_TEMPLATE['page']['body'] .= '
|
||||
{LOGIN_TABLE_USERNAME}
|
||||
{LOGIN_TABLE_USERNAME}
|
||||
{LOGIN_TABLE_PASSWORD}
|
||||
{SOCIAL_LOGIN: size=3x}
|
||||
{LOGIN_TABLE_SECIMG_SECIMG} {LOGIN_TABLE_SECIMG_TEXTBOC}
|
||||
{LOGIN_TABLE_REMEMBERME}
|
||||
{LOGIN_TABLE_SUBMIT=large}
|
||||
|
Reference in New Issue
Block a user