예제 #1
0
 public static function Facebook_register_override()
 {
     global $modSettings;
     //overide normal registration if set
     if (!empty($modSettings['fb_app_enabled']) && $modSettings['fb_dfbreg2'] == 1 && isset($_REQUEST['action']) && $_REQUEST['action'] == 'register') {
         redirectexit('action=facebookintegrate;area=fbbp');
     }
     if (!class_exists('Facebook')) {
         self::face_load();
     }
     $user = fb_cookie_parse();
     if ($user && isset($_REQUEST['action']) && $_REQUEST['action'] == 'login' && !empty($modSettings['fb_app_enablelogauto'])) {
         $face_user['id_member'] = self::face_USettings($user['user_id'], 'id_member', 'fbid');
         if (!empty($face_user['id_member'])) {
             redirectexit('action=facebookintegrate;area=connectlog');
         }
     }
 }
예제 #2
0
function template_fbc_set()
{
    global $context, $sc, $modSettings, $profileUrl, $scripturl, $txt;
    $user = fb_cookie_parse();
    if (!$user) {
        echo '<div class="information">
	   <div align="center" class="error">' . $txt['fb_nocon'] . '</div>';
        echo '<div align="center"><a href="' . $profileUrl . '">' . $txt['fb_nocon1'] . '</a></div></div>';
    } else {
        echo ' <form action="', $scripturl, '?action=profile;area=fsettings;u=' . $_GET['u'] . ';save" method="post" accept-charset="', $context['character_set'], '" />
	 <div class="cat_bar">
				<h3 class="catbg">
					<span class="ie6_header floatleft">
					  ' . $txt['fb_main5'] . '
					</span>
				</h3>
			</div>
			<p class="windowbg description">' . $txt['fb_set1'] . '</p>
			<div class="windowbg2">
				<span class="topslice"><span></span></span>
				<div class="content">
	       <dl class="register_form" >
		   <dt>
			<label for="pwp">' . $txt['fb_set2'] . '</label>
				</dt>
					<dd>
					<input type="checkbox" name="pwp" class="input_check" ' . ($context['fbpwp'] ? ' checked="checked" ' : '') . ' />
				</dd>
				<dt>';
        if ($modSettings['enable_buddylist']) {
            echo '
			<label for="impf">' . $txt['fb_set3'] . '</label>
				</dt>
					<dd>
					<button type="button"  onclick="javascript:window.location.href = \'' . $scripturl, '?action=profile;area=fsettings;u=' . $_GET['u'] . ';import\';">' . $txt['fb_set4'] . '</button>
				</dd>';
        }
        echo '
				<dt><label for="impf">' . $txt['fb_aimp'] . '<div class="smalltext">' . $txt['fb_aimp1'] . '</div></label>
				</dt>
					<dd>
					<button type="button"  onclick="javascript:window.location.href = \'' . $scripturl, '?action=profile;area=fsettings;u=' . $_GET['u'] . ';doavatar\';">' . $txt['fb_set4'] . '</button>
				</dd></dl><hr />
		  <div align="center"><a href="' . $scripturl . '?action=facebookintegrate;area=usyncc;sesc=' . $sc . '" onclick="return confirm(\'' . $txt['fb_sync4'] . '\');">' . $txt['fb_sync3'] . '</a></div>
		 <div class="righttext">
						<input type="submit" value="', $txt['change_profile'], '" class="button_submit" /></div>
		 </div>
				<span class="botslice"><span></span></span>
			</div> ';
    }
    template_fbc_copy();
}