/** * 共通チェック */ function log_common_check($kind, $page, $parm) { global $log; global $log_ua; $username = auth::check_auth(); // 認証済の場合 if ($log['auth_nolog'] && !empty($username)) { return ''; } $utime = UTIME; $obj_log = new log(); $obj_proxy = new check_proxy(); $ip = $obj_log->getip(); $hostname = $obj_log->ip2host($ip); $proxy_info = $obj_proxy->is_proxy() ? $obj_proxy->get_proxy_info() . '(' . $obj_proxy->get_realip() . ')' : ''; unset($obj_log); unset($obj_proxy); if (isset($log[$kind]['nolog_ip'])) { // ロギング対象外IP foreach ($log[$kind]['nolog_ip'] as $nolog_ip) { if ($ip == $nolog_ip) { return ''; } } } // NetBIOS でのチェックを実施 if (netbios_scope_check($ip, $hostname)) { $obj_nbt = new netbios($ip); $ntlm_user = $obj_nbt->username; unset($obj_nbt); } else { $ntlm_user = ''; } // 更新時は、削除されたか? if ($kind == 'update') { $delete_flag = file_exists(get_filename($page)) ? '' : 'DELETE'; } else { $delete_flag = ''; } // 署名の収集 $signature = log_set_signature($kind, $page, $utime); $rc = array(); $field = log::set_fieldname($kind); $obj = new auth_api(); $msg = $obj->auth_session_get(); foreach ($field as $key) { switch ($key) { case 'ts': // タイムスタンプ (UTIME) $rc[$key] = $utime; break; case 'ip': // IPアドレス $rc[$key] = $ip; break; case 'host': // ホスト名 (FQDN) $rc[$key] = $hostname; break; case 'auth_api': // 認証API名 //$obj = new auth_api(); //$msg = $obj->auth_session_get(); $rc[$key] = empty($msg['api']) && !empty($username) ? 'plus' : $msg['api']; break; case 'local_id': $rc[$key] = empty($msg['local_id']) ? '' : $msg['local_id']; break; case 'user': // ユーザ名(認証済) $rc[$key] = $username; break; case 'ntlm': // ユーザ名(NTLM認証) $rc[$key] = $ntlm_user; break; case 'proxy': // Proxy情報 $rc[$key] = $proxy_info; break; case 'ua': // ブラウザ情報 $rc[$key] = $log_ua; break; case 'del': // 削除フラグ $rc[$key] = $delete_flag; break; case 'sig': // 署名(曖昧) $rc[$key] = $signature; break; case 'file': // ファイル名 $rc[$key] = $parm; break; case 'page': case 'cmd': $rc[$key] = $page; break; } } return $rc; }
function get_auth_api_info() { global $auth_api, $auth_wkgrp_user, $defaultpage; foreach ($auth_api as $api => $val) { // どうしても必要な場合のみ開始 if (!$val['use']) { continue; } if (function_exists('pkwk_session_start')) { pkwk_session_start(); } break; } require_once LIB_DIR . 'auth_api.cls.php'; $obj = new auth_api(); $msg = $obj->auth_session_get(); if (isset($msg['api']) && $auth_api[$msg['api']]['use']) { if (exist_plugin($msg['api'])) { $call_func = 'plugin_' . $msg['api'] . '_get_user_name'; $auth_key = $call_func(); $auth_key['api'] = $msg['api']; if (empty($auth_key['nick'])) { return array('role' => ROLE_GUEST, 'nick' => '', 'key' => '', 'group' => '', 'displayname' => '', 'home' => '', 'mypage' => '', 'api' => ''); } // 上書き・追加する項目 if (!empty($auth_wkgrp_user[$auth_key['api']][$auth_key['key']])) { $val =& $auth_wkgrp_user[$auth_key['api']][$auth_key['key']]; $auth_key['role'] = empty($val['role']) ? ROLE_ENROLLEE : $val['role']; $auth_key['group'] = empty($val['group']) ? '' : $val['group']; $auth_key['displayname'] = empty($val['displayname']) ? $user : $val['displayname']; $auth_key['home'] = empty($val['home']) ? $defaultpage : $val['home']; $auth_key['mypage'] = empty($val['mypage']) ? '' : $val['mypage']; } return $auth_key; } } return array('role' => ROLE_GUEST, 'nick' => '', 'key' => '', 'group' => '', 'displayname' => '', 'home' => '', 'mypage' => '', 'api' => ''); }