/** * scope based __link call * */ function _checkAuth($scope = false) { global $roster, $addon; if (!$scope) { return false; } $roster_login = new RosterLogin(); if ($roster_login->getAuthorized() < $addon['config'][$scope]) { print '<span class="title_text">' . $this->title . '</span><br />' . $roster_login->getMessage() . $roster_login->getLoginForm($addon['config'][$scope]); $ret = false; } else { $ret = true; } $this->_debug(1, $ret, 'Checked authentication', $ret ? 'OK' : 'Failed'); return $ret; }
/****************************** * WoWRoster.net Roster * Copyright 2002-2006 * Licensed under the Creative Commons * "Attribution-NonCommercial-ShareAlike 2.5" license * * Short summary * http://creativecommons.org/licenses/by-nc-sa/2.5/ * * Full license information * http://creativecommons.org/licenses/by-nc-sa/2.5/legalcode * ----------------------------- * * $Id$ * ******************************/ if (!defined('ROSTER_INSTALLED')) { exit('Detected invalid access to this file!'); } // ----[ Check log-in ]------------------------------------- $roster_login = new RosterLogin($script_filename . (isset($_GET['action']) ? "&action=" . $_GET['action'] : '')); // Disallow viewing of the page if (!$roster_login->getAuthorized()) { include_once ROSTER_BASE . 'roster_header.tpl'; include_once ROSTER_LIB . 'menu.php'; print '<span class="title_text">' . $wordings[$roster_conf['roster_lang']]['roster_config'] . '</span><br />' . $roster_login->getMessage() . $roster_login->getLoginForm(); include_once ROSTER_BASE . 'roster_footer.tpl'; exit; } // ----[ End Check log-in ]---------------------------------
} if ($addon_conf['MadeBy']['display_recipe_level'] && $recipe->data['skill_name'] != $wordings[$lang]['Enchanting'] && $recipe->data['skill_name'] != $wordings[$lang]['Mining']) { $content .= $table_cell_start . ' ' . $recipe->data['level'] . ' </td>'; } if ($addon_conf['MadeBy']['display_recipe_tooltip']) { $content .= $table_cell_start . '<table style="width:240;white-space:normal;"><tr><td>' . stripslashes($tooltip) . '</td></tr></table></td>'; } if ($addon_conf['MadeBy']['display_recipe_type']) { $content .= $table_cell_start . ' ' . $recipe->data['recipe_type'] . ' </td>'; } if ($addon_conf['MadeBy']['display_recipe_reagents']) { $content .= $table_cell_start . ' ' . str_replace('<br>', ' <br /> ', $recipe->data['reagents']) . '</td>'; } if ($addon_conf['MadeBy']['display_recipe_makers']) { $content .= $table_cell_start . ' ' . $users . ' </td>'; } $content .= '</tr>'; } $content .= '</table>' . border('syellow', 'end'); } else { $content .= $wordings[$lang]['dnotpopulatelist']; } } // config button (only show if authorized as admin) if (!is_object($roster_login)) { $roster_login = new RosterLogin($script_filename . (isset($_GET['action']) ? "&action=" . $_GET['action'] : '')); } if ($roster_login->getAuthorized()) { $content .= '<br /><br /><br />' . border('sblue', 'start') . make_link('', " {$wordings[$lang]['MadeBy_Configure_txt']} ", array('action' => 'config')) . border('sblue', 'end'); } $content .= '<br /><br /><br />' . MADEBY_VERSION;
function logoutPage() { global $roster, $addon, $accounts; $roster_login = new RosterLogin(); $roster_login->logOut(); }
* LICENSE: Licensed under the Creative Commons * "Attribution-NonCommercial-ShareAlike 2.5" license * * @copyright 2006-2007 PoloDude * @license http://creativecommons.org/licenses/by-nc-sa/2.5 Creative Commons "Attribution-NonCommercial-ShareAlike 2.5" * @version 1.2.1 * @svn SVN: $Id$ * @author PoloDude * @link http://www.wowroster.net/Forums/viewforum/f=55.html * */ if (!defined('ROSTER_INSTALLED')) { exit('Detected invalid access to this file!'); } // ----[ Check log-in ]------------------------------------- $roster_login = new RosterLogin($script_filename . "&display=admin"); $action = $_REQUEST['action']; // Disallow viewing of the page if (!$roster_login->getAuthorized()) { print '<span class="title_text">RaidTracker Admin</span><br />' . $roster_login->getMessage() . $roster_login->getLoginForm(); return; } else { // Show Admin Menu echo border('syellow', 'start', $rt_wordings[$roster_conf['roster_lang']]['Admin']); echo '<table cellpadding="0" cellspacing="0" class="membersList"><tr>'; echo '<td class="membersHeader"><a href="addon.php?roster_addon_name=RaidTracker&display=admin">' . $rt_wordings[$roster_conf['roster_lang']]['Admin'] . '</a></td>'; echo '<td class="membersHeader"><a href="addon.php?roster_addon_name=RaidTracker&display=admin&action=delete">Delete Raids</a></td>'; // echo '<td class="membersHeader"><a href="addon.php?roster_addon_name=RaidTracker&display=admin&action=options">RaidTracker Options</a></td>'; echo '<td class="membersHeaderRight"><a href="addon.php?roster_addon_name=RaidTracker">Back to RaidTracker</a></td>'; echo '</tr></table>'; echo border('syellow', 'end');
function update() { global $roster, $update; $CALENDAR_TABLE = "group_calendar_info"; $ATTENDANCE_TABLE = "group_calendar_attend"; $OTHERINFO_TABLE = "group_calendar_other"; //Verifiy that SMFSync is enabled before attempting to procede. if ($this->data['config']['main_enable'] == true) { //Check to see if GroupCalendar sync is enabled and current user is authorized. $roster_login = new RosterLogin(); if ($this->data['config']['groupcal_enable'] == true && $roster_login->getAuthorized() >= $this->data['config']['groupcal_update_permission']) { /////////////////////////////////////////////////////////////////// // Original credit for this goes to Munazz of Mediocrity in Motion /////////////////////////////////////////////////////////////////// $filefield = "GroupCalendar"; if (isset($_FILES[$filefield])) { //If the file is gzipped, uncompress the file first $filename = $_FILES[$filefield]['tmp_name']; if (substr_count($_FILES[$filefield]['name'], '.gz') > 0) { // If the file is gzipped $file_as_array = gzfile($filename); } else { // The file is not gzipped $file_as_array = file($filename); } unlink($filename); //Parse the LUA file into an array //THANK YOU ZANIX!!!!! $lua_data = $update->uploadData['groupcalendar']; unset($file_as_array); $calendar_data = $this->GroupCalendarParse($lua_data, ''); unset($lua_data); $replace_chars = array("&a;", "&c;", "&s;", "&cn;", "&n;"); $substu_chars = array("&", ",", "/", ":", "\n"); if (count($calendar_data) > 0) { if ($debuging_flag) { debug_output("** Count of data array is: " . count($calendar_data) . ". Tables dumped for anticipated data entry.\n"); } //empty table to get rid of all information before reposting new events. This eliminate events that were removed in game. $query = "TRUNCATE " . $CALENDAR_TABLE; $result = $roster->db->query($query); if (!$result) { die("Failed to clear out the old data. SQL: {$query}.<b>" . mysql_error() . "</b>\n"); } $query = "TRUNCATE " . $ATTENDANCE_TABLE; $result = $roster->db->query($query); if (!$result) { die("Failed to clear out the old data. SQL: {$query}.<b>" . mysql_error() . "</b>\n"); } $query = "UPDATE " . $OTHERINFO_TABLE . " SET `value`='" . gmmktime() . "' WHERE id='upload_time'"; $result = $roster->db->query($query); if ($roster->db->affected_rows() == 0) { $query = "INSERT INTO " . $OTHERINFO_TABLE . " SET id='upload_time',`value`='" . gmmktime() . "'"; $result = $roster->db->query($query); if (!$result) { die("Failed to create the upload_time field. SQL: {$query}.<b>" . mysql_error() . "</b>\n"); } } //Dump the SMF Calendar. $sql2 = "DELETE FROM `{$this->data['config']['forum_prefix']}calendar` WHERE `title` LIKE '(GC)%' "; $roster->db->query($sql2); } else { if ($debuging_flag) { debug_output("** Count of data array is: " . count($calendar_data) . ". Tables not emptied.\n"); } } $good_adds = 0; $bad_adds = 0; $id_counter = 1; foreach (array_keys($calendar_data) as $eid) { if ($calendar_data[$eid]['MinLevel'] == "") { $calendar_data[$eid]['MinLevel'] = "NULL"; } if ($calendar_data[$eid]['MaxLevel'] == "") { $calendar_data[$eid]['MaxLevel'] = "NULL"; } if ($calendar_data[$eid]['MaxAttendance'] == "") { $calendar_data[$eid]['MaxAttendance'] = "NULL"; } $sql = "INSERT INTO " . $CALENDAR_TABLE . " SET "; $sql .= "`id`='" . $id_counter . "', "; $sql .= "`creator`='" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $calendar_data[$eid]['Creator'])) . "', "; $sql .= "`start`=FROM_UNIXTIME(" . $calendar_data[$eid]['DateTime'] . "), "; $sql .= "`title`='" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $calendar_data[$eid]['Title'])) . "', "; $sql .= "`type`='" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $calendar_data[$eid]['Type'])) . "', "; $sql .= "`description`='" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $calendar_data[$eid]['description'])) . "', "; $sql .= "`guildonly`='" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $calendar_data[$eid]['GuildOnly'])) . "', "; $sql .= "`duration`=" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $calendar_data[$eid]['Duration'])) . ", "; $sql .= "`minlevel`=" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $calendar_data[$eid]['MinLevel'])) . ", "; $sql .= "`maxlevel`=" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $calendar_data[$eid]['MaxLevel'])) . ", "; $sql .= "`maxattend`=" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $calendar_data[$eid]['MaxAttendance'])) . ", "; $NewEventTitle = '(GC)' . $calendar_data[$eid]['Title'] . ' - ' . date("g:ia", $calendar_data[$eid]['DateTime']); $EventDate = date("Y-m-d", $calendar_data[$eid]['DateTime']); $sql2 = "INSERT INTO `{$this->data['config']['forum_prefix']}calendar` SET `title` = '{$NewEventTitle}', `startDate` = '{$EventDate}', `endDate` = '{$EventDate}' "; $roster->db->query($sql2); $limitstr = ""; if (is_array($calendar_data[$eid]['Limits'])) { $tempLimits = array(); foreach (array_keys($calendar_data[$eid]['Limits']) as $k) { $v = $calendar_data[$eid]['Limits'][$k]['mMax']; if ($v > 0) { $tempLimits[ClassInt($k)] = $v; } } $tk = array_keys($tempLimits); sort($tk); foreach ($tk as $k) { $limitstr .= $k . ": " . mysql_escape_string(str_replace($replace_chars, $substu_chars, $tempLimits[$k])) . "<br />"; } } $sql .= "`limits`='" . $limitstr . "'"; if ($debuging_flag) { debug_output("{$sql}\n"); } $result = $roster->db->query($sql); if (!$result) { $bad_adds++; if ($debuging_flag) { debug_output("***FAILED to add event. <b>" . mysql_error() . "</b>\n"); } } else { $good_adds++; if (is_array($calendar_data[$eid]['Attendance'])) { foreach (array_keys($calendar_data[$eid]['Attendance']) as $i) { $v = $calendar_data[$eid]['Attendance'][$i]; if ($v['modDate'] == "") { $v['modDate'] = "1971-1-1"; } if ($v['modTime'] == "") { $v['modTime'] = "0"; } if ($v['GuildRank'] == "") { $v['GuildRank'] = "0"; } if ($v['createDate'] == "") { $v['createDate'] = $v['modDate']; } if ($v['createTime'] == "") { $v['createTime'] = $v['modTime']; } if ($v['Level'] == "") { $v['Level'] = "0"; } $sql = "INSERT INTO " . $ATTENDANCE_TABLE . " SET "; $sql .= "`eid`='" . $id_counter . "', "; $sql .= "`name`='" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $v['Name'])) . "', "; $sql .= "`modDate`='" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $v['modDate'])) . "', "; $sql .= "`modTime`='" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $v['modTime'])) . "', "; $sql .= "`status`='" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $v['Status'])) . "', "; $sql .= "`level`=" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $v['Level'])) . ", "; $sql .= "`racecode`='" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $v['RaceCode'])) . "', "; $sql .= "`classcode`='" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $v['ClassCode'])) . "', "; $sql .= "`comment`='" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $v['Comment'])) . "', "; $sql .= "`guild`='" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $v['Guild'])) . "', "; $sql .= "`guildRank`=" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $v['GuildRank'])) . ", "; $sql .= "`createDate`='" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $v['createDate'])) . "', "; $sql .= "`createTime`='" . mysql_escape_string(str_replace($replace_chars, $substu_chars, $v['createTime'])) . "'"; if ($debuging_flag) { debug_output("{$sql}\n"); } $result = $roster->db->query($sql); if (!$result) { $bad_adds++; if ($debuging_flag) { debug_output("***FAILED to add attendance. <b>" . mysql_error() . "</b>\n"); } } } } } $id_counter++; } $this->messages .= "Updated {$good_adds} Records in the Calendar \n"; } } } return true; }