本文整理汇总了PHP中user_has_access函数的典型用法代码示例。如果您正苦于以下问题:PHP user_has_access函数的具体用法?PHP user_has_access怎么用?PHP user_has_access使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_has_access函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: call_news_text
function call_news_text()
{
global $go, $tribeid, $tool;
include_once('inc/functions/resort_tools.php');
if (! user_has_access($tool))
{
echo "Sorry, this page is restricted to ORKFiA Staff";
include_game_down();
exit;
}
IF($tribeid && $go =="yes") {
$result = mysql_query("SELECT time,text from news WHERE duser = $tribeid ORDER BY time DESC") or die(mysql_error());
echo "<table cellspacing=0 cellpadding=0 width=80% class=\"border\">";
echo "<tr><td colspan=2 class=\"pd bold dark black bdown\" align=center>";
echo "The Headlines</td></tr>";
while ($newsloop =(mysql_fetch_array($result))) {
echo "<tr><td class=\"pd 11\">";
echo "$newsloop[time]</td><td class=\"pd 11\">$newsloop[text]</td></tr>";
}
echo "</table>";
}
echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
ECHO "Input user id:<input type=text size=20 name=tribeid>";
ECHO "<input type=hidden name=go value=yes>";
ECHO "<br><input type=submit value=\"show me\"></form>";
}
示例2: call_admin_switches_text
function call_admin_switches_text()
{
global $tool;
include_once 'inc/functions/resort_tools.php';
if (!user_has_access($tool)) {
echo "Sorry, this page is restricted to ORKFiA Staff";
include_game_down();
exit;
}
include_once 'inc/classes/clsGame.php';
$objGame = new clsGame();
if (isset($_POST[ON])) {
$strTool = $_POST['tool'];
$objGame->set_game_switch($strTool, ON);
echo '<p>' . "Switch '{$strTool}' is now turned on." . '<br /><br />' . '<a href="main.php?cat=game&page=resort_tools&' . 'tool=admin_switches">' . 'Return to Tool' . '</a>' . '</p>';
} elseif (isset($_POST[OFF])) {
$strTool = $_POST['tool'];
$objGame->set_game_switch($strTool, OFF);
echo '<p>' . "Switch '{$strTool}' is now turned off." . '<br /><br />' . '<a href="main.php?cat=game&page=resort_tools&' . 'tool=admin_switches">' . 'Return to Tool' . '</a>' . '</p>';
} else {
$strDiv = '<h2>' . 'Admin Switches' . '</h2>';
$arrGameSwitches = $objGame->get_game_switches();
foreach ($arrGameSwitches as $strName => $strValue) {
switch ($strValue) {
case ON:
$strDiv .= '<form method="post" action="main.php?cat=game&page=' . 'resort_tools&tool=admin_switches"><p><b class="positive">' . $strName . ' is ON. <br />' . '<input type="hidden" name="tool" value="' . $strName . '">' . '<input type="submit" name="' . OFF . '" value="Switch OFF ' . $strName . '">' . '</b></p></form>';
break;
case OFF:
$strDiv .= '<form method="post" action="main.php?cat=game&page=' . 'resort_tools&tool=admin_switches"><p><b class="negative">' . $strName . ' is OFF. <br />' . '<input type="hidden" name="tool" value="' . $strName . '">' . '<input type="submit" name="' . ON . '" value="Switch ON ' . $strName . '">' . '</b></p></form>';
break;
}
}
echo $strDiv;
}
}
示例3: call_eldervotes_text
function call_eldervotes_text()
{
global $tool;
include_once 'inc/functions/resort_tools.php';
if (!user_has_access($tool)) {
echo "Sorry, this page is restricted to ORKFiA Staff";
include_game_down();
exit;
}
$go = '';
$reset_id = 0;
if (isset($_POST['go']) && !empty($_POST['go'])) {
$go = $_POST['go'];
}
if (isset($_POST['reset_id']) && !empty($_POST['reset_id'])) {
$reset_id = intval($_POST['reset_id']);
}
if ($go != "sure" && $go != "yes") {
echo $strResetForm = '<h2>Reset elder votes of an alliance</h2>' . '<form method="post" action="main.php?cat=game&page=resort_tools&tool=eldervotes">' . '<label for="alli_id">Alliance #</label>: ' . '<input type="text" size="5" name="reset_id" id="alli_id" />' . '<input type="hidden" name="go" value="sure" /> ' . '<input type="submit" value="Check alliance" />' . '</form>';
}
if ($reset_id > 0 && $go == 'sure') {
$name = @mysql_query("SELECT id, name FROM " . TBL_ALLIANCE . " WHERE id = {$reset_id}");
$name = mysql_fetch_array($name);
echo $strResetForm2 = '<h2>Reset elder votes of an alliance</h2>' . '<h3>Confirm alliance</h3>' . '<p>' . stripslashes($name[NAME]) . ' (#' . $name[ID] . ')</p>' . '<form method="post" action="main.php?cat=game&page=resort_tools&tool=eldervotes">' . '<input type="hidden" name="go" value="yes" />' . '<input type="hidden" name="reset_id" value="' . $reset_id . '" /> ' . '<input type="submit" value="Reset elder votes">' . '</form>';
}
if ($reset_id && $go == "yes") {
echo '<h2>Reset elder votes of an alliance</h2>';
// Reset votes (an automatic routine will remove it from alliance #0)
mysql_query("UPDATE " . TBL_STAT . " SET " . VOTE . " = 0 WHERE " . ALLIANCE . " = {$reset_id}") or die('There was an error with the query.');
echo "<p><strong>Reset successful!</strong> - Alliance #{$reset_id} has had their elder vote reset.</p>";
}
}
示例4: call_tribename_text
function call_tribename_text(){
global $id,$confirm,$Aname,$tool;
include_once('inc/functions/resort_tools.php');
if (! user_has_access($tool))
{
echo "Sorry, this page is restricted to ORKFiA Staff";
include_game_down();
exit;
}
echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
ECHO "Input ID#: <input name=id size=5><br>";
ECHO "Change Name to: <input type=text name=Aname maxlength=30 size=25><br>";
ECHO "<input type=submit value=Save name=confirm>";
ECHO "</form>";
ECHO "<br><br>";
IF($confirm && $id && $Aname)
{
$Aname = quote_smart(strip_tags(trim($Aname)));
$check = mysql_query("SELECT * FROM stats WHERE tribe = $Aname AND id != $id");
if(mysql_num_rows($check) != 0){
echo "that name is already in use";
} else {
$result = mysql_query("UPDATE stats SET tribe = $Aname where id = $id");
$result = mysql_query("UPDATE ranking_write SET tribe_name = $Aname where id = $id");
ECHO "Done =)";
}
}
}
示例5: call_tribe_activities_text
function call_tribe_activities_text(){
global $go, $tribe_id,$tool;
include_once('inc/functions/resort_tools.php');
if (! user_has_access($tool))
{
echo "Sorry, this page is restricted to ORKFiA Staff";
include_game_down();
exit;
}
IF($tribe_id && $go =="yes") {
$result = mysql_query("Select * from news where ouser=$tribe_id");
$tribe = array();
while ($arrtribe = mysql_fetch_array ($result, MYSQL_ASSOC)) {
$tribe[$arrtribe["id"]] = $arrtribe;
}
ECHO "<table border=1 width=66%>";
ECHO "<tr><td colspan=4 align=center><b>Tribe Activity tracking on $tribe_id</b></td></tr>";
ECHO "<tr><td><b> Time </b></td><td><b> Type </b></td><td><b> Target </b></td><td><b> Text </b></td><td><b> ip </b></td></tr>";
foreach($tribe as $strKey => $value) {
$stats = mysql_query("SELECT * from stats where id = $value[duser]");
$stats = mysql_fetch_array($stats);
ECHO "<tr><td> $value[time] </td><td> $value[type] </td><td> $stats[tribe](#".$stats[kingdom].")<br>id = $value[duser] </td><td> $value[text]</td><td> $value[ip]</td></tr>";
}
ECHO "</table>";
}
echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
ECHO "Input user id to attain activites:<input type=text size=4 name=tribe_id>";
ECHO "<input type=hidden name=go value=yes>";
ECHO "<br><input type=submit value=\"show me\"></form>";
}
示例6: call_suspension_text
function call_suspension_text()
{
global $tool;
include_once 'inc/functions/resort_tools.php';
if (!user_has_access($tool)) {
echo "Sorry, this page is restricted to ORKFiA Staff";
include_game_down();
exit;
}
echo $strHeader = '<h2>L&O: Player Suspension (aka Forced Vacation Mode)</h2>';
echo $strForm = '<form method="post" action="' . $_SERVER['REQUEST_URI'] . '">' . 'User-id: ' . '<input type="text" size="11" name="suspend_id">' . '<br />' . 'Updates: ' . '<select name="suspend_updates">' . '<option>12</option>' . '<option>24</option>' . '<option selected>48</option>' . '</select>' . '<br /><br />' . '<input type="submit" value="Suspend Tribe!">' . '</form>' . '<br /><br />';
if (isset($_POST['suspend_id']) && $_POST['suspend_id'] > 1) {
include_once 'inc/classes/clsUser.php';
$objTmpUser = new clsUser($_POST['suspend_id']);
// Pause Account Routines. Martel July 13, 2006
$arrSrcUser = $objTmpUser->get_user_infos();
if ($arrSrcUser[NEXT_ATTACK] <= 1) {
$arrSrcUser[NEXT_ATTACK] = 1;
}
$arrNewSrcUser = array(NEXT_ATTACK => $arrSrcUser[NEXT_ATTACK], PAUSE_ACCOUNT => $_POST['suspend_updates']);
$objTmpUser->set_user_infos($arrNewSrcUser);
// Empty Magic and Thievery Points
$objTmpUser->set_spell(POWER, 0);
$objTmpUser->set_thievery(CREDITS, 0);
// Forced Ranking Update
include_once 'inc/functions/update_ranking.php';
doUpdateRankings($objTmpUser, 'yes');
echo stripslashes($objTmpUser->get_stat(TRIBE)) . " will be paused for " . $_POST['suspend_updates'] . " updates. Don't forget to send a notice.";
echo '<div id="textSmall">' . '<p><b>' . 'Standard notice to copy+paste:' . '</b></p>' . '<p>' . 'Your account has been suspended by the Law & Order Resort (found in alliance #2), you will not recieve updates, or be able to interact with the game, this may be because of a Code of Conduct violation or for some other action. Usually a staff member will contact you, if they have not, it is highly advised that you contact them, especially if you are not guilty of what you have been suspended for.' . '</p>' . '</div>';
}
}
示例7: call_fix_alliances_text
function call_fix_alliances_text()
{
global $sure, $orkTime, $tool;
include_once 'inc/functions/resort_tools.php';
if (!user_has_access($tool)) {
echo "Sorry, this page is restricted to ORKFiA Staff";
include_game_down();
exit;
}
// This query find alliances that lack a kingdom table
$query1 = "SELECT stats.kingdom AS id FROM stats GROUP BY kingdom HAVING id NOT IN (SELECT kingdom.id AS id FROM kingdom)";
$query1 = mysql_query($query1);
$amount1 = mysql_num_rows($query1);
if (isset($_POST['sure'])) {
// Perform post-action
$i = 0;
while ($resIds = mysql_fetch_array($query1)) {
if ($resIds[id] != '0') {
mysql_query("REPLACE INTO " . TBL_ALLIANCE . " SET ID={$resIds['id']}") or die("alliance table");
mysql_query("REPLACE INTO " . TBL_RANKINGS_ALLIANCE . " SET ID={$resIds['id']}") or die("alliance_rankings table");
mysql_query("REPLACE INTO " . TBL_WAR . " SET ID={$resIds['id']}") or die("war table");
$i++;
} else {
echo "(alliance #0 cannot be created - instead visit tribe page to remedy this)";
}
}
echo "{$i} DONE";
} else {
echo "<form method=\"post\" action=\"" . $_SERVER['REQUEST_URI'] . "\">";
echo "Missing: " . $amount1 . " tables";
echo "<br>Add tables for these alliances? (alliance, rankings_aliance & war): <input type='checkbox' name='sure'>";
echo "<br><input type=submit value=Insert></form>";
}
}
示例8: call_banner_text
function call_banner_text(){
global $local_stats, $id, $confirm, $tool;
include_once('inc/functions/resort_tools.php');
if (! user_has_access($tool))
{
echo "Sorry, this page is restricted to ORKFiA Staff";
include_game_down();
exit;
}
IF($confirm && $id){
IF($id == 1)
{
ECHO "ohhhh you dont want to do that, trust me $local_stats[name] =P";
}else {
ECHO "Alliance #$id has had its banner removed!";
$result = mysql_query("UPDATE kingdom SET image = '' where id = $id");
}
}
echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
ECHO "Input alliance #: <input name=id size=5><br>";
ECHO "<input type=submit value=Remove_banner name=confirm>";
ECHO "</form>";
ECHO "<br><br>";
}
示例9: call_mail_to_user_text
function call_mail_to_user_text(){
global $tool;
include_once('inc/functions/resort_tools.php');
if (! user_has_access($tool))
{
echo "Sorry, this page is restricted to ORKFiA Staff";
include_game_down();
exit;
}
$id = $_POST['id'];
$email = $_POST['email'];
$message = $_POST['message'];
$subject = $_POST['subject'];
IF ($subject && $message && $email) {
mail("$email","$subject","$message \n\n\nThis email is php generated, you cannot successfully reply." , "From: admins@orkfia.org");
ECHO "<b><i>sent</b></i><br>";
} else if($subject && $message && $id) {
$seek = mysql_query("Select * from preferences where id = $id");
$seek = mysql_fetch_array($seek);
mail("$seek[email]","$subject","$message \n\n\nThis email is php generated, you cannot successfully reply." , "From: admins@orkfia.org");
ECHO "<b><i>sent to $seek[email]</b></i><br>";
}
ECHO "<br><br><b>Only 1 address or id at a time....</b><br> Resort heads, this is not overly for your use, but in emergencies or when you really need to mail a user, you can use this, instead of your actual email addys, it does go without saying, if there is any abuse at all, it will no longer be availible.<br><br>";
echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
ECHO "Email: <input name=email size=40> OR ID: <input name=id size=5>";
ECHO "<br><br>Subject: <input name=subject size=40><br>";
ECHO "<br>Message: <br> <textarea rows=7 cols=50 wrap=on name=message></textarea><br>";
ECHO "<input type=submit value=Send name=confirm>";
ECHO "</form>";
}
示例10: call_namechanges_text
function call_namechanges_text()
{
global $enable,$disable, $tool;
include_once('inc/functions/resort_tools.php');
if (! user_has_access($tool))
{
echo "Sorry, this page is restricted to ORKFiA Staff";
include_game_down();
exit;
}
IF (!$enable && !$disable) {
$namechanges = mysql_query("SELECT names FROM admin_switches");
$namechanges = mysql_fetch_array($namechanges);
if ($namechanges['names'] == "on") {
$value = "disable";
} else {
$value = "enable";
}
echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
ECHO "<input type=submit value=$value name=$value></form>";
}
IF($enable) {
mysql_query("UPDATE admin_switches SET names = 'on'");
ECHO "The name changes tool has been activated.";
}
IF($disable) {
mysql_query("UPDATE admin_switches SET names = 'off'");
ECHO "The name changes tool is turned off now.";
}
}
示例11: call_pausemode_text
function call_pausemode_text()
{
global $tool;
include_once('inc/functions/resort_tools.php');
if (! user_has_access($tool))
{
echo "Sorry, this page is restricted to ORKFiA Staff";
include_game_down();
exit;
}
$res = mysql_query("SELECT PauseModeActive FROM admin_switches");
$line = mysql_fetch_assoc($res);
echo "Pause-mode is currently: " . $line["PauseModeActive"] . "<BR>";
echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
?>
<INPUT type="submit" value="Enable Pause-mode" name="enable">
</FORM>
<? echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">"; ?>
<INPUT type="submit" value="Disable Pause-mode" name="disable">
</FORM>
<?
if ($enable)
{
mysql_query("UPDATE admin_switches SET PauseModeActive = 'on'");
echo "Pause-mode enabled!";
}
if ($disable)
{
mysql_query("UPDATE admin_switches SET PauseModeActive = 'off'");
echo "Pause-mode disabled!";
}
}
示例12: call_checkinfo2_text
function call_checkinfo2_text()
{
global $tool;
include_once 'inc/functions/resort_tools.php';
if (!user_has_access($tool)) {
echo "Sorry, this page is restricted to ORKFiA Staff";
include_game_down();
exit;
}
echo $strDiv = '<h2>' . 'Check User(s) Registration Info' . '</h2>' . '<p>' . 'Enter one or several user-ids, separate each by a space and ' . '<br />they will be listed if they exist in the database. Staff excluded.' . '</p>';
echo $strForm = '<form method="post" action="main.php?cat=game&page=resort_tools&tool=' . $tool . '">' . '<input type="text" size="60" name="user_ids" value="' . $_POST['user_ids'] . '" />' . '<br /><br />' . '<input type="submit" value="List User(s)" />' . '<br /><br />' . '</form>';
if (isset($_POST['user_ids']) && trim($_POST['user_ids']) != '') {
echo $strTable = '<table class="big" cellspacing="0" cellpadding="0">' . '<tr class="header">' . '<th colspan="12">' . 'Check User Info' . '</th>' . '</tr>' . '<tr class="subheader">' . '<th>' . "ID" . '</th>' . '<th>' . "Name" . '</th>' . '<th>' . "From" . '</th>' . '<th>' . "E-mail" . '</th>' . '<th>' . "Login" . '</th>' . '<th>' . "Alias" . '</th>' . '<th>' . "Tribe" . '</th>' . '<th>' . "Alli#" . '</th>' . '<th>' . "Logins" . '</th>' . '<th>' . "TWG" . '</th>' . '<th>' . "RPs" . '</th>' . '</tr>';
$strUserIds = trim($_POST['user_ids']);
$arrUserIds = explode(" ", $strUserIds);
foreach ($arrUserIds as $iUserId) {
$iUserId = intval($iUserId);
$strSQL = "SELECT * " . "FROM user, stats, preferences " . "WHERE user.id = {$iUserId} " . "AND user.id = stats.id " . "AND user.id = preferences.id " . "AND stats.kingdom > 10";
$result = mysql_query($strSQL) or die("query error");
while ($value = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo $strTableTr = '<tr class="data">' . '<th>' . $value['id'] . '</th>' . '<td class="left">' . stripslashes($value['realname']) . '</td>' . '<td class="left">' . $value['country'] . '</td>' . '<td class="left">' . $value['email'] . '</td>' . '<td class="left">' . stripslashes($value['username']) . '</td>' . '<td class="left">' . stripslashes($value['name']) . '</td>' . '<td class="left">' . stripslashes($value['tribe']) . '</td>' . '<td>' . $value['kingdom'] . '</td>' . '<td>' . $value['logins'] . '</td>' . '<td>' . $value['twg_vote'] . '</td>' . '<td>' . $value['invested'] . '</td>' . '</tr>';
}
}
echo "</table>";
echo "<p>(TWG = Last week a tribe voted, 0 by default)</p>";
}
}
示例13: call_mergehistory_text
function call_mergehistory_text(){
global $go, $id, $tool;
include_once('inc/functions/resort_tools.php');
if (! user_has_access($tool))
{
echo "Sorry, this page is restricted to ORKFiA Staff";
include_game_down();
exit;
}
IF($id && $go =="yes")
{
$fetch = mysql_query("SELECT * FROM mergers WHERE request_status = 'done' AND tribe = '$id' order by merge_time desc");
$mergers = array();
while ($arrmergers = mysql_fetch_array ($fetch, MYSQL_ASSOC))
{
$mergers[$arrmergers["id"]] = $arrmergers;
}
ECHO "<br><br><table border=0 cellspacing=0 cellpadding=0 width=75% class='border'>";
ECHO "<tr><td colspan=5 align=center class='pd black bold dark bdown'><b>Done Mergers</b></td></tr>";
ECHO "<tr><td class='pd black bold darker bdown'>Merge Time</td><td class='pd black bold darker bdown'>Tribe ID</td><td class='pd black bold darker bdown'>Old Location</td><td class='pd black bold darker bdown'>New Location</td></tr>";
foreach($mergers as $strKey => $value)
{
ECHO "<tr><td class='pd bdown'> $value[merge_time] </td><td class='pd bdown'> $value[tribe] </td><td class='pd bdown'> $value[oldname] (#$value[origin]) </td><td class='pd bdown'> $value[newname] (#$value[target]) </td></tr>";
}
ECHO "</table>";
}
echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
ECHO "Input user id to attain merge history (if there is any):<input type=text size=20 name=id>";
ECHO "<input type=hidden name=go value=yes>";
ECHO "<br><input type=submit value=\"Show me\"></form>";
}
示例14: call_authcode_text
function call_authcode_text()
{
global $id,$confirm,$Aname,$tool;
include_once('inc/functions/resort_tools.php');
if (! user_has_access($tool))
{
echo "Sorry, this page is restricted to ORKFiA Staff";
include_game_down();
exit;
}
ECHO "<p>Just enter verified to stop the auth request, or to require them to read their new email use something random.</p>";
echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
ECHO "Input ID#: <input name=id size=5><br>";
ECHO "Change authcode to: <input type=text name=Aname maxlength=30 size=25><br>";
ECHO "<input type=submit value=Send name=confirm>";
ECHO "</form>";
ECHO "<br><br>";
IF($confirm && $id && $Aname)
{
$result = mysql_query("UPDATE preferences SET email_activation = '$Aname' where id = $id");
$result = mysql_query ("SELECT * FROM preferences WHERE id = $id");
$check =mysql_fetch_array($result);
ECHO "<p>Activation code changed to: $Aname . Email sent to $check[email]</p>";
mail("$check[email]","ORKFiA Activation","Welcome to ORKFiA =) \n\nHere is your activation code: $Aname \n\n\nIt is recommended you tend to your tribe at least once per day. If you require help or this is your first time playing ORKFiA, you may find the forums and the manual useful.\n\nWe hope you enjoy this age in ORKFiA =)\n\n- The ORKFiA Team\n\n\nThis email is php generated, you cannot successfully reply." , "From: Admins@orkfia.net");
}
}
示例15: call_userpw_text
function call_userpw_text()
{
global $id, $confirm, $level, $tool;
include_once('inc/functions/resort_tools.php');
if (! user_has_access($tool))
{
echo "Sorry, this page is restricted to ORKFiA Staff";
include_game_down();
exit;
}
echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
ECHO "Input user id: <input name=id size=5><br>";
ECHO "<br><br>This function will randomize a new password and send it by mail.";
ECHO "<br><br>";
ECHO "<input type=submit value=Save name=confirm>";
ECHO "</form>";
IF($confirm && $id)
{
$objUser = new clsUser ($id);
$email = $objUser->get_preference(EMAIL);
$password = generatePassword();
$cpassword = $password;
mysql_query("UPDATE user SET password = sha1('$cpassword') WHERE id = $id");
$username = $objUser->get_user_info(USERNAME);
mail("$email","ORKFiA New Password","Hello, \nYour password has been updated with a new one =) \n\nUsername: $username \nPassword: $password \n\n- The ORKFiA Team\n\n\nThis email is php generated, you cannot successfully reply." , "From: registration@orkfia.org\r\nX-Mailer: PHP/4.3.0\r\nX-Priority: Normal");
echo "User " . $id . " will have a new pw sent within minutes to: " . $email;
}
}