Beispiel #1
0
        $submit = false;
        // Set submit as false to keep the main stuff from being resubmitted again
        redirect(titania::$contrib->get_url());
    }
}
/**
* ---------------------------- Main Page ----------------------------
*/
// Load the message object
$message = new titania_message(titania::$contrib);
$message->set_auth(array('bbcode' => phpbb::$auth->acl_get('u_titania_bbcode'), 'smilies' => phpbb::$auth->acl_get('u_titania_smilies'), 'edit_subject' => titania_types::$types[titania::$contrib->contrib_type]->acl_get('moderate')));
$message->set_settings(array('display_error' => false, 'display_subject' => false, 'subject_name' => 'name'));
// Screenshots
$screenshot = new titania_attachment(TITANIA_SCREENSHOT, titania::$contrib->contrib_id);
$screenshot->load_attachments();
$screenshot->upload(175);
$error = array_merge($error, $screenshot->error);
if ($screenshot->uploaded || isset($_POST['preview']) || $submit) {
    titania::$contrib->post_data($message);
    titania::$contrib->__set_array(array('contrib_demo' => titania::$config->can_modify_style_demo_url || titania_types::$types[TITANIA_TYPE_STYLE]->acl_get('moderate') || titania::$contrib->contrib_type != TITANIA_TYPE_STYLE ? $contrib_demo : titania::$contrib->contrib_demo, 'contrib_local_name' => utf8_normalize_nfc(request_var('contrib_local_name', '', true)), 'contrib_iso_code' => request_var('contrib_iso_code', '')));
}
if (isset($_POST['preview'])) {
    $message->preview();
} else {
    if ($submit) {
        // Handle the deletion routine
        if (isset($_POST['delete']) && phpbb::$auth->acl_get('u_titania_admin')) {
            titania::$contrib->delete();
            redirect(titania_url::build_url(''));
        }
        titania::$contrib->post_data($message);
Beispiel #2
0
$message->set_auth(array('bbcode' => phpbb::$auth->acl_get('u_titania_bbcode'), 'smilies' => phpbb::$auth->acl_get('u_titania_smilies'), 'edit_subject' => titania_types::$types[titania::$contrib->contrib_type]->acl_get('moderate')));
$message->set_settings(array('display_error' => false, 'display_subject' => false, 'subject_name' => 'name'));
// Screenshots
$screenshot = new titania_attachment(TITANIA_SCREENSHOT, titania::$contrib->contrib_id);
$screenshot->load_attachments();
$screenshot->upload(175);
$error = array_merge($error, $screenshot->error);
if ($screenshot->uploaded || isset($_POST['preview']) || $submit) {
    titania::$contrib->post_data($message);
    titania::$contrib->__set_array(array('contrib_demo' => titania::$config->can_modify_style_demo_url || titania_types::$types[TITANIA_TYPE_STYLE]->acl_get('moderate') || titania::$contrib->contrib_type != TITANIA_TYPE_STYLE ? $contrib_demo : titania::$contrib->contrib_demo, 'contrib_local_name' => utf8_normalize_nfc(request_var('contrib_local_name', '', true)), 'contrib_iso_code' => request_var('contrib_iso_code', '')));
}
// ColorizeIt sample
if (strlen(titania::$config->colorizeit) && titania_types::$types[titania::$contrib->contrib_type]->acl_get('colorizeit')) {
    $clr_sample = new titania_attachment(TITANIA_CLR_SCREENSHOT, titania::$contrib->contrib_id);
    $clr_sample->load_attachments();
    $clr_sample->upload();
    $error = array_merge($error, $clr_sample->error);
    if ($clr_sample->uploaded || isset($_POST['preview']) || $submit) {
        titania::$contrib->post_data($message);
    }
}
if (isset($_POST['preview'])) {
    $message->preview();
} else {
    if ($submit) {
        // Handle the deletion routine
        if (isset($_POST['delete']) && phpbb::$auth->acl_get('u_titania_admin')) {
            titania::$contrib->delete();
            redirect(titania_url::build_url(''));
        }
        titania::$contrib->post_data($message);
if (!titania::$contrib->is_author && !titania::$contrib->is_active_coauthor && !titania_types::$types[titania::$contrib->contrib_type]->acl_get('moderate')) {
    titania::needs_auth();
}
// Setup some variables
$revision_id = request_var('revision', 0);
$error = $revision_phpbb_versions = array();
$phpbb_versions = titania::$cache->get_phpbb_versions();
// Load the revision
$revision = new titania_revision(titania::$contrib, $revision_id);
if (!$revision->load()) {
    trigger_error('NO_REVISION');
}
// Translations
$translation = new titania_attachment(TITANIA_TRANSLATION, $revision_id);
$translation->load_attachments();
$translation->upload();
$error = array_merge($error, $translation->error);
// Revision phpBB versions
$revision->load_phpbb_versions();
foreach ($revision->phpbb_versions as $row) {
    $revision_phpbb_versions[] = $phpbb_versions[$row['phpbb_version_branch'] . $row['phpbb_version_revision']];
}
// Revision Status
$revision_status = request_var('revision_status', (int) $revision->revision_status);
$status_list = array(TITANIA_REVISION_NEW => 'REVISION_NEW', TITANIA_REVISION_APPROVED => 'REVISION_APPROVED', TITANIA_REVISION_DENIED => 'REVISION_DENIED', TITANIA_REVISION_PULLED_SECURITY => 'REVISION_PULLED_FOR_SECURITY', TITANIA_REVISION_PULLED_OTHER => 'REVISION_PULLED_FOR_OTHER', TITANIA_REVISION_REPACKED => 'REVISION_REPACKED', TITANIA_REVISION_RESUBMITTED => 'REVISION_RESUBMITTED');
if ($translation->uploaded || isset($_POST['submit'])) {
    $revision_license = utf8_normalize_nfc(request_var('revision_license', '', true));
    $revision->__set_array(array('revision_name' => utf8_normalize_nfc(request_var('revision_name', $revision->revision_name, true)), 'revision_license' => $revision_license != phpbb::$user->lang['CUSTOM_LICENSE'] ? $revision_license : utf8_normalize_nfc(request_var('revision_custom_license', '', true))));
    // Stuff that can be done by moderators only
    if (titania_types::$types[titania::$contrib->contrib_type]->acl_get('moderate')) {
        $revision_phpbb_versions = request_var('revision_phpbb_versions', array(''));
Beispiel #4
0
 $display_main = false;
 // Display the main upload page?
 $next_step = $step + 1;
 // Default to the next step...
 $try_again = false;
 // Try again?  Used when skip steps
 $error = array();
 switch ($step) {
     case 0:
         $display_main = true;
         break;
     case 1:
         // Upload the revision
         $revision_attachment = new titania_attachment(TITANIA_CONTRIB, titania::$contrib->contrib_id);
         $revision_attachment->is_orphan = false;
         $revision_attachment->upload();
         $revision_version = utf8_normalize_nfc(request_var('revision_version', '', true));
         $queue_allow_repack = request_var('queue_allow_repack', 0);
         $revision_license = utf8_normalize_nfc(request_var('revision_license', '', true));
         // Check for errors
         $error = array_merge($error, $revision_attachment->error);
         if (!$revision_attachment->uploaded) {
             $error[] = phpbb::$user->lang['NO_REVISION_ATTACHMENT'];
         }
         if (!$revision_version) {
             $error[] = phpbb::$user->lang['NO_REVISION_VERSION'];
         }
         if (sizeof(titania_types::$types[titania::$contrib->contrib_type]->license_options) && !titania_types::$types[titania::$contrib->contrib_type]->license_allow_custom && !in_array($revision_license, titania_types::$types[titania::$contrib->contrib_type]->license_options)) {
             $error[] = phpbb::$user->lang['INVALID_LICENSE'];
         }
         // Do some simple error checking on the versions