mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
Fixes #881 - Signup permission check issue. Corrected signup-text styling and signature styling.
This commit is contained in:
@@ -142,26 +142,31 @@ class signup_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
function sc_signup_form_open()
|
function sc_signup_form_open()
|
||||||
{
|
{
|
||||||
global $rs;
|
|
||||||
return "<form action='".e_SELF."' method='post' id='signupform' autocomplete='off'><div>".e107::getForm()->token()."</div>";
|
return "<form action='".e_SELF."' method='post' id='signupform' autocomplete='off'><div>".e107::getForm()->token()."</div>";
|
||||||
return $rs->form_open("post", e_SELF, "signupform");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_signup_signup_text()
|
function sc_signup_signup_text()
|
||||||
{
|
{
|
||||||
// global $SIGNUP_TEXT;
|
|
||||||
$pref = e107::getPref();
|
$pref = e107::getPref();
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
|
||||||
if($pref['signup_text'])
|
if(!empty($pref['signup_text']))
|
||||||
{
|
{
|
||||||
return $tp->toHTML($pref['signup_text'], TRUE, 'parse_sc,defs');
|
return "<div id='signup-custom-text' class='alert alert-block alert-warning'>".$tp->toHTML($pref['signup_text'], TRUE, 'parse_sc,defs')."</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
elseif($pref['user_reg_veri'])
|
elseif($pref['user_reg_veri'])
|
||||||
{
|
{
|
||||||
return $SIGNUP_TEXT." ";
|
// $SIGNUP_TEXT = LAN_SIGNUP_80." <b>".LAN_SIGNUP_29."</b><br /><br />".
|
||||||
|
// LAN_SIGNUP_30."<br />".
|
||||||
|
// LAN_SIGNUP_85;
|
||||||
|
// return $SIGNUP_TEXT." ";
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -387,16 +392,12 @@ class signup_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
function sc_signup_signature()
|
function sc_signup_signature()
|
||||||
{
|
{
|
||||||
global $pref, $SIGNUP_SIGNATURE_START, $SIGNUP_SIGNATURE_END;
|
$sigActive = e107::pref('core','signup_option_signature');
|
||||||
if($pref['signup_option_signature'])
|
|
||||||
|
if($sigActive)
|
||||||
{
|
{
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
return $frm->bbarea('signature', $sig, 'signature','helpb','small');
|
return $frm->bbarea('signature', $sig, 'signature','helpb', 'tiny');
|
||||||
// require_once(e_HANDLER."ren_help.php");
|
|
||||||
$SIGNUP_SIGNATURE_START = str_replace("{REN_HELP}", $area, $SIGNUP_SIGNATURE_START);
|
|
||||||
$SIGNUP_SIGNATURE_END = str_replace("{REN_HELP}", $area, $SIGNUP_SIGNATURE_END);
|
|
||||||
$sig = ($_POST['signature'] ? $_POST['signature'] : $signature);
|
|
||||||
return $SIGNUP_SIGNATURE_START.$sig.$SIGNUP_SIGNATURE_END;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1169,7 +1169,7 @@ class e_form
|
|||||||
|
|
||||||
if(vartrue($options['size']) && !is_numeric($options['size']))
|
if(vartrue($options['size']) && !is_numeric($options['size']))
|
||||||
{
|
{
|
||||||
$options['class'] .= " input-".$options['size'];
|
$options['class'] .= " form-control input-".$options['size'];
|
||||||
unset($options['size']); // don't include in html 'size='.
|
unset($options['size']); // don't include in html 'size='.
|
||||||
}
|
}
|
||||||
elseif(!vartrue($options['noresize']))
|
elseif(!vartrue($options['noresize']))
|
||||||
@@ -1187,16 +1187,28 @@ class e_form
|
|||||||
/**
|
/**
|
||||||
* Bbcode Area. Name, value, template, media-Cat, size, options array eg. counter
|
* Bbcode Area. Name, value, template, media-Cat, size, options array eg. counter
|
||||||
* IMPORTANT: $$mediaCat is also used is the media-manager category identifier
|
* IMPORTANT: $$mediaCat is also used is the media-manager category identifier
|
||||||
|
* @param $name
|
||||||
|
* @param $value
|
||||||
|
* @param $template
|
||||||
|
* @param $mediaCat _common
|
||||||
|
* @param $size : small | medium | large
|
||||||
|
* @param $options array();
|
||||||
*/
|
*/
|
||||||
function bbarea($name, $value, $template = '', $mediaCat='_common', $size = 'large', $options = array())
|
function bbarea($name, $value, $template = '', $mediaCat='_common', $size = 'large', $options = array())
|
||||||
{
|
{
|
||||||
if(is_string($options)) parse_str($options, $options);
|
if(is_string($options)) parse_str($options, $options);
|
||||||
//size - large|medium|small
|
//size - large|medium|small
|
||||||
//width should be explicit set by current admin theme
|
//width should be explicit set by current admin theme
|
||||||
$size = 'input-large';
|
// $size = 'input-large';
|
||||||
|
|
||||||
switch($size)
|
switch($size)
|
||||||
{
|
{
|
||||||
|
case 'tiny':
|
||||||
|
$rows = '3';
|
||||||
|
// $height = "style='height:250px'"; // inline required for wysiwyg
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
case 'small':
|
case 'small':
|
||||||
$rows = '7';
|
$rows = '7';
|
||||||
$height = "style='height:250px'"; // inline required for wysiwyg
|
$height = "style='height:250px'"; // inline required for wysiwyg
|
||||||
@@ -1218,7 +1230,7 @@ class e_form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// auto-height support
|
// auto-height support
|
||||||
$options['class'] = 'tbox bbarea '.($size ? ' '.$size : '').' e-wysiwyg e-autoheight';
|
$options['class'] = 'tbox bbarea '.($size ? ' '.$size : '').' e-wysiwyg e-autoheight form-control';
|
||||||
$bbbar = '';
|
$bbbar = '';
|
||||||
|
|
||||||
|
|
||||||
@@ -1227,10 +1239,9 @@ class e_form
|
|||||||
|
|
||||||
$counter = vartrue($options['counter'],false);
|
$counter = vartrue($options['counter'],false);
|
||||||
|
|
||||||
$ret = "
|
$ret = "<div class='bbarea {$size}'>
|
||||||
<div class='bbarea {$size}'>
|
|
||||||
<div class='field-spacer'><!-- --></div>\n";
|
<div class='field-spacer'><!-- --></div>\n";
|
||||||
|
|
||||||
|
|
||||||
$ret .= e107::getBB()->renderButtons($template,$help_tagid);
|
$ret .= e107::getBB()->renderButtons($template,$help_tagid);
|
||||||
$ret .= $this->textarea($name, $value, $rows, 70, $options, $counter); // higher thank 70 will break some layouts.
|
$ret .= $this->textarea($name, $value, $rows, 70, $options, $counter); // higher thank 70 will break some layouts.
|
||||||
|
@@ -108,9 +108,9 @@ a.cpage-np.current { text-decoration: none; }
|
|||||||
/* message text (overall) */
|
/* message text (overall) */
|
||||||
.warning { color: #FF6600 }
|
.warning { color: #FF6600 }
|
||||||
.success { color: green; }
|
.success { color: green; }
|
||||||
.error { color: #FF0000 }
|
.error { color: #A94442; }
|
||||||
.info {}
|
.info {}
|
||||||
.required { color:red }
|
.required { color:#A94442; }
|
||||||
|
|
||||||
/******** Tooltip info */
|
/******** Tooltip info */
|
||||||
.e-info {}
|
.e-info {}
|
||||||
|
28
signup.php
28
signup.php
@@ -265,7 +265,7 @@ if($signup_imagecode)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((USER || ($pref['user_reg'] != 1) || (vartrue($pref['auth_method'],'e107') != 'e107')) && !getperms('0'))
|
if ((USER || (intval($pref['user_reg']) !== 1) || (vartrue($pref['auth_method'],'e107') != 'e107')) && !getperms('0'))
|
||||||
{
|
{
|
||||||
header('location: '.e_HTTP.'index.php');
|
header('location: '.e_HTTP.'index.php');
|
||||||
|
|
||||||
@@ -278,7 +278,7 @@ if(getperms('0')) // allow main admin to view signup page for design/testing.
|
|||||||
|
|
||||||
$adminMsg = LAN_SIGNUP_112;
|
$adminMsg = LAN_SIGNUP_112;
|
||||||
|
|
||||||
if($pref['user_reg'] !== 1)
|
if(intval($pref['user_reg']) !== 1)
|
||||||
{
|
{
|
||||||
$adminMsg .= "<br />User registration is currently disabled";
|
$adminMsg .= "<br />User registration is currently disabled";
|
||||||
}
|
}
|
||||||
@@ -380,9 +380,8 @@ if (e_QUERY)
|
|||||||
|
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
// Initial signup (registration)
|
// Initial signup (registration)
|
||||||
//----------------------------------------
|
|
||||||
|
|
||||||
if (isset($_POST['register']) && $pref['user_reg'] === 1)
|
if (isset($_POST['register']) && intval($pref['user_reg']) === 1)
|
||||||
{
|
{
|
||||||
e107::getCache()->clear("online_menu_totals");
|
e107::getCache()->clear("online_menu_totals");
|
||||||
|
|
||||||
@@ -513,12 +512,29 @@ if (isset($_POST['register']) && $pref['user_reg'] === 1)
|
|||||||
$temp[] = validatorClass::makeErrorList($eufVals,'USER_ERR_','%n - %t: %v', '<br />');
|
$temp[] = validatorClass::makeErrorList($eufVals,'USER_ERR_','%n - %t: %v', '<br />');
|
||||||
}
|
}
|
||||||
|
|
||||||
message_handler('P_ALERT', implode('<br />', $temp));
|
|
||||||
|
if(deftrue('BOOTSTRAP'))
|
||||||
|
{
|
||||||
|
e107::getMessage()->addError(implode('<br />', $temp));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
message_handler('P_ALERT', implode('<br />', $temp));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} // End of data validation
|
} // End of data validation
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
message_handler('P_ALERT', implode('<br />', $extraErrors)); // Workaround for image-code errors.
|
if(deftrue('BOOTSTRAP'))
|
||||||
|
{
|
||||||
|
e107::getMessage()->addError(implode('<br />', $temp));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
message_handler('P_ALERT', implode('<br />', $extraErrors)); // Workaround for image-code errors.
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user