コード例 #1
0
 protected function _initialize()
 {
     adminCheck('news');
 }
コード例 #2
0
ファイル: clean.php プロジェクト: ranok/wiki-wide-web
<?php

include '../lib/classes.class.php';
include '../lib/misc.inc.php';
adminCheck();
$db = new DB();
$db->query("SET NAMES utf8");
$toremove = array();
$db->query("SELECT * FROM diff;");
while ($row = $db->fetchRow()) {
    if ($row[4] == entityScrub($row[3])) {
        $toremove[] = $row[0];
    }
}
for ($i = 0; $i < count($toremove); $i++) {
    $db->query("DELETE FROM diff WHERE did = '{$toremove[$i]}';");
}
$db->query("OPTIMIZE TABLE `diff`;");
$db->close();
header('Location: index.php');
die;
コード例 #3
0
ファイル: approve.php プロジェクト: bigSiebs/assignment10
<?php

include '../top.php';
print "<article>";
if (!adminCheck($thisDatabaseReader, $username)) {
    print '<section class="panel alert-panel">';
    print "<h4>Sorry.</h4>";
    print "<p>You don't have access to this page.</p>";
    print '</section>';
} else {
    print "<h2>Unapproved Activities</h2>";
    if (isset($_GET['activity'])) {
        $activityID = (int) $_GET['activity'];
        $check = " SELECT pmkActivityId";
        $check .= " FROM tblActivities";
        $check .= " WHERE fldApproved = ?";
        $checkData = array(0);
        // Call select method
        $unapproved = $thisDatabaseReader->select($check, $checkData, 1, 0, 0, 0, false, false);
        $validID = false;
        foreach ($unapproved as $record) {
            if ($record['pmkActivityId'] == $activityID) {
                $validID = true;
            }
        }
        if ($validID) {
            $update = " UPDATE tblActivities SET";
            $update .= " fldApproved = ?";
            $update .= " WHERE pmkActivityId = ?";
            $updateData = array(1, $activityID);
            $updated = $thisDatabaseWriter->update($update, $updateData, 1, 0, 0, 0, false, false);
コード例 #4
0
<?php

/**
 * Created by PhpStorm.
 * User: radim_000
 * Date: 1. 7. 2015
 * Time: 17:46
 */
include_once "../functions/check.php";
include_once "../functions/admin.php";
include_once "../functions/functions.php";
include_once "../functions/dbconnect.php";
adminCheck($_COOKIE['MTU'], $mysqli);
include_once "../functions/ages.php";
include_once "../functions/quests.php";
include_once "../functions/player.php";
if (!isset($_GET["completed"])) {
    echo "Neplatny vstup";
    exit;
} else {
    $completed = clean($_GET["completed"], $mysqli);
}
foreach (completedInfo($completed, $mysqli) as $single) {
    $qId = $single["questId"];
    $uId = $single["playerId"];
    $status = $single["status"];
    $x = $single["coordinateX"];
    $y = $single["coordinateY"];
    $z = $single["coordinateZ"];
    if ($single["timeChecked"] == "" || isset($single["timeChecked"])) {
        $already = 1;
コード例 #5
0
 protected function _initialize()
 {
     adminCheck('category');
 }
コード例 #6
0
 protected function _initialize()
 {
     adminCheck('superadmin');
 }
コード例 #7
0
ファイル: helper_functions.php プロジェクト: R-J/vanilla
 /**
  * Render options that the user has for this discussion.
  */
 function writeOptions($Discussion)
 {
     if (!Gdn::session()->isValid() || !Gdn::controller()->ShowOptions) {
         return;
     }
     echo '<span class="Options">';
     // Options list.
     echo optionsList($Discussion);
     // Bookmark button.
     echo bookmarkButton($Discussion);
     // Admin check.
     echo adminCheck($Discussion);
     echo '</span>';
 }