当前位置: 首页>>代码示例>>PHP>>正文


PHP wp_login函数代码示例

本文整理汇总了PHP中wp_login函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_login函数的具体用法?PHP wp_login怎么用?PHP wp_login使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wp_login函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的wp_login函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。