search
HomeBackend DevelopmentPHP TutorialBlackBerry passport discuz Passport pass integrated notes

It's too simple, but after a long time, I couldn't remember it. I wasted half an hour looking for information, and I deeply realized that a good memory is not as good as a bad writing! ! Post the passport document today to prevent it from being forgotten later! ! Remember, it takes time to find the information you need online!!!!!!

Passport integration

Part 1: Integration principles
Please note: Possible consequences of unsuccessful integration---- -dz forum cannot be logged in and cannot be managed
Solution:
Step one: Go to the dz database table cdb_settings and find the following lines and modify them to
 discuz Passport 通行证 整合笔记 discuz Passport 通行证 整合笔记

 discuz Passport 通行证 整合笔记setting.gif (4.3 KB)

2006- 9-30 13:59


Step 2: Delete the dz installation directory/forumdata/cache/cache_settings.php
Step 3: Re-visit the forum

Login and registration integration process
User submits account and password information from the login or registration form ==>
Master The website program checks user login or registration. If successful (registration needs to generate a new user) ==>
Set the cookie or session of the main website itself ==>
url passes the return address forward and encoded user information and other information to dz/api/passport.php

Please read the official passport technical documentation carefully before integrating: http://www.discuz.net/usersguide/advanced_passport.htm

Copy the content to the clipboard

Code:
<font face="新宋体"><?php <BR>//Save this document as login.php<br>//First copy the encryption and decryption functions in the interface technical document<br>//In order to prevent the code from being too messy, I copied it to the end of the document <br>//Assume that the user name field in your user database table is UserName, the password field is Pwd, and the Email field is Email<br>//The registration page implementation method is similar and can be implemented by yourself. If you have any questions, please add me QQ: 2666556<br>$act=(isset ($_GET['act']))?$_GET['act']:"login";<br>if(function_exists($act)) $act();else login(); $ErrMsg=UserCheck();<br> if($ErrMsg!="")echo $ErrMsg; =login method=post><br>Username:<input name="username"><br>Password:<input name="password"><br><input name="submit" type="submit" value="Login"><br>}//end function<br>function logout()//Logout<br>{<br> $passportkey="1234567890";//Replace the passportkey set by your forum pass here<br> $auth=$_COOKIE['auth']; <br>         setcookie("auth", "",time() - 3600); <br>             $forward=$_GET['forward'];                                                 through .php";//Replace here with the absolute address or relative address of your homepage                                                                                    $forward =rawurlencode($forward);<br> header("Location: bbs/api/passport.php?action=logout&auth=$auth&forward=$forward&verify=$verify");<br>}OnFunction usercheck () {<br> $ passportkey = "1234567890"; // here to replace it with passportkey<br> // ==================== =============<br> If(!isset($_POST['submit'])) return; // The button of the login form needs to have the same name<br> $usnm=$_POST['username' ];//username is replaced with the username field in your login form                                                                                                                                                                        ") return "Please enter the username!"; <br> if ($ pwd == "") Return "Please enter the password!"; <br> // ======= The database processing ======== ================ <br> $ db = mysql_connect ("localhost", "root", ""); <br> mysql_select_db ("you_db_name"); `user' where UserName='".$usnm."' Limit 1"; The user does not exist"; <br>                                                                                                                                                                           if($row["Pwd"]!=md5($pwd))return ""Password Incorrect"; ====header to bbs======================                                                                                                                                          ​'username' = & gt; $ row ["username"], <br> 'password' = & gt; $ row ["pwd"], <br> 'email' = & gt; $ row ["email"]; Assport_encode ($member), $passportkey);<br> setcookie("auth",$auth,($_POST["Cookie"]? time()+(int)$_POST["Cookie"] :0));<br> $forward =$_POST['forward'];<br> if($forward=="")$forward="../../index.php"; $verify = md5('login'.$auth.$forward. $passportkey);<br>                                                                                                                                 $auth=rawurlencode(($auth); "); " ===================<br>//==============The following is the copied function========= ===================<br>function passport_encrypt($txt, $key) {<br> srand((double)microtime() * 1000000);<br> $encrypt_key = md5(rand (0, 32000)); $ctr = 0;<br> $tmp = '';<br> $i r = $ctr == strlen($encrypt_key) ? 0 : $ctr;<br>                                                                        $tmp, $key));<br>}<br>function passport_decrypt($txt, $key) {<br> $txt = passport_key(base64_decode($txt), $key);<br> $tmp = '';<br> for ($i = 0; $ i                                                                                                                                                                        ​ <br>function passport_key($txt, $encrypt_key) {<br> $encrypt_key = md5($encrypt_key);<br> $ctr = 0;<br> $tmp = '';<br> for($i = 0; $i                                                              }<br>           return $tmp ;<br>}<br>function passport_encode($array) {<br> $arrayenc = array();<br> foreach($array as $key => $val) {<br> $arrayenc[] = $key.'='.urlencode($ val);<br>           }                                                                                                                        ’’’ return implode('&', $arrayenc); =============================================<br>//== =========================End of copy======================== ===============<br>?><br><br><br> <br> The above introduces the BlackBerry passport discuz Passport integration notes, including BlackBerry passport content. I hope it will be helpful to friends who are interested in PHP tutorials. <br> </font>
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Working with Flash Session Data in LaravelWorking with Flash Session Data in LaravelMar 12, 2025 pm 05:08 PM

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

cURL in PHP: How to Use the PHP cURL Extension in REST APIscURL in PHP: How to Use the PHP cURL Extension in REST APIsMar 14, 2025 am 11:42 AM

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Simplified HTTP Response Mocking in Laravel TestsSimplified HTTP Response Mocking in Laravel TestsMar 12, 2025 pm 05:09 PM

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

12 Best PHP Chat Scripts on CodeCanyon12 Best PHP Chat Scripts on CodeCanyonMar 13, 2025 pm 12:08 PM

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Discover File Downloads in Laravel with Storage::downloadDiscover File Downloads in Laravel with Storage::downloadMar 06, 2025 am 02:22 AM

The Storage::download method of the Laravel framework provides a concise API for safely handling file downloads while managing abstractions of file storage. Here is an example of using Storage::download() in the example controller:

Explain the concept of late static binding in PHP.Explain the concept of late static binding in PHP.Mar 21, 2025 pm 01:33 PM

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

PHP Logging: Best Practices for PHP Log AnalysisPHP Logging: Best Practices for PHP Log AnalysisMar 10, 2025 pm 02:32 PM

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

How to Register and Use Laravel Service ProvidersHow to Register and Use Laravel Service ProvidersMar 07, 2025 am 01:18 AM

Laravel's service container and service providers are fundamental to its architecture. This article explores service containers, details service provider creation, registration, and demonstrates practical usage with examples. We'll begin with an ove

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools