1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-16 02:26:25 +02:00

Fixes #881 - Signup permission check issue. Corrected signup-text styling and signature styling.

This commit is contained in:
Cameron 2015-02-10 19:47:45 -08:00
parent 27d76b1685
commit 540922d25c
4 changed files with 56 additions and 28 deletions

View File

@ -142,26 +142,31 @@ class signup_shortcodes extends e_shortcode
function sc_signup_form_open()
{
global $rs;
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()
{
// global $SIGNUP_TEXT;
$pref = e107::getPref();
$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'])
{
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()
{
global $pref, $SIGNUP_SIGNATURE_START, $SIGNUP_SIGNATURE_END;
if($pref['signup_option_signature'])
$sigActive = e107::pref('core','signup_option_signature');
if($sigActive)
{
$frm = e107::getForm();
return $frm->bbarea('signature', $sig, 'signature','helpb','small');
// 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;
return $frm->bbarea('signature', $sig, 'signature','helpb', 'tiny');
}
}

View File

@ -1169,7 +1169,7 @@ class e_form
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='.
}
elseif(!vartrue($options['noresize']))
@ -1187,16 +1187,28 @@ class e_form
/**
* Bbcode Area. Name, value, template, media-Cat, size, options array eg. counter
* 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())
{
if(is_string($options)) parse_str($options, $options);
//size - large|medium|small
//width should be explicit set by current admin theme
$size = 'input-large';
// $size = 'input-large';
switch($size)
{
case 'tiny':
$rows = '3';
// $height = "style='height:250px'"; // inline required for wysiwyg
break;
case 'small':
$rows = '7';
$height = "style='height:250px'"; // inline required for wysiwyg
@ -1218,7 +1230,7 @@ class e_form
}
// 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 = '';
@ -1227,10 +1239,9 @@ class e_form
$counter = vartrue($options['counter'],false);
$ret = "
<div class='bbarea {$size}'>
$ret = "<div class='bbarea {$size}'>
<div class='field-spacer'><!-- --></div>\n";
$ret .= e107::getBB()->renderButtons($template,$help_tagid);
$ret .= $this->textarea($name, $value, $rows, 70, $options, $counter); // higher thank 70 will break some layouts.

View File

@ -108,9 +108,9 @@ a.cpage-np.current { text-decoration: none; }
/* message text (overall) */
.warning { color: #FF6600 }
.success { color: green; }
.error { color: #FF0000 }
.error { color: #A94442; }
.info {}
.required { color:red }
.required { color:#A94442; }
/******** Tooltip info */
.e-info {}

View File

@ -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');
@ -278,7 +278,7 @@ if(getperms('0')) // allow main admin to view signup page for design/testing.
$adminMsg = LAN_SIGNUP_112;
if($pref['user_reg'] !== 1)
if(intval($pref['user_reg']) !== 1)
{
$adminMsg .= "<br />User registration is currently disabled";
}
@ -380,9 +380,8 @@ if (e_QUERY)
//----------------------------------------
// 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");
@ -513,12 +512,29 @@ if (isset($_POST['register']) && $pref['user_reg'] === 1)
$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
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.
}
}