Exemplo n.º 1
0
function tokencheck($id)
{
    if ($_GET['chksum'] != '' && md5sum($id) == $_GET['chksum'] || $_GET['token'] != '' && md5sum($id) == $_GET['token']) {
        $flag = true;
    } else {
        $flag = flase;
        header('location:do?module=Error&err=2');
        die('<div style="color:red">You do not have access to this area. Contact your site administrator to obtain access.</div>');
    }
    return $flag;
}
Exemplo n.º 2
0
    die('denied.');
}
if ($config['use_email']) {
    $r_user = thwb_query("SELECT username, userpassword, useremail FROM " . $pref . "user WHERE username='******' AND useremail='" . addslashes($email) . "'");
    if (mysql_num_rows($r_user) != 1) {
        message("Fehler", "Es gibt leider keinen Benutzer mit diesem Namen und dieser Email!");
    } else {
        $user = mysql_fetch_array($r_user);
        if (!isset($hash) || !$hash || empty($new_hash)) {
            if (!isset($HTTP_POST_VARS['Submit'])) {
                die("denied");
            }
            if ($pass1 !== $pass2) {
                message('Fehler', 'Ihr neues Passwort und die Passwortwiederholung stimmen nicht &uuml;berein.');
            }
            $new_hash = md5sum($pass1);
            $TMail = new Template("./templates/mail/send_password_request.mail");
            $username = rawurlencode($user['username']);
            eval($TMail->GetTemplate("text"));
            @mail($email, "Passwort vergessen - {$config['board_name']}", $text, "From: {$config['board_admin']}");
            message("Best&#xE4;tigung", "Es wurde eine Mail an die angegebene Email Adresse geschickt. Bitte lesen Sie diese, um die Passwort&#xE4;nderung zu vervollst&#xE4;ndigen.");
        } else {
            if (empty($new_hash) || strlen($new_hash) != 32) {
                message('Fehler', 'Ung&uuml;ltiger Hash.');
            }
            if ($hash != $user['userpassword']) {
                message("Fehler", "Ung&#xFC;ltiger Hash.");
            } else {
                /* set new password */
                thwb_query("UPDATE " . $pref . "user SET userpassword='******' WHERE username='******'");
                eval($TMail->GetTemplate("text"));
 /**
  * @params boolean $activate Whether to generate activation key when user is
  * registering first time (false)
  * or when it is activating (true)
  * @params string $password password entered by user
  * @param array $params, optional, to allow passing values outside class in inherited classes
  * By default it uses password and microtime combination to generated activation key
  * When user is activating, activation key becomes micortime()
  * @return string
  */
 public function generateActivationKey($activate = false)
 {
     if ($activate) {
         $this->activationKey = $activate;
         $this->save(false, array('activationKey'));
     } else {
         $this->activationKey = md5sum(microtime() . $this->password, Yum::module()->passwordHashCost);
     }
     if (!$this->isNewRecord) {
         $this->save(false, array('activationKey'));
     }
     return $this->activationKey;
 }
Exemplo n.º 4
0
{
    global $fp1, $fp2;
    gzwrite($fp1, $line);
    fwrite($fp2, $line);
}
$fp1 = gzopen("Packages.gz", "w");
$fp2 = fopen("Packages", "w");
$od = opendir("./") or die("Could not dir.\n");
$first = true;
while (($file = readdir($od)) !== false) {
    if ($file != "." && $file != "..") {
        $ext = substr($file, -4, 4);
        if ($ext == ".ipk" || $ext == ".deb") {
            echo "Reading \"" . $file . "\".\n";
            $result = ipkg_parse($file);
            $md5sum = md5sum($file);
            if ($first == true) {
                $first = false;
            } else {
                writeout("\n");
            }
            foreach ($result["control"] as $key => $value) {
                $keyl = strtolower($key);
                if (strlen($key) > 0 && strlen($value) > 0 && $keyl != "filename" && $keyl != "size" && $keyl != "md5sum") {
                    writeout($key . ": " . $value . "\n");
                }
            }
            writeout("Filename: " . $file . "\n");
            writeout("Size: " . filesize($file) . "\n");
            writeout("MD5Sum: " . $md5sum . "\n");
        }