diff --git a/e107_core/shortcodes/batch/login_shortcodes.php b/e107_core/shortcodes/batch/login_shortcodes.php index 6566ab24e..64b72b5c6 100644 --- a/e107_core/shortcodes/batch/login_shortcodes.php +++ b/e107_core/shortcodes/batch/login_shortcodes.php @@ -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 = ""; @@ -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 ""; @@ -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 ""; } 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 ""; } @@ -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 = "".LAN_LOGIN_11.""; - $text .= " ".LAN_LOGIN_12.""; - return $text; - } - else - { - return ' '; // In case no registration system enabled - } + $text = "".LAN_LOGIN_11.""; + $text .= " ".LAN_LOGIN_12.""; + return $text; + } diff --git a/e107_core/templates/login_template.php b/e107_core/templates/login_template.php index 75c3e1aa7..4fb716984 100644 --- a/e107_core/templates/login_template.php +++ b/e107_core/templates/login_template.php @@ -112,8 +112,9 @@ $LOGIN_WRAPPER['page']['LOGIN_TABLE_SUBMIT'] = "
Sign in with:
"; + + $text = ''; + + if(!empty($parm['label'])) + { + $text .= "Sign in with:
"; + } + $text .= $sc->sc_signup_xup_login($parm); $text .= "
"; + } + } + + if($userReg === 1) + { + $COMLAN_501 = COMLAN_501; // If you are not yet registered, you may [click here to register]. + + $repl = array("",""); + + $text .= "