public function delete_member() { if (!fse_try_to_login()) { header("location:/fse_login"); return; } $project_id = $this->post('projectID'); $area_handle = $this->post('areaHandle'); $domain_handle = $this->post('domainHandle'); $volume_handle = $this->post('volumeHandle'); $part_handle = $this->post('partHandle'); $chapter_handle = $this->post('chapterHandle'); $section_id = $this->post('sectionID'); $member_username = $this->post('memberUsername'); $page_path = ProjectInfo::assemblePath($project_id, $domain_handle, $volume_handle, $part_handle, $chapter_handle); $page_id = Page::getByPath($page_path)->getCollectionID(); if ($page_id <= 0) { header('Location: /'); return; } if (!fse_try_to_login()) { set_page_action_status($page_id, t('Delete Member'), 'error', t('You do not sign in or session expired.')); header("Location: {$page_path}"); return; } $curr_fse_id = $_SESSION['FSEInfo']['fse_id']; $curr_rights = ProjectInfo::getUserRights($project_id, $curr_fse_id); if ($curr_rights[0] != 't') { set_page_action_status($page_id, t('Delete Member'), 'error', t('You have no right to edit member roles.')); header("Location: {$page_path}"); return; } $fse_info = FSEInfo::getBasicProfile($member_username); if ($fse_info == false) { set_page_action_status($page_id, t('Delete Member'), 'error', t('No such user!')); header("Location: {$page_path}"); return; } ProjectInfo::removeMember($project_id, $fse_info['fse_id']); $section_manager = new DocSectionManager(); $res = $section_manager->deleteSection($project_id, $domain_handle, $section_id); if ($res != DocSectionManager::EC_OK) { set_page_action_status($page_id, t('Delete Member'), 'error', t('Failed to add/edit member roles: %s', $section_manager->getErrorMessage($res))); header("Location: {$page_path}"); return; } set_page_action_status($page_id, t('Delete Member'), 'success', t('Succeed to delete the member.')); header("Location: {$page_path}"); }
public static function getUserEditRight($project_id, $domain_handle, $volume_handle, $part_handle, $chapter_handle, $fse_id) { $user_rights = self::getUserRights($project_id, $fse_id); $project_shortname = substr($project_id, 0, strlen($project_id) - 3); if ($project_shortname == SYSTEM_PROJECT_SHORTNAME && $domain_handle == 'document' && $volume_handle == 'blog' && $part_handle != 'na' && $chapter_handle != 'na') { $author_info = FSEInfo::getBasicProfile($part_handle); if ($author_info == false) { return self::EDIT_PAGE_USER_ERROR; } if ($fse_id == $author_info['fse_id']) { if ($user_info['status'] > 0) { return self::EDIT_PAGE_USER_BANNED; } } else { if ($user_rights[1] != 't') { return self::EDIT_PAGE_USER_NO_RIGHT; } } } else { if ($user_rights[1] != 't') { return self::EDIT_PAGE_USER_NO_RIGHT; } } return 0; }
$attached_files = $json->decode($attached_files); if (is_array($attached_files) == false) { $error_info = t('Section content file is bad or lost!'); } else { if (strncmp($type_handle, "member", 6) != 0) { $error_info = t('Section is not a member section!'); } else { if ($attached_files[0] > 0) { $attached_file_0 = File::getByID($attached_files[0]); } $type_fragments = explode(":", $type_handle); if (count($type_fragments) != 5) { $error_info = t('Bad member section!'); } else { $member_username = $type_fragments[2]; $member_fse_info = FSEInfo::getBasicProfile($member_username); if ($member_fse_info == false) { $error_info = t('Bad member username!'); } else { $roles = ProjectInfo::getUserRoles($project_id, $member_fse_info['fse_id']); $member_roles = $roles['member_roles']; if ($member_roles == '') { $error_info = t('Not a valid member!'); } else { if ($member_roles == 'owner') { $error_info = t('You can not edit roles of the owner!'); } } } } }
?> </h1> </header> <ul class="list-group"> <?php foreach ($top_authors as $ta) { ?> <li class="list-group-item"> <h4 class="list-group-item-heading"> <a href="<?php echo "/{$doc_lang}/blog/" . $ta['part_handle']; ?> "> <?php $author_info = FSEInfo::getBasicProfile($ta['part_handle']); echo h5($author_info['nick_name']); ?> </a> </h4> </li> <?php } ?> </ul> <?php } ?> </div><!-- col-md-4 -->
exit(0); } if ($nr_comments < 1) { $nr_comments = 1; } $nr = 0; $ret_info->detail = '<ul class="list-group" style="width:300px;">'; foreach ($comments as $comment) { if ($nr >= $nr_comments) { break; } $author_name_info = FSEInfo::getNameInfo($comment['author_id']); if ($author_name_info == false) { continue; } $author_info = FSEInfo::getBasicProfile($author_name_info['user_name']); unset($replied_name_info); if (preg_match("/^[0-9a-f]{32}\$/", $comment['replied_author_id'])) { $replied_name_info = FSEInfo::getNameInfo($comment['replied_author_id']); if ($replied_name_info == false) { unset($replied_name_info); } } $ret_info->detail .= ' <li class="list-group-item"> <p> <small><strong class="text-info">' . $author_info['nick_name'] . '</strong>' . (isset($replied_name_info) ? t('Reply to ') . '<strong class="text-info">' . $replied_name_info['nick_name'] . '</strong>' : '') . ': ' . h5($comment['body']) . ' </small> </p> </li>'; $nr++;
require_once 'helpers/fsen/DocSectionManager.php'; include 'inc/head.php'; $doc_lang = $this->controller->get('fsenDocLang'); if (!isset($doc_lang)) { $doc_lang = 'en'; } ?> <body> <div class="full-stack"> <?php include 'inc/header.php'; $my_user_name = $c->getCollectionHandle(); $my_user_info = FSEInfo::getBasicProfile($my_user_name); if (count($my_user_info) > 0) { $db = Loader::db(); $my_projects = $db->getAll("SELECT project_id FROM fsen_projects WHERE fse_id=? AND project_id NOT LIKE 'sys-__'\n\tUNION SELECT project_id FROM fsen_project_members WHERE fse_id=? AND project_id NOT LIKE 'sys-__'", array($my_user_info['fse_id'], $my_user_info['fse_id'])); $nr_projects = count($my_projects); $my_blogs = $db->getAll("SELECT chapter_handle FROM fsen_project_doc_volume_part_chapters_{$doc_lang}\n\tWHERE project_id='sys-{$doc_lang}' AND domain_handle='document' AND volume_handle='blog' AND part_handle=?\n\tORDER BY heat_level DESC LIMIT 20", array($my_user_name)); $nr_blogs = count($my_blogs); $my_discussions = $db->getAll("SELECT project_id, domain_handle, volume_handle, part_handle, chapter_handle\n\tFROM fsen_project_doc_volume_part_chapters_all\n\tWHERE domain_handle='community' AND fse_id=?\n\tORDER BY heat_level DESC LIMIT 20", array($my_user_info['fse_id'])); $nr_discussions = count($my_discussions); $my_posts = $db->getAll("SELECT project_id, domain_handle, volume_handle, part_handle, chapter_handle,\n\t\tid, page_id, curr_ver_code, heat_level\n\tFROM fsen_document_sections_all\n\tWHERE author_id=? ORDER BY heat_level DESC LIMIT 20", array($my_user_info['fse_id'])); $nr_posts = count($my_posts); $my_favorites = $db->getAll("SELECT section_id\n\tFROM fsen_document_section_action_comments\n\tWHERE author_id=? AND action=? ORDER BY create_time DESC LIMIT 20", array($my_user_info['fse_id'], DocSectionManager::COMMENT_ACTION_FAVORITE)); $nr_favorites = count($my_favorites); ?> <div class="v-seperator"> </div>
$page_id = $_REQUEST['cID']; $project_id = $_REQUEST['projectID']; $domain_handle = $_REQUEST['domainHandle']; $volume_handle = $_REQUEST['volumeHandle']; $part_handle = $_REQUEST['partHandle']; $project_shortname = substr($project_id, 0, strlen($project_id) - 3); $doc_lang = substr($project_id, -2); if (!fse_try_to_login()) { $error_info = t('You are not signed in.'); } else { if ($project_shortname != SYSTEM_PROJECT_SHORTNAME || $domain_handle != 'document' || $volume_handle != 'blog') { $error_info = t('Bad Request!'); } else { $form_action = "/fse_settings/projects/add_new_blog"; $fse_id = $_SESSION['FSEInfo']['fse_id']; $user_info = FSEInfo::getBasicProfile($part_handle); $user_rights = ProjectInfo::getUserRights($project_id, $fse_id); if ($user_rights[1] == 't' && $user_info['fse_id'] != $fse_id) { $error_info = t('Only the author of this blog zone can add new blog!'); } else { if ($user_info['fse_id'] != $fse_id) { $error_info = t('You are not the author of this blog zone!'); } else { if ($user_info['email_verified'] == 0) { $error_info = t('Your primary email address has not been verified. Please verify it first in your Personal Settings page.'); } else { if ($user_info['status'] > 0) { $error_info = t('You are banned currently due to the violation against the site policy!'); } } }
* distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ defined('C5_EXECUTE') or die("Access Denied."); require_once 'helpers/fsen/FSEInfo.php'; $wiki_id = $_GET['WikiID']; $prefix = substr($wiki_id, 0, 3); if ($prefix == 'FSP') { $project_id = substr($wiki_id, 3); $doc_lang = substr($project_id, -2); header("location:/{$doc_lang}/project/{$project_id}"); exit(0); } else { if ($prefix == 'FSE') { $fse_user_name = substr($wiki_id, 3); $fse_info = FSEInfo::getBasicProfile($fse_user_name); if ($fse_info) { $home_link = FSEInfo::getPersonalHomeLink($fse_info); header("location:{$home_link}"); exit(0); } } else { if ($prefix == 'htt') { header("location:{$wiki_id}"); exit(0); } } } header('location:/');