function execute(&$controller) { $observer =& $controller->getObserver(); if (require_level(USERLEVEL_MODERATOR_TEAM) || $observer->get('debug_log') == TRUE) { if ($observer->get('debug_log')) { $enablednote = "enabled"; } echo "\n\n\n\n<!-- BEGIN Frame: Default.Observer -->\n\n"; echo "<script>function toggleLayer(whichLayer) { if (whichLayer=='obslink') { "; echo "var o = document.getElementById(whichLayer); if ( o.style.width=='15px') { o.style.width='99%'; } "; echo "else { o.style.width='15px'; } } else if (document.getElementById) { "; echo "var style2 = document.getElementById(whichLayer).style; style2.display = (style2.display=='block')? "; echo "\"none\":\"block\"; } } </script>\n<style> <!--\n"; echo ".obs { font-family: tahoma,arial,helvetica; font-size:11px; color:#333; text-align: left; } \n"; echo ".deb { font-family: tahoma,arial,helvetica; font-size:11px; color:#214482; text-align: left; } \n"; echo ".debm { font-family: tahoma,arial,helvetica; font-size:11px; color:#824421; text-align: left; } \n"; echo "div#obslink { height:22px; border:1px solid #000; padding: 2px; margin: 0px 0px 2px 0px; background: #ccc; display:block; width:99%; overflow:hidden; line-height: 18px;} \n"; echo "div#obslink a { text-decoration: none; } \n"; echo "div#observer { border:1px solid #000; padding: 5px; margin: 0; background: #ccc; display:none; width:100%; z-index: 1000001;} \n"; echo "div#debug { border:1px solid #214482; padding: 5px; margin: 0; background: #AEC4EB; display:none; width:100%; z-index: 1000001;} \n"; echo "div#debugmessages { border:1px dashed #824421; padding: 5px; margin: 0; background: #EBC4AE; display:none; z-index: 1000001;} \n"; echo "div#obswin { float: left; position: absolute; top: 0; left: 0; z-index: 1000000; width: 100%; } \n"; echo "--></style>"; echo "\n\n<div id=\"obswin\">"; echo "<div id=\"obslink\" class=\"obs\">"; echo "<a href=\"javascript:toggleLayer('obslink');\">[o]</a> "; if ($observer->isEmpty('Default.debug.observer')) { echo "<strong>observer:</strong> <a href=\"javascript:toggleLayer('observer');\">show/hide</a>"; } if (!$observer->isEmpty('Default.debug')) { echo " "; echo "<span class=\"deb\"><strong>debug:</strong> <a href=\"javascript:toggleLayer('debug');\">show/hide</a></span>"; } if (!$observer->isEmpty('Default.debug_messages')) { echo " "; echo "<span class=\"debm\"><strong>messages:</strong> <a href=\"javascript:toggleLayer('debugmessages');\">show/hide</a></span>"; } echo "</div>"; if ($observer->isEmpty('Default.debug.observer')) { echo "<div id=\"observer\" class=\"obs\">"; gaia_pre($observer); echo "</div>"; } if (!$observer->isEmpty('Default.debug')) { echo "<div id=\"debug\" class=\"deb\">"; gaia_pre($observer->get('Default.debug')); echo "</div>"; } if (!$observer->isEmpty('Default.debug_messages')) { echo "<div id=\"debugmessages\" class=\"deb\">"; foreach ($observer->get('Default.debug_messages') as $k => $m) { echo "<strong>" . htmlspecialchars($k) . "</strong><br/>" . $m . "<hr/>"; } echo "</div>"; } //echo "<div>Observer Frame is <strong>".$enablednote."</strong></div>"; echo "\n\n</div><!-- END Frame: Default.Observer -->\n\n\n\n"; } // done! }
function execute(&$observer) { if (SC::isEmpty('userdata.user_id') || !require_level(USERLEVEL_ADMINISTRATION_TEAM)) { $observer->set('error.title', 'Permissions Error'); $observer->set('error.message', 'You do not have permission to access this function.'); $observer->set('error.line', __LINE__); $observer->set('error.file', __FILE__); return FALSE; } return TRUE; }
public function database() { require_level(ACCLEVEL_SUPERADMIN); //session_start(); $_SESSION['PMA_single_signon_user'] = $this->db->username; $_SESSION['PMA_single_signon_password'] = $this->db->password; $_SESSION['PMA_single_signon_host'] = $this->db->hostname; if (!isset($_SESSION['PMA_single_signon_token'])) { $_SESSION['PMA_single_signon_token'] = md5(uniqid(rand(), true)); } session_write_close(); //print_r($_SESSION); redirect("/phpmyadmin/index.php?server=1", 303); }
/** * Execute */ function execute( & $observer ) { if( SC::isEmpty('userdata.user_id') || ! require_level(USERLEVEL_ADMIN)) { $message = "This page is not available under the current configuration, or "; $message .= "you are not authorized to view this page."; $observer->set('error.message', $message); $observer->set('error.code', GENERAL_MESSAGE); $observer->set('error.title', 'Not Authorized'); $observer->set('error.line', __LINE__); $observer->set('error.file', __FILE__); return FALSE; } return TRUE; }
/** * Execute */ function execute( & $observer ) { if( !SC::get('userdata.session_logged_in') || ! require_level(USERLEVEL_DEVELOPER)) { $message = "This page is not available under the current configuration, or "; $message .= "you are not authorized to view this page."; $observer->set('error.message', $message); $observer->set('error.code', GENERAL_MESSAGE); if ( !SC::get('userdata.session_logged_in') ) { $observer->set('error.title', 'Not Logged In'); } else { $observer->set('error.title', 'Not Authorized'); } $observer->set('error.line', __LINE__); $observer->set('error.file', __FILE__); return FALSE; } return TRUE; }
public function search($by = "all", $criteria = "_", $page = 1) { require_level(ACCLEVEL_MODERATOR); $this->load->model($this->_model, "mdl"); $this->load->library('table'); $this->load->library('pagination'); $config['base_url'] = base_url("/" . $this->module . "/search/{$by}/{$criteria}"); if ($by == "all" || $criteria == "_") { $criteria = ""; } $where = $this->_generate_where($criteria, $by); $total = $this->mdl->count_by($where); $config['total_rows'] = $total; $config['per_page'] = 10; $config['uri_segment'] = 5; $config['use_page_numbers'] = true; $this->pagination->initialize($config); $pagination = $this->pagination->create_links(); $list = $this->_query($this->mdl, $where, $config, $page); if ($list != array()) { $tmpl = array('table_open' => '<table id="gradient-style">'); $this->table->set_template($tmpl); $this->_set_table_heading($this->table); foreach ($list as $item) { $this->_add_row_to_table($this->table, $item); } $table = $this->table->generate(); } else { $table = "No se encontraron resultados"; } $title = $this->_list_title; $this->load->view("header.php", array('title' => $title)); $this->load->view("topbar.php"); $data = array('table' => $table, 'module' => $this->module, 'title' => $title, 'pagination' => $pagination, 'searchBy' => $by); $this->load->view($this->_view, $data); $this->load->view("footer.php"); }
public function certify($regid) { require_level(ACCLEVEL_MODERATOR); $this->load->model("Registration_model", "registration"); $this->load->model("Account_model", "account"); $cert = $this->input->post(); $reg = $this->registration->as_array()->get($regid); $reg['admincomments'] = $cert['admincomments']; $reg['adminname'] = $this->session->userdata('Name'); $reg['lastedit'] = null; if ($cert['action'] == 'reject') { $reg['status'] = 'Rechazado'; } else { if ($cert['action'] == 'accept') { $reg['status'] = 'Aceptado'; $userid = $this->account->resetuser($reg['name'], $reg['password']); $reg['accountid'] = $userid; } } $this->registration->update($regid, $reg); $this->detail_popup($regid); }
public function leveldn($command) { require_level(ACCLEVEL_SUPERADMIN); $this->mdl->leveldn($command); redirect($this->session->get_flashdata('refreshurl')); }
<?php $layout = $this->getLayoutConfig(); ?> </div> <!-- END main content --> <div id="gaia_footer"> <? if (require_level(USERLEVEL_STAFF_TEAM)) : ?> <p><a href="/admin/?">Go to Administration Panel</a></p> <p>Page generated in <?php echo round(array_sum(explode(" ", microtime())) - MICROTIME, 3); ?> seconds</p> <p>Time drift: <?php echo TIME_DRIFT; ?> s</p> <p>Server IP: <?php echo $_SERVER['SERVER_ADDR']; ?> </p> <? endif; ?> <? if (!SC::isEmpty('board_config.query_log')) : ?> <p><a href="/queryprofiler/?mode=read&ts=<?php echo SC::get('board_config.time_now'); ?> " target="query_log">EXPLAIN</a></p> <? endif; ?>
function getLiveData() { $this->o->append('Default.debug.steps', __CLASS__ . '.' . __FUNCTION__); // woohoo! GET THE CACHE DATA $cachedata =& $this->get('cachedata'); $missing =& $this->get('missing'); // so now, we check the friendlist to figure shit out, // and have a final set of data to cache. $fu =& new FriendUtility(); $fu->getFriendLists($missing); $fu->getBothLists(); $final_stats = array(); $me = SC::get('userdata.user_id'); $is_mod = require_level(USERLEVEL_MODERATOR_TEAM); $cutoff = SC::get('board_config.time_now') - 600; foreach ($cachedata as $uid => $user_cache) { // init the stat array $stats = $user_cache; // determine friend bullshit. $is_my_friend = $fu->isFriend($uid); $am_i_their_friend = $fu->isFriend($me, $uid); $am_i_ignored = $fu->isIgnored($me, $uid); // first. online status. if ($me == $uid) { $stats['status'] = 'online'; } else { if ($user_cache['status'] == 'online' && $is_mod == false && $am_i_their_friend == false) { // If : user does not allow others to view status and viewer is not a mod and // viewer is not in the user's friends list - hidden $stats['status'] = 'hidden'; } } // housing if (isset($user['home_zip'])) { $locked = false; if ($uid == $me || $is_mod == true) { $locked = false; } else { if ($user['home_privacy'] == 2 && $am_i_their_friend == false) { $locked = true; } else { if ($am_i_ignored == true || $user['home_privacy'] == 0) { $locked = true; } } } if ($locked == false) { $stats['housing_url'] = append_sid("/launch/towns?home=" . $user['home_zip']); } } // journal if (isset($user['journal_view'])) { $journalview = true; if ($uid == $me['user_id'] || $is_mod == true) { $journalview = true; } else { if ($user['journal_view'] == 2 && $am_i_their_friend == false) { $journalview = false; } else { if ($am_i_ignored == true || $user['journal_view'] == 0) { $journalview = false; } } } if ($journalview == true) { $stats['journal_url'] = append_sid("/journal/?u=" . $uid); } } // private messages if (isset($user['pm_receive'])) { $receive = true; if ($uid == $me['user_id'] || $is_mod == true) { $receive = true; } else { if ($user['pm_receive'] == 2 && $am_i_their_friend == false) { $receive = false; } else { if ($am_i_ignored == true || $user['pm_receive'] == 0) { $receive = false; } } } if ($receive == true) { $stats['pm_url'] = append_sid("/profile/privmsg.php?mode=post&" . POST_USERS_URL . "=" . $uid); } } $final_stats[$uid] = $stats; } unset($fu); $this->remove('cachedata'); $this->set('statusbar', $final_stats); return true; }
function singleBar( $sb_userdata ) { $is_mod = require_level(USERLEVEL_SITEASSISTANCE1); $images =& SC::get('images'); $userdata =& SC::get('userdata'); $board_config =& SC::get('board_config'); # Default indicators if (empty($use_rows)) { $use_rows = array("status","profile","housing","journal","pm","store","trade","www","aim","yim","msn","icq"); } # ON/OFFLINE INDICATOR # ----------------------------------- # Make the default cutoff for on/off status 10 minutes if (!isset($online_offline_cutoff)) { $online_offline_cutoff = SC::get('board_config.time_now') - 600; } # If : user does not allow others to view status and viewer is not a mod and viewer is not in the user's friends list - hidden $fu = new FriendUtility(); if (isset($user_data['user_allow_viewonline']) && $user_data['user_allow_viewonline']==0 && $is_mod==false && !$fu->isFriend($userdata['user_id']) ) { $status_bar['status_img'] = '<img src="http://' . GRAPHICS_SERVER . '/images/template/icons/icon_hidden.gif" height="22" width="72" border="0">'; $status_bar['status'] = 'Hidden'; } # Elseif : user's last recorded session time is greater than the cutoff time - online elseif (isset($user_data['user_session_time']) && $user_data['user_session_time'] > $online_offline_cutoff) { $status_bar['status_img'] = '<img src="http://' . GRAPHICS_SERVER . '/images/template/icons/icon_online.gif" height="22" width="72" border="0" />'; $status_bar['status'] = 'Online'; } # Else : fails above conditions - offline else { $status_bar['status_img'] = '<img src="http://' . GRAPHICS_SERVER . '/images/template/icons/icon_offline.gif" height="22" width="72" border="0" />'; $status_bar['status'] = 'Offline'; } # ----------------------------------- # PROFILE # ----------------------------------- if (isset($user_data['user_id'])) { $user_id = $user_data['user_id']; } else { $user_id = ''; } if (isset($user_data['username'])) { $user_name = $user_data['username']; } else { $user_name = ''; } $temp_url = append_sid("/profile/index.php?view=profile.ShowProfile&item=" . $user_id); $status_bar['profile_img'] = '<a href="' . $temp_url . '"><img src="http://' . GRAPHICS_SERVER . '/images/template/icons/icon_profile_2.gif" alt="View '.addslashes($user_name).'\'s Profile" title="View '.addslashes($user_name).'\'s Profile" border="0" /></a>'; $status_bar['profile'] = '<a href="' . $temp_url . '">' . "Profile" . '</a>'; # ----------------------------------- # HOUSING # ----------------------------------- //$daoGH =& DaoFactory::create('gaiahousing.detailById'); //$userHouseDetails =& $daoGH->fetch($user_data['user_id']); if (isset($user_data['user_home'])) { $user_home = $user_data['user_home']; } else { $user_home = 0; } if ($user_home==1) { $temp_url = append_sid("/games/housing/index.php?mode=viewer&" . POST_USERS_URL . "=".$user_id); $status_bar['housing_img'] = '<a href="' . $temp_url . '"><img src="http://' . GRAPHICS_SERVER . '/images/template/icons/icon_housing_2.gif" alt="View '.addslashes($user_name).'\'s Home" title="View '.$user_name.'\'s Home" border="0" /></a>'; $status_bar['housing'] = '<a href="' . $temp_url . '">' . "My Home" . '</a>'; } # ----------------------------------- # JOURNAL # ----------------------------------- if (isset($user_data['user_journal_id'])) { $user_journal_id = $user_data['user_journal_id']; } else { $user_journal_id = 0; } $temp_url = append_sid("/journal/?u=" . $user_id); $status_bar['journal_img'] = ($user_journal_id!=0) ? '<a href="' . $temp_url . '"><img src="http://' . GRAPHICS_SERVER . '/images/template/icons/icon_journal_2.gif" alt="Read '.addslashes($user_name).'\'s Journal" title="Read '.addslashes($user_name).'\'s Journal" border="0" /></a>' : ''; $status_bar['journal'] = ($user_journal_id!=0) ? '<a href="$temp_url">Journal</a>' : ''; # ----------------------------------- # PM # ----------------------------------- if (isset($user_data['user_receive_pm'])) { $user_receive_pm = $user_data['user_receive_pm']; } else { $user_receive_pm = 0; } $temp_url = append_sid("/profile/privmsg.php?mode=post&" . POST_USERS_URL . "=".$user_id); $status_bar['pm_img'] = ($user_receive_pm != 0) ? '<a href="'.$temp_url.'"><img src="http://' . GRAPHICS_SERVER . '/images/template/icons/icon_pm_2.gif" alt="Send '.addslashes($user_name).' a PM" title="Send '.addslashes($user_name). ' a PM" border="0" /></a>' : ''; $status_bar['pm'] = ($user_receive_pm!=0) ? '<a href="$temp_url">PrivateMsg</a>' : ''; # ----------------------------------- # EMAIL # ----------------------------------- if (isset($user_data['user_viewemail'])) { $user_viewmail = $user_data['user_viewemail']; } else { $user_viewmail = 0; } if (isset($user_data['user_email'])) { $user_email = $user_data['user_email']; } else { $user_email = NULL; } if (! isset($poster_id)) { $poster_id = NULL; } if ( !empty($user_viewmail) || $is_mod==true ) { $temp_url = ( $board_config['board_email_form'] ) ? append_sid("/profile/profile.php?mode=email&" . POST_USERS_URL .'=' . $poster_id) : 'mailto:' . htmlspecialchars($user_email); $status_bar['email_img'] = '<a href="' . $temp_url . '"><img src="http://' . GRAPHICS_SERVER . '/images/template/icons/icon_email_2.gif" alt="Send '.addslashes($user_name).'\ an Email" title="Send '.addslashes($user_name).'\ an Email" border="0" /></a>'; $status_bar['email'] = '<a href="$temp_url">Email</a>'; } else { $status_bar['email_img'] = ''; $status_bar['email'] = ''; } # ----------------------------------- # STORE (VEND) # ----------------------------------- if (isset($user_data['user_vend'])) { $user_vend = $user_data['user_vend']; } else { $user_vend = 0; } $temp_url = append_sid('http://'.VEND_SERVER."/gaia/vend.php?mystore=" . $user_id); $status_bar['store_img'] = ( $user_vend ) ? '<a href="' . $temp_url . '"><img src="http://' . GRAPHICS_SERVER . '/images/template/icons/icon_mystore_2.gif" alt="'.addslashes($user_name).'\'s store has '.$user_vend.' item(s)" title="'.addslashes($user_name).'\'s store has '.$user_vend.' item(s)" border="0" /></a>' : ''; $status_bar['store'] = ( $user_vend ) ? '<a href="' . $temp_url . '">'."Store".'</a>' : ''; # ----------------------------------- # TRADE # ----------------------------------- $temp_url = append_sid('http://'.BANK_SERVER."/gaia/bank.php?mode=trade&uid=".$user_id); $status_bar['trade_img'] = '<a href="' . $temp_url . '"><img src="http://' . GRAPHICS_SERVER . '/images/template/icons/icon_trade_2.gif" alt="Trade with '.addslashes($user_name).'" title="Trade with '.addslashes($user_name).'" border="0" /></a>'; $status_bar['trade'] = '<a href="$temp_url">Trade</a>'; # ----------------------------------- # WWW (homepage) # ----------------------------------- if (isset($user_data['user_website'])) { $user_website = $user_data['user_website']; } else { $user_website = NULL; } $status_bar['www_img'] = ($user_website) ? '<a href="'.htmlspecialchars($user_website).'" target="_userwww"><img src="'.$images['icon_www'].'" alt="Visit posters website" title="Visit posters website" border="0" /></a>' : ''; $status_bar['www'] = ($user_website) ? '<a href="'.htmlspecialchars($user_website).'" target="_userwww">Visit posters website</a>' : ''; # ----------------------------------- # ICQ # ----------------------------------- if (isset($user_data['user_icq'])) { $user_icq = $user_data['user_icq']; } else { $user_icq = NULL; } $status_bar['icq_status_img'] = ($user_icq) ? '<a href="http://wwp.icq.com/'.htmlspecialchars($user_icq).'#pager"><img src="http://web.icq.com/whitepages/online?icq='.htmlspecialchars($user_icq).'&img=5" width="18" height="18" border="0" /></a>' : ''; $status_bar['icq_img'] = ($user_icq) ? '<a href="http://wwp.icq.com/scripts/search.dll?to='.htmlspecialchars($user_icq).'"><img src="'.$images['icon_icq'].'" alt="ICQ Number" title="'.htmlspecialchars($user_icq).'" border="0" /></a>' : ''; $status_bar['icq'] = ($user_icq) ? '<a href="http://wwp.icq.com/scripts/search.dll?to='.htmlspecialchars($user_icq).'">ICQ Number</a>' : ''; # ----------------------------------- # AIM # -----------------------------------M if (isset($user_data['user_aim'])) { $user_aim = $user_data['user_aim']; } else { $user_aim = NULL; } $status_bar['aim_img'] = ($user_aim) ? '<a href="aim:goim?screenname='.htmlspecialchars($user_aim).'&message=Hello+Are+you+there?"><img src="'.$images['icon_aim'].'" alt="AIM Address" title="'.htmlspecialchars($user_aim).'" border="0" /></a>' : ''; $status_bar['aim'] = ($user_aim) ? '<a href="aim:goim?screenname='.htmlspecialchars($user_aim).'&message=Hello+Are+you+there?">AIM</a>' : ''; # ----------------------------------- # MSN # ----------------------------------- if (isset($user_data['user_msnm'])) { $user_msnm = $user_data['user_msnm']; } else { $user_msnm = NULL; } $temp_url = append_sid("/profile/profile.php?mode=viewprofile&" . POST_USERS_URL . "=".$user_id); $status_bar['msn_img'] = ( $user_msnm ) ? '<a href="'.$temp_url.'"><img src="'.$images['icon_msnm'].'" alt="MSN Messenger" title="'.htmlspecialchars($user_msnm).'" border="0" /></a>' : ''; $status_bar['msn'] = ($user_msnm) ? '<a href="'.$temp_url.'">MSN Messenger</a>' : ''; # ----------------------------------- # YIM # ----------------------------------- if (isset($user_data['user_yim'])) { $user_yim = $user_data['user_yim']; } else { $user_yim = NULL; } $status_bar['yim_img'] = ($user_yim) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target='.htmlspecialchars($user_yim).'&.src=pg"><img src="'.$images['icon_yim'].'" alt="Yahoo Messenger" title="'.htmlspecialchars($user_yim).'" border="0" /></a>' : ''; $status_bar['yim'] = ($user_yim) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target='.htmlspecialchars($user_yim).'&.src=pg">Yahoo Messenger</a>' : ''; # ----------------------------------- # BUILD THE BAR # ----------------------------------- if (! isset($output_bar) ) { $output_bar = NULL; } if ($img_or_txt=='img') { $start_cap = "<img src=\"http://" . GRAPHICS_SERVER . "/images/template/s.gif\" width=1 height=2><br><img src=\"http://" . GRAPHICS_SERVER . "/images/template/icons/icon_fend_t.gif\" height=22 width=7 border=0>"; $end_cap = "<img src=\"http://" . GRAPHICS_SERVER . "/images/template/icons/icon_end_t.gif\" height=22 width=9 border=0><br><img src=\"http://" . GRAPHICS_SERVER . "/images/template/s.gif\" width=1 height=2>"; } else { $start_cap = "[ "; $end_cap = " ]"; } foreach ($use_rows as $show_row) { if ($img_or_txt=='img') { $show_row_img = $show_row."_img"; if ( isset($status_bar[$show_row_img]) ) { $output_bar .= $status_bar[$show_row_img]; } } else { $output_bar .= $status_bar[$show_row]; if ($status_bar[$show_row]!="") $output_bar .= " · "; } } # ----------------------------------- # Display as image or text if ($img_or_txt=="txt" && substr($output_bar,-20)==" · ") $output_bar = substr($output_bar,0,-20); return "\n\n<!-- new profile bar :: ".$_SERVER["HTTP_HOST"]." -->\n" . $start_cap . $output_bar . $end_cap; }
public function new_ban_popup() { require_level(ACCLEVEL_ADMIN); $this->load->view("bans/new_form.php"); }
public function create($name = "") { require_level(ACCLEVEL_MODERATOR); $this->load->model('Account_model', 'account'); $this->load->helper('string'); $this->load->helper('security'); if ($name == "") { $name = $this->input->post("name"); } if ($name != "") { $pass = random_string("numeric", "6"); $userid = $this->account->resetuser($name, $pass); if ($userid != FALSE) { $this->load->view("header.php", array('title' => "Malos Aires Roleplay - Ficha del ciudadano {$name}")); $this->load->view("topbar.php"); //$this->load->view('players/created.php',array('Player' => $name,'Password' => $pass)); $account = $this->account->get($userid); $this->_show_details($account, "Registrado el usuario <b>{$name}</b> con password <b>{$pass}</b>"); $this->load->view("footer.php"); } } else { $this->load->helper(array('form', 'url')); $this->load->view("header.php", array('title' => "Malos Aires Roleplay - Nueva ciudadanía")); $this->load->view("topbar.php"); $this->load->view("players/create.php"); $this->load->view("footer.php"); } }