diff --git a/import.php b/import.php index ea8421c..828fd20 100644 --- a/import.php +++ b/import.php @@ -139,13 +139,8 @@ function mod_oublog_import_get_identifier($user): array { } $blogs = oublog_import_getblogs($USER->id, $cm->id, $excludedlist); try { - if ($isou && \local_oudataload\util::is_september_2020_release_complete()) { - $remoteblogs = oublog_import_remote_call('mod_oublog_get_user_blogs2', - ['identifier' => mod_oublog_import_get_identifier($USER)]); - } else { - $remoteblogs = oublog_import_remote_call('mod_oublog_get_user_blogs', - ['username' => $USER->username]); - } + $remoteblogs = oublog_import_remote_call('mod_oublog_get_user_blogs2', + ['identifier' => mod_oublog_import_get_identifier($USER)]); if ($remoteblogs) { $blogs = array_merge($remoteblogs, $blogs); } @@ -221,15 +216,9 @@ function mod_oublog_import_get_identifier($user): array { if ($remote = optional_param('remote', false, PARAM_BOOL)) { $stepinfo['remote'] = true; // Blog on remote server, use WS to get info. - if ($isou && \local_oudataload\util::is_september_2020_release_complete()) { - $result = oublog_import_remote_call('mod_oublog_get_blog_info2', - ['identifier' => mod_oublog_import_get_identifier($USER), - 'cmid' => $bid, 'sharedblogcmid' => (int)$sharedblogcmid]); - } else { - $result = oublog_import_remote_call('mod_oublog_get_blog_info', - ['username' => $USER->username, - 'cmid' => $bid, 'sharedblogcmid' => (int)$sharedblogcmid]); - } + $result = oublog_import_remote_call('mod_oublog_get_blog_info2', + ['identifier' => mod_oublog_import_get_identifier($USER), + 'cmid' => $bid, 'sharedblogcmid' => (int)$sharedblogcmid]); if (!$result) { throw new moodle_exception('invalidcoursemodule', 'error'); } @@ -269,16 +258,10 @@ function mod_oublog_import_get_identifier($user): array { $stepinfo['preselected'] = $preselected; $preselected = array_filter(array_unique(explode(',', $preselected))); if ($remote) { - if ($isou && \local_oudataload\util::is_september_2020_release_complete()) { - $result = oublog_import_remote_call('mod_oublog_get_blog_allposts2', [ - 'blogid' => $boublogid, - 'identifier' => mod_oublog_import_get_identifier($USER), - 'sort' => $sort, 'page' => $page, 'tags' => $tags]); - } else { - $result = oublog_import_remote_call('mod_oublog_get_blog_allposts', [ - 'blogid' => $boublogid, 'username' => $USER->username, 'sort' => $sort, - 'page' => $page, 'tags' => $tags]); - } + $result = oublog_import_remote_call('mod_oublog_get_blog_allposts2', [ + 'blogid' => $boublogid, + 'identifier' => mod_oublog_import_get_identifier($USER), + 'sort' => $sort, 'page' => $page, 'tags' => $tags]); $posts = $result->posts; $total = $result->total; $tagnames = $result->tagnames; @@ -373,15 +356,9 @@ function mod_oublog_import_get_identifier($user): array { $importall = optional_param('importall', false, PARAM_BOOL); if ($remote = optional_param('remote', false, PARAM_BOOL)) { // Blog on remote server, use WS to get info. - if ($isou && \local_oudataload\util::is_september_2020_release_complete()) { - $result = oublog_import_remote_call('mod_oublog_get_blog_info2', - ['identifier' => mod_oublog_import_get_identifier($USER), - 'cmid' => $bid, 'sharedblogcmid' => (int)$sharedblogcmid]); - } else { - $result = oublog_import_remote_call('mod_oublog_get_blog_info', - ['username' => $USER->username, 'cmid' => $bid, - 'sharedblogcmid' => (int)$sharedblogcmid]); - } + $result = oublog_import_remote_call('mod_oublog_get_blog_info2', + ['identifier' => mod_oublog_import_get_identifier($USER), + 'cmid' => $bid, 'sharedblogcmid' => (int)$sharedblogcmid]); if (!$result) { throw new moodle_exception('invalidcoursemodule', 'error'); } @@ -416,32 +393,17 @@ function mod_oublog_import_get_identifier($user): array { } if ($remote) { if ($importall) { - if ($isou && \local_oudataload\util::is_september_2020_release_complete()) { - $posts = oublog_import_remote_call('mod_oublog_get_blog_posts2', - ['identifier' => mod_oublog_import_get_identifier($USER), - 'blogid' => $boublogid, 'selected' => '0', - 'inccomments' => $currentblog->allowcomments != OUBLOG_COMMENTS_PREVENT, - 'bcontextid' => $bcontextid]); - } else { - $posts = oublog_import_remote_call('mod_oublog_get_blog_posts', - ['username' => $USER->username, 'blogid' => $boublogid, 'selected' => '0', - 'inccomments' => $currentblog->allowcomments != OUBLOG_COMMENTS_PREVENT, - 'bcontextid' => $bcontextid]); - } + $posts = oublog_import_remote_call('mod_oublog_get_blog_posts2', + ['identifier' => mod_oublog_import_get_identifier($USER), + 'blogid' => $boublogid, 'selected' => '0', + 'inccomments' => $currentblog->allowcomments != OUBLOG_COMMENTS_PREVENT, + 'bcontextid' => $bcontextid]); } else { - if ($isou && \local_oudataload\util::is_september_2020_release_complete()) { - $posts = oublog_import_remote_call('mod_oublog_get_blog_posts2', - ['identifier' => mod_oublog_import_get_identifier($USER), - 'blogid' => $boublogid, 'selected' => implode(',', $selected), - 'inccomments' => $currentblog->allowcomments != OUBLOG_COMMENTS_PREVENT, - 'bcontextid' => $bcontextid]); - } else { - $posts = oublog_import_remote_call('mod_oublog_get_blog_posts', - ['username' => $USER->username, 'blogid' => $boublogid, - 'selected' => implode(',', $selected), - 'inccomments' => $currentblog->allowcomments != OUBLOG_COMMENTS_PREVENT, - 'bcontextid' => $bcontextid]); - } + $posts = oublog_import_remote_call('mod_oublog_get_blog_posts2', + ['identifier' => mod_oublog_import_get_identifier($USER), + 'blogid' => $boublogid, 'selected' => implode(',', $selected), + 'inccomments' => $currentblog->allowcomments != OUBLOG_COMMENTS_PREVENT, + 'bcontextid' => $bcontextid]); } } else {