}
}
// If we are inside an iframe, halt the script
if (serendipity_is_iframe() !== false) {
    include_once S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
    // An iframe may NOT contain <html> and </html> tags, that's why we emit different headers here than on serendipity_admin.php
    // We need to restore GET/POST variables to that depending plugins inside the iframe
    // can still fetch all that variables; and we also tighten security by not allowing
    // to pass any different GET/POST variables to our iframe.
    $iframe_mode = $serendipity['GET']['iframe_mode'];
    $serendipity['POST'] =& $_SESSION['save_entry_POST'];
    $serendipity['GET'] =& $_SESSION['save_entry_POST'];
    // GET-Vars are the same as POST to ensure compatibility.
    $serendipity['hidefooter'] = true;
    ignore_user_abort(true);
    echo serendipity_iframe($_SESSION['save_entry'], $iframe_mode);
    return true;
}
if (isset($serendipity['GET']['no_smarty']) || isset($serendipity['no_smarty'])) {
    $_SESSION['no_smarty'] = true;
}
if (defined('IS_up2date') && IS_up2date === true && IS_installed === true) {
    $admin_installed = true;
} else {
    $admin_installed = false;
}
$is_logged_in = serendipity_userLoggedIn();
if ($is_logged_in) {
    $self_info = sprintf(USER_SELF_INFO, serendipity_specialchars($serendipity['serendipityUser']), $serendipity['permissionLevels'][$serendipity['serendipityUserlevel']]);
} else {
    $self_info = '';
/**
 * Performs a check whether an iframe for the admin section shall be emitted
 *
 * The iframe is used for previewing an entry with the stylesheet of the frontend.
 * It fetches its data from the session input data.
 *
 * @access private
 * @return boolean  True, if iframe was requested, false if not.
 */
function serendipity_is_iframe()
{
    global $serendipity;
    if ($serendipity['GET']['is_iframe'] && is_array($_SESSION['save_entry'])) {
        include_once S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
        // An iframe may NOT contain <html> and </html> tags, that's why we emit different headers here than on serendipity_admin.php
        // We need to restore GET/POST variables to that depending plugins inside the iframe
        // can still fetch all that variables; and we also tighten security by not allowing
        // to pass any different GET/POST variables to our iframe.
        $iframe_mode = $serendipity['GET']['iframe_mode'];
        $serendipity['POST'] =& $_SESSION['save_entry_POST'];
        $serendipity['GET'] =& $_SESSION['save_entry_POST'];
        // GET-Vars are the same as POST to ensure compatibility.
        ignore_user_abort(true);
        serendipity_iframe($_SESSION['save_entry'], $iframe_mode, true);
        return true;
    }
    return false;
}
示例#3
0
                 }
                 $entry['categories'][] = serendipity_fetchCategoryInfo($catid);
             }
             if (count($entry['categories']) < 1) {
                 unset($entry['categories']);
             }
             if (isset($entry['id'])) {
                 $serendipity['GET']['id'] = $entry['id'];
             } else {
                 $serendipity['GET']['id'] = 1;
             }
             if ($serendipity['use_iframe']) {
                 echo '<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . IFRAME_PREVIEW . '</div><br />';
                 serendipity_iframe_create('preview', $entry);
             } else {
                 serendipity_iframe($entry, 'preview');
             }
         }
     }
     // serendipity_updertEntry sets this global variable to store the entry id. Couldn't pass this
     // by reference or as return value because it affects too many places inside our API and dependant
     // function calls.
     if (!empty($serendipity['lastSavedEntry'])) {
         $entry['id'] = $serendipity['lastSavedEntry'];
     }
     if (!$preview_only) {
         include_once S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
         serendipity_printEntryForm('?', array('serendipity[action]' => 'admin', 'serendipity[adminModule]' => 'entries', 'serendipity[adminAction]' => 'save', 'serendipity[timestamp]' => $entry['timestamp']), $entry);
     }
     break;
 case 'doDelete':
示例#4
0
                 }
                 $entry['categories'][] = serendipity_fetchCategoryInfo($catid);
             }
             if (count($entry['categories']) < 1) {
                 unset($entry['categories']);
             }
             if (isset($entry['id'])) {
                 $serendipity['GET']['id'] = $entry['id'];
             } else {
                 $serendipity['GET']['id'] = 1;
             }
             if ($serendipity['use_iframe']) {
                 $data['is_iframepreview'] = true;
                 $data['iframe'] = serendipity_iframe_create('preview', $entry);
             } else {
                 $data['iframe'] = serendipity_iframe($entry, 'preview');
             }
         }
     }
     // serendipity_updertEntry sets this global variable to store the entry id. Couldn't pass this
     // by reference or as return value because it affects too many places inside our API and dependant
     // function calls.
     if (!empty($serendipity['lastSavedEntry'])) {
         $entry['id'] = $serendipity['lastSavedEntry'];
     }
     if (!$preview_only) {
         include_once S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
         $entryForm = serendipity_printEntryForm('?', array('serendipity[action]' => 'admin', 'serendipity[adminModule]' => 'entries', 'serendipity[adminAction]' => 'save', 'serendipity[timestamp]' => serendipity_specialchars($entry['timestamp'])), $entry, $errors);
     }
     break;
 case 'doDelete':