예제 #1
0
}
if ($_SESSION['user'] == "jrizzle") {
    if (!empty($_REQUEST['weddingthumbs'])) {
        setInfo("weddingthumbs", $_REQUEST['weddingthumbs']);
    }
    if (!empty($_REQUEST['creativethumbs'])) {
        setInfo("creativethumbs", $_REQUEST['creativethumbs']);
    }
    if (!empty($_REQUEST['beachthumbs'])) {
        setInfo("beachthumbs", $_REQUEST['beachthumbs']);
    }
    if (!empty($_REQUEST['watermark'])) {
        setInfo("watermark", $_REQUEST['watermark']);
    }
    if (!empty($_REQUEST['contacttext'])) {
        setInfo("contact", $_REQUEST['contacttext']);
    }
    echo '<form action="admin.php" method="post" name="admin">';
    echo '<br /><table cellspacing="0" cellpadding="0" border="0" align="center">';
    echo '<tr><td>';
    echo '<table cellspacing="8" cellpadding="0" border="0" align="center">';
    echo '<tr><td colspan="2" align="center" style="font-size: 36px; font-family: Arial;">Admin</td></tr>';
    echo '<tr><td align="right">Thumbnails per page (Wedding Gallery)</td><td><input type="text" name="weddingthumbs" value="' . getInfo("weddingthumbs") . '"></td></tr>';
    echo '<tr><td align="right">Thumbnails per page (Creative Gallery)</td><td><input type="text" name="creativethumbs" value="' . getInfo("creativethumbs") . '"></td></tr>';
    echo '<tr><td align="right">Thumbnails per page (Beach Gallery)</td><td><input type="text" name="beachthumbs" value="' . getInfo("beachthumbs") . '"></td></tr>';
    echo '<tr><td align="right">Watermark Text</td><td><input type="text" name="watermark" value="' . getInfo("watermark") . '"></td></tr>';
    echo '<tr><td colspan="2" align="center">Contact Info</td></tr>';
    echo '<tr><td colspan="2" align="center"><textarea cols="40" rows="8" name="contacttext">' . getInfo("contact") . '</textarea></td></tr>';
    echo '<tr><td colspan="2" align="center"><input type="submit" value="Save Changes!"></td></tr>';
    echo '<tr><td colspan="2" align="center" style="color: #FF0000">If you want to add or delete pictures, click one of the navigation links on top.</td></tr>';
    echo '</table>';
예제 #2
0
                        $error = true;
                    }
                }
                if (!$error) {
                    $id = isUserPasswordCorrect($adminusername, $adminpassword1);
                    if (!setUserGroup($id, 'admin')) {
                        setError('Der Admin-Account konnte der Admin-Gruppe nicht zugewiesen werden!');
                        $error = true;
                    }
                }
            } catch (Exception $e) {
                setError('Fehler: ' . $e->getMessage());
                $error = true;
            }
            if (!$error) {
                setInfo('Konfiguration erstellt!');
                header("location: {$SETTINGS['url']}/");
                exit;
            } else {
                if (file_exists('settings.cfg')) {
                    unlink('settings.cfg');
                }
            }
        }
    }
}
$hostname = isset($_POST['hostname']) ? htmlspecialchars($_POST['hostname']) : '';
$database = isset($_POST['database']) ? htmlspecialchars($_POST['database']) : '';
$username = isset($_POST['username']) ? htmlspecialchars($_POST['username']) : '';
$prefix = isset($_POST['prefix']) ? htmlspecialchars($_POST['prefix']) : '';
$adminusername = isset($_POST['adminusername']) ? htmlspecialchars($_POST['adminusername']) : '';
예제 #3
0
    if ($count < 10) {
        setError('Nicht genügend Vokabeln zum trainieren!');
        unset($_SESSION['voc']);
    } else {
        $voc = getVocByTime($interval * 7);
        if ($voc === false) {
            setError('Fehler beim laden der Vokabeln!');
        } else {
            $_SESSION['voc'] = $voc;
            $vocs = getVocsByGerman($voc->german);
            if ($vocs === false) {
                setError('Fehler beim suchen!');
                unset($_SESSION['voc']);
            } else {
                if ($interval != $interval_start) {
                    setInfo("Aufgrund mangelnder Vokabeln wurde der Zeitraum auf {$interval} Wochen erhöht");
                }
                $_SESSION['vocs'] = $vocs;
            }
        }
    }
}
$table = '';
if (isset($_SESSION['voc'])) {
    $english = htmlspecialchars($_SESSION['voc']->english, 0, 'UTF-8');
    $german = htmlspecialchars($_SESSION['voc']->german, 0, 'UTF-8');
    $table = <<<EOT
<form method="post" action="{$SETTINGS['path']}/trainer">
\t<table class="trainer">
\t\t<thead>
\t\t\t<tr>
예제 #4
0
echo '</h1><h2><a href="analyze.php?u=' . $author . '"';
if (rights($author) == 'admin') {
    echo ' style="color: #CC0000;" title="' . $author . ' is an administrator."';
} elseif (rights($author) == 'moderator') {
    echo ' style="color: #00CC00;" title="' . $author . ' is a moderator."';
}
echo '>' . $author . '</a></h2>';
echo '<br /><div id="description" class="shown">' . $description;
if ($_SESSION['user'] == $author || rights($_SESSION['user']) == 'admin' || rights($_SESSION['user']) == 'moderator') {
    echo ' <a href="#"><img src="images/edit.gif" border="0" onclick="editDescription()"></a></div>';
    echo '<div id="editDescription" class="hidden"><textarea name="newDescription" class="editDescription" cols="64" rows="10">' . $editdescription . '</textarea> <a href="#"><img src="images/check.gif" border="0" onclick="document.edit.submit();"></a></div>';
}
echo '<br />&nbsp;<br />&nbsp;<br />';
if (isset($_SESSION['user'])) {
    if (checkUserInfo("viewed", $_REQUEST['id']) === false) {
        setInfo($_REQUEST['id'], "views", strval(intval(getInfo($_REQUEST['id'], "views")) + 1));
        setUserInfo("viewed", $_REQUEST['id']);
    }
}
$rating = getInfo($_REQUEST['id'], "rating");
if (empty($rating)) {
    echo '<table align="center" cellpadding="0" cellspacing="0"><tr><td style="font-weight: bold;">Track Rating:</td><td width="8"></td><td style="background: url(\'nostars.png\'); color: #FFFFFF;" width="86">Not Yet Rated</td></tr>';
    if ($_SESSION['user'] != $author && isset($_SESSION['user'])) {
        echo '<tr class="trshown" id="ratebutton"><td colspan="4" align="center"><input type="button" value="Rate It!" class="rateit" onclick="rateIt();"></td></tr>';
        echo '<tr class="hidden" id="rateline"><td colspan="4" align="center"><table cellpadding="0" cellspacing="0" border="0"><tr><td><select name="rating">';
        echo '<option>No Rating</option>';
        for ($i = 1; $i <= 5; $i++) {
            echo '<option value="' . $i . '">' . $i . ' Stars</option>';
        }
        echo '</select></td><td width="4"></td><td><a href="#"><img src="images/check.gif" border="0" onclick="document.edit.submit();"></a></td></tr></table></td></tr>';
    }
예제 #5
0
파일: users.php 프로젝트: hackyourlife/evoc
                setError('Benutzer nicht gelöscht!');
            }
        }
        header("location: {$SETTINGS['url']}/");
        exit;
    }
}
if (isset($_POST['group']) && isset($_POST['code'])) {
    $group = $_POST['group'];
    $code = $_POST['code'];
    if ($code == $_SESSION['groupcode']) {
        if ($userid == $_SESSION['userid']) {
            setError('Gruppe des eigenen Benutzers kann nicht geändert werden!');
        } else {
            if (setUserGroup($userid, $group)) {
                setInfo("Gruppe erfolgreich zugewiesen!");
            } else {
                setError("Die Gruppe konnte nicht zugewiesen werden!");
            }
        }
        header("location: {$SETTINGS['url']}/user/{$userid}");
        exit;
    }
}
$userinfo = getUserInfo($userid);
$userstats = getUserStats($userid);
$username = htmlspecialchars($userinfo->username, 0, 'UTF-8');
$lastname = htmlspecialchars($userinfo->lastname, 0, 'UTF-8');
$group = getRoleName($userinfo->group);
$correct = $userinfo->correct;
$wrong = $userinfo->wrong;
예제 #6
0
<?php

require_once 'lib/settings.php';
require_once 'lib/db.php';
require_once 'lib/users.php';
require_once 'lib/session.php';
require_once 'lib/login.php';
require_once 'lib/voc.php';
if (!connect_mysql()) {
    exit;
}
include 'lib/loginfilter.php';
secureArea('admin');
if (!isset($_GET['id'])) {
    header("location: {$SETTINGS['url']}/");
    exit;
}
$id = $_GET['id'];
if (!restoreVoc($id, $german, $english, $_SESSION['userid'])) {
    setError('Vokabel konnte nicht wiederhergetsellt werden!');
} else {
    setInfo('Vokabel erfolgreich wiederhergestellt!');
}
header("location: {$SETTINGS['url']}/");
exit;
예제 #7
0
<?php

session_start();
include "functions.php";
if ($_REQUEST['editType'] == 'title') {
    setInfo('aboutTitle', $_REQUEST['aboutTitleEdit']);
} elseif ($_REQUEST['editType'] == 'text') {
    $write = str_replace("  ", "&nbsp;&nbsp;", $_REQUEST['aboutTextEdit']);
    $write = str_replace("\r\n", "<br />", $write);
    $file = fopen("about.dat", "w");
    fwrite($file, $write);
    fclose($file);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Jared Cline Photography - About Me</title>
<?php 
include "style.php";
?>
<script type="text/javascript" language="javascript">
<!--
function editTitle() {
	document.getElementById('title').className = "hidden";
	document.getElementById('titleEdit').className = "shown";
	document.main.aboutTitleEdit.focus();
}
function editText() {
	document.getElementById('text').className = "hidden";
예제 #8
0
        }
    }
    header("location: {$SETTINGS['url']}/settings");
    exit;
}
if (isset($_POST['password']) && isset($_POST['password2'])) {
    $password = $_POST['password'];
    $password2 = $_POST['password2'];
    if (strlen(trim($password)) < 5) {
        setError('Passwort zu kurz!');
    } else {
        if ($password != $password2) {
            setError('Du hast das Passwort nicht richtig wiederholt!');
        } else {
            if (setPassword($_SESSION['userid'], $password)) {
                setInfo('Passwort gespeichert!');
            } else {
                setError('Fehler beim speichern des Passwortes!');
            }
        }
    }
    header("location: {$SETTINGS['url']}/settings");
    exit;
}
$TITLE = 'Einstellungen';
$CONTENT = <<<EOT
<h2>Einstellungen</h2>

<div class="settingsbox">
\t<form method="post" action="{$SETTINGS['path']}/settings">
\t\t<label for="lastname">Nachname:</label>
예제 #9
0
파일: add.php 프로젝트: hackyourlife/evoc
if (!connect_mysql()) {
    exit;
}
include 'lib/loginfilter.php';
include 'lib/navbar.php';
secureArea('user');
if (isset($_POST['add']) && isset($_POST['german']) && isset($_POST['english'])) {
    $german = trim($_POST['german']);
    $english = trim($_POST['english']);
    if (strlen($german) == 0 && strlen($english) == 0) {
        setError('Du musst das Formular schon ausfüllen!');
    } else {
        if (!addVoc($german, $english, $_SESSION['userid'])) {
            setError('Fehler beim hinzufügen!');
        } else {
            setInfo('Vokabel wurde hinzugefügt!');
            header("location: {$SETTINGS['url']}/add");
            exit;
        }
    }
}
$TITLE = 'Vokabel eintragen';
$CONTENT = <<<EOT
<h2>Vokabel hinzuf&uuml;gen</h2>
<form method="post" action="{$SETTINGS['path']}/add">
\t<table class="add">
\t\t<thead>
\t\t\t<tr>
\t\t\t\t<th>Englisch</th>
\t\t\t\t<th>Deutsch</th>
\t\t\t</tr>
예제 #10
0
<?php

require_once 'lib/settings.php';
require_once 'lib/db.php';
require_once 'lib/users.php';
require_once 'lib/session.php';
require_once 'lib/login.php';
require_once 'lib/navbar.php';
if (!$SETTINGS['allow_register']) {
    setError('Die Registrierung von neuen Accounts wurde deaktiviert!');
    header("location: {$SETTINGS['url']}/");
    exit;
}
if (isLoggedIn()) {
    setInfo('Du bist bereits eingeloggt!');
    header("location: {$SETTINGS['url']}/");
    exit;
}
if (!connect_mysql()) {
    exit;
}
if (isset($_POST['register']) && isset($_POST['username']) && isset($_POST['password1']) && isset($_POST['password2']) && isset($_POST['lastname'])) {
    $username = trim($_POST['username']);
    $password1 = $_POST['password1'];
    $password2 = $_POST['password2'];
    $lastname = trim($_POST['lastname']);
    if (strlen($username) < 3) {
        setError('Dein Benuztername ist zu kurz!');
    } else {
        if (strlen($password1) < 5) {
            setError('Dein Passwort ist zu kurz!');
예제 #11
0
파일: del.php 프로젝트: hackyourlife/evoc
<?php

require_once 'lib/settings.php';
require_once 'lib/db.php';
require_once 'lib/users.php';
require_once 'lib/session.php';
require_once 'lib/login.php';
require_once 'lib/voc.php';
if (!connect_mysql()) {
    exit;
}
include 'lib/loginfilter.php';
secureArea('user');
if (!isset($_GET['id'])) {
    header("location: {$SETTINGS['url']}/");
    exit;
}
$id = $_GET['id'];
if (!delVoc($id, $german, $english, $_SESSION['userid'])) {
    setError('Fehler beim löschen!');
} else {
    setInfo('Vokabel erfolgreich gelöscht!');
}
header("location: {$SETTINGS['url']}/");
exit;
예제 #12
0
    mergeTracks($_SESSION['user'], $ids);
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename="savedLines.sol"');
    header('Content-Transfer-Encoding: binary');
    header('Content-Length: ' . filesize("tracks/managers/" . $_SESSION['user'] . ".sol"));
    readfile("tracks/managers/" . $_SESSION['user'] . ".sol");
    exit;
}
if ($_REQUEST['rename'] == 'yes') {
    $newmanager = '';
    $file = fopen("tracks/managers/" . $_SESSION['user'] . ".manager", "r");
    $tracks = fread($file, filesize("tracks/managers/" . $_SESSION['user'] . ".manager"));
    fclose($file);
    $tracks = explode("\r\n", $tracks);
    for ($i = 0; $i < count($tracks) - 1; $i++) {
        setInfo($tracks[$i], "label", $_REQUEST['rename' . $tracks[$i]]);
    }
}
if ($_REQUEST['purge'] == true) {
    //Purge missing tracks
    $newmanager = '';
    $file = fopen("tracks/managers/" . $_SESSION['user'] . ".manager", "r");
    $tracks = fread($file, filesize("tracks/managers/" . $_SESSION['user'] . ".manager"));
    fclose($file);
    $tracks = explode("\r\n", $tracks);
    for ($i = 0; $i < count($tracks) - 1; $i++) {
        if (file_exists("tracks/" . $tracks[$i] . ".track")) {
            $newmanager .= $tracks[$i] . "\r\n";
        }
    }
    $file = fopen("tracks/managers/" . $_SESSION['user'] . ".manager", "w");
예제 #13
0
if (!isset($_SESSION['statsorder'])) {
    $_SESSION['statsorder'] = $_SESSION['userinfo']->statsorder;
}
$orderby = $_SESSION['statsorder'];
if (isset($_REQUEST['o'])) {
    $allowed = array('total' => true, 'ratio' => true, 'username' => true, 'correct' => true, 'wrong' => true);
    if (isset($allowed[$_REQUEST['o']])) {
        $orderby = $_REQUEST['o'];
    } else {
        header('location: /statistics');
        exit;
    }
    if ($_SESSION['statsorder'] != $orderby) {
        $_SESSION['statsorder'] = $orderby;
        if (setStatisticsOrder($_SESSION['userid'], $orderby)) {
            setInfo('Sortierreihenfolge wurde gespeichert!');
        } else {
            setError('Fehler beim speichern der Sortierreihenfolge!');
        }
        header("location: {$SETTINGS['url']}/statistics");
        exit;
    }
}
$stats = getStatistics($orderby);
if ($stats === false) {
    setError('Fehler beim laden der Statistik!');
}
$tablebody = '';
foreach ($stats as $user) {
    $username = htmlspecialchars($user->username, 0, 'UTF-8');
    $lastname = htmlspecialchars($user->lastname, 0, 'UTF-8');