本文整理汇总了PHP中auth::get_user_name方法的典型用法代码示例。如果您正苦于以下问题:PHP auth::get_user_name方法的具体用法?PHP auth::get_user_name怎么用?PHP auth::get_user_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类auth
的用法示例。
在下文中一共展示了auth::get_user_name方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_auth
function check_auth()
{
$login = auth::check_auth_pw();
if (!empty($login)) {
return $login;
}
// 外部認証API
$auth_key = auth::get_user_name();
// 暫定管理者(su)
global $vars;
if (!isset($vars['pass'])) {
return $auth_key['nick'];
}
if (pkwk_login($vars['pass'])) {
return UNAME_ADM_CONTENTS_TEMP;
}
return $auth_key['nick'];
}
示例2: plugin_commentx_get_nick
function plugin_commentx_get_nick()
{
global $vars;
$name = empty($vars['name']) ? '' : $vars['name'];
if (PKWK_READONLY != ROLE_AUTH) {
return array($name, $name, '');
}
list($role, $name, $nick, $url) = auth::get_user_name();
if (empty($nick)) {
return array($name, $name, '');
}
if (auth::get_role_level() < ROLE_AUTH) {
return array($name, $name, '');
}
$link = empty($url) ? $nick : $nick . '>' . $url;
return array($nick, $link, "disabled=\"disabled\"");
}
示例3: get_role_level
/**
* ユーザのROLEを取得
* @static
*/
function get_role_level()
{
global $realm, $auth_type, $auth_users, $adminpass;
$login = auth::check_auth();
if (empty($login)) {
return ROLE_GUEST;
}
// 未認証者
// 管理者パスワードなのかどうか?
$temp_admin = pkwk_hash_compute($_SERVER['PHP_AUTH_PW'], $adminpass) !== $adminpass ? FALSE : TRUE;
if (!$temp_admin && $login == UNAME_ADM_CONTENTS_TEMP) {
global $vars;
if (isset($vars['pass']) && pkwk_login($vars['pass'])) {
$temp_admin = TRUE;
}
}
if (!isset($auth_users[$login])) {
// 未登録者の場合
// 管理者パスワードと偶然一致した場合でも見做し認証者(4.1)
//return ($login == 'admin' && $temp_admin) ? 3.1 : 4.1;
if ($login == UNAME_ADM_CONTENTS_TEMP && $temp_admin) {
return ROLE_ADM_CONTENTS_TEMP;
}
// 外部認証API
list($role, $name, $nick, $profile) = auth::get_user_name();
// return (empty($name)) ? ROLE_AUTH_TEMP : $role;
if (empty($name)) {
return ROLE_AUTH_TEMP;
}
$wkgrp = auth::get_role_wkgrp($role, $name);
return $wkgrp == 0 ? $role : $wkgrp;
}
// 設定されている役割を取得
$role = empty($auth_users[$login][1]) ? ROLE_AUTH : $auth_users[$login][1];
switch ($role) {
case ROLE_ADM:
// サイト管理者
// サイト管理者
case ROLE_ADM_CONTENTS:
// コンテンツ管理者
// パスワードまで一致していること
if ($auth_type == 2) {
return auth::auth_digest($realm, $auth_users) ? $role : ROLE_AUTH;
} else {
return auth::auth_pw($auth_users) ? $role : ROLE_AUTH;
}
case ROLE_AUTH:
// 認証者(pukiwiki)
return $temp_admin ? ROLE_ADM_CONTENTS_TEMP : ROLE_AUTH;
}
return ROLE_AUTH;
}
示例4: plugin_typekey_inline
function plugin_typekey_inline()
{
global $vars, $_typekey_msg, $auth_api;
if (!function_exists('pkwk_session_start')) {
return $_typekey_msg['msg_not_found'];
}
if (pkwk_session_start() == 0) {
return $_typekey_msg['msg_not_start'];
}
if ($auth_api['typekey']['use'] != 1) {
return $_typekey_msg['msg_invalid'];
}
if (empty($auth_api['typekey']['site_token'])) {
return $_typekey_msg['msg_error'];
}
$obj = new auth_typekey();
$link = $obj->get_profile_link();
if ($link === false) {
return '';
}
if (!empty($link)) {
// 既に認証済
$page = get_script_absuri() . rawurlencode('?plugin=typekey');
if (!empty($vars['page'])) {
$page .= rawurlencode('&page=' . $vars['page']);
}
return sprintf($_typekey_msg['msg_logined'], $link) . '(<a href="' . auth_typekey::typekey_logout_url($page) . rawurlencode('&logout') . '">' . $_typekey_msg['msg_logout'] . '</a>)';
}
$auth_key = auth::get_user_name();
if (!empty($auth_key['nick'])) {
return $_typekey_msg['msg_typekey'];
}
return '<a href="' . plugin_typekey_jump_url() . '">' . $_typekey_msg['msg_typekey'] . '</a>';
}
示例5: plugin_pcomment_get_nick
function plugin_pcomment_get_nick()
{
global $vars, $_no_name;
$name = empty($vars['name']) ? $_no_name : $vars['name'];
if (PKWK_READONLY != ROLE_AUTH) {
return array($name, $name, '');
}
$auth_key = auth::get_user_name();
if (empty($auth_key['nick'])) {
return array($name, $name, '');
}
if (auth::get_role_level() < ROLE_AUTH) {
return array($auth_key['nick'], $name, '');
}
$link = empty($auth_key['profile']) ? $auth_key['nick'] : $auth_key['nick'] . '>' . $auth_key['profile'];
return array($auth_key['nick'], $link, "disabled=\"disabled\"");
}
示例6: plugin_openid_inline
function plugin_openid_inline()
{
global $vars, $auth_api, $_openid_msg;
if (!isset($auth_api['openid']['use'])) {
return '';
}
if (!$auth_api['openid']['use']) {
return $_openid_msg['msg_invalid'];
}
if (!function_exists('pkwk_session_start')) {
return $_openid_msg['msg_not_found'];
}
if (pkwk_session_start() == 0) {
return $_openid_msg['msg_not_start'];
}
$obj = new auth_openid_plus();
$name = $obj->auth_session_get();
if (!empty($name['api']) && $obj->auth_name !== $name['api']) {
return;
}
$page = empty($vars['page']) ? '' : $vars['page'];
$cmd = get_cmd_uri('openid', $page);
if (!empty($name['nickname'])) {
if (empty($name['local_id'])) {
$link = $name['nickname'];
} else {
$link = '<a href="' . $name['local_id'] . '">' . $name['nickname'] . '</a>';
}
return sprintf($_openid_msg['msg_logined'], $link) . '(<a href="' . $cmd . '&logout' . '">' . $_openid_msg['msg_logout'] . '</a>)';
}
$auth_key = auth::get_user_name();
if (!empty($auth_key['nick'])) {
return $_openid_msg['msg_openid'];
}
return '<a href="' . $cmd . '">' . $_openid_msg['msg_openid'] . '</a>';
}
示例7: plugin_livedoor_inline
function plugin_livedoor_inline()
{
global $script, $vars, $auth_api, $_livedoor_msg;
if (!$auth_api['livedoor']['use']) {
return $_livedoor_msg['msg_invalid'];
}
if (!function_exists('pkwk_session_start')) {
return $_livedoor_msg['msg_not_found'];
}
if (pkwk_session_start() == 0) {
return $_livedoor_msg['msg_not_start'];
}
$obj = new auth_livedoor();
$name = $obj->auth_session_get();
if (!empty($name['api']) && $obj->auth_name !== $name['api']) {
return;
}
if (isset($name['livedoor_id'])) {
$logout_url = $script . '?plugin=livedoor';
if (!empty($vars['page'])) {
$logout_url .= '&page=' . rawurlencode($vars['page']) . '&logout';
}
return sprintf($_livedoor_msg['msg_logined'], $name['livedoor_id']) . '(<a href="' . $logout_url . '">' . $_livedoor_msg['msg_logout'] . '</a>)';
}
$auth_key = auth::get_user_name();
if (!empty($auth_key['nick'])) {
return $_livedoor_msg['msg_livedoor'];
}
$login_url = plugin_livedoor_jump_url(1);
return '<a href="' . $login_url . '">' . $_livedoor_msg['msg_livedoor'] . '</a>';
}
示例8: plugin_hatena_inline
function plugin_hatena_inline()
{
global $script, $vars, $auth_api, $_hatena_msg;
if (!$auth_api['hatena']['use']) {
return $_hatena_msg['msg_invalid'];
}
if (!function_exists('pkwk_session_start')) {
return $_hatena_msg['msg_not_found'];
}
if (pkwk_session_start() == 0) {
return $_hatena_msg['msg_not_start'];
}
$obj = new auth_hatena();
$name = $obj->auth_session_get();
if (!empty($name['api']) && $obj->auth_name !== $name['api']) {
return;
}
if (isset($name['name'])) {
// $name = array('name','ts','image_url','thumbnail_url');
$link = $name['name'] . '<img src="' . $name['thumbnail_url'] . '" alt="id:' . $name['name'] . '" />';
$logout_url = $script . '?plugin=hatena';
if (!empty($vars['page'])) {
$logout_url .= '&page=' . rawurlencode($vars['page']);
}
$logout_url .= '&logout';
return sprintf($_hatena_msg['msg_logined'], $link) . '(<a href="' . $logout_url . '">' . $_hatena_msg['msg_logout'] . '</a>)';
}
$auth_key = auth::get_user_name();
if (!empty($auth_key['nick'])) {
return $_hatena_msg['msg_hatena'];
}
$login_url = plugin_hatena_jump_url(1);
return '<a href="' . $login_url . '">' . $_hatena_msg['msg_hatena'] . '</a>';
}