本文整理汇总了PHP中wp_login函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_login函数的具体用法?PHP wp_login怎么用?PHP wp_login使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_login函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$model = $this->load->model('pad_model');
if ($row = $model->get_pemda()) {
$ta = date('Y');
$sess_data = array('pad_tahun_anggaran' => $ta, 'pad_pemda_daerah' => $row->daerah, 'pad_pemda_alamat' => $row->alamat, 'pad_pemda_alamat_lengkap' => $row->alamat_lengkap, 'pad_pemda_telp' => $row->telp, 'pad_pemda_fax' => $row->fax, 'pad_pemda_website' => $row->website, 'pad_pemda_email' => $row->email, 'pad_pemda_nama' => $row->pemda_nama, 'pad_pemda_singkatan' => $row->pemda_nama_singkat, 'pad_pemda_type' => $row->type, 'pad_pemda_kepala' => $row->kepala_nama, 'pad_pemda_jabatan' => $row->jabatan, 'pad_pemda_ibukota' => $row->ibukota, 'pad_pemda_unitid' => $row->ppkd_id, 'pad_reklame_id' => $row->reklame_id, 'pad_air_tanah_id' => $row->airtanah_id, 'pad_dok_self_id' => $row->self_dok_id, 'pad_dok_office_id' => $row->office_dok_id, 'pad_hiburan_id' => $row->hiburan_id, 'pad_ppj_id' => $row->ppj_id, 'pad_hotel_id' => $row->hotel_id, 'pad_walet_id' => $row->walet_id, 'pad_restauran_id' => $row->restauran_id, 'pad_parkir_id' => $row->parkir_id, 'pad_surat_no' => $row->surat_no, 'pad_ijin_kd' => $row->ijin_kd, 'pad_reklame_kd' => $row->reklame_kd, 'pad_air_tanah_kd' => $row->airtanah_kd, 'pad_parkir_kd' => $row->parkir_kd, 'pad_ppj_kd' => $row->ppj_kd, 'pad_hiburan_kd' => $row->hiburan_kd, 'pad_hotel_kd' => $row->hotel_kd, 'pad_restauran_kd' => $row->restauran_kd, 'pad_spt_date' => $row->tgl_spt, 'pad_spt_due_date' => $row->tgl_jatuhtempo_self, 'pad_spt_denda' => $row->spt_denda, 'pad_bunga' => $row->pad_bunga, 'pad_ppkd_id' => $row->ppkd_id);
$this->session->set_userdata($sess_data);
}
$data['current'] = 'beranda';
$data['apps'] = $this->apps_model->get_active_only();
if (!wp_login()) {
$this->load->view('vmain', $data);
} else {
$this->load->view('wp/vmenu', $data);
}
}
开发者ID:aagusti,项目名称:padl-tng,代码行数:16,代码来源:pad.php
示例2: get_currentuserinfo
function get_currentuserinfo()
{
// Use HTTP auth instead of cookies
global $current_user;
if (!empty($current_user)) {
return;
}
// Some apache versions prepend "REDIRECT_" to server variable name, according to http://www.besthostratings.com/articles/http-auth-php-cgi.html
if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']) && !isset($_SERVER['HTTP_AUTHORIZATION'])) {
$_SERVER['HTTP_AUTHORIZATION'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
}
// Workaround for HTTP Authentication with PHP running as CGI (htaccess rule copies authentication data into HTTP_AUTHORIZATION)
if (isset($_SERVER['HTTP_AUTHORIZATION'])) {
$ha = base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6));
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', $ha);
unset($ha);
}
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) || !wp_login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) {
header('WWW-Authenticate: Basic realm="' . get_bloginfo('name') . '"');
header('HTTP/1.0 401 Unauthorized');
scoper_load_textdomain();
// otherwise this is only loaded for wp-admin
die(__('Access denied: Incorrect credentials supplied.', 'scoper'));
}
$user_login = $_SERVER['PHP_AUTH_USER'];
wp_set_current_user(0, $user_login);
}
开发者ID:joostrijneveld,项目名称:cscircles-wp-content,代码行数:27,代码来源:feed-interceptor_rs.php
示例3: mylogin
public function mylogin($login, $pass)
{
$result = wp_login($login, $pass, 'test');
if (!$result) {
return false;
}
var_dump($result);
$this->login = $login;
$this->logining();
return true;
}
开发者ID:alexandrtkachuk,项目名称:arena,代码行数:11,代码来源:User.php
示例4: sptpd_get_cu
function sptpd_get_cu($customer_id, $usaha_id = '')
{
// terlanjur sayang
$qry = "select cu.id customer_usaha_id, cu.customer_id, cu.usaha_id, get_npwpd(c.id, true) as npwpd, get_npwpd(c.id, false) as npwpd2, c.nama as customernm,\r\n\t\t\tcu.konterid, cu.air_zona_id, cu.air_manfaat_id , u.so, cu.def_pajak_id,\r\n\t\t\tcast(u.nama||' ('||cu.konterid||' | '||coalesce(cu.opnm,u.nama)||')' as character varying) as usahanm,\r\n \r\n c.wpnama, c.wpalamat\r\n\r\n\t\t\tfrom pad_customer_usaha cu\r\n\t\t\tinner join pad_customer c on cu.customer_id=c.id\r\n\t\t\tinner join pad_usaha u on cu.usaha_id=u.id\r\n\t\t\twhere cu.customer_id = ?";
if (wp_login() && empty($usaha_id)) {
$qry .= "and u.id not in (" . pad_reklame_id() . ", " . pad_air_tanah_id() . ") ";
}
if (wp_login() && !empty($usaha_id)) {
$qry .= "and u.id in ({$usaha_id}) ";
}
$qry .= "order by c.rp,c.pb,c.formno, cu.usaha_id, cu.konterid";
$query = $this->db_pad->query($qry, array($customer_id));
if ($query->num_rows() !== 0) {
return $query->result();
} else {
return FALSE;
}
}
开发者ID:aagusti,项目名称:padl-tng,代码行数:18,代码来源:pad_model.php
示例5: ProjectTheme_do_login_scr
//.........这里部分代码省略.........
}
if (isset($_SESSION['redirect_me_back'])) {
$redirect_to = $_SESSION['redirect_me_back'];
}
if ($_POST) {
$user_login = $_POST['log'];
$user_login = sanitize_user($user_login);
$user_pass = $_POST['pwd'];
$rememberme = $_POST['rememberme'];
} else {
if (function_exists('wp_get_cookie_login')) {
$cookie_login = wp_get_cookie_login();
if (!empty($cookie_login)) {
$using_cookie = true;
$user_login = $cookie_login['login'];
$user_pass = $cookie_login['password'];
}
} elseif (!empty($_COOKIE)) {
if (!empty($_COOKIE[USER_COOKIE])) {
$user_login = $_COOKIE[USER_COOKIE];
}
if (!empty($_COOKIE[PASS_COOKIE])) {
$user_pass = $_COOKIE[PASS_COOKIE];
$using_cookie = true;
}
}
}
do_action('wp_authenticate', $user_login, $user_pass);
if ($user_login && $user_pass) {
$user = new WP_User(0, $user_login);
// If the user can't edit posts, send them to their profile.
//if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' ) )
// $redirect_to = get_settings('siteurl') . '/' . 'my-account';
if (wp_login($user_login, $user_pass, $using_cookie)) {
if (!$using_cookie) {
wp_setcookie($user_login, $user_pass, false, '', '', $rememberme);
}
do_action('wp_login', $user_login);
wp_redirect($redirect_to);
exit;
} else {
if ($using_cookie) {
$error = __('Your session has expired.', $current_theme_locale_name);
}
}
} else {
if ($_POST && !$user_login) {
$error = __('<strong>Error</strong>: The Username field is empty.', $current_theme_locale_name);
} else {
if ($_POST && !$user_pass) {
$error = __('<strong>Error</strong>: The password field is empty.', $current_theme_locale_name);
}
}
}
get_header();
?>
<div class="page_heading_me">
<div class="page_heading_me_inner">
<div class="mm_inn"><?php
printf(__("Login - %s", $current_theme_locale_name), get_bloginfo('name'));
?>
</div>
</div>
开发者ID:vicpril,项目名称:ProjectTheme,代码行数:67,代码来源:login.php
示例6: check_ajax_referer
function check_ajax_referer() {
$current_name = '';
if ( ( $current = wp_get_current_user() ) && $current->ID )
$current_name = $current->data->user_login;
if ( !$current_name )
die('-1');
$cookie = explode('; ', urldecode(empty($_POST['cookie']) ? $_GET['cookie'] : $_POST['cookie'])); // AJAX scripts must pass cookie=document.cookie
foreach ( $cookie as $tasty ) {
if ( false !== strpos($tasty, USER_COOKIE) )
$user = substr(strstr($tasty, '='), 1);
if ( false !== strpos($tasty, PASS_COOKIE) )
$pass = substr(strstr($tasty, '='), 1);
}
if ( $current_name != $user || !wp_login( $user, $pass, true ) )
die('-1');
do_action('check_ajax_referer');
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:19,代码来源:pluggable.php
示例7: authenticate
function authenticate()
{
$login_data = array();
$already_md5 = false;
log_app("authenticate()", print_r($_ENV, true));
// if using mod_rewrite/ENV hack
// http://www.besthostratings.com/articles/http-auth-php-cgi.html
if (isset($_SERVER['HTTP_AUTHORIZATION'])) {
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
}
// If Basic Auth is working...
if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
$login_data = array('login' => $_SERVER['PHP_AUTH_USER'], 'password' => $_SERVER['PHP_AUTH_PW']);
log_app("Basic Auth", $login_data['login']);
} else {
// else, do cookie-based authentication
if (function_exists('wp_get_cookie_login')) {
$login_data = wp_get_cookie_login();
$already_md5 = true;
}
}
// call wp_login and set current user
if (!empty($login_data) && wp_login($login_data['login'], $login_data['password'], $already_md5)) {
$current_user = new WP_User(0, $login_data['login']);
wp_set_current_user($current_user->ID);
log_app("authenticate()", $login_data['login']);
}
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:28,代码来源:wp-app.php
示例8: wpSignIn
function wpSignIn($wpUsr, $pass)
{
// This overrides authentication in wp_check_password() [wp-functions.php]
// This is OK to set here, as phpBB has already dealt with integration.
// DO NOT define this anywhere else, ever!
define('PASSWORD_ALREADY_HASHED', TRUE);
global $error;
if (function_exists('wp_signon')) {
$result = wp_signon(array('user_login' => $wpUsr, 'user_password' => $pass, 'remember' => false));
if (!is_wp_error($result)) {
return true;
}
$error = $result->get_error_message();
} else {
if (wp_login($wpUsr, md5($pass), true)) {
wp_setcookie($wpUsr, md5($pass), true, '', '', false);
do_action('wp_login', $wpUsr);
return true;
}
}
return false;
}
开发者ID:Oddsor,项目名称:lpt-forum,代码行数:22,代码来源:wp-integration-class.php
示例9: check_ajax_referer
function check_ajax_referer() {
$cookie = explode('; ', urldecode(empty($_POST['cookie']) ? $_GET['cookie'] : $_POST['cookie'])); // AJAX scripts must pass cookie=document.cookie
foreach ( $cookie as $tasty ) {
if ( false !== strpos($tasty, USER_COOKIE) )
$user = substr(strstr($tasty, '='), 1);
if ( false !== strpos($tasty, PASS_COOKIE) )
$pass = substr(strstr($tasty, '='), 1);
}
if ( !wp_login( $user, $pass, true ) )
die('-1');
do_action('check_ajax_referer');
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:12,代码来源:pluggable.php
示例10: wp_hash_password
}
if ($password1 != '') {
if ($password1 == $password2) {
$pwd = wp_hash_password($password1);
$sql = "UPDATE ".$wpdb->base_prefix."users SET user_pass = '%s' WHERE ID = %d";
if ($wpdb->query( $wpdb->prepare($sql, $pwd, $uid) ) ) {
$sql = "SELECT user_login FROM ".$wpdb->base_prefix."users WHERE ID = %d";
$username = $wpdb->get_var($wpdb->prepare($sql, $uid));
$id = $uid;
$url = __wps__get_url('profile')."?view=settings&msg=".$pwmsg;
wp_login($username, $pwd, true);
wp_setcookie($username, $pwd, true);
wp_set_current_user($id, $username);
$pwmsg = "PASSWORD CHANGED";
} else {
$pwmsg = __("Failed to update password, sorry.", WPS_TEXT_DOMAIN);
}
} else {
$pwmsg = __("Passwords different, please try again.", WPS_TEXT_DOMAIN);
}
}
echo $pwmsg;
开发者ID:niamherinoc,项目名称:rctractors,代码行数:30,代码来源:profile_functions.php
示例11: set_post_content_13
function set_post_content_13($entry, $form)
{
//login, set cookies, and set current user
$user_pass = md5($entry['2']);
wp_login($entry['3'], $user_pass, true);
wp_setcookie($entry['3'], $entry['2'], true);
wp_set_current_user($user->ID, $user_login);
if (isset($_SESSION['returnURL']) && !empty($_SESSION['returnURL'])) {
$url = $_SESSION['returnURL'];
$_SESSION['returnURL'] == '';
header('Location: ' . $url);
}
}
开发者ID:avijitdeb,项目名称:flatterbox.com,代码行数:13,代码来源:functions.php
示例12: get_cu
function get_cu()
{
$c_id = $this->uri->segment(4);
$cu_id = $this->uri->segment(5);
$u_id = $this->uri->segment(6);
// param untuk wp_login (opsional di menu default)
$model = $this->load->model('pad_model');
if (!wp_login()) {
$rows = $model->sptpd_get_cu($c_id);
} else {
$rows = $model->sptpd_get_cu($c_id);
}
$usaha = '';
$cu_data = new stdClass();
if ($rows) {
$cu_data->customer_id = $rows[0]->customer_id;
$cu_data->customernm = $rows[0]->customernm;
$cu_data->npwpd = $rows[0]->npwpd;
$cu_data->so = $rows[0]->so;
$cu_data->konterid = $rows[0]->konterid;
$cu_data->air_zona_id = $rows[0]->air_zona_id;
$cu_data->air_manfaat_id = $rows[0]->air_manfaat_id;
$cu_data->usaha_id = $rows[0]->usaha_id;
$selected = "selected";
foreach ($rows as $row) {
if ($cu_id == $row->customer_usaha_id) {
$cu_data->usaha_id = $row->usaha_id;
$usaha .= "<option value={$row->customer_usaha_id} selected>{$row->usahanm}</option>";
} else {
$usaha .= "<option value={$row->customer_usaha_id}>{$row->usahanm}</option>";
}
}
$cu_data->usaha = $usaha;
//Get Bulan SPT Pajak yg Terakhir
//$cu_id = 10;
//$u_id = 49;
$month_ini = new DateTime("first day of last month");
$query = $this->db->query("select max(masadari) as max_masa from pad_spt \r\n where customer_id={$c_id} and customer_usaha_id={$cu_id} and pajak_id={$u_id}");
foreach ($query->result() as $row) {
$max_masa = $row->max_masa;
}
$max_masa_f = date('d-m-Y', strtotime($max_masa));
$month_ini_f = $month_ini->format('d-m-Y');
if ($max_masa_f == $month_ini_f) {
$cu_data->masadari = $month_ini_f;
$cu_data->masapajak_bulan = $month_ini->format('M-Y');
} else {
if ($max_masa != '') {
$cu_data->masadari = date('d-m-Y', strtotime("{$max_masa} + 1 month"));
$cu_data->masapajak_bulan = date('M-Y', strtotime($cu_data->masadari));
} else {
$cu_data->masadari = $month_ini_f;
$cu_data->masapajak_bulan = $month_ini->format('M-Y');
}
}
echo json_encode($cu_data);
}
}
开发者ID:aagusti,项目名称:padl-tng,代码行数:58,代码来源:sptpd.old.php
示例13: __
$have_error = true;
}
if ($_POST['profile_agree'] != "yes") {
$error .= __("You must agree to the terms and conditions to register.<br />", rb_login_TEXTDOMAIN);
$have_error = true;
}
// Bug Free!
if ($have_error == false) {
$new_user = wp_insert_user($userdata);
$new_user_type = $_POST['profile_type'];
// Model or Client
update_user_meta($new_user, 'rb_login_interact_profiletype', $new_user_type);
// Log them in if no confirmation required.
if ($rb_login_option_registerconfirm == 1) {
global $error;
$login = wp_login($user_login, $user_pass);
$login = wp_signon(array('user_login' => $user_login, 'user_password' => $user_pass, 'remember' => 1), false);
}
// Notify admin and user
wp_new_user_notification($new_user, $user_pass);
}
// Log them in if no confirmation required.
if ($rb_login_option_registerconfirm == 1) {
if ($login) {
header("Location: " . get_bloginfo("wpurl") . "/dashboard/");
}
}
}
// *************************************************************************************************** //
// Prepare Page
get_header();
开发者ID:robertholf,项目名称:Empire-Playground,代码行数:31,代码来源:register.php
示例14: get_cu
function get_cu()
{
$c_id = $this->uri->segment(4);
$cu_id = $this->uri->segment(5);
$u_id = $this->uri->segment(6);
// param untuk wp_login (opsional di menu default)
$model = $this->load->model('pad_model');
if (!wp_login()) {
$rows = $model->sptpd_get_cu($c_id);
} else {
$rows = $model->sptpd_get_cu($c_id, $u_id);
}
$usaha = '';
$cu_data = new stdClass();
if ($rows) {
$cu_data->customer_id = $rows[0]->customer_id;
$cu_data->nama = $rows[0]->nama;
$cu_data->npwpd = $rows[0]->npwpd;
$cu_data->so = $rows[0]->so;
$cu_data->konterid = $rows[0]->konterid;
$cu_data->air_zona_id = $rows[0]->air_zona_id;
$cu_data->air_manfaat_id = $rows[0]->air_manfaat_id;
$cu_data->wpnama = $rows[0]->wpnama;
$cu_data->wpalamat = $rows[0]->wpalamat;
$selected = "selected";
foreach ($rows as $row) {
if ($cu_id == $row->customer_usaha_id) {
$usaha .= "<option value={$row->customer_usaha_id} selected>{$row->nama}</option>";
} else {
$usaha .= "<option value={$row->customer_usaha_id}>{$row->nama}</option>";
}
}
$cu_data->usaha = $usaha;
echo json_encode($cu_data);
}
}
开发者ID:aagusti,项目名称:padl-tng,代码行数:36,代码来源:sptpd_all.php
示例15: shipme_do_login_scr
//.........这里部分代码省略.........
//exit;
if (isset($_SESSION['redirect_me_back'])) {
$redirect_to = $_SESSION['redirect_me_back'];
}
if ($_POST) {
$user_login = $_POST['log'];
$user_login = sanitize_user($user_login);
$user_pass = $_POST['pwd'];
$rememberme = $_POST['rememberme'];
} else {
if (function_exists('wp_get_cookie_login')) {
$cookie_login = wp_get_cookie_login();
if (!empty($cookie_login)) {
$using_cookie = true;
$user_login = $cookie_login['login'];
$user_pass = $cookie_login['password'];
}
} elseif (!empty($_COOKIE)) {
if (!empty($_COOKIE[USER_COOKIE])) {
$user_login = $_COOKIE[USER_COOKIE];
}
if (!empty($_COOKIE[PASS_COOKIE])) {
$user_pass = $_COOKIE[PASS_COOKIE];
$using_cookie = true;
}
}
}
do_action('wp_authenticate', $user_login, $user_pass);
if ($user_login && $user_pass) {
$user = new WP_User(0, $user_login);
// If the user can't edit posts, send them to their profile.
//if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' ) )
// $redirect_to = get_settings('siteurl') . '/' . 'my-account';
if (wp_login($user_login, $user_pass, $using_cookie)) {
if (!$using_cookie) {
wp_setcookie($user_login, $user_pass, false, '', '', $rememberme);
}
do_action('wp_login', $user_login);
wp_redirect($redirect_to);
exit;
} else {
if ($using_cookie) {
$error = __('Your session has expired.', 'shipme');
}
}
} else {
if ($user_login || $user_pass) {
$error = __('<strong>Error</strong>: The password field is empty.', 'shipme');
}
}
global $real_ttl;
$real_ttl = __("Login", 'shipme');
add_filter('wp_title', 'shipme_sitemile_filter_ttl', 10, 3);
get_header();
?>
<div class="container_ship_no_bk margin_top_40">
<ul class="virtual_sidebar">
<li class="widget-container widget_text"><h3 class="widget-title"><?php
_e("Login", 'shipme');
?>
- <?php
echo get_bloginfo('name');
?>
开发者ID:nupursolanki,项目名称:kalaba,代码行数:67,代码来源:login.php
示例16: xpress_login
function xpress_login(){
global $current_user;
global $xoopsModule,$xoopsUser,$xoopsUserIsAdmin;
if(is_object($xoopsUser)){
$u_name = $xoopsUser->getVar("uname");
$u_pass_md5 = $xoopsUser->getVar("pass");
if ( ! empty($u_name) && ! empty($u_pass_md5) ) {
include_once dirname( __FILE__ ).'/user_sync_xoops.php';
repair_user_meta_prefix(); //Repair when data base prefix is changed on XOOPS side
$messege = '';
$ret = user_sync_to_wordpress($xoopsUser->getVar("uid"),$messege);
if ($ret){
$user = new WP_User(0, $u_name);
if ( wp_login($u_name, $u_pass_md5) ) {
wp_setcookie($u_name, $u_pass_md5, true, '', '', false);
do_action('wp_login', $u_name);
wp_set_current_user($user->ID);
return true;
}
}
}
}
if ( ! empty($current_user) ){
wp_set_current_user(0);
wp_logout();
wp_clear_auth_cookie();
}
return false;
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:30,代码来源:pluggable-override.php
示例17: openid_create_new_user
/**
* Create a new WordPress user with the specified identity URL and user data.
*
* @param string $identity_url OpenID to associate with the newly
* created account
* @param array $user_data array of user data
*/
function openid_create_new_user($identity_url, &$user_data) {
global $wpdb;
// Identity URL is new, so create a user
@include_once( ABSPATH . 'wp-admin/upgrade-functions.php'); // 2.1
@include_once( ABSPATH . WPINC . '/registration-functions.php'); // 2.0.4
// otherwise, try to use preferred username
if ( empty($username) && array_key_exists('nickname', $user_data) ) {
$username = openid_generate_new_username($user_data['nickname'], false);
}
// finally, build username from OpenID URL
if (empty($username)) {
$username = openid_generate_new_username($identity_url);
}
$user_data['user_login'] = $username;
$user_data['user_pass'] = substr( md5( uniqid( microtime() ) ), 0, 7);
$user_id = wp_insert_user( $user_data );
if( $user_id ) { // created ok
$user_data['ID'] = $user_id;
// XXX this all looks redundant, see openid_set_current_user
$user = new WP_User( $user_id );
if( ! wp_login( $user->user_login, $user_data['user_pass'] ) ) {
openid_message(__('User was created fine, but wp_login() for the new user failed. This is probably a bug.', 'openid'));
openid_status('error');
openid_error(openid_message());
return;
}
// notify of user creation
wp_new_user_notification( $user->user_login );
wp_clearcookie();
wp_setcookie( $user->user_login, md5($user->user_pass), true, '', '', true );
// Bind the provided identity to the just-created user
openid_add_user_identity($user_id, $identity_url);
openid_status('redirect');
if ( !$user->has_cap('edit_posts') ) $redirect_to = '/wp-admin/profile.php';
} else {
// failed to create user for some reason.
openid_message(__('OpenID authentication successful, but failed to create WordPress user. This is probably a bug.', 'openid'));
openid_status('error');
openid_error(openid_message());
}
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:63,代码来源:common.php
示例18: podPress_validateLogin
function podPress_validateLogin()
{
global $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_pass_md5, $user_identity, $current_user;
if (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
return false;
}
$http_headers = getallheaders();
if (empty($http_headers['Authorization'])) {
if (empty($http_headers['AUTHORIZATION'])) {
podPress_requestLogin();
return false;
} else {
$http_headers['Authorization'] = stripslashes(stripslashes($http_headers['AUTHORIZATION']));
}
}
switch (PODPRESS_PREMIUM_METHOD) {
case 'Digest':
$data = podPress_http_digest_parse($http_headers['Authorization']);
if (!$data) {
die('Wrong Credentials!');
}
$x = get_userdatabylogin($data['username']);
$A1 = get_usermeta($x->ID, 'premiumcast_creds');
$A2 = md5($_SERVER['REQUEST_METHOD'] . ':' . $data['uri']);
$valid_response = md5($A1 . ':' . $data['nonce'] . ':' . $data['nc'] . ':' . $data['cnonce'] . ':' . $data['qop'] . ':' . $A2);
if ($data['response'] == $valid_response) {
$user_login = $data['username'];
$authresult = wp_login($user_login, md5($x->user_pass), true);
}
break;
case 'Basic':
default:
$authparts = podPress_http_basic_parse($http_headers['Authorization']);
$user_login = $authparts['username'];
$authresult = wp_login($user_login, $authparts['passwd']);
break;
}
$podPress_x = $GLOBALS['wp_object_cache']->cache['userlogins'][$user_login];
if (is_object($GLOBALS['wp_object_cache']->cache['userlogins'][$user_login])) {
if ($podPress_x->wp_capabilities['premium_subscriber'] != 1 && $podPress_x->wp20_capabilities['premium_subscriber'] != 1) {
$authresult = false;
}
} else {
if ($GLOBALS['wp_object_cache']->cache['users'][$podPress_x]->wp_capabilities['premium_subscriber'] != 1 && $GLOBALS['wp_object_cache']->cache['users'][$podPress_x]->wp20_capabilities['premium_subscriber'] != 1) {
$authresult = false;
}
}
unset($podPress_x);
if (!$authresult) {
podPress_requestLogin();
return false;
$current_user = new WP_User(0);
return false;
}
$userdata = get_userdatabylogin($user_login);
$user_level = $userdata->user_level;
$user_ID = $userdata->ID;
$user_email = $userdata->user_email;
$user_url = $userdata->user_url;
$user_pass_md5 = md5($userdata->user_pass);
$user_identity = $userdata->display_name;
define('PODPRESS_PREMIUMLOGIN', $user_login);
define('PODPRESS_PREMIUMID', $userdata->ID);
if (empty($current_user)) {
$current_user = new WP_User($user_ID);
}
}
开发者ID:niko-lgdcom,项目名称:archives,代码行数:67,代码来源:podpress_premium_functions.php
示例19: WPMRegisterExisting
/**
* WPMRegisterExisting
* Registers existing user to a membership level
* @param array $data User data array
* @param string $wpm_errmsg Passed by reference, we save the error message here
* @param boolean $send_welcome_email True to send registration email or not
* @param boolean $notifyadmin True to notify admin via email of this registration
* @return integer|boolean User ID on success or false on error
*/
function WPMRegisterExisting($data, &$wpm_errmsg, $send_welcome_email = true, $notifyadmin = true, $special_bypass = false)
{
/* include the required WordPress functions */
require_once ABSPATH . 'wp-admin/includes/user.php';
/* load the membership levels */
$wpm_levels = $this->GetOption('wpm_levels');
/* set blacklist to zero */
$blacklist = 0;
/* Check if for approval registration */
$is_forapproval = $this->IsForApprovalRegistration($data['wpm_id']);
if ($is_forapproval) {
$wpm_newid = time();
sleep(1);
$pendingstatus = "Registered For Approval";
if ($is_forapproval['name'] == "PinPayments") {
$data['sctxnid'] = "SP-" . $data['wpm_id'] . "-" . $wpm_newid;
$pendingstatus = "Pin Payments Confirmation";
}
$data['wpm_id'] = $is_forapproval["level"];
$registered_by_admin = false;
}
/* check if the user is valid */
if (true === wlm_admin_in_admin() || true === $special_bypass) {
$validuser = username_exists($data['username']);
if (!$validuser) {
$validuser = email_exists($data['email']);
$user_info = get_userdata($validuser);
$data['username'] = $user_info->user_login;
}
$data['password'] = __('Already assigned', 'wishlist-member');
} else {
$validuser = wp_login($data['username'], $data['password']);
}
if ($validuser) {
$user = $this->Get_UserData(0, $data['username']);
/* check for blacklist status */
$blacklist = $this->CheckBlackList($user->user_email);
/* load user's Membership Levels */
$levels = $this->GetMembershipLevels($user->ID);
/* check if the member is already registered to the level */
$inlevel = in_array($data['wpm_id'], $levels);
/*
* if member is already in level, check if he's expired and if so,
* check if level is configured to reset registration for expired
* level re-registration
*/
if ($inlevel) {
$expired = $this->LevelExpired($data['wpm_id'], $user->ID);
$resetexpired = $wpm_levels[$data['wpm_id']]['registrationdatereset'] == 1;
/* if expired and level allows re-registration then set inlevel to false */
if ($expired && $resetexpired) {
$inlevel = false;
}
$cancelled = $this->LevelCancelled($data['wpm_id'], $user->ID);
$resetcancelled = $wpm_levels[$data['wpm_id']]['uncancelonregistration'] == 1;
/* if expired and level allows re-registration then set inlevel to false */
if ($cancelled && $resetcancelled) {
$inlevel = false;
}
$repeat_registration = false;
if (defined('WLM_ALLOW_REPEAT_REGISTRATION')) {
$inlevel = false;
$repeat_registration = true;
}
}
}
/* validate if not blacklisted */
if ($blacklist) {
switch ($blacklist) {
case 1:
$wpm_errmsg = $this->GetOption('blacklist_email_message');
break;
case 2:
$wpm_errmsg = $this->GetOption('blacklist_ip_message');
break;
case 3:
$wpm_errmsg = $this->GetOption('blacklist_email_ip_message');
break;
}
return false;
}
/* validate if a valid user */
if (!$validuser) {
$wpm_errmsg = __('Invalid username and/or password.', 'wishlist-member');
return false;
}
/* validate if not in level */
if ($inlevel) {
$wpm_errmsg = __('You are already registered to this level.', 'wishlist-member');
return false;
}
//.........这里部分代码省略.........
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:101,代码来源:PluginMethods.php
示例20: auth_redirect
function auth_redirect() {
// Checks if a user is logged in, if not redirects them to the login page
if ( (!empty($_COOKIE['wordpressuser_' . COOKIEHASH]) &&
!wp_login($_COOKIE['wordpressuser_' . COOKIEHASH], $_COOKIE['wordpresspass_' . COOKIEHASH], true)) ||
(empty($_COOKIE['wordpressuser_' . COOKIEHASH])) ) {
header('Expires: Wed, 11 Jan 1984 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-cache, must-revalidate, max-age=0');
header('Pragma: no-cache');
header('Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']));
exit();
}
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:14,代码来源:pluggable-functions.php
注:本文中的wp_login函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论