简体   繁体   中英

How i can create pyrocms login module in core php?

I have developed a Web Application in pyrocms and thats working perfectly. Now i want to create the mobile version of this site in core php as my client ask me to do. I have done almost but facing problem in creating login module in core php as i want to be able the users created by the main site using pyrocms.. So please let me know how i can create login functionality in core php that works same like pyrocms login.

The login module resides in cms/users module.

It is based on the ION auth library which you can take the relevant functions from. You need to make sure that you keep all the configuration options identical via cms/users/config .

Codeigniter is a very light and fast framework. Writing the code in core PHP won't ensure a faster website; it will just make maintaining and upgrading it a much harder and longer process.

Necessity is the mother of all invention...:)

Finally i have done this.. There is few steps ..

1. Get the email and password from login form.
2. Select user detail from default_users detail using emailid.
3. Calcuate the encrypted password using  password  and salt in this `sha1($password . $salt)`
4. Check the encrypted password value with db password value..

Here is the working code.

$result = fetchuserdetail($email);
            while($row = mysql_fetch_object($result))
                    {
                         $dbpassword =  $row->password;
                         $salt =  $row->salt;
                         $userid =  $row->id;
                    }
            $encrypassword = sha1($password . $salt);
            if($encrypassword == $dbpassword)
            {
                $_SESSION['user_logged_in'] = TRUE;     
                $_SESSION['user_logged_id'] = $userid;                  
                header("Location:$refer");
            }
            else
            {
                $_SESSION['email'] = $email;
                $_SESSION['password'] = $password;
                $_SESSION['loginerro'] = "Please fill the login detail";
                header('Location:login.php');
            }

Hopefully this will help someone ....Thanks for your time on this question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM