Yii Framework Forum: Integrasi dengan wordpress - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Integrasi dengan wordpress Login dengan user di wordpress Rate Topic: -----

#1 User is offline   waton 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 05-April 09
  • Location:Indonesia

Posted 15 July 2010 - 09:41 PM

Hi,

Saya ingin menggabungkan user di wordpress dengan user aplikasi buatan sendiri. Bagaimana caranya ya?

Terimakasih
0

#2 User is offline   bhoo-day 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 17-June 10

Posted 17 July 2010 - 06:33 AM

View Postwaton, on 15 July 2010 - 09:41 PM, said:

Hi,

Saya ingin menggabungkan user di wordpress dengan user aplikasi buatan sendiri. Bagaimana caranya ya?

Terimakasih


Hmm..blm pernah ketemu kasus kyk gini mas waton. Digabungin itu mksudnya si user bisa login ke sistem dengan username dan password wordpress gitu?
0

#3 User is offline   fad.lee 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 19-July 10

Posted 19 July 2010 - 08:25 PM

<?php 
/* Include wordpress header */
define('WP_USE_THEMES', false);
require('./wp/wp-blog-header.php');
?>
<pre>

Display the Log In/Out link.
<?php
$redirect = $_SERVER["PHP_SELF"];
wp_loginout($redirect);
?>


Check that the user login name and password is correct.
<?php
$check = user_pass_ok($user,$pass);
var_dump($check);
?>


Login user
<?php
$credentials['user_login'] = $user;
$credentials['user_password'] = $password;
$credentials['remember'] = false; // true or false
wp_signon($credentials);
?>


Retrieve the current user object.
<?php
$user = wp_get_current_user();
var_dump($user);
?>
</pre>


Create new user
<?php
require_once( ABSPATH . WPINC . '/registration.php');
$user_id = wp_create_user( $user, $pass, $email );
var_dump($user_id);
?>


Logout user
<?php wp_logout(); ?>

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users