mirror of
https://github.com/e107inc/e107.git
synced 2025-07-25 08:51:50 +02:00
Issue #3676 Missing "required" marker on signup
This commit is contained in:
@@ -20,6 +20,8 @@ e107::coreLan('signup');
|
||||
|
||||
class signup_shortcodes extends e_shortcode
|
||||
{
|
||||
|
||||
|
||||
|
||||
function sc_signup_coppa_form($parm)
|
||||
{
|
||||
@@ -455,7 +457,7 @@ class signup_shortcodes extends e_shortcode
|
||||
|
||||
function sc_signup_extended_user_fields()
|
||||
{
|
||||
global $usere, $tp, $SIGNUP_EXTENDED_USER_FIELDS, $EXTENDED_USER_FIELD_REQUIRED, $SIGNUP_EXTENDED_CAT;
|
||||
global $usere, $tp, $SIGNUP_EXTENDED_USER_FIELDS, $SIGNUP_EXTENDED_CAT;
|
||||
$text = "";
|
||||
|
||||
$search = array(
|
||||
@@ -486,26 +488,31 @@ class signup_shortcodes extends e_shortcode
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach($extList as $ext)
|
||||
{
|
||||
if($ext['user_extended_struct_required'] == 1 || $ext['user_extended_struct_required'] == 2)
|
||||
{
|
||||
if(!$done_heading && ($cat['user_extended_struct_id'] > 0))
|
||||
{ // Add in a heading
|
||||
$catName = $cat['user_extended_struct_text'] ? $cat['user_extended_struct_text'] : $cat['user_extended_struct_name'];
|
||||
if(defined($catName)) $catName = constant($catName);
|
||||
$text .= str_replace('{EXTENDED_CAT_TEXT}', $tp->toHTML($catName, FALSE, 'emotes_off,defs'), $SIGNUP_EXTENDED_CAT);
|
||||
$done_heading = TRUE;
|
||||
}
|
||||
$replace = array(
|
||||
$tp->toHTML(deftrue($ext['user_extended_struct_text'], $ext['user_extended_struct_text']), FALSE, 'emotes_off,defs'),
|
||||
($ext['user_extended_struct_required'] == 1 ? $EXTENDED_USER_FIELD_REQUIRED : ''),
|
||||
$usere->user_extended_edit($ext, $_POST['ue']['user_'.$ext['user_extended_struct_name']])
|
||||
);
|
||||
$text .= str_replace($search, $replace, $SIGNUP_EXTENDED_USER_FIELDS);
|
||||
}
|
||||
}
|
||||
|
||||
foreach($extList as $ext)
|
||||
{
|
||||
if($ext['user_extended_struct_required'] == 1 || $ext['user_extended_struct_required'] == 2)
|
||||
{
|
||||
if(!$done_heading && ($cat['user_extended_struct_id'] > 0))
|
||||
{ // Add in a heading
|
||||
$catName = $cat['user_extended_struct_text'] ? $cat['user_extended_struct_text'] : $cat['user_extended_struct_name'];
|
||||
if(defined($catName))
|
||||
{
|
||||
$catName = constant($catName);
|
||||
}
|
||||
$text .= str_replace('{EXTENDED_CAT_TEXT}', $tp->toHTML($catName, false, 'emotes_off,defs'), $SIGNUP_EXTENDED_CAT);
|
||||
$done_heading = true;
|
||||
}
|
||||
|
||||
$replace = array(
|
||||
$tp->toHTML(deftrue($ext['user_extended_struct_text'], $ext['user_extended_struct_text']), false, 'emotes_off,defs'),
|
||||
($ext['user_extended_struct_required'] == 1 ? $this->sc_signup_is_mandatory('true') : ''),
|
||||
$usere->user_extended_edit($ext, $_POST['ue']['user_' . $ext['user_extended_struct_name']])
|
||||
);
|
||||
|
||||
$text .= str_replace($search, $replace, $SIGNUP_EXTENDED_USER_FIELDS);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
@@ -561,17 +568,46 @@ class signup_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
function sc_signup_is_mandatory($parm='')
|
||||
function sc_signup_is_mandatory($parm=null)
|
||||
{
|
||||
global $pref;
|
||||
if (isset($parm))
|
||||
$pref = e107::pref('core');
|
||||
|
||||
$mandatory = array(
|
||||
'realname' => 'signup_option_realname',
|
||||
'subscribe' => 'signup_option_class',
|
||||
'avatar' => 'signup_option_image',
|
||||
'signature' => 'signup_option_signature',
|
||||
);
|
||||
|
||||
if((!empty($mandatory[$parm]) && (int) $pref[$mandatory[$parm]] === 2) || $parm === 'true' || ($parm === 'email' && empty($pref['disable_emailcheck'])))
|
||||
{
|
||||
switch ($parm)
|
||||
{
|
||||
case 'email' : if (varset($pref['disable_emailcheck'],FALSE)) return '';
|
||||
}
|
||||
return "<span class='required'><!-- empty --></span>";
|
||||
}
|
||||
return " *";
|
||||
|
||||
|
||||
|
||||
if(!empty($parm))
|
||||
{
|
||||
switch($parm)
|
||||
{
|
||||
|
||||
|
||||
case 'email' :
|
||||
if(varset($pref['disable_emailcheck'], false))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// if((int) $val === 2)
|
||||
{
|
||||
// return "<span class='required'><!-- empty --><</span>";
|
||||
}
|
||||
|
||||
//return "<span class='required'></span>";
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,12 +17,11 @@
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
if (!defined("USER_WIDTH")){ define("USER_WIDTH", "width:100%"); }
|
||||
|
||||
define("REQUIRED_FIELD_MARKER", "<span class='required'> *</span>");
|
||||
|
||||
$sc_style['SIGNUP_DISPLAYNAME']['pre'] = "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:30%;white-space:nowrap' ><label for='username'>"
|
||||
.LAN_SIGNUP_89."<span class='required'> *</span><br /><span class='smalltext'>".LAN_SIGNUP_90."</span></label>
|
||||
.LAN_SIGNUP_89."{SIGNUP_IS_MANDATORY=true}<br /><span class='smalltext'>".LAN_SIGNUP_90."</span></label>
|
||||
</td>
|
||||
<td class='forumheader3' style='width:70%'>";
|
||||
$sc_style['SIGNUP_DISPLAYNAME']['post'] = "
|
||||
@@ -32,51 +31,15 @@ $sc_style['SIGNUP_DISPLAYNAME']['post'] = "
|
||||
$sc_style['SIGNUP_REALNAME']['pre'] = "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:30%;white-space:nowrap'><label for='realname'>"
|
||||
.LAN_SIGNUP_91."".req($pref['signup_option_realname'])."</label>
|
||||
.LAN_SIGNUP_91."{SIGNUP_IS_MANDATORY=realname}</label>
|
||||
</td>
|
||||
<td class='forumheader3' style='width:70%' >";
|
||||
$sc_style['SIGNUP_REALNAME']['post'] = "
|
||||
</td>
|
||||
</tr>";
|
||||
|
||||
$sc_style['SIGNUP_IS_MANDATORY']['pre'] = "<span class='required'>";
|
||||
$sc_style['SIGNUP_IS_MANDATORY']['post'] = "</span>";
|
||||
|
||||
if(!defined($USERCLASS_SUBSCRIBE_START))
|
||||
{
|
||||
$USERCLASS_SUBSCRIBE_START = "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:30%;vertical-align:top'>"
|
||||
.LAN_USER_76." ".req($pref['signup_option_class'])."<br />
|
||||
<span class='smalltext'>".LAN_USER_73."</span>
|
||||
</td>
|
||||
<td class='forumheader3' style='width:70%;margin-left:0px'>
|
||||
<table style='".USER_WIDTH."'>";
|
||||
}
|
||||
/*
|
||||
if(!defined($USERCLASS_SUBSCRIBE_ROW))
|
||||
{
|
||||
$USERCLASS_SUBSCRIBE_ROW = "
|
||||
<tr>
|
||||
<td class='defaulttext' style='width:10%;vertical-align:top'>
|
||||
<div {USERCLASS_INDENT}>
|
||||
<input type='checkbox' name='class[]' value='{USERCLASS_ID}' {USERCLASS_CHECKED} />
|
||||
</div>
|
||||
</td>
|
||||
<td class='defaulttext' style='text-align:left;margin-left:0px;width:90%;padding-top:3px;vertical-align:top'>
|
||||
{USERCLASS_NAME}<br />
|
||||
<span class='smalltext'>{USERCLASS_DESCRIPTION}</span>
|
||||
</td>
|
||||
</tr>";
|
||||
}*/
|
||||
|
||||
if(!defined($USERCLASS_SUBSCRIBE_END))
|
||||
{
|
||||
$USERCLASS_SUBSCRIBE_END = "
|
||||
</table>
|
||||
</td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
if(!defined($SIGNUP_PASSWORD_LEN))
|
||||
{
|
||||
@@ -98,28 +61,11 @@ if(!defined($SIGNUP_EXTENDED_USER_FIELDS))
|
||||
</tr>";
|
||||
}
|
||||
|
||||
if(!defined($EXTENDED_USER_FIELD_REQUIRED))
|
||||
{
|
||||
$EXTENDED_USER_FIELD_REQUIRED = "<span class='required'> *</span>";
|
||||
}
|
||||
|
||||
/* // DEPRECATED
|
||||
$SIGNUP_SIGNATURE_START = "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:30%;white-space:nowrap;vertical-align:top' >".LAN_SIGNUP_93." ".req($pref['signup_option_signature'])."</td>
|
||||
<td class='forumheader3' style='width:70%' >
|
||||
<textarea class='tbox' style='width:99%' name='signature' cols='10' rows='4' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>";
|
||||
|
||||
$SIGNUP_SIGNATURE_END = "
|
||||
</textarea><br />
|
||||
<div style='".USER_WIDTH."'>{REN_HELP}</div>
|
||||
</td></tr>
|
||||
";
|
||||
*/
|
||||
|
||||
$sc_style['SIGNUP_SIGNATURE']['pre'] = "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:30%;white-space:nowrap;vertical-align:top' ><label for='signature'>".LAN_SIGNUP_93." ".req($pref['signup_option_signature'])."</label></td>
|
||||
<td class='forumheader3' style='width:30%;white-space:nowrap;vertical-align:top' ><label for='signature'>".LAN_SIGNUP_93." {SIGNUP_IS_MANDATORY=signature}</label></td>
|
||||
<td class='forumheader3' style='width:70%'>";
|
||||
|
||||
$sc_style['SIGNUP_SIGNATURE']['post'] = "
|
||||
@@ -128,7 +74,7 @@ $sc_style['SIGNUP_SIGNATURE']['post'] = "
|
||||
|
||||
$sc_style['SIGNUP_IMAGES']['pre'] = "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:30%; vertical-align:top;white-space:nowrap' ><label for='avatar'>".LAN_SIGNUP_94.req($pref['signup_option_image'])."</label></td>
|
||||
<td class='forumheader3' style='width:30%; vertical-align:top;white-space:nowrap' ><label for='avatar'>".LAN_SIGNUP_94."{SIGNUP_IS_MANDATORY=avatar}</label></td>
|
||||
<td class='forumheader3' style='width:70%;vertical-align:top'>";
|
||||
$sc_style['SIGNUP_IMAGES']['post'] = "
|
||||
</td>
|
||||
@@ -136,7 +82,7 @@ $sc_style['SIGNUP_IMAGES']['post'] = "
|
||||
|
||||
$sc_style['SIGNUP_IMAGECODE']['pre'] = "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:30%'><label for='code-verify'>".e107::getSecureImg()->renderLabel().req(2)."</label></td>
|
||||
<td class='forumheader3' style='width:30%'><label for='code-verify'>".e107::getSecureImg()->renderLabel()."{SIGNUP_IS_MANDATORY=true}</label></td>
|
||||
<td class='forumheader3' style='width:70%'>";
|
||||
$sc_style['SIGNUP_IMAGECODE']['post'] = "
|
||||
</td>
|
||||
@@ -144,7 +90,7 @@ $sc_style['SIGNUP_IMAGECODE']['post'] = "
|
||||
|
||||
$sc_style['SIGNUP_LOGINNAME']['pre'] = "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:30%'><label for='loginname'>".LAN_SIGNUP_81.req(2)."</label></td>
|
||||
<td class='forumheader3' style='width:30%'><label for='loginname'>".LAN_SIGNUP_81."{SIGNUP_IS_MANDATORY=true}</label></td>
|
||||
<td class='forumheader3' style='width:70%'>";
|
||||
$sc_style['SIGNUP_LOGINNAME']['post'] = "
|
||||
</td>
|
||||
@@ -160,7 +106,7 @@ $sc_style['SIGNUP_HIDE_EMAIL']['post'] = "
|
||||
|
||||
$sc_style['SIGNUP_EMAIL_CONFIRM']['pre'] = "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:30%;white-space:nowrap'><label for='email-confirm'>".LAN_SIGNUP_39."</label></td>
|
||||
<td class='forumheader3' style='width:30%;white-space:nowrap'><label for='email-confirm'>".LAN_SIGNUP_39."{SIGNUP_IS_MANDATORY=true}</label></td>
|
||||
<td class='forumheader3' style='width:70%'>";
|
||||
$sc_style['SIGNUP_EMAIL_CONFIRM']['post'] = "
|
||||
</td>
|
||||
@@ -170,19 +116,19 @@ $sc_style['SIGNUP_XUP']['pre'] = "<div class='center' style='display:block;paddi
|
||||
$sc_style['SIGNUP_XUP']['post'] = "<h2 class='signup-divider'><span>".LAN_SIGNUP_120."</span></h2></div>";
|
||||
|
||||
$sc_style['SIGNUP_PASSWORD1']['pre'] = "<tr>
|
||||
<td class='forumheader3' style='width:30%;white-space:nowrap'><label for='password1'>".LAN_SIGNUP_83."<span class='required'> *</span></label></td>
|
||||
<td class='forumheader3' style='width:30%;white-space:nowrap'><label for='password1'>".LAN_SIGNUP_83."{SIGNUP_IS_MANDATORY=true}</label></td>
|
||||
<td class='forumheader3' style='width:70%'>";
|
||||
$sc_style['SIGNUP_PASSWORD1']['post'] = "</td>
|
||||
</tr>";
|
||||
|
||||
$sc_style['SIGNUP_PASSWORD2']['pre'] = "<tr>
|
||||
<td class='forumheader3' style='width:30%;white-space:nowrap'><label for='password2'>".LAN_SIGNUP_84."<span class='required'> *</span></label></td>
|
||||
<td class='forumheader3' style='width:30%;white-space:nowrap'><label for='password2'>".LAN_SIGNUP_84."{SIGNUP_IS_MANDATORY=true}</label></td>
|
||||
<td class='forumheader3' style='width:70%'>";
|
||||
$sc_style['SIGNUP_PASSWORD2']['post'] = "</td>
|
||||
</tr>";
|
||||
|
||||
$sc_style['SIGNUP_USERCLASS_SUBSCRIBE']['pre'] = "<tr>
|
||||
<td class='forumheader3' style='width:30%;white-space:nowrap'><label>".LAN_SIGNUP_113."</label></td>
|
||||
<td class='forumheader3' style='width:30%;white-space:nowrap'><label>".LAN_SIGNUP_113."{SIGNUP_IS_MANDATORY=subscribe}</label></td>
|
||||
<td class='forumheader3' style='width:70%'>";
|
||||
$sc_style['SIGNUP_USERCLASS_SUBSCRIBE']['post'] = "</td>
|
||||
</tr>";
|
||||
|
@@ -540,7 +540,7 @@ class e_parse extends e_parser
|
||||
$data = strip_tags($data); // remove tags from cleaned html.
|
||||
$data = str_replace(array('[html]','[/html]'),'',$data);
|
||||
}
|
||||
|
||||
|
||||
// $data = html_entity_decode($data, ENT_QUOTES, 'utf-8'); // Prevent double-entities. Fix for [code] - see bb_code.php toDB();
|
||||
}
|
||||
|
||||
|
@@ -1084,7 +1084,7 @@ exit;
|
||||
// Function returns an image if a field is required.
|
||||
function req($field)
|
||||
{
|
||||
return ($field == 2 ? REQUIRED_FIELD_MARKER : "");
|
||||
return ($field == 2 ? "<span class='required'></span>" : "");
|
||||
}
|
||||
//----------------------------------
|
||||
|
||||
|
Reference in New Issue
Block a user