Esempio n. 1
0
require_once 'helpers/fsen/ProjectInfo.php';
$page_id = $_REQUEST['cID'];
$project_id = $_REQUEST['projectID'];
$domain_handle = $_REQUEST['domainHandle'];
$volume_handle = $_REQUEST['volumeHandle'];
$part_handle = $_REQUEST['partHandle'];
$chapter_handle = $_REQUEST['chapterHandle'];
$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 {
        $bi = ProjectInfo::getBlogInfo($chapter_handle);
        if ($bi == false) {
            $error_info = t('Bad request!');
        } else {
            if (($user_right = ProjectInfo::getUserEditRight($project_id, $domain_handle, $volume_handle, $part_handle, $chapter_handle, $_SESSION['FSEInfo']['fse_id'])) != 0) {
                switch ($user_right) {
                    case ProjectInfo::EDIT_PAGE_USER_BANNED:
                        $error_info = t('You are banned currently due to the violation against the site policy!');
                        break;
                    case ProjectInfo::EDIT_PAGE_USER_NO_RIGHT:
                        $error_info = t('You have no right to edit this blog!');
                        break;
                    default:
                        $error_info = t('Bad request!');
                        break;
                }