Wer ist hier? 1 Gäste
Facebook
|
|
limus |
Geschrieben am 29.11.2010 00000011 10:02
|
![]() Mitglied ![]() Beiträge: 161 Registriert am: 05.07.09 Fusioneer: 15 years 9 months 0 weeks 5 days 23 hours 58 minutes 36 seconds |
Hallo zusammen mir ist aufgefallen das viele Seiten eine Anmeldung mit seinem Facebookdaten anbieten. Nun meine Frage kann man das in seine Fusionseite einbinden? Vielen Dank. <div style="text-align:center"><b style="font-size:large">Besuchen Sie auch unsere <a href="http://www.one4all.by-limus24.de" target="_blank">Webseite</a>.</b></div><div style="text-align:center"><img style="font-size:10pt"></div>
<center><img src="http://www.by-limus24.de/livepreview.jpg" width="350" height="240" border="2" alt="Voten fürs ..."> </center> |
|
|
SC-Ad-Bot | Advertisement |
| |
Dat Tunes |
Geschrieben am 29.11.2010 00000011 11:10
|
![]() Moderator ![]() Beiträge: 477 Registriert am: 07.12.08 Fusioneer: 16 years 4 months 0 weeks 2 days 17 hours 39 minutes 25 seconds |
Schau mal hier: http://www.phpfusion-support.de/forum...ost_177615
Leute ohne Macke, sind Kacke ![]() Oh Herr, schmeiss Grundwissen von Himmel ! |
|
|
limus |
Geschrieben am 29.11.2010 00000011 12:55
|
![]() Mitglied ![]() Beiträge: 161 Registriert am: 05.07.09 Fusioneer: 15 years 9 months 0 weeks 5 days 23 hours 58 minutes 36 seconds |
Danke habe mich an die Anleitung gehalten. bekomme jetzt wenn ich den code in eine neue Seite eintrage folgendes Zitat Duplicate column name 'user_fb_userid'Duplicate column name 'user_fb_hash'Duplicate column name 'facebook_salt' hier mal die readme Zitat PHP-Fusion Facebook Integration 1.02 For version 7.x Coded By: Arda Kilicdagi (SoulSmasher) Web: www.soulsmasher.net , www.phpfusionturkiye.com This modification is based on the beautiful tutorial of barattalo.it This program is released as free software under the Affero GPL license. You can redistribute it and/or modify it under the terms of this license which you can read by viewing the included agpl.txt or online at www.gnu.org/licenses/agpl.html. Removal of this copyright header is strictly prohibited without written permission from the original author(s). FEATURES -------------- This mod allows Facebook® Connect to allow facebook users to login to your site. After conencting, the system generates a new user binded with the user's Facebook account, snatches his/hers profile picture and email for its profile. (Note: for the privacy, if you hid your email from public, Facebook "proxifies" it with a loong facebook mail redirected to you for email column, that is normal) INCLUDED LOCALES --------------- -English -Turkish INSTALLATION -------------- -Upload everything under files folder to your root -Go to Admin panel->System Administration->Panels and add and activate facebook_login_panel -Now go to http://developers.facebook.com/setup.php and generate your own application, set your website URL exactly. After that it'll give you a file names xd_receiver.htm. Upload that to your PHP-Fusion Root, and validate your website. -After validating, you'll be redirected to Facebook Developers page showing your API and SECRET KEY. Open facebook_system.php, and fill these two lines: define("FB_API_KEY","facebookapikeyhere"); define("FB_SECRET","facebooksecretkeyhere"); -And Run this once in custom pages: <?php $soul=dbquery("ALTER TABLE ".DB_USERS." ADD user_fb_userid BIGINT(16) UNSIGNED NOT NULL DEFAULT '0'"); $soul=dbquery("ALTER TABLE ".DB_USERS." ADD user_fb_hash VARCHAR(32) NOT NULL DEFAULT ''"); $soul=dbquery("ALTER TABLE ".DB_SETTINGS." ADD facebook_salt VARCHAR(32) NOT NULL DEFAULT ''"); $soul=dbquery("UPDATE ".DB_SETTINGS." SET facebook_salt='".md5(rand(0,9999999))."'"); ?> After this, either use modified files or mod manually. -Now open maincore.php and find: $user_pass = md5($_POST['user_pass']); Change as: if (isset($_POST['user_fb_hash'])) { $user_pass = $_POST['user_fb_hash']; } else if (isset($_POST['user_pass'])) { $user_pass = md5($_POST['user_pass']); } -Find: $cookie_value = $data['user_id'].".".$user_pass; Add Above: //update facebook hash if not done yet if ($data['user_fb_hash']=="") { $result2=dbquery("UPDATE ".DB_USERS." SET user_fb_hash='".md5($data['user_password'])."' WHERE user_id='".$data['user_id']."'"); } //update facebook hash -Find: if (isset($_POST['login']) && isset($_POST['user_name']) && isset($_POST['user_pass'])) { Change As: if (isset($_POST['login']) && isset($_POST['user_name']) && (isset($_POST['user_pass']) || isset($_POST['user_fb_hash']))) { -Find: $result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_name='".$user_name."' AND user_password='".md5($user_pass)."' LIMIT 1"); Change As: if (isset($_POST['user_fb_hash'])) { $result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_name='".$user_name."' AND user_fb_hash='".facebook_crypt($_POST['user_fb_hash'])."' LIMIT 1"); } else { $result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_name='".$user_name."' AND user_password='".md5($user_pass)."' LIMIT 1"); } -Find: $result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_id='$cookie_1' AND user_password='".md5($cookie_2)."' LIMIT 1"); Change As: $result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_id='$cookie_1' AND (user_password='".md5($cookie_2)."' OR user_fb_hash='".facebook_crypt($cookie_2)."') LIMIT 1"); -Find: // Initialise the $locale array $locale = array(); Add Above: //this function is to improve security of user_fb_hash column. function facebook_crypt($string) { global $settings; return md5($string.$settings['facebook_salt']); } //function end -Open includes/update_profile_include.php and find: $new_pass = " user_password='".md5(md5($user_new_password))."', "; Change as: $new_pass = " user_password='".md5(md5($user_new_password))."', user_fb_hash='".facebook_crypt(md5(md5($user_new_password)))."', "; -Open administration/updateuser.php, find: if ($user_new_password) { $new_pass = " user_password='".md5(md5($user_new_password))."', "; } else { $new_pass = " "; } Change as: if ($user_new_password) { $new_pass = " user_password='".md5(md5($user_new_password))."', user_fb_hash='".facebook_crypt(md5(md5($user_new_password)))."', "; } else { $new_pass = " "; } -Open setuser.php and find: if (!dbcount("(user_id)", DB_USERS, "user_name='".$user_name."' AND user_password='".md5($user_pass)."'")) { Change as: if (!dbcount("(user_id)", DB_USERS, "user_name='".$user_name."' AND (user_password='".md5($user_pass)."' OR user_fb_hash='".facebook_crypt($user_pass)."')")) { I know, it's a big long, but it's needed. KNOWN ISSUES -------------- -Sometimes the page may show some issues like this: Fatal error: Uncaught exception 'FacebookRestClientException' with message 'Session key invalid or no longer valid' in.. That is because of Facebook API, session timeout. If this happens, to fix this, logout from Facebook and try again, Or clean cookies. TIPS ------------- Instead of opening a facebook popup for login you can redirect people to facebook.com to force login. To do this, uncomment this line: //$fb->require_login();//uncomment this if you want to want to redirect to facebook.com to login the user. VERSION HISTORY ------------- 1.02 - Fixed changed files includes/update_profile_include.php, administration/updateuser.php manual modding and changed file is added for setuser.php, so if a person from facebook logs in, setuser.php will output "Hello user" instead of "wrong password" even though the user logs in. username salting for the names which all characters are non-alphanumeric. PM issue is fixed (at least for me) 1.01 - Added changed files for 7.00.07 Updated a minor issue about editing which prevented logging in. block image linked. 1.0 - Initial Release Bearbeitet von DjMicha1985 am 16.01.2013 00000001 09:27 <div style="text-align:center"><b style="font-size:large">Besuchen Sie auch unsere <a href="http://www.one4all.by-limus24.de" target="_blank">Webseite</a>.</b></div><div style="text-align:center"><img style="font-size:10pt"></div>
<center><img src="http://www.by-limus24.de/livepreview.jpg" width="350" height="240" border="2" alt="Voten fürs ..."> </center> |
|
|
MaZzIMo24 |
Geschrieben am 29.11.2010 00000011 13:21
|
![]() Mitglied ![]() Beiträge: 172 Registriert am: 13.11.10 Fusioneer: 14 years 4 months 4 weeks 28 days 3 hours 3 minutes 54 seconds |
Ein Profilfeld würde ich dir auch sonst Schreiben ! |
|
|
limus |
Geschrieben am 29.11.2010 00000011 13:35
|
![]() Mitglied ![]() Beiträge: 161 Registriert am: 05.07.09 Fusioneer: 15 years 9 months 0 weeks 5 days 23 hours 58 minutes 36 seconds |
Das wäre echt super danke. ![]() Hab mal meine dateien angehange wäre nett wenn sich die mal jemand ansehen könnte was ich falsch gemacht habe. Vielen Dank Bearbeitet von limus am 29.11.2010 00000011 13:56 <div style="text-align:center"><b style="font-size:large">Besuchen Sie auch unsere <a href="http://www.one4all.by-limus24.de" target="_blank">Webseite</a>.</b></div><div style="text-align:center"><img style="font-size:10pt"></div>
<center><img src="http://www.by-limus24.de/livepreview.jpg" width="350" height="240" border="2" alt="Voten fürs ..."> </center> |
|
|
MaZzIMo24 |
Geschrieben am 29.11.2010 00000011 14:09
|
![]() Mitglied ![]() Beiträge: 172 Registriert am: 13.11.10 Fusioneer: 14 years 4 months 4 weeks 28 days 3 hours 3 minutes 54 seconds |
da ist deine readme drinn |
|
|
limus |
Geschrieben am 29.11.2010 00000011 14:13
|
![]() Mitglied ![]() Beiträge: 161 Registriert am: 05.07.09 Fusioneer: 15 years 9 months 0 weeks 5 days 23 hours 58 minutes 36 seconds |
hier die readme. <div style="text-align:center"><b style="font-size:large">Besuchen Sie auch unsere <a href="http://www.one4all.by-limus24.de" target="_blank">Webseite</a>.</b></div><div style="text-align:center"><img style="font-size:10pt"></div>
<center><img src="http://www.by-limus24.de/livepreview.jpg" width="350" height="240" border="2" alt="Voten fürs ..."> </center> |
|
Springe ins Forum: |
Ähnliche Themen
Thema | Forum | Antworten | Letzter Beitrag |
---|---|---|---|
Theme im Facebook style | Infusionen | 1 | 08.12.2014 00000012 17:25 |
Facebook Like Button | Allgemeine Support Fragen | 8 | 16.04.2012 00000004 22:13 |
Musik aus dem Stream auf Facebook teilen | Allgemeine Support Fragen | 3 | 11.04.2012 00000004 05:10 |
Chat-CCommunity wie Facebook oder Co | Allgemeine Support Fragen | 3 | 30.07.2011 00000007 09:06 |
Facebook gefällt mir Butten | Allgemeine Support Fragen | 3 | 05.11.2010 00000011 15:04 |