Example #1
0
function board_main()
{
    global $x7c, $x7s, $db, $prefix, $x7p, $print;
    if ($x7c->settings['panic']) {
        $print->board_window("", "", "");
        return;
    }
    udpate_unread();
    if (isset($_GET['newboard'])) {
        create_board();
    } else {
        if (isset($_GET['board'])) {
            show_board($_GET['board']);
        } else {
            if (isset($_GET['send'])) {
                new_communication($_GET['send']);
            } else {
                if (isset($_GET['delete'])) {
                    delete_message($_GET['delete']);
                } else {
                    if (isset($_GET['delboard'])) {
                        delete_board($_GET['delboard']);
                    } else {
                        if (isset($_GET['readall'])) {
                            read_all();
                        } else {
                            if (isset($_GET['move'])) {
                                move_msg();
                            } else {
                                board_list();
                            }
                        }
                    }
                }
            }
        }
    }
}
Example #2
0
if ($_REQUEST['from'] == 'sendbox') {
    $message = get_post($_REQUEST['id']);
    $box = 'sendbox';
    if (isset($_REQUEST['delete'])) {
        echo $_REQUEST['delete'];
        wp_delete_post($_REQUEST['id']);
        wp_safe_redirect(admin_url() . "admin.php?page=gmgt_message&tab=sentbox");
        exit;
    }
}
if ($_REQUEST['from'] == 'inbox') {
    $message = gmgt_get_message_by_id($_REQUEST['id']);
    $box = 'inbox';
    if (isset($_REQUEST['delete'])) {
        echo $_REQUEST['delete'];
        delete_message('smgt_message', $_REQUEST['id']);
        wp_safe_redirect(admin_url() . "admin.php?page=gmgt_message&tab=inbox");
        exit;
    }
}
?>
<div class="mailbox-content">
 	<div class="message-header">
		<h3><span><?php 
_e('Subject', 'gym_mgt');
?>
 :</span>  <?php 
if ($box == 'sendbox') {
    echo $message->post_title;
} else {
    echo $message->subject;
Example #3
0
    exit;
}
if (isset($_GET["SuperAdminQuery"])) {
    SuperAdminQuery();
    exit;
}
if (isset($_GET["quarantine-settings"])) {
    quarantine_ou_settings();
    exit;
}
if (isset($_GET["OuSendQuarantineReports"])) {
    quarantine_ou_settings_save();
    exit;
}
if (isset($_GET["delete-message-id"])) {
    delete_message();
    exit;
}
function GetRights()
{
    $users = new usersMenus();
    if ($users->AsMessagingOrg) {
        return true;
    }
    if ($users->AsQuarantineAdministrator) {
        return true;
    }
    return false;
}
function delete_js()
{
//then decide where we should go, register, login, or exit.
//inside we will pass the entire post through to the function
if (isset($_POST['register']) && $_POST['register'] == "register") {
    register_validation($_POST);
} else {
    if (isset($_POST['login']) && $_POST['login'] == "login") {
        login_validation($_POST);
    } else {
        if (isset($_POST['post_message']) && $_POST['post_message'] == "post_message") {
            message_validation($_POST);
        } else {
            if (isset($_POST['post_comment']) && $_POST['post_comment'] == "post_comment") {
                comment_validation($_POST);
            } else {
                if (isset($_POST['delete']) && $_POST['delete'] == "delete") {
                    delete_message($_POST);
                } else {
                    session_destroy();
                    header('location:index.php');
                }
            }
        }
    }
}
//register validaiton
function register_validation($post)
{
    //set error flags to 0
    $error_flags = 0;
    //first_name errors
    if (!empty($_POST['first_name'])) {
Example #5
0
<?php 
require_once "config/connexion.php";
require_once 'fonctions.php';
require_once 'classes/touite.class.php';
if (isset($_GET['search']) && !isset($_GET['moreSearch'])) {
    searchByName($_GET['search'], $bd);
} else {
    if (isset($_GET['moreSearch'])) {
        moreSearchResult($_GET['search'], $bd, $_GET['offset']);
    } else {
        if (!empty($_SESSION['id']) and !empty($_GET['remove'])) {
            delete_message($_GET['id'], $_SESSION['id'], $bd);
        } else {
            if (!empty($_GET['id']) and !empty($_GET['voirMessage'])) {
                voir_message($_GET['id'], $bd);
            } else {
                if (!empty($_SESSION['id']) && !empty($_POST['discution'])) {
                    $touite = array("texte" => $_POST['message'], "idAuteur" => $_SESSION['id']);
                    envoyer_reponse($_POST['id'], new Touite($touite), $bd);
                } else {
                    if (!empty($_POST['message']) && !isset($_POST['sendDiscussion'])) {
                        $touite = array("texte" => $_POST['message'], "idAuteur" => $_SESSION['id']);
                        if (!empty($_POST['id_message'])) {
                            $touite['id_message'] = $_POST['id_message'];
                            $message = new Touite($touite);
                            //réponse
                        } else {
                            $message = new Touite($touite);
                            $message->setLadate(date("Y-m-d H:i:s"));
                            addTouite($message, $bd);
                            $th = new touitosHandler($bd);
Example #6
0
        }
    } else {
        // display a warning for the user
        $warning = true;
    }
} else {
    // generic wall
    $feed_hash = 'local';
    $owner_webid = 'local';
    $owner_hash = 'local';
}
// delete a post
if (isset($_REQUEST['del'])) {
    // verify if we're logged in or not
    check_auth(IDP, $page_uri);
    $notification .= delete_message($_SESSION['webid'], $_REQUEST['del']);
}
// ADD a post
if (isset($_REQUEST['comment'])) {
    // verify if we're logged in or not
    check_auth(IDP, $page_uri);
    if (isset($_REQUEST['user']) && strlen($_REQUEST['user']) > 0) {
        $to_hash = $_REQUEST['user'];
    } else {
        $to_hash = 'local';
    }
    // only post if we have a message
    if (strlen($_REQUEST['comment']) > 1) {
        // Limit the message to 10k characters
        $msg = trim(substr($_REQUEST['comment'], 0, 10000));
        // Get the list of mentioned WebIDs from the message
Example #7
0
 case 'store-settings':
 case 'account-setup':
 case 'delete-account':
     display_account_setup($_SESSION['auth_user']);
     break;
 case 'send-message':
     if (send_message($to, $cc, $subject, $message)) {
         echo '<p>Message sent.</p><br /><br /><br /><br /><br /><br />';
     } else {
         echo '<p>Could not send message.</p><br /><br /><br /><br />
     <br /><br />';
     }
     break;
 case 'delete':
     if ($_SESSION) {
         delete_message($_SESSION['auth_user'], $_SESSION['selected_account'], $messageid);
     }
     //note deliberately no 'break' - we will continue to the next case
 case 'select-account':
 case 'view-mailbox':
     // if mailbox just chosen, or view mailbox chosen, show mailbox
     if (isset($selected_account)) {
         display_list($_SESSION['auth_user'], $_SESSION['selected_account']);
     } else {
         display_list($_SESSION['auth_user']);
     }
     break;
 case 'show-headers':
 case 'hide-headers':
 case 'view-message':
     // if we have just picked a message from the list, or were looking at
Example #8
0
<?php

require_once "../lib/header.php";
$action = array();
$error = array();
if (isset($_GET["action"])) {
    if ($_GET["action"] == "del-message") {
        if (delete_message($_GET["id"])) {
            $action[] = "Die Information wurde gel&ouml;scht.";
        } else {
            $error[] = "Die Information konnte nicht gelöscht werden." . mysql_error();
        }
    }
}
if (isset($_POST["allySubmit"])) {
    if (is_array($_POST["runden"])) {
        $p_runden = array_map("intval", array_unique($_POST["runden"]));
    } else {
        $error[] = "Du musst Runden f&uuml;r die Allianz markieren!";
    }
    if (is_array($_POST["banner"])) {
        $p_banner = array_map("intval", array_unique($_POST["banner"]));
    } else {
        $error[] = "Du musst Banner f&uuml;r die Allianz markieren!";
    }
    if (count($error) > 0) {
        $del = 1;
    } elseif ($_POST["action"] == "new") {
        $p_tag = trim($_POST["tag"]);
        if (strlen($p_tag) <= 2 || !preg_match("#\\[.{1,3}\\]#", $p_tag)) {
            $error[] = "Der Allianztag <b>" . $p_tag . "</b> ist falsch. Richtig ist beispielsweise: [tag] (vorne und hinten [ ])";
Example #9
0
			echo $tpl->_ENGINE_parse_body("alert('$error')");
			die();
	}
	
	
if(isset($_GET["js"])){echo quarantine_script();exit;}
if(isset($_GET["popup"])){echo quarantine_index();exit;}
if(isset($_GET["query"])){echo quarantine_query();exit;}


if(isset($_GET["SuperAdmin"])){SuperAdmin();exit;}
if(isset($_GET["SuperAdminQuery"])){SuperAdminQuery();exit;}
if(isset($_GET["quarantine-settings"])){quarantine_ou_settings();exit;}
if(isset($_GET["OuSendQuarantineReports"])){quarantine_ou_settings_save();exit;}

if(isset($_GET["delete-message-id"])){delete_message();exit;}

function GetRights(){
	$users=new usersMenus();
	if($users->AsMessagingOrg){return true;}
	if($users->AsQuarantineAdministrator){return true;}
	return false;
}

function delete_js(){
	$tpl=new templates();
	$page=CurrentPageName();
	$are_you_sure_to_delete=$tpl->javascript_parse_text("{are_you_sure_to_delete}");
	
	$html="
	
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/include/functions.php';
if (isset($_GET)) {
    $messages = get_messages();
    echo json_encode($messages);
}
if (isset($_POST['delete'])) {
    $delete = $_POST['delete'];
    delete_message($delete);
}
Example #11
0
 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     require_code('ocworld');
     require_code('ocworld_screens');
     // Decide what functions to execute for this command
     $command = either_param('type', 'room');
     $param = either_param('param', '');
     $dest_member_id = either_param_integer('user', -1);
     $member_id = get_member();
     if (is_guest($member_id)) {
         ocw_refresh_with_message(do_lang_tempcode('W_NOT_LOGGED_IN'), 'warn');
         return new ocp_tempcode();
     }
     $item = either_param('item', '');
     // Create the member if they aren't already in the system
     $member_rows = $GLOBALS['SITE_DB']->query_select('w_members', array('*'), array('id' => $member_id), '', 1);
     if (!array_key_exists(0, $member_rows)) {
         $member_rows[0] = array('id' => $member_id, 'location_realm' => 0, 'location_x' => 0, 'location_y' => 0, 'banned' => 0, 'health' => 10, 'trolled' => 0, 'lastactive' => time());
         $GLOBALS['SITE_DB']->query_insert('w_members', $member_rows[0]);
     }
     $member_row = $member_rows[0];
     // Check for banning
     if ($member_row['banned'] == 1) {
         ocw_refresh_with_message(do_lang_tempcode('W_YOU_BANNED'), 'warn');
     }
     // Check for death
     if ($member_row['health'] < 1) {
         take_items($member_id);
         $GLOBALS['SITE_DB']->query_update('w_members', array('location_realm' => 0, 'location_x' => 0, 'location_y' => 0, 'banned' => 0, 'health' => 10), array('id' => $member_id), '', 1);
         ocw_refresh_with_message(do_lang_tempcode('W_YOU_DIED'), 'warn');
     }
     // Mark as active
     $GLOBALS['SITE_DB']->query_update('w_members', array('lastactive' => time()), array('id' => $member_id), '', 1);
     destick($member_id);
     // Check to see if the user is locked into answering a trolls questions
     if ($member_row['trolled'] != 0) {
         $realm = $member_row['location_realm'];
         // Get the questions that were asked
         $i = 0;
         $trolled = $member_row['trolled'];
         $q = array();
         $a = array();
         while (($trolled & 255 << $i * 8) != 0) {
             $q_num = $trolled >> $i * 8 & 255;
             $q[$i + 1] = $GLOBALS['SITE_DB']->query_value('w_realms', 'q' . strval($q_num), array('id' => $realm));
             $a[$i + 1] = $GLOBALS['SITE_DB']->query_value('w_realms', 'a' . strval($q_num), array('id' => $realm));
             $i++;
         }
         $num_questions = $i;
         // Are we marking or answering?
         if (post_param('a1', '!!') != '!!') {
             // Mark them
             $pass = 0;
             for ($i = 1; $i <= $num_questions; $i++) {
                 $given = strtolower(post_param('a' . strval($i)));
                 $stored = strtolower($a[$i]);
                 if ($given == $stored) {
                     $pass++;
                 } elseif (strstr(':' . $stored . ':', ':' . $given . ':') !== false) {
                     $pass++;
                 }
             }
             // Regardless they have had their chance: no more questions
             $GLOBALS['SITE_DB']->query_update('w_members', array('trolled' => 0), array('id' => $member_id), '', 1);
             if ($pass == 0) {
                 $pen_id = mt_rand(0, 2);
                 if ($pen_id == 0) {
                     $joke = mt_rand(1, 10);
                     $penalty = do_lang_tempcode('W_JOKE_' . strval($joke));
                     hurt($member_id);
                 }
                 if ($pen_id == 1) {
                     $penalty = do_lang('W_PENALTY_STOLEN');
                     steal($member_id, -$realm - 1);
                 }
                 if ($pen_id == 2) {
                     $penalty = do_lang('W_PENALTY_SENT_LOBBY');
                     basic_enter_room($member_id, $realm, 0, 0);
                 }
                 ocw_refresh_with_message(do_lang_tempcode('W_TROLL_YOU', escape_html($penalty)), 'warn');
             } else {
                 ocw_refresh_with_message(do_lang_tempcode('W_TROLL_THANKYOU', integer_format($pass)));
             }
         } else {
             $troll_name = $GLOBALS['SITE_DB']->query_value('w_realms', 'troll_name', array('id' => $realm));
             $title = get_page_title('W_TROLL_Q', true, array(escape_html($troll_name)));
             $questions = new ocp_tempcode();
             for ($i = 1; $i <= $num_questions; $i++) {
                 $questions->attach(do_template('W_TROLL_QUESTION', array('_GUID' => 'b09eb44e4264a9dca5bdf651ca9a48d4', 'Q' => $q[$i], 'I' => strval($i))));
             }
             return do_template('W_TROLL', array('_GUID' => 'e108ccaebc5b1adfa9db6b5b23e93602', 'TITLE' => $title, 'TROLL' => $troll_name, 'QUESTIONS' => $questions));
         }
     }
     // There is a chance the troll on this realm will pick this 'turn' to move
     if (mt_rand(0, 6) == 1) {
         $realm = $member_row['location_realm'];
         $troll_id = -$realm - 1;
         $troll_loc = get_loc_details($troll_id, true);
         if (!is_null($troll_loc)) {
             list(, $troll_x, $troll_y) = $troll_loc;
             $dx = -1;
             $dy = -1;
             do {
                 $dx = mt_rand(-1, 1);
                 $dy = mt_rand(-1, 1);
             } while (!room_exists($troll_x + $dx, $troll_y + $dy, $realm));
             $GLOBALS['SITE_DB']->query_update('w_members', array('location_x' => $troll_x + $dx, 'location_y' => $troll_y + $dy), array('id' => $troll_id), '', 1);
         }
     }
     require_code('uploads');
     // What command are we being asked to do?
     if ($command == 'confirm') {
         $url = build_url(array('page' => 'ocworld'), '_SELF');
         $command2 = either_param('btype', '');
         $item = either_param('item', '');
         $user = either_param_integer('user', -1);
         $param = either_param('param', '');
         return do_template('W_CONFIRM_SCREEN', array('_GUID' => '365870cb4c6cb4282ff6c7a11f4f8a5b', 'TITLE' => get_page_title('W_CONFIRM_TITLE'), 'URL' => $url, 'COMMAND' => $command2, 'ITEM' => $item, 'USER' => strval($user), 'PARAM' => $param));
     }
     if ($command == 'reallocate') {
         if (!has_specific_permission(get_member(), 'administer_ocworld')) {
             ocw_refresh_with_message(do_lang_tempcode('W_ONLY_STAFF_REALLOC'), 'warn');
         }
         $out = new ocp_tempcode();
         $rows = $GLOBALS['SITE_DB']->query_select('items', array('*'), array('copy_owner' => NULL));
         foreach ($rows as $myrow) {
             $owner = $GLOBALS['SITE_DB']->query_value('w_itemdef', 'owner', array('name' => $myrow['name']));
             if (!is_null($owner)) {
                 $GLOBALS['SITE_DB']->query_update('w_items', array('copy_owner' => $owner), array('name' => $myrow['name'], 'copy_owner' => NULL));
                 $out->attach(paragraph(do_lang_tempcode('W_REALLOCATING', escape_html($myrow['name']), 'tfgdfgd4rf')));
             }
         }
         return do_template('W_REALLOCATE', array('_GUID' => '8fa4b9205310d6bc2fc28348a52898d5', 'TITLE' => get_page_title('W_REALLOCATE'), 'OUT' => $out));
     }
     if ($command == 'portal') {
         portal($member_id, intval($param));
     }
     if ($command == 'realms') {
         realms();
         return new ocp_tempcode();
     }
     if ($command == 'up') {
         $tpl = try_to_enter_room($member_id, 0, -1, '');
         if (!is_null($tpl)) {
             return $tpl;
         }
         ocw_refresh_with_message(new ocp_tempcode());
     }
     if ($command == 'down') {
         $tpl = try_to_enter_room($member_id, 0, 1, '');
         if (!is_null($tpl)) {
             return $tpl;
         }
         ocw_refresh_with_message(new ocp_tempcode());
     }
     if ($command == 'right') {
         $tpl = try_to_enter_room($member_id, 1, 0, '');
         if (!is_null($tpl)) {
             return $tpl;
         }
         ocw_refresh_with_message(new ocp_tempcode());
     }
     if ($command == 'left') {
         $tpl = try_to_enter_room($member_id, -1, 0, '');
         if (!is_null($tpl)) {
             return $tpl;
         }
         ocw_refresh_with_message(new ocp_tempcode());
     }
     if ($command == 'answered') {
         $tpl = try_to_enter_room($member_id, post_param_integer('dx'), post_param_integer('dy'), $param);
         if (!is_null($tpl)) {
             return $tpl;
         }
     }
     if ($command == 'drop') {
         drop_wrap($member_id, $item);
     }
     if ($command == 'give') {
         give($member_id, $dest_member_id, $item);
     }
     if ($command == 'pickpocket') {
         pickpocket($member_id, $dest_member_id);
     }
     if ($command == 'use') {
         useitem($member_id, $item);
     }
     if ($command == 'take') {
         take($member_id, $item, $dest_member_id);
     }
     if ($command == 'buy') {
         buy($member_id, $item, $dest_member_id);
     }
     if ($command == 'inventory') {
         $tpl = output_inventory_screen($dest_member_id);
         return $tpl;
     }
     if ($command == 'findperson') {
         findperson($param == '' ? strval($dest_member_id) : $param);
     }
     if ($command == 'message') {
         message($member_id, post_param('post'), post_param_integer('tuser'));
     }
     if ($command == 'emergency') {
         basic_enter_room($member_id, 0, 0, 0);
     }
     if ($command == 'delete-message-by-person') {
         if (!has_specific_permission($member_id, 'administer_ocworld') && $member_id != $dest_member_id) {
             ocw_refresh_with_message(do_lang_tempcode('ACCESS_DENIED__I_ERROR', $GLOBALS['FORUM_DRIVER']->get_username(get_member())), 'warn');
         }
         delete_message($member_id, $dest_member_id, addslashes($param));
     }
     // Management
     if ($command == 'additem') {
         require_code('ocworld_action');
         $name = post_param('name', '');
         if ($name == '') {
             $tpl = do_template('W_ITEM_SCREEN', array('_GUID' => '0246f7037a360996bdfb4f1dcf96bcfc', 'PRICE' => integer_format(get_price('mud_item')), 'TEXT' => paragraph(do_lang_tempcode('W_ADD_ITEM_TEXT')), 'TITLE' => get_page_title('W_ADD_ITEM_TITLE'), 'PAGE_TYPE' => 'additem', 'ITEM' => '', 'DESCRIPTION' => '', 'BRIBABLE' => '0', 'HEALTHY' => '0', 'PICTURE_URL' => '', 'MAX_PER_PLAYER' => '10', 'REPLICATEABLE' => '1'));
             return $tpl;
         }
         $urls = get_url('url', 'pic', 'uploads/ocworld', 0, OCP_UPLOAD_IMAGE);
         add_item_wrap($member_id, $name, post_param_integer('cost', 0), post_param_integer('not_infinite', 0), post_param_integer('bribable', 0), post_param_integer('healthy', 0), $urls[0], post_param_integer('max_per_player', -1), post_param_integer('replicateable', 0), post_param('description'));
     }
     if ($command == 'additemcopy') {
         require_code('ocworld_action');
         $name = post_param('name', '');
         if ($name == '') {
             $rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'w_itemdef WHERE replicateable=1 OR owner=' . strval((int) get_member()) . ' ORDER BY name');
             $items = '';
             foreach ($rows as $myrow) {
                 $items .= "<option value=\"" . escape_html($myrow['name']) . "\">" . escape_html($myrow['name']) . "</option>";
             }
             if ($items == '') {
                 ocw_refresh_with_message(do_lang_tempcode('W_NO_ITEMS_YET'), 'warn');
             }
             if ($GLOBALS['XSS_DETECT']) {
                 ocp_mark_as_escaped($items);
             }
             $tpl = do_template('W_ITEMCOPY_SCREEN', array('_GUID' => '15799930bca51eafdee3c0a8e197866a', 'PRICE' => integer_format(get_price('mud_item_copy')), 'TEXT' => paragraph(do_lang_tempcode('W_ADD_ITEM_COPY_TEXT')), 'TITLE' => get_page_title('W_ADD_ITEM_COPY_TITLE'), 'PAGE_TYPE' => 'additemcopy', 'NOT_INFINITE' => '1', 'ITEMS' => $items, 'COST' => ''));
             return $tpl;
         }
         add_item_wrap_copy($member_id, $name, post_param_integer('cost'), post_param_integer('not_infinite', 0));
     }
     if ($command == 'addroom') {
         require_code('ocworld_action');
         $name = post_param('name', '');
         if ($name == '') {
             list($realm, $x, $y) = get_loc_details($member_id);
             $tpl = do_template('W_ROOM_SCREEN', array('_GUID' => '5357a6cf8648c952cf29c2b7234cfa6c', 'PRICE' => integer_format(get_price('mud_room')), 'TEXT' => paragraph(do_lang_tempcode('W_ADD_ROOM_TEXT')), 'ROOM_TEXT' => '', 'TITLE' => get_page_title('W_ADD_ROOM_TITLE'), 'PAGE_TYPE' => 'addroom', 'NAME' => '', 'PASSWORD_QUESTION' => '', 'PASSWORD_ANSWER' => '', 'PASSWORD_FAIL_MESSAGE' => '', 'REQUIRED_ITEM' => '', 'LOCKED_UP' => '0', 'LOCKED_DOWN' => '0', 'LOCKED_LEFT' => '0', 'LOCKED_RIGHT' => '0', 'ALLOW_PORTAL' => '1', 'PICTURE_URL' => ''));
             return $tpl;
         }
         $urls = get_url('url', 'pic', 'uploads/ocworld', 0, OCP_UPLOAD_IMAGE);
         add_room_wrap($member_id, post_param_integer('position'), $name, post_param('text'), post_param('password_question'), post_param('password_answer'), post_param('password_fail_message'), post_param('required_item'), post_param_integer('locked_up', 0), post_param_integer('locked_down', 0), post_param_integer('locked_right', 0), post_param_integer('locked_left', 0), $urls[0], post_param_integer('allow_portal', 0));
     }
     if ($command == 'addrealm') {
         require_code('ocworld_action');
         $name = post_param('name', '');
         if ($name == '') {
             $fortnights = (time() - $GLOBALS['FORUM_DRIVER']->get_member_join_timestamp(get_member())) / (60 * 60 * 24 * 7 * 2);
             $made = $GLOBALS['SITE_DB']->query_value('w_realms', 'COUNT(*)', array('owner' => get_member()));
             $left = round($fortnights - $made);
             $_qa = new ocp_tempcode();
             for ($i = 1; $i <= 30; $i++) {
                 $_qa->attach(do_template('W_REALM_SCREEN_QUESTION', array('_GUID' => '5fa7725f11b0df7e58ff83f2f1751515', 'I' => strval($i), 'Q' => '', 'A' => '')));
             }
             $tpl = do_template('W_REALM_SCREEN', array('_GUID' => '7ae26fe1766aed02233e1be84772759b', 'PRICE' => integer_format(get_price('mud_realm')), 'TEXT' => paragraph(do_lang_tempcode('W_ADD_REALM_TEXT', integer_format($left))), 'TITLE' => get_page_title('W_ADD_REALM_TITLE'), 'PAGE_TYPE' => 'addrealm', 'QA' => $_qa, 'NAME' => '', 'TROLL_NAME' => '', 'PRIVATE' => '0'));
             return $tpl;
         }
         $i = 1;
         $qa = array();
         while (strlen(post_param('question' . strval($i), '')) > 0) {
             $qa[$i] = array();
             $qa[$i]['q'] = post_param('question' . strval($i));
             $qa[$i]['a'] = post_param('answer' . strval($i));
             $i++;
         }
         $urls1 = get_url('jail_pic_url', 'jail_pic', 'uploads/ocworld', 0, OCP_UPLOAD_IMAGE);
         $urls2 = get_url('jail_house_pic_url', 'jail_house_pic', 'uploads/ocworld', 0, OCP_UPLOAD_IMAGE);
         $urls3 = get_url('lobby_pic_url', 'lobby_pic', 'uploads/ocworld', 0, OCP_UPLOAD_IMAGE);
         add_realm_wrap($member_id, $name, post_param('troll_name'), post_param('jail_name'), post_param('jail_text'), $urls1[0], post_param('jail_house_name'), post_param('jail_house_text'), $urls2[0], post_param('lobby_name'), post_param('lobby_text'), $urls3[0], $qa, post_param_integer('private', 0));
     }
     if ($command == 'addportal') {
         require_code('ocworld_action');
         $name = post_param('name', '');
         if ($name == '') {
             $tpl = do_template('W_PORTAL_SCREEN', array('_GUID' => '69e74a964f69721d0381a920c4a25ce5', 'PRICE' => integer_format(get_price('mud_portal')), 'TEXT' => paragraph(do_lang_tempcode('W_ADD_PORTAL_TEXT')), 'TITLE' => get_page_title('W_ADD_PORTAL_TITLE'), 'PORTAL_TEXT' => '', 'PAGE_TYPE' => 'addportal', 'NAME' => '', 'END_LOCATION_REALM' => '', 'END_LOCATION_X' => '', 'END_LOCATION_Y' => ''));
             return $tpl;
         }
         add_portal_wrap($member_id, $name, post_param('text'), post_param_integer('end_location_realm', -1), post_param_integer('end_location_x', -1), post_param_integer('end_location_y', -1));
     }
     if ($command == 'deleteitem') {
         require_code('ocworld_action');
         delete_item_wrap($item);
     }
     if ($command == 'deleteroom') {
         require_code('ocworld_action');
         delete_room_wrap($member_id);
     }
     if ($command == 'deleterealm') {
         require_code('ocworld_action');
         delete_realm_wrap($member_id);
     }
     if ($command == 'deleteportal') {
         require_code('ocworld_action');
         delete_portal_wrap($member_id, intval($param));
     }
     // Admin commands
     if (has_specific_permission($member_id, 'administer_ocworld')) {
         if ($command == 'mergeitems') {
             merge_items($item, either_param('item2'));
         }
         if ($command == 'teleport-person') {
             $ast = strpos($param, ':');
             $b = strpos($param, ':', $ast + 1);
             $realm = substr($param, 0, $ast);
             $x = intval(substr($param, $ast + 1, $b - $ast - 1));
             $y = intval(substr($param, $b + 1));
             basic_enter_room($dest_member_id, $realm, $x, $y);
         }
         if ($command == 'imprison-person') {
             imprison($dest_member_id);
         }
         if ($command == 'hurt-person') {
             hurt($dest_member_id);
         }
         if ($command == 'dehurt-person') {
             dehurt($dest_member_id);
         }
         if ($command == 'ban-person') {
             ban_member($dest_member_id);
         }
         if ($command == 'unban-person') {
             unban_member($dest_member_id);
         }
         if ($command == 'take-from-person') {
             steal($member_id, $dest_member_id);
         }
     }
     if ($command == 'edititem') {
         require_code('ocworld_action');
         $name = post_param('name', '');
         if ($name == '') {
             $rows = $GLOBALS['SITE_DB']->query_select('w_itemdef', array('*'), array('name' => either_param('item')), '', 1);
             if (!array_key_exists(0, $rows)) {
                 ocw_refresh_with_message(do_lang_tempcode('MISSING_RESOURCE'), 'warn');
             }
             $row = $rows[0];
             $tpl = do_template('W_ITEM_SCREEN', array('_GUID' => '1f581864bd2f0cbe05742e03ab6c2a53', 'TITLE' => get_page_title('W_EDIT_ITEM_TITLE'), 'PAGE_TYPE' => 'edititem', 'ITEM' => either_param('item'), 'DESCRIPTION' => $row['description'], 'BRIBABLE' => strval($row['bribable']), 'HEALTHY' => strval($row['healthy']), 'PICTURE_URL' => $row['picture_url'], 'OWNER' => is_null($row['owner']) ? '' : strval($row['owner']), 'MAX_PER_PLAYER' => strval($row['max_per_player']), 'REPLICATEABLE' => strval($row['replicateable'])));
             return $tpl;
         }
         $urls = get_url('url', 'pic', 'uploads/ocworld', 0, OCP_UPLOAD_IMAGE);
         edit_item_wrap($member_id, $item, $name, post_param_integer('bribable', 0), post_param_integer('healthy', 0), $urls[0], grab_new_owner('new_owner'), post_param_integer('max_per_player', -1), post_param_integer('replicateable', 0), post_param('description'));
     }
     if ($command == 'edititemcopy') {
         require_code('ocworld_action');
         $cost = post_param_integer('cost', -1);
         if ($cost == -1) {
             $user = get_param_integer('user');
             list($realm, $x, $y) = get_loc_details($member_id);
             $cost = $GLOBALS['SITE_DB']->query_value('w_items', 'cost', array('copy_owner' => $user, 'location_x' => $x, 'location_y' => $y, 'location_realm' => $realm, 'name' => get_param('item')));
             $not_infinite = $GLOBALS['SITE_DB']->query_value('w_items', 'not_infinite', array('copy_owner' => $user, 'location_x' => $x, 'location_y' => $y, 'location_realm' => $realm, 'name' => get_param('item')));
             $tpl = do_template('W_ITEMCOPY_SCREEN', array('_GUID' => 'a8d28f6516408dba96a8b57ddcd7cee6', 'TITLE' => get_page_title('W_EDIT_ITEM_COPY_TITLE'), 'PAGE_TYPE' => 'edititemcopy', 'NOT_INFINITE' => strval($not_infinite), 'X' => strval($x), 'Y' => strval($y), 'REALM' => strval($realm), 'ITEM' => get_param('item'), 'OWNER' => strval($user), 'COST' => strval($cost)));
             return $tpl;
         }
         edit_item_wrap_copy($member_id, $item, $cost, post_param_integer('not_infinite', 0), post_param_integer('new_x'), post_param_integer('new_y'), post_param_integer('new_realm'), grab_new_owner('new_owner'));
     }
     if ($command == 'editroom') {
         require_code('ocworld_action');
         $name = post_param('name', '');
         if ($name == '') {
             list($location_realm, $x, $y) = get_loc_details($member_id);
             $rows = $GLOBALS['SITE_DB']->query_select('w_rooms', array('*'), array('location_x' => $x, 'location_y' => $y, 'location_realm' => $location_realm), '', 1);
             if (!array_key_exists(0, $rows)) {
                 ocw_refresh_with_message(do_lang_tempcode('MISSING_RESOURCE'), 'warn');
             }
             $row = $rows[0];
             $tpl = do_template('W_ROOM_SCREEN', array('_GUID' => 'a4c5f8ae962cdbaa304135cf07c583a0', 'TITLE' => get_page_title('W_EDIT_ROOM_TITLE'), 'PAGE_TYPE' => 'editroom', 'X' => strval($x), 'Y' => strval($y), 'REALM' => strval($location_realm), 'NAME' => $row['name'], 'ROOM_TEXT' => $row['r_text'], 'PASSWORD_QUESTION' => $row['password_question'], 'PASSWORD_ANSWER' => $row['password_answer'], 'PASSWORD_FAIL_MESSAGE' => $row['password_fail_message'], 'REQUIRED_ITEM' => $row['required_item'], 'LOCKED_UP' => strval($row['locked_up']), 'LOCKED_DOWN' => strval($row['locked_down']), 'LOCKED_LEFT' => strval($row['locked_left']), 'LOCKED_RIGHT' => strval($row['locked_right']), 'ALLOW_PORTAL' => strval($row['allow_portal']), 'PICTURE_URL' => $row['picture_url'], 'OWNER' => is_null($row['owner']) ? '' : strval($row['owner'])));
             return $tpl;
         }
         $urls = get_url('url', 'pic', 'uploads/ocworld', 0, OCP_UPLOAD_IMAGE);
         edit_room_wrap($member_id, $name, post_param('text'), post_param('password_question'), post_param('password_answer'), post_param('password_fail_message'), post_param('required_item'), post_param_integer('locked_up', 0), post_param_integer('locked_down', 0), post_param_integer('locked_right', 0), post_param_integer('locked_left', 0), $urls[0], post_param_integer('allow_portal', 0), grab_new_owner('new_owner'), post_param_integer('new_x'), post_param_integer('new_y'), post_param_integer('new_realm'));
     }
     if ($command == 'editrealm') {
         require_code('ocworld_action');
         $name = post_param('name', '');
         if ($name == '') {
             list($realm, , ) = get_loc_details($member_id);
             $rows = $GLOBALS['SITE_DB']->query_select('w_realms', array('*'), array('id' => $realm), '', 1);
             if (!array_key_exists(0, $rows)) {
                 ocw_refresh_with_message(do_lang_tempcode('MISSING_RESOURCE'), 'warn');
             }
             $row = $rows[0];
             $qatc = new ocp_tempcode();
             for ($i = 1; $i <= 30; $i++) {
                 $qatc->attach(do_template('W_REALM_SCREEN_QUESTION', array('_GUID' => '0510427a3895969dede2bd13db7d46a6', 'I' => strval($i), 'Q' => $row['q' . strval($i)], 'A' => $row['a' . strval($i)])));
             }
             $tpl = do_template('W_REALM_SCREEN', array('_GUID' => 'f2503e0be6e45a296baa8625cafb4d72', 'TITLE' => get_page_title('W_EDIT_REALM_TITLE'), 'PAGE_TYPE' => 'editrealm', 'OWNER' => is_null($row['owner']) ? '' : strval($row['owner']), 'QA' => $qatc, 'NAME' => $row['name'], 'TROLL_NAME' => $row['troll_name'], 'PRIVATE' => strval($row['r_private'])));
             return $tpl;
         }
         for ($i = 1; $i <= 30; $i++) {
             $qa[$i]['q'] = post_param('question' . strval($i));
             $qa[$i]['a'] = post_param('answer' . strval($i));
         }
         edit_realm_wrap($member_id, $name, post_param('troll_name'), $qa, post_param_integer('private', 0), grab_new_owner('new_owner'));
     }
     if ($command == 'editportal') {
         require_code('ocworld_action');
         $name = post_param('name', '');
         if ($name == '') {
             list($realm, $x, $y) = get_loc_details($member_id);
             $end_realm = get_param_integer('param');
             $rows = $GLOBALS['SITE_DB']->query_select('w_portals', array('*'), array('start_location_x' => $x, 'start_location_y' => $y, 'start_location_realm' => $realm, 'end_location_realm' => $end_realm), '', 1);
             if (!array_key_exists(0, $rows)) {
                 ocw_refresh_with_message(do_lang_tempcode('MISSING_RESOURCE'), 'warn');
             }
             $row = $rows[0];
             $tpl = do_template('W_PORTAL_SCREEN', array('_GUID' => 'cad0e01c1c4c410e67b775c3ff6eeb3a', 'TITLE' => get_page_title('W_EDIT_PORTAL_TITLE'), 'PAGE_TYPE' => 'editportal', 'X' => strval($x), 'Y' => strval($y), 'REALM' => strval($realm), 'PARAM' => $param, 'NAME' => $row['name'], 'PORTAL_TEXT' => $row['p_text'], 'END_LOCATION_REALM' => strval($end_realm), 'END_LOCATION_X' => strval($row['end_location_x']), 'END_LOCATION_Y' => strval($row['end_location_y']), 'OWNER' => is_null($row['owner']) ? '' : strval($row['owner'])));
             return $tpl;
         }
         edit_portal_wrap($member_id, intval($param), $name, post_param('text'), post_param_integer('end_location_realm'), post_param_integer('end_location_x'), post_param_integer('end_location_y'), grab_new_owner('new_owner'), post_param_integer('new_x'), post_param_integer('new_y'), post_param_integer('new_realm'));
     }
     if ($command == 'room') {
         return output_room_screen($member_id);
     }
     ocw_refresh_with_message(do_lang('SUCCESS'));
     return new ocp_tempcode();
 }
 // deleted an account, show account setup page
 case 'store-settings':
 case 'account-setup':
 case 'delete-account':
     display_account_setup($HTTP_SESSION_VARS['auth_user']);
     break;
 case 'send-message':
     if (send_message($to, $cc, $subject, $message)) {
         echo '<p>Message sent.</p><br /><br /><br /><br /><br /><br />';
     } else {
         echo '<p>Could not send message.</p><br /><br /><br /><br />
         <br /><br />';
     }
     break;
 case 'delete':
     delete_message($HTTP_SESSION_VARS['auth_user'], $HTTP_SESSION_VARS['selected_account'], $messageid);
     //note deliberately no 'break' - we will continue to the next case
 case 'select-account':
 case 'view-mailbox':
     // if mailbox just chosen, or view mailbox chosen, show mailbox
     display_list($HTTP_SESSION_VARS['auth_user'], $HTTP_SESSION_VARS['selected_account']);
     break;
 case 'show-headers':
 case 'hide-headers':
 case 'view-message':
     // if we have just picked a message from the list, or were looking at
     // a message and chose to hide or view headers, load a message
     $fullheaders = $action == 'show-headers';
     display_message($HTTP_SESSION_VARS['auth_user'], $HTTP_SESSION_VARS['selected_account'], $messageid, $fullheaders);
     break;
 case 'reply-all':
require 'inc/func.inc.php';
if (!loggedin()) {
    header('Location: login.php');
}
if (!empty($_POST)) {
    if (!empty($_POST['res'])) {
        $test = json_decode($_POST['res'], true);
        $message_id = (int) $test[0];
        $item = $test[1];
        $defination = $test[2];
        $query = "INSERT INTO `requests` (`item`,`defination`) VALUES ('{$item}','{$defination}')";
        mysqli_query($connection, $query);
        delete_message($connection, $message_id);
    } else {
        $message_id = (int) $_POST['rej'];
        delete_message($connection, $message_id);
    }
}
// requests
?>

<!DOCTYPE html>
<html>
<head>
<?php 
include 'layout/meta.inc.php';
?>
</head>
<body class="skin-black">
<?php 
include 'layout/header.inc.php';
Example #14
0
include "config/config.php";
include "admin/include/function.php";
include "include/common-scripts.php";
include "include/logincheck.php";
if (isset($_POST["delete_from_inbox"])) {
    delete_message("inbox", $_POST['message']);
}
if (isset($_POST["delete_from_sent"])) {
    delete_message("send_items", $_POST['message']);
}
if (isset($_POST["delete_from_view_inbox"])) {
    delete_message("inbox", $_POST['message']);
    header("location:messages.php");
}
if (isset($_POST["delete_from_view_sent"])) {
    delete_message("send_items", $_POST['message']);
    header("location:messages.php?view=sent");
}
if (isset($_POST["delete_forever"])) {
    delete_message_forever("send_items", $_POST['message'], $_SESSION["userid"]);
}
if (isset($_POST["reply"])) {
    $from = $_SESSION["userid"];
    $to = $_POST["sendto"];
    $replyof = $_POST["replyof"];
    $title = mysql_real_escape_string(stripslashes($_POST["title"]));
    $message = mysql_real_escape_string(stripslashes($_POST["message"]));
    send_message($from, $to, $title, $message, $replyof);
    header("location:messages.php?message={$_GET['message']}&replysucess");
}
?>