function execute()
 {
     $context = $this->getContext();
     $controller = $context->getController();
     $request = $context->getRequest();
     $user = $context->getUser();
     $target_user_community_id = $request->getParameter('id');
     $view_mode = $request->getParameter('mode');
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     $target_user_info_row = ACSUser::get_user_profile_row($target_user_community_id);
     $is_permitted = false;
     /* アクセス権チェック */
     // マイページが閲覧可能かチェックする
     // 削除フラグ、全体の公開範囲をチェック
     /* 写真表示 */
     // ファイル情報取得
     // (1) 一般ユーザ(外部ユーザ)かどうか
     if (!$acs_user_info_row['is_acs_user']) {
         $image_file_id = $target_user_info_row['file_id_ol01'];
     } else {
         // (2) ログインユーザかどうか
         $image_file_id = $target_user_info_row['file_id_ol02'];
         // (3) 友人かどうか
         if (ACSUser::is_in_friends_id_array($acs_user_info_row, $target_user_info_row['user_community_id'])) {
             $image_file_id = $target_user_info_row['file_id_ol05'];
         }
         // (4) 本人かどうか
         if ($acs_user_info_row['user_id'] == $target_user_info_row['user_id']) {
             $image_file_id = $target_user_info_row['file_id_ol05'];
         }
         // (5) システム管理者かどうか
         if (ACSAccessControl::is_system_administrator($acs_user_info_row)) {
             $image_file_id = $target_user_info_row['file_id_ol05'];
         }
     }
     if ($image_file_id) {
         $file_obj = ACSFile::get_file_info_instance($image_file_id);
         $ret = $file_obj->view_image($view_mode);
     } else {
         $image_url = ACSUser::get_default_image_url($view_mode);
         header("Location: {$image_url}");
     }
 }
Esempio n. 2
0
 /**
  * execute
  */
 function execute()
 {
     $context =& $this->getContext();
     $request =& $context->getRequest();
     $moduleName = $context->getModuleName();
     $actionName = $context->getActionName();
     $controller = $context->getController();
     $user = $context->getUser();
     $acs_user_info_row = $user->getAttribute('acs_user_info_row');
     // ログイン中のユーザ情報
     $this->setAttribute('acs_user_info_row', $acs_user_info_row);
     // ログインユーザかどうか
     $this->setAttribute('is_login_user', $acs_user_info_row['is_login_user']);
     // コミュニティメニューURL
     $this->setAttribute('community_menu_url', $this->getControllerPath('Community', 'SearchCommunity'));
     // ユーザ検索URL
     $this->setAttribute('search_user_url', $this->getControllerPath('User', 'SearchUser'));
     // 新着情報URL
     $this->setAttribute('public_index_url', $this->getControllerPath('Public', DEFAULT_ACTION));
     // FAQ URL
     $this->setAttribute('faq_url', ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL') . 'faq/');
     // システム管理メニューURL
     if (ACSAccessControl::is_system_administrator($acs_user_info_row)) {
         $this->setAttribute('is_system_administrator', true);
         $this->setAttribute('system_manage_menu_url', $this->getControllerPath('System', DEFAULT_ACTION));
     }
     // ログインURL
     $login_url = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_LOGIN_URL');
     $login_url .= $this->getControllerPath(DEFAULT_MODULE, 'Login');
     $this->setAttribute('login_url', $login_url);
     // ログアウトURL
     $logout_url = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL');
     $logout_url .= $this->getControllerPath(DEFAULT_MODULE, 'Logout');
     $this->setAttribute('logout_url', $logout_url);
     // 新着情報URL(非ログイン)
     $public_index_url_not_login = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group', 'D01'), 'SYSTEM_BASE_URL');
     $public_index_url_not_login .= $this->getControllerPath('Public', DEFAULT_ACTION);
     $this->setAttribute('public_index_url_not_login', $public_index_url_not_login);
 }
 /**
  * コミュニティのコンテンツにアクセス可能かどうか
  *
  * @param $acs_user_info_row アクセス者のユーザ情報
  * @param $role_array アクセス者のrole_array
  * @param $row アクセス対象となるデータ (連想配列)
  * @return アクセス可(true)/アクセス不可(false)
  */
 static function is_valid_user_for_community($acs_user_info_row, $role_array, $row)
 {
     $ret = false;
     // コミュニティメンバ、システム管理者以外の場合
     // コミュニティ全体の公開範囲をチェック
     if (!ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $row['community_id']) && !ACSAccessControl::is_system_administrator($acs_user_info_row)) {
         $community_self_info_row = ACSCommunity::get_contents_row($row['community_id'], ACSMsg::get_mst('contents_type_master', 'D00'));
         if ($community_self_info_row['open_level_name'] == ACSMsg::get_mst('open_level_master', 'D03')) {
             return false;
         }
     }
     foreach ($role_array as $role_key => $role_value) {
         if (ACSLib::get_boolean($row["open_for_{$role_key}"]) && $role_value) {
             $ret = true;
             break;
         } elseif ($role_key == 'member') {
             // 閲覧許可を与えるコミュニティが指定されている場合
             if (count($row['trusted_community_row_array']) > 0) {
                 foreach ($row['trusted_community_row_array'] as $trusted_community_row) {
                     if (ACSCommunity::is_community_member($acs_user_info_row['user_community_id'], $trusted_community_row['community_id'])) {
                         $ret = true;
                         break;
                     }
                 }
             }
             if ($ret) {
                 break;
             }
         }
     }
     return $ret;
 }