Example #1
0
        <!-- Main contentent box -->
        <div id="content-container">

            <!-- Navigation -->
            <nav id="nav">
                <ul class="navigation">
                    <li><a href="{SITE_URL}">Home</a></li>
                    <li><a href="http://plexis.tk/forum/">Forums</a></li>
                    <li><a href="{SITE_URL}/account/vote">Vote</a></li>
                    <li><a href="{SITE_URL}/account/donate">Donate</a></li>
                    <li><a href="{SITE_URL}/server">Server</a>
                        <ul class="subnav">
                            <li><a href="{SITE_URL}/server/realmlist">Realmlist</a></li>
                            <li><a href="{SITE_URL}/server/onlinelist">Players Online</a>
                                <?php 
$realms = get_installed_realms();
if (!empty($realms)) {
    echo '<span class="spmore"></span>';
    echo '<ul class="subnav-out">';
    foreach ($realms as $realm) {
        echo '<li><a href="{SITE_URL}/server/onlinelist/' . $realm['id'] . '">' . $realm['name'] . '</a></li>';
    }
    echo '</ul>';
}
?>
                            </li>
                        </ul>
                    </li>
                    <li><a href="{SITE_URL}/support">Support</a>
                        <ul class="subnav">
                            <li><a href="{SITE_URL}/support/howtoplay">Connection Guide</a></li>
Example #2
0
 public function uninstall_realm()
 {
     // Load our config class
     $Config = load_class('Config');
     $Ajax = get_instance();
     // Get our realm ID and the default realm ID
     $id = $_POST['id'];
     $default = $Config->get('default_realm_id');
     // Run the delete though the database
     $result = $this->DB->delete('pcms_realms', '`id`=' . $id . '');
     // If we are uninstalling the default Realm, we set a new one
     if ($id == $default) {
         // Get the new Default Realm
         $installed = get_installed_realms();
         if ($installed == FALSE || empty($installed)) {
             // Set the new default Realm
             $Config->set('default_realm_id', 0, 'App');
             $Config->save('App');
         } else {
             // Set the new default Realm
             $Config->set('default_realm_id', $installed[0]['id'], 'App');
             $Config->save('App');
         }
     }
     $result == TRUE ? $Ajax->output(true, 'realm_uninstall_success') : $Ajax->output(false, 'realm_uninstall_failed', 'error');
 }
Example #3
0
 public function characters($realmid = 0, $character = 0)
 {
     // Make sure the user can view this page
     if (!$this->check_permission('manage_characters')) {
         return;
     }
     // Set new realm
     if ($realmid != 0 && realm_installed($realmid)) {
         $current = $realmid;
     } else {
         $current = get_realm_cookie();
     }
     // Get our installed realms
     $realms = get_installed_realms();
     // If no realms installed, display a message instead
     if (empty($realms)) {
         // Build our page title / desc, then load the view
         $data = array('page_title' => "Character Editor", 'page_desc' => "This page allows you to edit character information. NOTE: You cannot edit a character while they are playing!");
         $this->load->view('no_realms', $data);
         return;
     }
     // Editing a character?
     if ($character != 0) {
         // Load the wowlib for this realm
         $Lib = $this->load->wowlib($realmid, false);
         if ($Lib == false) {
             // Give the admin an error
             output_message('warning', 'Unable to load wowlib for this realm. Please make sure the character and world databases are online');
             // Build our page title / desc, then load the view
             $data = array('page_title' => "Character Editor", 'page_desc' => "This page allows you to edit character information. NOTE: You cannot edit a character while they are playing!");
             $this->load->view('blank', $data);
             return;
         }
         // Fetch character
         $char = $Lib->characters->fetch((int) $character);
         if ($char == false) {
             // Give the admin an error
             output_message('error', 'Character Doesnt Exist!');
             // Build our page title / desc, then load the view
             $data = array('page_title' => "Character Editor", 'page_desc' => "This page allows you to edit character information. NOTE: You cannot edit a character while they are playing!");
             $this->load->view('blank', $data);
             return;
         }
         // Get alist of login flags
         $flags = array();
         $aflags = $Lib->characters->loginFlags();
         $has_flag = $char->getLoginFlags();
         // Loop through each flag so we can set the proper enabled : disabled at login select options
         foreach ($aflags as $key => $flag) {
             // Dont show flags that arent enabled by this realm
             if ($flag == false) {
                 continue;
             }
             // Create a name, and add to the flags array
             $name = str_replace('_', ' ', ucfirst($key));
             $flags[] = array('label' => $key, 'name' => $name, 'enabled' => $has_flag[$key]);
         }
         // Fetch account and character postion
         $Account = $this->realm->fetchAccount($char->getAccountId());
         $pos = $char->getPosition();
         // Build our page title / desc, then load the view
         $data = array('page_title' => "Character Editor", 'page_desc' => "This page allows you to edit character information.", 'flags' => $flags, 'character' => array('id' => $character, 'name' => $char->getName(), 'level' => $char->getLevel(), 'money' => $char->getMoney(), 'xp' => $char->getXp()), 'account' => $Account->getUsername(), 'race' => $char->getRace(true), 'class' => $char->getClass(true), 'zone' => $Lib->zone->name($pos['zone']), 'realm' => $realmid);
         $this->load->view('edit_character', $data);
         return;
     }
     // Otherwise, list
     $array = array();
     $set = false;
     foreach ($realms as $realm) {
         $selected = '';
         if ($realm['id'] == $current) {
             $selected = 'selected="selected" ';
         }
         // Add the language folder to the array
         $array[] = '<option value="' . $realm['id'] . '" ' . $selected . '>' . $realm['name'] . '</option>';
     }
     // Build our page title / desc, then load the view
     $data = array('page_title' => "Character Editor", 'page_desc' => "This page allows you to edit character information. NOTE: You cannot edit a character while they are playing!", 'realms' => $array);
     $this->load->view('characters', $data);
 }
Example #4
0
 public function realmlist()
 {
     // Get our users selected realm
     $c = get_realm_cookie();
     // Get our realm id if none is provieded
     if ($c == 0) {
         output_message('info', 'no_realms_installed');
         $this->load->view('blank');
         return;
     }
     // Load the datatables script
     $this->Template->add_script('jquery.dataTables.js');
     // Build our realm select options
     $data['realms'] = get_installed_realms();
     // Load the view and call it a day!
     $this->load->view('realmlist', $data);
 }
Example #5
0
 public function realms()
 {
     // Load the ajax model and action
     $this->load->model('Ajax_Model', 'model');
     $action = $this->Input->post('action');
     // Get our realm ID
     $id = (int) $this->Input->post('id', true);
     // Make sure use has perms
     $this->check_permission('manage_realms');
     // Find out what we are doing here by our requested action
     switch ($action) {
         case "install":
         case "manual-install":
         case "edit":
             $this->model->process_realm($action);
             break;
         case "un-install":
             // Get our realm name
             $r = get_realm($id);
             // Log action
             $this->log('Uninstalled Realm ' . $r['name']);
             $this->model->uninstall_realm();
             break;
         case "make-default":
             // Get our realm name
             $r = get_realm($id);
             // Log action
             $this->log('Changed the default realm to ' . $r['name']);
             // Load our config class
             $Config = load_class('Config');
             // Set the new default Realm
             $Config->set('default_realm_id', $id, 'App');
             $result = $Config->save('App');
             $result == TRUE ? $this->output(true, 'realm_default_success') : $this->output(false, 'realm_default_failed', 'error');
             break;
         case "admin":
             // Prepare DataTables
             $cols = array('id', 'name', 'address', 'port');
             $index = "id";
             $table = "realmlist";
             $where = '';
             /* Process the request */
             if (config("emulator") != "arcemu") {
                 $output = $this->model->process_datatables($cols, $index, $table, $where, $this->RDB);
             } else {
                 $output = array("aaData" => array(), "iTotalDisplayRecords" => 0, "iTotalRecords" => 0, "ssEcho" => intval($_POST["sEcho"]));
             }
             // Get our installed realms
             $realms = $output['aaData'];
             $installed = get_installed_realms();
             $irealms = array();
             // Build an array of installed IDs
             foreach ($installed as $realm) {
                 $irealms[] = $realm['id'];
             }
             // We need to add a working "manage", and "Make Default Link" link
             $aa = array();
             $key = 0;
             $default = config('default_realm_id');
             // Loop, and add options for each realm
             foreach ($output['aaData'] as $realm) {
                 // Easier to write
                 $id = $realm[0];
                 $aa[] = $id;
                 // Create out action links for this realm
                 if (in_array($id, $irealms)) {
                     // We CANNOT uninstall the default realm!
                     if ($id == $default) {
                         $output['aaData'][$key][4] = "<font color='green'>Installed</font> - Default Realm";
                         $output['aaData'][$key][5] = "<a href=\"" . SITE_URL . "/admin/realms/edit/" . $id . "\">Update</a>\n                                - <a class=\"un-install\" name=\"" . $id . "\" href=\"javascript:void(0);\">Uninstall</a>";
                     } else {
                         $output['aaData'][$key][4] = "<font color='green'>Installed</font>";
                         $output['aaData'][$key][5] = "<a href=\"" . SITE_URL . "/admin/realms/edit/" . $id . "\">Update</a>\n                                - <a class=\"make-default\" name=\"" . $id . "\" href=\"javascript:void(0);\">Make Default</a>\n                                - <a class=\"un-install\" name=\"" . $id . "\" href=\"javascript:void(0);\">Uninstall</a>";
                     }
                 } else {
                     $output['aaData'][$key][4] = "<font color='red'>Not Installed</font>";
                     $output['aaData'][$key][5] = "<a href=\"" . SITE_URL . "/admin/realms/install/" . $id . "\">Install Realm</a>";
                 }
                 ++$key;
             }
             // For cores that dont have a realmist in the DB, we need to manually add these
             foreach ($installed as $realm) {
                 $id = $realm['id'];
                 if (!in_array($id, $aa)) {
                     ++$output["iTotalRecords"];
                     ++$output["iTotalDisplayRecords"];
                     $data[0] = $id;
                     $data[1] = $realm['name'];
                     $data[2] = $realm['address'];
                     $data[3] = $realm['port'];
                     // We CANNOT uninstall the default realm!
                     if ($id == $default) {
                         $data[4] = "<font color='green'>Installed</font> - Default Realm";
                         $data[5] = "<a href=\"" . SITE_URL . "/admin/realms/edit/" . $id . "\">Update</a>\n                                - <a class=\"un-install\" name=\"" . $id . "\" href=\"javascript:void(0);\">Uninstall</a>";
                     } else {
                         $data[4] = "<font color='green'>Installed</font>";
                         $data[5] = "<a href=\"" . SITE_URL . "/admin/realms/edit/" . $id . "\">Update</a>\n                                - <a class=\"make-default\" name=\"" . $id . "\" href=\"javascript:void(0);\">Make Default</a>\n                                - <a class=\"un-install\" name=\"" . $id . "\" href=\"javascript:void(0);\">Uninstall</a>";
                     }
                     $output['aaData'][] = $data;
                 }
             }
             // Push the output in json format
             echo json_encode($output);
             break;
         default:
             $this->output(false, "Unknown Action");
             break;
     }
 }