Example #1
0
/**
 * 指定したアクションにリダイレクトする
 *
 * 引数 $tail は文字列と配列の両方を許容する。
 * 文字列を指定した場合、URLに $tail がそのまま付加される。
 * 配列を指定した場合、キーと要素を元にパラメータを生成し、URLに付加する。
 *
 * @param string $p    リダイレクト先のページ
 * @param string $msg    エラーメッセージ
 * @param mixied $tail    URLに付加する文字列かパラメータ
 */
function admin_client_redirect($p, $msg = '', $tail = '')
{
    if (is_array($tail)) {
        $_tail_list = array();
        foreach ($tail as $key => $value) {
            $_tail_list[] = $key . '=' . urlencode($value);
        }
        $tail = '';
        $tail = implode('&', $_tail_list);
    }
    if (OPENPNE_ADMIN_URL) {
        $url = OPENPNE_ADMIN_URL;
    } else {
        $url = openpne_gen_url_head('admin', 'page_' . $p, true);
    }
    if (need_ssl_param('admin', 'page_' . $p)) {
        if ($tail) {
            $tail .= '&';
        }
        $tail .= 'ssl_param=1';
    }
    $hash_tbl =& AdminHashTable::singleton();
    $m = ADMIN_MODULE_NAME;
    $p = $hash_tbl->hash($p);
    $url .= "?m={$m}&a=page_{$p}";
    if ($tail) {
        $url .= "&{$tail}";
    }
    if ($msg) {
        $url .= '&msg=' . urlencode($msg);
    }
    client_redirect_absolute($url);
}
 /**
  * Exceute login using OpenPNE_Shibboleth
  */
 public function execute($requests)
 {
     $auth_config = get_auth_config();
     $auth = new OpenPNE_Shibboleth($auth_config['storage'], $auth_config['options']);
     $this->_auth =& $auth;
     $this->_login_params = $requests['login_params'];
     $auth->setExpire($GLOBALS['OpenPNE']['common']['session_lifetime']);
     $auth->setIdle($GLOBALS['OpenPNE']['common']['session_idletime']);
     $auth->logout();
     if (!$auth->login($requests['is_save'], true)) {
         $this->_fail_login();
     }
     if (LOGIN_CHECK_ENABLE) {
         include_once 'OpenPNE/LoginChecker.php';
         $options = array('check_num' => LOGIN_CHECK_NUM, 'check_time' => LOGIN_CHECK_TIME, 'reject_time' => LOGIN_REJECT_TIME);
         $this->_lc =& new OpenPNE_LoginChecker($options);
     }
     if (LOGIN_CHECK_ENABLE && $this->_lc->is_rejected()) {
         $this->_fail_login();
     }
     $c_member_id = db_member_c_member_id4username_encrypted($auth->getUsername(), false);
     // IS_SLAVEPNE is false on Shibboleth.
     if (IS_SLAVEPNE && !$c_member_id) {
         $c_member_id = db_member_create_member($_POST['username']);
     }
     if (!$c_member_id) {
         $this->_fail_login();
     }
     db_api_update_token($c_member_id);
     $url = OPENPNE_URL;
     if ($this->_login_params) {
         $url .= '?' . $this->_login_params;
     }
     client_redirect_absolute($url);
 }
Example #3
0
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     $target_c_banner_id = $requests['target_c_banner_id'];
     $referer = $_SERVER['HTTP_REFERER'];
     db_banner_insert_c_banner_log($target_c_banner_id, $u, $referer);
     $c_banner = db_banner_get_c_banner4id($target_c_banner_id);
     if (empty($c_banner['a_href'])) {
         openpne_redirect('pc');
     } else {
         client_redirect_absolute($c_banner['a_href']);
     }
 }
Example #4
0
 function execute($requests)
 {
     if (LOGIN_URL_PC && !DISPLAY_LOGIN) {
         client_redirect_absolute(LOGIN_URL_PC);
     }
     //---- inc_ テンプレート用 変数 ----//
     $this->set('inc_page_header', fetch_inc_page_header('public'));
     $this->set('INC_PAGE_HEADER', db_banner_get_top_banner(false));
     $this->set('IS_CLOSED_SNS', IS_CLOSED_SNS);
     $this->set('top_banner_html_before', p_common_c_siteadmin4target_pagename('top_banner_html_before'));
     $this->set('top_banner_html_after', p_common_c_siteadmin4target_pagename('top_banner_html_after'));
     $this->set('inc_page_footer', p_common_c_siteadmin4target_pagename('inc_page_footer_before'));
     return 'success';
 }
Example #5
0
 function execute($requests)
 {
     $this->_login_params = $requests['login_params'];
     $config = get_auth_config();
     $auth = new OpenPNE_Auth($config);
     $this->_auth =& $auth;
     $auth->setExpire($GLOBALS['OpenPNE']['common']['session_lifetime']);
     $auth->setIdle($GLOBALS['OpenPNE']['common']['session_idletime']);
     // 現在のセッションを削除
     $auth->logout();
     if (LOGIN_CHECK_ENABLE) {
         include_once 'OpenPNE/LoginChecker.php';
         $options = array('check_num' => LOGIN_CHECK_NUM, 'check_time' => LOGIN_CHECK_TIME, 'reject_time' => LOGIN_REJECT_TIME);
         $this->_lc =& new OpenPNE_LoginChecker($options);
     }
     if (!$auth->login($requests['is_save'])) {
         $this->_fail_login();
     }
     if (LOGIN_CHECK_ENABLE && $this->_lc->is_rejected()) {
         $this->_fail_login();
     }
     $c_member_id = db_member_c_member_id4username_encrypted($auth->getUsername(), false);
     if (OPENPNE_AUTH_MODE == 'slavepne' && !$c_member_id) {
         $c_member_id = db_member_create_member($_POST['username']);
     }
     if (!$c_member_id) {
         $this->_fail_login();
     }
     if (OPENPNE_ONE_SESSION_PER_USER) {
         db_member_update_c_member_secure_insert_sess_id($c_member_id, session_id());
     }
     if (db_member_is_login_rejected($c_member_id)) {
         $this->_fail_login('login_rejected');
     }
     if (db_member_is_blacklist($c_member_id)) {
         $this->_fail_login('login_rejected');
     }
     db_member_do_access($c_member_id);
     db_api_update_token($c_member_id);
     $url = OPENPNE_URL;
     if ($this->_login_params) {
         $url .= '?' . $this->_login_params;
     }
     client_redirect_absolute($url);
 }
Example #6
0
 function execute($requests)
 {
     $u = $GLOBALS['AUTH']->uid();
     if (!is_null($requests['community_x'])) {
         $p = array('keyword' => $requests['q']);
         openpne_redirect('pc', 'page_h_com_find_all', $p);
     } elseif (!is_null($requests['web_x'])) {
         $q = urlencode($requests['q']);
         client_redirect_absolute('http://www.google.com/search?hl=ja&q=' . $q);
     } elseif (!is_null($requests['message_x'])) {
         $p = array('keyword' => $requests['q'], 'box' => 'inbox');
         openpne_redirect('pc', 'page_h_message_box', $p);
     } else {
         // default
         $p = array('keyword' => $requests['q']);
         openpne_redirect('pc', 'page_h_diary_list_all', $p);
     }
 }
Example #7
0
 function execute($requests)
 {
     if (LOGIN_URL_KTAI && !DISPLAY_LOGIN) {
         client_redirect_absolute(LOGIN_URL_KTAI);
     }
     // --- リクエスト変数
     $msg_id = $requests['msg'];
     $kad = $requests['kad'];
     // ----------
     //メッセージ
     $this->set('msg', k_p_common_msg4msg_id($msg_id));
     $this->set('ktai_address', t_decrypt($kad));
     $this->set('SNS_NAME', SNS_NAME);
     $this->set('IS_CLOSED_SNS', IS_CLOSED_SNS);
     // inc_entry_point
     $this->set('inc_ktai_entry_point', fetch_inc_entry_point($this->getView(), 'ktai_o_login'));
     return 'success';
 }
Example #8
0
 function execute($requests)
 {
     $q = http_build_query($_REQUEST);
     client_redirect_absolute(OPENPNE_URL . 'img.php?' . $q);
     return 'success';
 }
function ktai_biz_openpne_redirect($module, $action = '', $params = array())
{
    if ($module == 'ktai_biz') {
        if (session_id()) {
            $params['ksid'] = session_id();
        }
    }
    $url = openpne_gen_url($module, $action, $params);
    client_redirect_absolute($url);
}
Example #10
0
/**
 * クライアントリダイレクト(ログインページ)
 */
function client_redirect_login()
{
    client_redirect_absolute(get_login_url());
}