Example #1
0
    // clean table
    $sql = "truncate table test";
    mysql_query($sql);
    // fill with data
    for ($i = 0; $i < $PARAMETERS['BIProblemSize']; $i++) {
        $sql = "insert into test ( value ) values ( " . rand(0, 1024) . " )";
        mysql_query($sql);
    }
}
function measurement_reading($PARAMETERS)
{
    $sql = "select * from test limit 1, " . $PARAMETERS['BIProblemSize'];
    mysql_query($sql);
}
if ($PARAMETERS = grepArgv($argv, $argc)) {
    if ($t = initDBConnection($PARAMETERS)) {
        switch ($PARAMETERS['BIMode']) {
            case 'overhead':
                // run the overhead measurement only
                break;
            case 'init':
                // run the initialisation routine
                measurement_init($PARAMETERS);
                break;
            case 'read':
                // run the readspeed benchmark
                measurement_reading($PARAMETERS);
                break;
            default:
                echo "Invalid measurementmode supplied\n";
                break;
Example #2
0
 */
/*
This file is part of Banbury.

Banbury is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License.

Banbury is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
# set_include_path('../php'); // Das machen wir erst wenn wir fertig sind ...
require '../php/Includes.php';
require '../php/Functions.php';
initDBConnection();
## Startet eine Session
session_start();
$PendingUsers = DBQ("SELECT Nickname,Mail,Time FROM " . DBTabKeys);
$PendingUsersTable = QueryToTable($PendingUsers);
$RegisteredUsers = DBQ("SELECT ID,Nickname,Anmeldung,Mail FROM " . DBTabUsers);
$RegisteredUsersTable = QueryToTable($RegisteredUsers);
echo "Pending Users (" . count($PendingUsers) . ")";
echo $PendingUsersTable;
echo "Registered Users";
echo "(" . count($RegisteredUsers) . ")";
echo $RegisteredUsersTable;
Example #3
0
function resetAdmin()
{
    $fehler = "";
    $username = $_POST["username"];
    $kennwort1 = $_POST["kennwort1"];
    $kennwort2 = $_POST["kennwort2"];
    $email = $_POST["email"];
    $result = false;
    if (eregi("^[a-z0-9]+([-_\\.]?[a-z0-9])+@[a-z0-9]+([-_\\.]?[a-z0-9])+\\.[a-z]{2,4}\$", $email)) {
        if (strlen($kennwort1) > 7) {
            if ($kennwort1 == $kennwort2) {
                require_once "php/Functions.php";
                initDBConnection();
                //Erzeuge Benutzer und Passworteintrag
                $werte = array('id' => 0, 'nickname' => $username, 'passwort' => sha1($kennwort1), 'Mail' => $email, 'anmeldung' => date("Y-m-d H:i:s"), 'Sorted' => "Profil,Galerie,Freunde,Hardware,Software,Anzeigen,Reviews");
                DBD(DBTabUsers, "id=0");
                $result = DBINAA(DBTabUsers, $werte);
                ergebnis($result, "Benutzer anlegen", "erfolgreich", "nicht erfolgreich");
                //in Tabelle DBTabRoles eintragen
                DBD(DBTabRoles, "BenutzerID=0");
                $werte = array('BenutzerID' => 0, 'Rolle' => ROLEAdmin);
                $result = $result && DBINAA(DBTabRoles, $werte);
                ergebnis($result, "Benutzerberechtigung Debugger", "erfolgreich", "nicht erfolgreich");
                $werte = array('BenutzerID' => 0, 'Rolle' => ROLEDebug);
                $result = $result && DBINAA(DBTabRoles, $werte);
                ergebnis($result, "Benutzerberechtigung Administrator", "erfolgreich", "nicht erfolgreich");
                $werte = array('ID' => 0, 'Nickname' => 1);
                $result = $result && DBINAA(DBTabProfiles, $werte);
                ergebnis($result, "Profil veröffentlichen", "erfolgreich", "nicht erfolgreich");
            } else {
                $fehler = "Passwörter weichen ab";
            }
        } else {
            $fehler = "Passwort zu kurz (mindestens 8 Stellen erforderlich)";
        }
    } else {
        $fehler = "Die E-Mailadresse ist ungültig";
    }
    if ($fehler != "") {
        $fehler = "Fehlgeschlagen: " . $fehler . "<br /><a href=\"config.php\" onClick=\"javascript:history.back();return false;\">zurück</a>";
    }
    ergebnis($result, "Administrator anlegen", "Erfolgreich", $fehler);
    if ($result) {
        echo "<p>Konfiguration abgeschlossen</p>";
    }
    cfgWarnung();
}