mirror of
https://github.com/e107inc/e107.git
synced 2025-07-25 17:01:43 +02:00
@@ -1342,117 +1342,8 @@ $text .= "
|
|||||||
";
|
";
|
||||||
|
|
||||||
// =========== Registration Preferences. ==================
|
// =========== Registration Preferences. ==================
|
||||||
$text .= "
|
|
||||||
<fieldset class='e-hideme' id='core-prefs-registration'>
|
|
||||||
<legend>".PRFLAN_28."</legend>
|
|
||||||
<table class='table adminform'>
|
|
||||||
<colgroup>
|
|
||||||
<col class='col-label' />
|
|
||||||
<col class='col-control' />
|
|
||||||
</colgroup>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><label for='user-reg'>".PRFLAN_29."</label></td>
|
|
||||||
<td>
|
|
||||||
".$frm->radio_switch('user_reg', $pref['user_reg'])."
|
|
||||||
<div class='smalltext field-help'>".PRFLAN_30."</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><label for='user-reg-veri'>".PRFLAN_154."</label></td>
|
|
||||||
<td>
|
|
||||||
".$frm->select_open('user_reg_veri');
|
|
||||||
$veri_list = array(PRFLAN_152,PRFLAN_31,PRFLAN_153);
|
|
||||||
|
|
||||||
foreach($veri_list as $v => $v_title)
|
|
||||||
{
|
|
||||||
$text .= $frm->option($v_title, $v, ($pref['user_reg_veri'] == $v));
|
|
||||||
}
|
|
||||||
|
|
||||||
$text .= "
|
|
||||||
</select>
|
|
||||||
<div class='field-help'>".PRFLAN_154a."</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for='allowemaillogin'>".PRFLAN_184."</label></td>
|
|
||||||
<td>".$frm->select_open('allowEmailLogin');
|
|
||||||
// $login_list = array(PRFLAN_201,PRFLAN_202,PRFLAN_203);
|
|
||||||
$login_list = array(
|
|
||||||
2 => PRFLAN_203,
|
|
||||||
1 => PRFLAN_202,
|
|
||||||
0 => PRFLAN_201
|
|
||||||
);
|
|
||||||
foreach($login_list as $l => $l_title)
|
|
||||||
{
|
|
||||||
$text .= $frm->option($l_title, $l, ($pref['allowEmailLogin'] == $l));
|
|
||||||
}
|
|
||||||
|
|
||||||
$text .= "
|
|
||||||
</select></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for='signup-remote-emailcheck'>".PRFLAN_160."</label></td>
|
|
||||||
<td>
|
|
||||||
".$frm->radio_switch('signup_remote_emailcheck', $pref['signup_remote_emailcheck'])."
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for='disable-emailcheck'>".PRFLAN_167."</label></td>
|
|
||||||
<td>
|
|
||||||
".$frm->radio_switch('disable_emailcheck', $pref['disable_emailcheck'])."
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><label for='use-coppa'>".PRFLAN_45."</label></td>
|
|
||||||
<td>
|
|
||||||
".$frm->radio_switch('use_coppa', $pref['use_coppa'])."
|
|
||||||
<div class='field-help'>".PRFLAN_46." <a href='http://www.ftc.gov/privacy/coppafaqs.shtm'>".PRFLAN_94."</a></div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for='membersonly-enabled'>".PRFLAN_58."</label></td>
|
|
||||||
<td>";
|
|
||||||
|
|
||||||
$memDisp = !vartrue($pref['membersonly_enabled']) ? "e-hideme" : "";
|
|
||||||
|
|
||||||
$text .= $frm->radio_switch('membersonly_enabled', $pref['membersonly_enabled'],'', '', 'class=e-expandit')."
|
|
||||||
<div class='field-help'>".PRFLAN_59."</div>
|
|
||||||
<div class='e-expandit-container {$memDisp}' style='padding-top:10px'>".
|
|
||||||
$frm->textarea('membersonly_exceptions', $pref['membersonly_exceptions'], 3, 1, 'placeholder='.PRFLAN_206)."
|
|
||||||
<div class='field-help'>".PRFLAN_207."</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><label for='autologinpostsignup'>".PRFLAN_197."</label></td>
|
|
||||||
<td>
|
|
||||||
".$frm->radio_switch('autologinpostsignup', $pref['autologinpostsignup'])."
|
|
||||||
<div class='smalltext field-help'>".PRFLAN_198."</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><label for='signup-maxip'>".PRFLAN_136."</label></td>
|
|
||||||
<td>
|
|
||||||
".$frm->number('signup_maxip', $pref['signup_maxip'], 3)."
|
|
||||||
<div class='field-help'>".PRFLAN_78."</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
".pref_submit('registration')."
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
";
|
|
||||||
|
|
||||||
// Single/ Social Login / / copied from hybridAuth config.php so it's easy to add more.
|
// Single/ Social Login / / copied from hybridAuth config.php so it's easy to add more.
|
||||||
// Used Below.
|
// Used Below.
|
||||||
|
|
||||||
@@ -1530,8 +1421,6 @@ $social_logins = array (
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Key registration
|
|
||||||
// TODO LAN
|
|
||||||
$social_external = array(
|
$social_external = array(
|
||||||
"Facebook" => "https://developers.facebook.com/apps",
|
"Facebook" => "https://developers.facebook.com/apps",
|
||||||
"Twitter" => "https://dev.twitter.com/apps/new",
|
"Twitter" => "https://dev.twitter.com/apps/new",
|
||||||
@@ -1543,12 +1432,216 @@ $social_external = array(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$testUrl = SITEURL."?route=system/xup/test";
|
$testUrl = SITEURL."?route=system/xup/test";
|
||||||
|
|
||||||
|
$elements = array(1=>'Register & Login', 2=> 'Login Only', 0=>LAN_DISABLED);
|
||||||
|
|
||||||
|
|
||||||
|
$text .= "
|
||||||
|
<fieldset class='e-hideme' id='core-prefs-registration'>
|
||||||
|
<legend>".PRFLAN_28."</legend>
|
||||||
|
<table class='table adminform'>
|
||||||
|
<colgroup>
|
||||||
|
<col class='col-label' />
|
||||||
|
<col class='col-control' />
|
||||||
|
</colgroup>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td><label for='user-reg'>".PRFLAN_224."</label></td>
|
||||||
|
<td>
|
||||||
|
".$frm->radio('user_reg', $elements, $pref['user_reg'])."
|
||||||
|
<div class='smalltext field-help'>".PRFLAN_30."</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><label for='user-reg-veri'>".PRFLAN_154."</label></td>
|
||||||
|
<td>
|
||||||
|
".$frm->select_open('user_reg_veri');
|
||||||
|
$veri_list = array(PRFLAN_152,PRFLAN_31,PRFLAN_153);
|
||||||
|
|
||||||
|
foreach($veri_list as $v => $v_title)
|
||||||
|
{
|
||||||
|
$text .= $frm->option($v_title, $v, ($pref['user_reg_veri'] == $v));
|
||||||
|
}
|
||||||
|
|
||||||
|
$text .= "
|
||||||
|
</select>
|
||||||
|
<div class='field-help'>".PRFLAN_154a."</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><label for='allowemaillogin'>".PRFLAN_184."</label></td>
|
||||||
|
<td>".$frm->select_open('allowEmailLogin');
|
||||||
|
// $login_list = array(PRFLAN_201,PRFLAN_202,PRFLAN_203);
|
||||||
|
$login_list = array(
|
||||||
|
2 => PRFLAN_203,
|
||||||
|
1 => PRFLAN_202,
|
||||||
|
0 => PRFLAN_201
|
||||||
|
);
|
||||||
|
foreach($login_list as $l => $l_title)
|
||||||
|
{
|
||||||
|
$text .= $frm->option($l_title, $l, ($pref['allowEmailLogin'] == $l));
|
||||||
|
}
|
||||||
|
|
||||||
|
$text .= "
|
||||||
|
</select></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for='signup-remote-emailcheck'>".PRFLAN_160."</label></td>
|
||||||
|
<td>
|
||||||
|
".$frm->radio_switch('signup_remote_emailcheck', $pref['signup_remote_emailcheck'])."
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for='disable-emailcheck'>".PRFLAN_167."</label></td>
|
||||||
|
<td>
|
||||||
|
".$frm->radio_switch('disable_emailcheck', $pref['disable_emailcheck'])."
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><label for='use-coppa'>".PRFLAN_45."</label></td>
|
||||||
|
<td>
|
||||||
|
".$frm->radio_switch('use_coppa', $pref['use_coppa'])."
|
||||||
|
<div class='field-help'>".PRFLAN_46." <a href='http://www.ftc.gov/privacy/coppafaqs.shtm'>".PRFLAN_94."</a></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label for='membersonly-enabled'>".PRFLAN_58."</label></td>
|
||||||
|
<td>";
|
||||||
|
|
||||||
|
$memDisp = !vartrue($pref['membersonly_enabled']) ? "e-hideme" : "";
|
||||||
|
|
||||||
|
$text .= $frm->radio_switch('membersonly_enabled', $pref['membersonly_enabled'],'', '', 'class=e-expandit')."
|
||||||
|
<div class='field-help'>".PRFLAN_59."</div>
|
||||||
|
<div class='e-expandit-container {$memDisp}' style='padding-top:10px'>".
|
||||||
|
$frm->textarea('membersonly_exceptions', $pref['membersonly_exceptions'], 3, 1, 'placeholder='.PRFLAN_206)."
|
||||||
|
<div class='field-help'>".PRFLAN_207."</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><label for='autologinpostsignup'>".PRFLAN_197."</label></td>
|
||||||
|
<td>
|
||||||
|
".$frm->radio_switch('autologinpostsignup', $pref['autologinpostsignup'])."
|
||||||
|
<div class='smalltext field-help'>".PRFLAN_198."</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><label for='signup-maxip'>".PRFLAN_136."</label></td>
|
||||||
|
<td>
|
||||||
|
".$frm->number('signup_maxip', $pref['signup_maxip'], 3)."
|
||||||
|
<div class='field-help'>".PRFLAN_78."</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
</tbody>";
|
||||||
|
|
||||||
|
|
||||||
|
$text .= "
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><label for='social-login-active'>Social Signup/Login</label>
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
".$frm->radio_switch('social_login_active', $pref['social_login_active'])."
|
||||||
|
<div class='smalltext field-help'>Allows users to signup/login with their social media accounts. When enabled, this option will still allow users to signup/login even if the core user registration system above is disabled. </div>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td colspan='2'><div>Note: In most cases you will need to obtain an id and secret key from one of the providers. Click the blue links below to configure.
|
||||||
|
<br />You may test your configuration with the following URL:
|
||||||
|
<a href='".$testUrl."' rel='external'>".$testUrl."</a></div>
|
||||||
|
</div>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
";
|
||||||
|
|
||||||
|
if(!is_array($pref['social_login']))
|
||||||
|
{
|
||||||
|
$pref['social_login'] = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($social_logins as $prov=>$val)
|
||||||
|
{
|
||||||
|
|
||||||
|
$label = varset($social_external[$prov]) ? "<a class='e-tip' rel='external' title='Get a key from the provider' href='".$social_external[$prov]."'>".$prov."</a>" : $prov;
|
||||||
|
$radio_label = strtolower($prov);
|
||||||
|
$text .= "
|
||||||
|
<tr>
|
||||||
|
<td><label for='social-login-".$radio_label."-enabled'>".$label."</label></td>
|
||||||
|
<td>
|
||||||
|
";
|
||||||
|
foreach($val as $k=>$v)
|
||||||
|
{
|
||||||
|
switch ($k) {
|
||||||
|
case 'enabled':
|
||||||
|
$eopt = array('class'=>'e-expandit');
|
||||||
|
$text .= $frm->radio_switch('social_login['.$prov.'][enabled]', vartrue($pref['social_login'][$prov]['enabled']),'','',$eopt);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'keys':
|
||||||
|
// $cls = vartrue($pref['single_login'][$prov]['keys'][$tk]) ? "class='e-hideme'" : '';
|
||||||
|
$sty = vartrue($pref['social_login'][$prov]['keys'][vartrue($tk)]) ? "" : "e-hideme";
|
||||||
|
$text .= "<div class='e-expandit-container {$sty}' id='option-{$prov}' >";
|
||||||
|
foreach($v as $tk=>$idk)
|
||||||
|
{
|
||||||
|
$eopt = array('placeholder'=> $tk, 'size'=>'xxlarge');
|
||||||
|
$text .= "<br />".$frm->text('social_login['.$prov.'][keys]['.$tk.']', vartrue($pref['social_login'][$prov]['keys'][$tk]), 100, $eopt);
|
||||||
|
}
|
||||||
|
$text .= "</div>";
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'scope':
|
||||||
|
$text .= $frm->hidden('social_login['.$prov.'][scope]','email');
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$text .= "</td>
|
||||||
|
</tr>
|
||||||
|
";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$text .= "
|
||||||
|
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
".pref_submit('registration')."
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
";
|
||||||
|
|
||||||
|
|
||||||
|
// Key registration
|
||||||
|
// TODO LAN
|
||||||
|
|
||||||
|
|
||||||
$text .= "
|
$text .= "
|
||||||
<fieldset class='e-hideme' id='core-prefs-sociallogin'>
|
<fieldset class='e-hideme' id='core-prefs-sociallogin'>
|
||||||
<legend>Social Options</legend>
|
<legend>Social Options</legend>
|
||||||
<div class='alert alert-warning'>Note: This section requires further testing.<br />You may test with the following URL:
|
|
||||||
<a href='".$testUrl."' rel='external'>".$testUrl."</a></div>
|
|
||||||
<table class='table adminform'>
|
<table class='table adminform'>
|
||||||
<colgroup>
|
<colgroup>
|
||||||
<col class='col-label' />
|
<col class='col-label' />
|
||||||
@@ -1592,68 +1685,7 @@ $xurls = array(
|
|||||||
";
|
";
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= "
|
|
||||||
<tr>
|
|
||||||
<th colspan='2'>Social Logins</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for='social-login-active'>Enable Social Logins</label></td>
|
|
||||||
<td>
|
|
||||||
".$frm->radio_switch('social_login_active', $pref['social_login_active'])."
|
|
||||||
</td>
|
|
||||||
</tr>";
|
|
||||||
|
|
||||||
if(!is_array($pref['social_login']))
|
|
||||||
{
|
|
||||||
$pref['social_login'] = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($social_logins as $prov=>$val)
|
|
||||||
{
|
|
||||||
|
|
||||||
$label = varset($social_external[$prov]) ? "<a class='e-tip' rel='external' title='Get a key from the provider' href='".$social_external[$prov]."'>".$prov."</a>" : $prov;
|
|
||||||
$radio_label = strtolower($prov);
|
|
||||||
$text .= "
|
|
||||||
<tr>
|
|
||||||
<td><label for='social-login-".$radio_label."-enabled'>".$label."</label></td>
|
|
||||||
<td>
|
|
||||||
";
|
|
||||||
foreach($val as $k=>$v)
|
|
||||||
{
|
|
||||||
switch ($k) {
|
|
||||||
case 'enabled':
|
|
||||||
$eopt = array('class'=>'e-expandit');
|
|
||||||
$text .= $frm->radio_switch('social_login['.$prov.'][enabled]', vartrue($pref['social_login'][$prov]['enabled']),'','',$eopt);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'keys':
|
|
||||||
// $cls = vartrue($pref['single_login'][$prov]['keys'][$tk]) ? "class='e-hideme'" : '';
|
|
||||||
$sty = vartrue($pref['social_login'][$prov]['keys'][vartrue($tk)]) ? "" : "e-hideme";
|
|
||||||
$text .= "<div class='e-expandit-container {$sty}' id='option-{$prov}' >";
|
|
||||||
foreach($v as $tk=>$idk)
|
|
||||||
{
|
|
||||||
$eopt = array('placeholder'=> $tk);
|
|
||||||
$text .= "<br />".$frm->text('social_login['.$prov.'][keys]['.$tk.']', vartrue($pref['social_login'][$prov]['keys'][$tk]), 100, $eopt);
|
|
||||||
}
|
|
||||||
$text .= "</div>";
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'scope':
|
|
||||||
$text .= $frm->hidden('social_login['.$prov.'][scope]','email');
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$text .= "</td>
|
|
||||||
</tr>
|
|
||||||
";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$text .= "
|
$text .= "
|
||||||
|
@@ -57,9 +57,12 @@ class signup_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO - template
|
// TODO - template
|
||||||
function sc_signup_xup_login()
|
function sc_signup_xup_login($parm)
|
||||||
{
|
{
|
||||||
$pref = e107::getPref('social_login_active');
|
$pref = e107::getPref('social_login_active');
|
||||||
|
$tp = e107::getParser();
|
||||||
|
|
||||||
|
$size = empty($parm['size']) ? '3x' : $parm['size'];
|
||||||
|
|
||||||
if(!empty($pref))
|
if(!empty($pref))
|
||||||
{
|
{
|
||||||
@@ -82,8 +85,9 @@ class signup_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 'signup' Creates a new XUP user if not found, otherwise it logs the person in.
|
// 'signup' Creates a new XUP user if not found, otherwise it logs the person in.
|
||||||
$button = (defset('FONTAWESOME') === 4) ? "<span title='Register using your {$p} account'>".$tp->toGlyph('fa-'.$ic, array('size'=>'3x'))."</span>" : "<img class='e-tip' title='Register using your {$p} account' src='".e_IMAGE_ABS."xup/{$p}.png' alt='' />";
|
|
||||||
$text .= " <a class='signup-xup' href='".e107::getUrl()->create('system/xup/signup?provider='.$p.'&back='.base64_encode(e_REQUEST_URL))."'>".$button."</a> ";
|
$button = (defset('FONTAWESOME') === 4) ? $tp->toGlyph('fa-'.$ic, array('size'=>$size)) : "<img class='e-tip' title='Register using your {$p} account' src='".e_IMAGE_ABS."xup/{$p}.png' alt='' />";
|
||||||
|
$text .= " <a title='Sign-in using your {$p} account' role='button' class='signup-xup btn btn-primary' href='".e107::getUrl()->create('system/xup/signup?provider='.$p.'&back='.base64_encode(e_REQUEST_URL))."'>".$button."</a> ";
|
||||||
}
|
}
|
||||||
//TODO different icon options. see: http://zocial.smcllns.com/
|
//TODO different icon options. see: http://zocial.smcllns.com/
|
||||||
}
|
}
|
||||||
@@ -94,14 +98,22 @@ class signup_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO - template
|
// TODO - template
|
||||||
function sc_signup_xup_signup()
|
function sc_signup_xup_signup($parm)
|
||||||
{
|
{
|
||||||
$pref = e107::getPref('social_login_active');
|
$pref = e107::getPref('social_login_active');
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
if(!empty($pref))
|
if(!empty($pref))
|
||||||
{
|
{
|
||||||
$text = "";
|
$text = "";
|
||||||
$providers = e107::getPref('social_login');
|
$providers = e107::pref('core', 'social_login');
|
||||||
|
|
||||||
|
$size = empty($parm['size']) ? '2x' : $parm['size'];
|
||||||
|
$class = empty($parm['class']) ? 'btn btn-primary' : $parm['class'] ;
|
||||||
|
|
||||||
|
if($size == '2x')
|
||||||
|
{
|
||||||
|
$class .= ' btn-lg';
|
||||||
|
}
|
||||||
|
|
||||||
foreach($providers as $p=>$v)
|
foreach($providers as $p=>$v)
|
||||||
{
|
{
|
||||||
@@ -115,9 +127,9 @@ class signup_shortcodes extends e_shortcode
|
|||||||
$ic = 'windows';
|
$ic = 'windows';
|
||||||
}
|
}
|
||||||
|
|
||||||
$button = (defset('FONTAWESOME') === 4) ? "<span title='Register using your {$p} account'>".$tp->toGlyph('fa-'.$ic, array('size'=>'3x'))."</span>" : "<img class='e-tip' title='Register using your {$p} account' src='".e_IMAGE_ABS."xup/{$p}.png' alt='' />";
|
$button = (defset('FONTAWESOME') === 4) ? "<span title='Register using your {$p} account'>".$tp->toGlyph('fa-'.$ic, array('size'=>$size))."</span>" : "<img class='e-tip' title='Register using your {$p} account' src='".e_IMAGE_ABS."xup/{$p}.png' alt='' />";
|
||||||
|
|
||||||
$text .= " <a class='signup-xup' href='".e107::getUrl()->create('system/xup/signup?provider='.$p.'&back='.base64_encode(e_REQUEST_URL))."'>".$button."</a> ";
|
$text .= " <a class='signup-xup ".$class."' role='button' href='".e107::getUrl()->create('system/xup/signup?provider='.$p.'&back='.base64_encode(e_REQUEST_URL))."'>".$button."</a> ";
|
||||||
}
|
}
|
||||||
//TODO different icon options. see: http://zocial.smcllns.com/
|
//TODO different icon options. see: http://zocial.smcllns.com/
|
||||||
}
|
}
|
||||||
|
@@ -230,4 +230,6 @@ define("PRFLAN_223", "Completely Automated Public Turing test to tell Computers
|
|||||||
// define("PRFLAN_222", "Moderate Comments made by");
|
// define("PRFLAN_222", "Moderate Comments made by");
|
||||||
// define("PRFLAN_223", "Comments will require manual approval by an admin prior to being visible to other users");
|
// define("PRFLAN_223", "Comments will require manual approval by an admin prior to being visible to other users");
|
||||||
|
|
||||||
|
define("PRFLAN_224", "User registration system");
|
||||||
|
|
||||||
?>
|
?>
|
@@ -63,7 +63,23 @@ class social_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function sc_social_login($parm=null)
|
||||||
|
{
|
||||||
|
$pref = e107::pref('core', 'social_login_active');
|
||||||
|
|
||||||
|
if(empty($pref))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sc = e107::getScBatch('signup');
|
||||||
|
$text .= "<p>Sign in with:</p>";
|
||||||
|
$text .= $sc->sc_signup_xup_login($parm);
|
||||||
|
$text .= "
|
||||||
|
<div class='clearfix'></div><hr class='clearfix' />";
|
||||||
|
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -24,24 +24,40 @@ class theme_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
require_once(e_PLUGIN."login_menu/login_menu_shortcodes.php");
|
require_once(e_PLUGIN."login_menu/login_menu_shortcodes.php");
|
||||||
|
|
||||||
|
$userReg = defset('USER_REGISTRATION');
|
||||||
|
|
||||||
if(!USERID) // Logged Out.
|
if(!USERID) // Logged Out.
|
||||||
{
|
{
|
||||||
$text = '
|
$text = '
|
||||||
<ul class="nav navbar-nav navbar-right">';
|
<ul class="nav navbar-nav navbar-right">';
|
||||||
|
|
||||||
if(deftrue('USER_REGISTRATION'))
|
if($userReg==1)
|
||||||
{
|
{
|
||||||
$text .= '
|
$text .= '
|
||||||
<li><a href="'.e_SIGNUP.'">'.LOGIN_MENU_L3.'</a></li>
|
<li><a href="'.e_SIGNUP.'">'.LOGIN_MENU_L3.'</a></li>
|
||||||
'; // Signup
|
'; // Signup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$text .= '
|
$text .= '
|
||||||
<li class="divider-vertical"></li>
|
<li class="divider-vertical"></li>
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
|
|
||||||
<a class="dropdown-toggle" href="#" data-toggle="dropdown">Sign In <strong class="caret"></strong></a>
|
<a class="dropdown-toggle" href="#" data-toggle="dropdown">Sign In <strong class="caret"></strong></a>
|
||||||
<div class="dropdown-menu col-sm-12" style="min-width:250px; padding: 15px; padding-bottom: 0px;">
|
<div class="dropdown-menu col-sm-12" style="min-width:250px; padding: 15px; padding-bottom: 0px;">
|
||||||
|
|
||||||
|
{SOCIAL_LOGIN: size=2x}
|
||||||
|
';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(!empty($userReg)) // value of 1 or 2 = login okay.
|
||||||
|
{
|
||||||
|
$text .='
|
||||||
|
|
||||||
<form method="post" onsubmit="hashLoginPassword(this);return true" action="'.e_REQUEST_HTTP.'" accept-charset="UTF-8">
|
<form method="post" onsubmit="hashLoginPassword(this);return true" action="'.e_REQUEST_HTTP.'" accept-charset="UTF-8">
|
||||||
{LM_USERNAME_INPUT}
|
{LM_USERNAME_INPUT}
|
||||||
{LM_PASSWORD_INPUT}
|
{LM_PASSWORD_INPUT}
|
||||||
@@ -54,36 +70,40 @@ class theme_shortcodes extends e_shortcode
|
|||||||
'.LOGIN_MENU_L6.'</label>
|
'.LOGIN_MENU_L6.'</label>
|
||||||
</div>
|
</div>
|
||||||
<input class="btn btn-primary btn-block" type="submit" name="userlogin" id="userlogin" value="'.LOGIN_MENU_L51.'">
|
<input class="btn btn-primary btn-block" type="submit" name="userlogin" id="userlogin" value="'.LOGIN_MENU_L51.'">
|
||||||
';
|
';
|
||||||
|
|
||||||
$text .= '
|
$text .= '
|
||||||
|
|
||||||
<a href="{LM_FPW_LINK=href}" class="btn btn-default btn-sm btn-block">'.LOGIN_MENU_L4.'</a>
|
<a href="{LM_FPW_LINK=href}" class="btn btn-default btn-sm btn-block">'.LOGIN_MENU_L4.'</a>
|
||||||
<a href="{LM_RESEND_LINK=href}" class="btn btn-default btn-sm btn-block">'.LOGIN_MENU_L40.'</a>
|
<a href="{LM_RESEND_LINK=href}" class="btn btn-default btn-sm btn-block">'.LOGIN_MENU_L40.'</a>
|
||||||
';
|
';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$text .= '
|
$text .= '
|
||||||
<label style="text-align:center;margin-top:5px">or</label>
|
<label style="text-align:center;margin-top:5px">or</label>
|
||||||
<input class="btn btn-primary btn-block" type="button" id="sign-in-google" value="Sign In with Google">
|
<input class="btn btn-primary btn-block" type="button" id="sign-in-google" value="Sign In with Google">
|
||||||
<input class="btn btn-primary btn-block" type="button" id="sign-in-twitter" value="Sign In with Twitter">
|
<input class="btn btn-primary btn-block" type="button" id="sign-in-twitter" value="Sign In with Twitter">
|
||||||
';
|
';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$text .= "<p></p>
|
$text .= "<p></p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$text .= "
|
||||||
|
|
||||||
|
|
||||||
</ul>";
|
</ul>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return $tp->parseTemplate($text, false, $login_menu_shortcodes);
|
return $tp->parseTemplate($text, true, $login_menu_shortcodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
require_once("class2.php");
|
require_once("class2.php");
|
||||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
|
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
|
||||||
|
|
||||||
if ((USER || e_LOGIN != e_SELF) && e_QUERY !== 'preview') // Disable page if user logged in, or some custom e_LOGIN value is used.
|
if ((USER || e_LOGIN != e_SELF || empty($pref['user_reg']) ) && e_QUERY !== 'preview' ) // Disable page if user logged in, or some custom e_LOGIN value is used.
|
||||||
{
|
{
|
||||||
header('location:'.e_BASE.'index.php');
|
header('location:'.e_BASE.'index.php');
|
||||||
exit();
|
exit();
|
||||||
|
@@ -268,6 +268,7 @@ if($signup_imagecode)
|
|||||||
if ((USER || ($pref['user_reg'] != 1) || (vartrue($pref['auth_method'],'e107') != 'e107')) && !getperms('0'))
|
if ((USER || ($pref['user_reg'] != 1) || (vartrue($pref['auth_method'],'e107') != 'e107')) && !getperms('0'))
|
||||||
{
|
{
|
||||||
header('location: '.e_HTTP.'index.php');
|
header('location: '.e_HTTP.'index.php');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getperms('0')) // allow main admin to view signup page for design/testing.
|
if(getperms('0')) // allow main admin to view signup page for design/testing.
|
||||||
@@ -277,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($pref['user_reg'] !== 1)
|
||||||
{
|
{
|
||||||
$adminMsg .= "<br />User registration is currently disabled";
|
$adminMsg .= "<br />User registration is currently disabled";
|
||||||
}
|
}
|
||||||
@@ -381,7 +382,7 @@ if (e_QUERY)
|
|||||||
// Initial signup (registration)
|
// Initial signup (registration)
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
|
|
||||||
if (isset($_POST['register']) && $pref['user_reg'] == 1)
|
if (isset($_POST['register']) && $pref['user_reg'] === 1)
|
||||||
{
|
{
|
||||||
e107::getCache()->clear("online_menu_totals");
|
e107::getCache()->clear("online_menu_totals");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user