/** * コンストラクター * * @access public */ function Abbreviateurl_Action() { $this->_container =& DIContainerFactory::getContainer(); $this->_db =& $this->_container->getComponent("DbObject"); $this->_session =& $this->_container->getComponent("Session"); $this->_abbreviateurlView =& $this->_container->getComponent("abbreviateurlView"); }
/** * コンストラクター * * @access public */ function Room_Components_View() { $this->_container =& DIContainerFactory::getContainer(); $this->_db =& $this->_container->getComponent("DbObject"); $this->_session =& $this->_container->getComponent("Session"); $this->_authoritiesView =& $this->_container->getComponent("authoritiesView"); $this->_configView =& $this->_container->getComponent("configView"); }
/** * コンストラクター * * @access public */ function Userinf_Components_Check() { $log =& LogFactory::getLog(); $log->trace("component userinf check のコンストラクタが実行されました", "UserinfCheck#Userinf_Components_Check"); $this->_container =& DIContainerFactory::getContainer(); $this->_usersView =& $this->_container->getComponent("usersView"); $this->_session =& $this->_container->getComponent("Session"); }
/** * コンストラクター * * @access public */ function Mobile_Action() { $this->_container =& DIContainerFactory::getContainer(); $this->_db =& $this->_container->getComponent("DbObject"); $this->_modulesView =& $this->_container->getComponent("modulesView"); $this->_session =& $this->_container->getComponent("Session"); $this->_mobile_obj = $this->_modulesView->getModuleByDirname("mobile"); }
/** * コンストラクター * * @access public */ function Login_Components_View() { $log =& LogFactory::getLog(); $log->trace("component login View のコンストラクタが実行されました", "loginView#Login_View"); $this->_container =& DIContainerFactory::getContainer(); $this->_config =& $this->_container->getComponent("configView"); $renderer =& SmartyTemplate::getInstance(); $renderer->assign('autoregist_use', $this->getAutoregistUse()); $renderer->assign('autoregist_disclaimer', $this->getDisclaimer()); }
/** * 携帯表示に対応できるルームのツリーを作成する * ルームツリー自体はFilter_AllowRoom...にて作成されている * 作成済みルームツリーに対して、携帯メニューに表示可能なルームを判定する * 2010.02.04 add by AllCreator * * @return true false * @access public */ function getRoomTree(&$roomArr, $display_type, $each_room, $roomIds) { $roomTree = array(); $request =& $this->_container->getComponent('Request'); $invisiblePageIds = $this->getInvisiblePageIds($display_type, $each_room, $roomIds); // エラー if ($invisiblePageIds === false) { return false; } $mobileModuleIds = $this->getMobileModuleIds($display_type, $each_room, $roomIds); if ($mobileModuleIds === false) { return false; } // 表示可能なモジュールが何もない if (empty($mobileModuleIds)) { // Roomデータ全てにvisible=falseを設定して戻る $temporaryRoomArr = null; $this->setVisibleFlagToRoomRecursive($roomArr, $roomArr[0][0], array(), $temporaryRoomArr); return true; } $params = array(_DISPLAY_POSITION_CENTER); if (empty($invisiblePageIds)) { $invisiblePageWhere = ""; } else { $invisiblePageWhere = "AND P.page_id NOT IN (" . implode(',', $invisiblePageIds) . ") "; } $sql = "SELECT P.room_id, count(B.block_id) as block_ct " . " FROM {pages} P INNER JOIN {blocks} B ON P.page_id = B.page_id AND B.module_id IN (" . implode(',', $mobileModuleIds) . ") " . " WHERE P.room_id IN ( " . implode(',', $roomIds) . ")" . " AND P.space_type IN (" . _SPACE_TYPE_PUBLIC . "," . _SPACE_TYPE_GROUP . ") " . " AND P.private_flag IN (" . _ON . "," . _OFF . ") " . " AND P.display_position = ? " . $invisiblePageWhere . $this->_getPageWhereSQL($invisiblePageIds) . " GROUP BY P.room_id "; $visibleRoomIds = $this->_db->execute($sql, $params, null, null, true, array($this, '_fetchVisibleRoomIds')); $temporaryRoomArr = null; $this->setVisibleFlagToRoomRecursive($roomArr, $roomArr[0][0], $visibleRoomIds, $temporaryRoomArr); return true; }
/** * Script文字列取得 * @param array $dir_name_arr * @param boolean $system_flag * @return string * @access public */ function _getScript($dir_name_arr = array(), $system_flag = false) { $session =& $this->_container->getComponent("Session"); $lang = $session->getParameter("_lang"); if (CORE_BASE_URL == BASE_URL && isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') { $base_url = BASE_URL_HTTPS; } else { $base_url = CORE_BASE_URL; } $script_name = $base_url . INDEX_FILE_NAME . "?action=common_download_js"; // パラメータの順番を同じようにするためソート(できるだけCasheで表示してもらうため) if ($dir_name_arr != null) { sort($dir_name_arr); $script_name .= "&dir_name=" . htmlspecialchars(implode("|", $dir_name_arr), ENT_QUOTES); } if ($session->getParameter("_system_flag") || $system_flag) { $script_name .= "&system_flag=" . _ON; } else { $script_name .= "&system_flag=" . _OFF; } $lang_script_name = ""; if (defined("_JS_VERSION")) { $script_name .= "&vs=" . _JS_VERSION; $lang_script_name .= "?vs=" . _JS_VERSION; } $scriptStr = "<script type=\"text/javascript\" src=\"" . $base_url . "/js/" . $lang . "/lang_common.js" . $lang_script_name . "\"></script>" . "<script type=\"text/javascript\" src=\"" . $script_name . "\"></script>"; return $scriptStr; }
/** * 新着データを登録する * * @return boolean true or false * @access public */ function setWhatsnew() { $assignment = $this->_request->getParameter("assignment"); if (empty($assignment)) { $assignmentView =& $this->_container->getComponent("assignmentView"); $assignment = $assignmentView->getAssignment(); if (empty($assignment)) { return false; } } $activity = intval($this->_request->getParameter("activity")); if ($activity == _ON) { $whatsnew_lang = ASSIGNMENT_START_WHATSNEW; } else { return true; } $whatsnewAction =& $this->_container->getComponent("whatsnewAction"); $assignment_name = mb_substr($assignment["assignment_name"], 0, ASSIGNMENT_WHATSNEW_TITLE, INTERNAL_CODE); if ($assignment_name != $assignment["assignment_name"]) { $assignment_name .= _SEARCH_MORE; } $whatsnew = array("unique_id" => $assignment["assignment_id"], "title" => sprintf($whatsnew_lang, $assignment_name), "description" => "", "action_name" => "assignment_view_main_whatsnew", "parameters" => "assignment_id=" . $assignment["assignment_id"]); $result = $whatsnewAction->insert($whatsnew); if ($result === false) { return false; } return true; }
/** * ハンドルの更新 * @param * @return * @access public */ function updHandle($edit_user_id, $input, $old_data) { $tag_name = "handle"; $params = array($tag_name => $input); $ret = $this->_updData($edit_user_id, $input, $old_data, $params); if ($ret == "" && $input != $old_data) { $this->_session->setParameter("_handle", $input); $private_where_params = array("{pages}.insert_user_id" => $edit_user_id, "{pages}.private_flag" => _ON, "{pages}.page_id={pages}.room_id" => null); $commonMain =& $this->_container->getComponent("commonMain"); $pagesView =& $commonMain->registerClass(WEBAPP_DIR . '/components/pages/View.class.php', "Pages_View", "paegsView"); $private_pages = $pagesView->getPagesUsers($private_where_params, array("default_entry_flag" => "ASC"), 2); if ($private_pages === false) { return 'error'; } if (isset($private_pages[0])) { $pagesAction =& $commonMain->registerClass(WEBAPP_DIR . '/components/pages/Action.class.php', "Pages_Action", "paegsAction"); $result = $pagesAction->updPermaLink($private_pages[0], $input); if ($result === false) { return 'error'; } $configView =& $commonMain->registerClass(WEBAPP_DIR . '/components/config/View.class.php', "Config_View", "configView"); $config = $configView->getConfigByCatid(_SYS_CONF_MODID, _GENERAL_CONF_CATID); if ($config === false) { return 'error'; } if (isset($private_pages[1]) && $config['open_private_space']['conf_value'] == _OPEN_PRIVATE_SPACE_MYPORTAL_GROUP || $config['open_private_space']['conf_value'] == _OPEN_PRIVATE_SPACE_MYPORTAL_PUBLIC) { $result = $pagesAction->updPermaLink($private_pages[1], $input); if ($result === false) { return 'error'; } } } } return $ret; }
/** * メール取得 * * @access public */ function getMailConfig() { $module_id = $this->_request->getParameter("module_id"); $configView =& $this->_container->getComponent("configView"); $config = $configView->getConfig($module_id, false); if ($config === false) { return false; } $result = array(); if (defined($config["mail_send"]["conf_value"])) { $result["mail_send"] = constant($config["mail_send"]["conf_value"]); } else { $result["mail_send"] = intval($config["mail_send"]["conf_value"]); } if (defined($config["mail_authority"]["conf_value"])) { $result["mail_authority"] = constant($config["mail_authority"]["conf_value"]); } else { $result["mail_authority"] = intval($config["mail_authority"]["conf_value"]); } if (defined($config["mail_subject"]["conf_value"])) { $result["mail_subject"] = constant($config["mail_subject"]["conf_value"]); } else { $result["mail_subject"] = $config["mail_subject"]["conf_value"]; } if (defined($config["mail_body"]["conf_value"])) { $result["mail_body"] = preg_replace("/\\\\n/s", "\n", constant($config["mail_body"]["conf_value"])); } else { $result["mail_body"] = preg_replace("/\\\\n/s", "\n", $config["mail_body"]["conf_value"]); } return $result; }
/** * モジュールのデータを取得 * * @access private */ function _callbackModules(&$recordSet, &$params) { $request = $actionChain =& $this->_container->getComponent("Request"); $block_id = $request->getParameter("block_id"); $target_modules = $this->_session->getParameter(array("search_select", $block_id, "target_modules")); $actionChain =& $this->_container->getComponent("ActionChain"); $actionName = $actionChain->getCurActionName(); $search_blocks_obj = $params[0]; $ret = array(); while ($row = $recordSet->fetchRow()) { if ($row["search_action"] == "") { continue; } $pathList = explode("_", $row["action_name"]); $row["dir_name"] = $pathList[0]; if ($actionName == "search_view_main_init" && $search_blocks_obj["show_mode"] == SEARCH_SHOW_MODE_SIMPLE && !in_array($row["dir_name"], $search_blocks_obj["default_target_module_arr"])) { continue; } $row["module_name"] = $this->_modulesView->loadModuleName($row["dir_name"]); if (isset($search_blocks_obj)) { if (isset($target_modules) && in_array($row["module_id"], $target_modules) || !isset($target_modules) && in_array($row["dir_name"], $search_blocks_obj["default_target_module_arr"])) { $row["target_module_flag"] = true; } else { $row["target_module_flag"] = false; } } $ret[] = $row; } return $ret; }
/** * 短縮URLデータ用JOIN句取得処理 * * @return string 短縮URLデータ用JOIN句文字列 * @access public */ function &_getAbbreviateUrlJoinStatement() { $request =& $this->_container->getComponent('Request'); $moduleId = $request->getParameter('module_id'); $joinStatement = 'LEFT JOIN {abbreviate_url} URL ' . "ON URL.module_id = '" . $moduleId . "' " . 'AND URL.contents_id = {multidatabase_content}.multidatabase_id ' . 'AND URL.unique_id = {multidatabase_content}.content_id '; return $joinStatement; }
/** * コンストラクター * * @access public */ function Backup_Components_Restore() { $this->_container =& DIContainerFactory::getContainer(); $this->_db =& $this->_container->getComponent("DbObject"); $this->_actionChain =& $this->_container->getComponent("ActionChain"); $commonMain =& $this->_container->getComponent("commonMain"); $this->_fileAction =& $commonMain->registerClass(WEBAPP_DIR . '/components/file/Action.class.php', "File_Action", "fileAction"); $this->_pagesView =& $this->_container->getComponent("pagesView"); $this->_configView =& $this->_container->getComponent("configView"); $this->_modulesView =& $this->_container->getComponent("modulesView"); $this->_databaseSqlutility =& $this->_container->getComponent("databaseSqlutility"); $this->_requestMain =& $this->_container->getComponent("requestMain"); }
/** * ルーム指定 * * @access public */ function setSelectRoom() { $block_id = $this->_request->getParameter("block_id"); $select_room = intval($this->_request->getParameter("select_room")); if ($select_room == _ON) { $not_enroll_room = $this->_session->getParameter(array("whatsnew", "not_enroll_room", $block_id)); $enroll_room = $this->_session->getParameter(array("whatsnew", "enroll_room", $block_id)); if (!isset($not_enroll_room) && !isset($enroll_room)) { $enroll_room = array($this->_session->getParameter("_main_room_id")); } $whatsnewView =& $this->_container->getComponent("whatsnewView"); $whatsnew_obj = $whatsnewView->getBlock($block_id); if (!$whatsnew_obj) { return false; } if (!empty($whatsnew_obj["select_room_list"]) && !empty($not_enroll_room)) { foreach ($not_enroll_room as $i => $room_id) { if (in_array($room_id, $whatsnew_obj["select_room_list"])) { $params = array("block_id" => $block_id, "room_id" => $room_id); $result = $this->_db->deleteExecute("whatsnew_select_room", $params); if (!$result) { return false; } } } } if (!empty($enroll_room)) { foreach ($enroll_room as $i => $room_id) { if (empty($whatsnew_obj["select_room_list"]) || !in_array($room_id, $whatsnew_obj["select_room_list"])) { $params = array("block_id" => $block_id, "room_id" => $room_id); $result = $this->_db->insertExecute("whatsnew_select_room", $params); if (!$result) { return false; } } } } } else { $params = array("block_id" => $block_id); $result = $this->_db->deleteExecute("whatsnew_select_room", $params); if (!$result) { return false; } } return true; }
function forward($ids = array(), $parameter = '', $options = array()) { $email_filters = array(); $pmAction =& $this->_container->getComponent("pmAction"); $request =& $this->_container->getComponent("Request"); $block_id = $request->getParameter("block_id"); if (is_array($ids)) { $email_address = $parameter; foreach ($ids as $id) { $email_filters[] = array('receiver_id' => $id, 'receiver_user_id' => $options["receiver_user_id"], 'receiver_user_name' => $options["receiver_user_name"], 'receiver_auth_id' => $options["receiver_auth_id"], 'email' => $email_address); } } if (sizeof($email_filters)) { return $email_filters; } else { return true; } }
/** * 権限判断用のSQLを取得する * * @return array array($from_sql, $where_sql), 権限判断用のSQL文 * @access private */ function getAuthoritySQL() { $usersView =& $this->_container->getComponent('usersView'); $from_sql = " FROM ({authorities},{users})" . " INNER JOIN {authorities_modules_link}" . " ON {authorities_modules_link}.module_id = " . $this->_request->getParameter("module_id") . " AND {authorities}.role_authority_id = {authorities_modules_link}.role_authority_id"; $where_sql = " WHERE {users}.role_authority_id = {authorities}.role_authority_id"; $where_sql .= " AND {authorities}.user_authority_id > " . _AUTH_GUEST; $where_sql .= $usersView->createSearchWhereString(); $where_sql .= " AND {users}.active_flag = " . _USER_ACTIVE_FLAG_ON; return array($from_sql, $where_sql); }
/** * モジュールID取得 * * @return string * @access public */ function getDefaultModuleId($module_name) { $getdata = $this->_container->getComponent("GetData"); $modules = $getdata->getParameter("modules"); if (isset($modules[$module_name])) { $module = $modules[$module_name]; } else { $modulesView = $this->_container->getComponent("modulesView"); $module = $modulesView->getModuleByDirname($module_name); } $module_id = $module['module_id']; return $module_id; }
/** * 祝日取得(複数日指定) * * @param array $dates 祝日の判断を行う対象年月日配列 * @return array 日時をkeyとした祝日名称配列 * @access public */ function getHolidays($dates) { $holidays = array(); $session =& $this->_container->getComponent('Session'); $language = $session->getParameter('_lang'); $datesString = implode("','", $dates); $sql = "SELECT holiday, summary " . "FROM {holiday} " . "WHERE lang_dirname = ? " . "AND holiday IN ('" . $datesString . "') "; $params = array($language); $holidays = $this->_db->execute($sql, $params, null, null, true, array($this, '_callback')); if ($holidays === false) { $this->_db->addError(); } return $holidays; }
/** * ルーム、モジュール毎で、指定件数以上の古いデータを削除する * * @param string $moduleId モジュールID * @param mixed $roomIds ルームID、ルームID配列 * @return boolean true or false * @access public */ function _deletePeriod($moduleId, $roomIds) { if (rand(0, 10) != 0) { return true; } $modulesView =& $this->_container->getComponent('modulesView'); $module = $modulesView->getModuleByDirname('whatsnew'); $configView =& $this->_container->getComponent('configView'); $config = $configView->getConfig($module['module_id'], false); if ($config === false) { return false; } $period = $config['whatsnew_period']['conf_value']; $maximumNumber = $config['whatsnew_delete_number']['conf_value']; $periodTime = timezone_date(); $periodTime = mktime(intval(substr($periodTime, 8, 2)), intval(substr($periodTime, 10, 2)), intval(substr($periodTime, 12, 2)), intval(substr($periodTime, 4, 2)), intval(substr($periodTime, 6, 2)) - intval($period), intval(substr($periodTime, 0, 4))); $periodTime = date('YmdHis', $periodTime); if (!is_array($roomIds)) { $roomIds = array($roomIds); } $sql = "SELECT room_id, COUNT(*) count " . "FROM {whatsnew} " . "WHERE room_id IN ('" . implode("','", $roomIds) . "') " . "AND module_id = ? " . "GROUP BY room_id " . "HAVING count > ?"; $bindValues = array($moduleId, $maximumNumber); $whatsnews = $this->_db->execute($sql, $bindValues); $inValue = ''; foreach ($whatsnews as $whatsnew) { $sql = "SELECT whatsnew_id " . "FROM {whatsnew} " . "WHERE insert_time < ? " . "AND child_update_time < ? " . "AND module_id = ? " . "AND room_id = ? " . "ORDER BY child_update_time"; $bindValues = array($periodTime, $periodTime, $moduleId, $whatsnew['room_id']); $oldWhatsnews = $this->_db->execute($sql, $bindValues); $deleteNumber = $whatsnew['count'] - $maximumNumber; foreach ($oldWhatsnews as $oldWhatsnew) { $inValue .= $oldWhatsnew['whatsnew_id'] . ','; $deleteNumber--; if ($deleteNumber <= 0) { break; } } } if (empty($inValue)) { return true; } $inValue = substr($inValue, 0, -1); if (!$this->_deleteByInOperator('whatsnew_user', $inValue)) { return false; } if (!$this->_deleteByInOperator('whatsnew', $inValue)) { return false; } return true; }
/** * 解凍処理 * * @return boolean * @access public */ function decompressFile($path, $parent_id, $depth, $rename = 0) { $handle = opendir($path); if (!$handle) { return false; } if ($rename == _ON) { $nameList = $this->_cabinetView->getFileNameList(); } while (false !== ($file_name = readdir($handle))) { if ($file_name == "." || $file_name == "..") { continue; } $file_path = $path . "/" . $file_name; if (!file_exists($file_path)) { continue; } $encode_name = mb_convert_encoding($file_name, _CHARSET, $this->encode); if (is_dir($file_path)) { if ($rename == _ON) { $encode_name = $this->_cabinetView->renameFile($encode_name, "", $nameList); } $params = array("upload_id" => 0, "parent_id" => $parent_id, "file_name" => $encode_name, "extension" => "", "depth" => $depth, "size" => 0, "file_type" => CABINET_FILETYPE_FOLDER); $file_id = $this->execDecompress($params); if ($file_id === false) { return false; } $this->decompressFile($file_path, $file_id, $depth + 1); } else { $pathinfo = pathinfo($file_name); if ($pathinfo === false) { $commonMain =& $this->_container->getComponent("commonMain"); $fileAction =& $commonMain->registerClass(WEBAPP_DIR . '/components/file/Action.class.php', "File_Action", "fileAction"); $result = $fileAction->delDir($file_path); continue; } if ($rename == _ON) { $encode_name = $this->_cabinetView->renameFile(strtr($encode_name, array("." . $pathinfo['extension'] => "")), $pathinfo['extension'], $nameList); } $params = array("upload_id" => 0, "parent_id" => $parent_id, "file_name" => strtr($encode_name, array("." . $pathinfo['extension'] => "")), "extension" => $pathinfo['extension'], "depth" => $depth, "size" => filesize($file_path), "file_type" => CABINET_FILETYPE_FILE); $file_id = $this->execDecompress($params, $file_path); if ($file_id === false) { return false; } } } closedir($handle); return true; }
/** * 会員データを削除する * * @param mix $roomId 削除対象ルームID * @return boolean true or false * @access public */ function deleteUser($userId) { if (empty($userId)) { return true; } $userIds = $userId; if (!is_array($userId)) { $userIds = array($userId); } $inValue = "'" . implode("','", $userIds) . "'"; $sql = "SELECT P.room_id, " . "U.role_authority_id " . "FROM {pages} P " . "INNER JOIN {users} U " . "ON P.insert_user_id = U.user_id " . "WHERE P.thread_num = ? " . "AND P.private_flag = ? " . "AND P.space_type = ? " . "AND P.insert_user_id IN (" . $inValue . ")"; $bindValues = array(0, _ON, _SPACE_TYPE_GROUP); $privateRoomsPerRole = $this->_db->execute($sql, $bindValues, null, null, true, array($this, '_fetchPrivateRoomPerRole')); $roles = array_keys($privateRoomsPerRole); $sql = "SELECT M.action_name, " . "M.delete_action, " . "AM.role_authority_id " . "FROM {modules} M " . "INNER JOIN {authorities_modules_link} AM " . "ON M.module_id = AM.module_id " . "WHERE M.system_flag = ? " . "AND AM.role_authority_id IN ('" . implode("','", $roles) . "')"; $bindValues = array(_OFF); $modulesPerRole =& $this->_db->execute($sql, $bindValues, null, null, true, array($this, '_fetchModulePerRole')); if ($modulesPerRole === false) { return false; } $pagesAction =& $this->_container->getComponent('pagesAction'); foreach ($privateRoomsPerRole as $roleId => $privateRooms) { if (!$pagesAction->deleteEachModule($privateRooms, $modulesPerRole[$roleId])) { return false; } foreach ($privateRooms as $roomId) { if (!$pagesAction->deleteRoom($roomId)) { return false; } } } if (!$this->deleteByInOperator('users', $inValue)) { return false; } if (!$this->deleteByInOperator('users_items_link', $inValue)) { return false; } if (!$this->deleteByInOperator('pages_users_link', $inValue)) { return false; } $sql = "UPDATE {uploads} " . "SET " . "garbage_flag = ? " . "WHERE action_name = ? " . "AND unique_id IN (" . $inValue . ") " . "AND garbage_flag = ?"; $bindValues = array(_ON, 'common_download_user', _OFF); if (!$this->_db->execute($sql, $bindValues)) { $this->_db->addError(); return false; } return true; }
/** * 携帯用(ヘッダメニューの新着情報)の設定データを取得 * * @access public */ function getMobileBlock($module_id) { $mobile_module_obj = $this->_modulesView->getModuleByDirname('mobile'); $configView =& $this->_container->getComponent("configView"); $config = $configView->getConfig($mobile_module_obj['module_id'], false); if ($config === false) { return false; } $display_type = $config['mobile_whatsnew_display_type']['conf_value']; $display_days = $config['mobile_whatsnew_display_days']['conf_value']; $display_number = $config['mobile_whatsnew_display_number']['conf_value']; $display_flag = $config['mobile_whatsnew_display_flag']['conf_value']; $display_modules = $config['mobile_whatsnew_select_module']['conf_value']; if (empty($display_modules)) { // 初期状態=全て選択 //携帯モジュールのIDを集める $getdata =& $this->_container->getComponent("GetData"); $mobile_modules = $getdata->getParameter("mobile_modules"); $mobile_modules_arr = array(); foreach ($mobile_modules as $display_position => $mmodules) { foreach ($mmodules as $dir_name => $mmodule) { $mobile_modules_arr[] = $mmodule["module_id"]; } } $display_modules = implode(',', $mobile_modules_arr); } $whatsnew_config = $configView->getConfig($module_id, false); if ($whatsnew_config == false) { return false; } $display_title = _ON; $display_room_name = _ON; $display_module_name = _ON; $display_user_name = _ON; $display_insert_time = _ON; $display_description = _ON; $allow_rss_feed = _OFF; $select_room_flag = $config['mobile_whatsnew_select_room_flag']['conf_value']; $select_room = $config['mobile_whatsnew_select_room']['conf_value']; $select_room_list = explode(',', $select_room); $myroom_flag = $config['mobile_whatsnew_select_myroom']['conf_value']; $mobile = array('block_id' => 0, 'display_type' => $display_type, 'display_days' => $display_days, 'display_number' => $display_number, 'display_flag' => $display_flag, 'display_modules' => $display_modules, 'display_title' => $display_title, 'display_room_name' => $display_room_name, 'display_module_name' => $display_module_name, 'display_user_name' => $display_user_name, 'display_insert_time' => $display_insert_time, 'display_description' => $display_description, 'allow_rss_feed' => $allow_rss_feed, 'select_room' => $select_room_flag, 'myroom_flag' => $myroom_flag, 'rss_title' => WHATSNEW_RSS_TITLE, 'rss_description' => WHATSNEW_RSS_DESCRIPTION, 'select_room_list' => $select_room_list, 'allow_switch_days' => defined($whatsnew_config['allow_switch_days']['conf_value']) ? constant($whatsnew_config['allow_switch_days']['conf_value']) : intval($whatsnew_config['allow_switch_days']['conf_value'])); $mobile =& $this->_modulesView->getModulesById(explode(',', $display_modules), array($this, "_callbackBlock"), array($mobile)); if ($mobile === false) { return false; } return $mobile; }
/** * 投稿権限チェック * * @access public */ function hasPostAuth($journal_id) { $session =& $this->_container->getComponent("Session"); $_user_id = $session->getParameter("_user_id"); $_auth_id = $session->getParameter("_auth_id"); if ($_auth_id >= _AUTH_CHIEF) { return true; } $result = $this->_db->selectExecute("journal", array("journal_id" => $journal_id)); if ($result === false || !isset($result[0])) { return false; } if ($_auth_id >= $result[0]["post_authority"]) { return true; } return false; }
/** * 投稿回数をセットする * * @return bool * @access public */ function setMonthlynumber($edit_flag, $status, $agree_flag = null, $before_post = null) { $monthlynumberAction =& $this->_container->getComponent("monthlynumberAction"); $session =& $this->_container->getComponent("Session"); // --- 投稿回数更新 --- if ($status == MULTIDATABASE_STATUS_RELEASED_VALUE && $agree_flag == MULTIDATABASE_STATUS_AGREE_VALUE && (!$edit_flag || $before_post['temporary_flag'] == MULTIDATABASE_STATUS_BEFORE_RELEASED_VALUE || $before_post['agree_flag'] == MULTIDATABASE_STATUS_WAIT_AGREE_VALUE)) { if (!$edit_flag) { $params = array("user_id" => $session->getParameter("_user_id")); } else { $params = array("user_id" => $before_post['insert_user_id']); } if (!$monthlynumberAction->incrementMonthlynumber($params)) { return false; } } return true; }
/** * ルーム選択の配列生成 * * @access public */ function &getSelectRoomList() { $calendarView =& $this->_container->getComponent("calendarView"); $calendar_block = $calendarView->getBlock(); if ($calendar_block === false) { return $calendar_block; } $sess_myroom_flag = $this->_session->getParameter(array("calendar", "myroom_flag", $calendar_block["block_id"])); if (isset($sess_myroom_flag)) { $calendar_block["myroom_flag"] = intval($sess_myroom_flag); } $user_id = $this->_session->getParameter("_user_id"); $room_arr = $this->_request->getParameter("room_arr"); if (!empty($user_id)) { $room_arr[0][0][0] = array("page_id" => CALENDAR_ALL_MEMBERS_ID, "parent_id" => 0, "page_name" => CALENDAR_ALL_MEMBERS_LANG, "thread_num" => 0, "space_type" => _SPACE_TYPE_UNDEFINED, "private_flag" => _OFF, "authority_id" => $this->_session->getParameter("_user_auth_id")); } $thread_num = 0; $parent_id = 0; $getdata =& $this->_container->getComponent("GetData"); $pages = $getdata->getParameter("pages"); $actionChain =& $this->_container->getComponent("ActionChain"); $result_params = array("enroll_room_arr" => array(), "not_enroll_room_arr" => array(), "room_arr" => $room_arr, "calendar_block" => $calendar_block, "private_room_id_arr" => array(), "action_name" => $actionChain->getCurActionName()); $sess_enroll_room = $this->_session->getParameter(array("calendar", "enroll_room", $calendar_block["block_id"])); foreach ($result_params["room_arr"][$thread_num][$parent_id] as $disp => $room) { if ($room["space_type"] == _SPACE_TYPE_GROUP && $room["private_flag"] == _ON) { if ($result_params["calendar_block"]["myroom_flag"] == _ON) { $result_params["calendar_block"]["select_room_list"][] = $room["page_id"]; } if ($result_params["calendar_block"]["myroom_flag"] == _ON && strpos(strtolower($result_params["action_name"]), "calendar_view_main") !== false) { $result_params["enroll_room_arr"][] = $room; } continue; } if (!isset($sess_enroll_room) && in_array($room["page_id"], $result_params["calendar_block"]["select_room_list"]) || !empty($sess_enroll_room) && in_array($room["page_id"], $sess_enroll_room)) { $result_params["enroll_room_arr"][] = $room; } else { $result_params["not_enroll_room_arr"][] = $room; } $this->_makeRoomArray($result_params, 1, $room["page_id"], $room); } $this->_request->setParameter("calendar_block", $result_params["calendar_block"]); $result = array("enroll_room_arr" => $result_params["enroll_room_arr"], "not_enroll_room_arr" => $result_params["not_enroll_room_arr"]); return $result; }
/** * 登録処理 * * @access public */ function insertRRule($calendar_id, $rrule) { $this->_calendarView =& $this->_container->getComponent("calendarView"); if (empty($this->_calendarView)) { return true; } if (!is_array($rrule)) { $rrule = $this->parseRRule($rrule); } $result = $this->_db->selectExecute("calendar_plan", array("calendar_id" => $calendar_id)); if ($result === false) { return $result; } $start_params = $result[0]; $sql = "DELETE FROM {calendar_plan} " . "WHERE plan_id = ? " . "AND calendar_id <> ?"; $result = $this->_db->execute($sql, array("plan_id" => $start_params["plan_id"], "calendar_id" => $calendar_id)); if ($result === false) { $this->_db->addError(); return $result; } $rrule["INDEX"] = 1; switch ($rrule["FREQ"]) { case "YEARLY": $result = $this->_insertYearly($start_params, $rrule, true); break; case "MONTHLY": if (isset($rrule["BYMONTHDAY"])) { $result = $this->_insertMonthlyByMonthday($start_params, $rrule, true); } else { $result = $this->_insertMonthlyByDay($start_params, $rrule, true); } break; case "WEEKLY": $result = $this->_insertWeekly($start_params, $rrule, true); break; case "DAILY": $result = $this->_insertDaily($start_params, $rrule); break; default: $result = true; } return $result; }
/** * 編集権限チェック * * @access public */ function _hasEditAuthority(&$file) { $_user_id = $this->_session->getParameter("_user_id"); $_auth_id = $this->_session->getParameter("_auth_id"); $_hierarchy = $this->_session->getParameter("_hierarchy"); if ($_auth_id >= _AUTH_CHIEF) { return true; } if ($file["file_type"] == CABINET_FILETYPE_FOLDER && $this->childExists($file["file_id"])) { return false; } $authCheck =& $this->_container->getComponent("authCheck"); $file_hierarchy = $authCheck->getPageHierarchy($file["insert_user_id"], $this->_request->getParameter("room_id")); if ($file["insert_user_id"] == $_user_id || $_hierarchy > $file_hierarchy) { return true; } else { return false; } }
/** * トラックバックの処理 * * @return bool * @access public */ function setTrackBack($journal_obj, $post_id, $params) { $trackback_result = ""; $journalView =& $this->_container->getComponent("journalView"); $trackbacks = $journalView->getChildDetail($post_id, JOURNAL_TRACKBACK_TRANSMIT); $old_tb_url = ""; if (!empty($trackbacks)) { foreach ($trackbacks as $key => $val) { $old_tb_url .= $val['tb_url'] . "\n"; } } if ($params['tb_url'] != "" || $old_tb_url != "") { // 送信するブログ名称、URLを設定 $pre_blogname = array("{X-MODULE_NAME}", "{X-USER}", "{X-SITE_NAME}"); $configView =& $this->_container->getComponent("configView"); $config =& $configView->getConfigByCatid(_SYS_CONF_MODID, _GENERAL_CONF_CATID); $session =& $this->_container->getComponent("Session"); $ext_blogname = array(JOURNAL_NAME, $session->getParameter("_handle"), $config['sitename']['conf_value']); $blog_name = str_replace($pre_blogname, $ext_blogname, $journal_obj['transmit_blogname']); $blog_url = BASE_URL . "/?action=pages_view_main&active_action=journal_view_main_detail&post_id=" . $post_id . "&block_id=" . $journal_obj['block_id'] . "#" . $session->getParameter("_id"); $trackback_urls = $this->getTrackbackUrl($params, $old_tb_url); foreach ($trackback_urls as $url => $type) { if ($type == "add") { $this->createTrackbackData($params, $blog_name, $blog_url); if ($this->weblogPostTrackback($url)) { //$response_xml = $this->journalAction->getRSSFromTrackbackURL($url); //$tb_rss_data = $this->journalAction->parseXML($response_xml); $trackback_param = array("journal_id" => $journal_obj['journal_id']); $tb_rss_data = array(); $params['post_id'] = $post_id; $this->setTrackbackValues($trackback_param, $tb_rss_data, $url, JOURNAL_TRACKBACK_TRANSMIT, $params); $this->saveTrackback($trackback_param); } } elseif ($type == "del") { $this->removeTrackback($post_id, $blog_url, JOURNAL_TRACKBACK_TRANSMIT); } } //メッセージ $trackback_result = $this->getWeblogMsg(); } return $trackback_result; }
/** * 新着情報の更新 * * @access public */ function setWhatsnew($plan_params) { $actionChain =& $this->_container->getComponent("ActionChain"); $actionName = $actionChain->getCurActionName(); //--新着情報関連 Start-- $whatsnewAction =& $this->_container->getComponent("whatsnewAction"); $result = true; if ($actionName == "calendar_action_main_plan_add" || $actionName == "calendar_action_main_plan_modify") { $description = ""; if ($plan_params["location"] != "") { $description .= sprintf(CALENDAR_LOCATION, $plan_params["location"]); } if ($plan_params["contact"] != "") { $description .= sprintf(CALENDAR_CONTACT, $plan_params["contact"]); } if ($plan_params["description"] != "") { $description .= sprintf(CALENDAR_DESCRIPTION, $plan_params["description"]); } if (!empty($plan_params["rrule"])) { $rrule_str = $this->_calendarView->stringRRule($plan_params["rrule"]); $description .= sprintf(CALENDAR_RRULE, $rrule_str); } $block_id = $this->_calendarView->getBlockIdByWhatsnew(); $whatsnew = array("room_id" => $plan_params["room_id"], "unique_id" => $plan_params["plan_id"], "title" => $plan_params["title"], "description" => $description, "action_name" => "calendar_view_main_init", "parameters" => "plan_id=" . $plan_params["plan_id"] . "&block_id=" . $block_id . "#_" . $block_id); if ($actionName == "calendar_action_main_plan_modify") { $plan = $this->_db->selectExecute("calendar_plan", array("plan_id" => $plan_params["plan_id"])); $whatsnew["insert_time"] = $plan[0]["insert_time"]; $whatsnew["insert_user_id"] = $plan[0]["insert_user_id"]; $whatsnew["insert_user_name"] = $plan[0]["insert_user_name"]; } $result = $whatsnewAction->auto($whatsnew, _ON); } elseif ($actionName == "calendar_action_main_plan_delete" || "calendar_action_edit_ical_import") { $params = array("plan_id" => $plan_params["plan_id"]); $count = $this->_db->countExecute("calendar_plan", $params); if ($count == 0) { $result = $whatsnewAction->delete($plan_params["plan_id"]); } } return $result; //--新着情報関連 End-- }
/** * Videoアップロードチェック * @param string * @param array * @return string * @access public **/ function _checkVideoURL($value, $allowable_video) { $session =& $this->_container->getComponent("Session"); $_allow_video_flag = $session->getParameter("_allow_video_flag"); if ($_allow_video_flag != _ON) { // 動画アップロード不可 return false; } // URlチェック $error_flag = true; foreach ($allowable_video as $url_key => $video) { $req_str = $video != "" ? $url_key . "?action=" . $video : $url_key; if (preg_match('/^' . $req_str . '/iu', $value)) { $error_flag = false; break; } } if ($error_flag == true) { return false; } return true; }