/**
  * encrypts a string
  *
  * @param $string \b string to encrypt
  */
 static function string_encrypt($string)
 {
     require_once 'encryption.class.php';
     include 'other/pw_key.php';
     $crypt = new encryption_class();
     return $crypt->encrypt($_PSU_KEY['key'], $string);
 }
예제 #2
0
 function decrypt($enc_text, $key = '')
 {
     $this->key = $key !== '' ? $key : mosCreateGUID();
     $plain_text = parent::decrypt($this->key, $enc_text);
     return $plain_text;
 }
function do_email_change()
{
    global $db, $ir, $c, $userid, $h;
    require 'encryptor.php';
    $crypt = new encryption_class();
    $encpass = $crypt->encrypt($ir['email'], $_POST['pass']);
    $encpass = addslashes($encpass);
    if ($encpass != $ir['userpass']) {
        print "The password you entered was wrong.<br />\n<a href='preferences.php?action=emailchange'>&gt; Back</a>";
    } else {
        if (!$_POST['email'] || !$_POST['pass']) {
            print "Must fill in all fields!<br />\n<a href='preferences.php?action=emailchange'>&gt; Back</a>";
        } else {
            if (!valid_email($_POST['email'])) {
                die("Sorry, the email is invalid.<br />\n&gt;<a href='preferences.php'>Back</a>");
            } else {
                $_POST['email'] = mysql_escape($_POST['email']);
                $newp = $crypt->encrypt($_POST['email'], $_POST['pass']);
                $newp = addslashes($newp);
                $db->query("UPDATE users SET email='{$_POST['email']}',userpass='******' WHERE userid={$userid}");
                print "Email changed!";
            }
        }
    }
}
<?php

require 'encryptor.php';
$crypt = new encryption_class();
ini_set('session.gc_maxlifetime', 36000);
session_start();
if (get_magic_quotes_gpc() == 0) {
    foreach ($_POST as $k => $v) {
        $_POST[$k] = addslashes($v);
    }
    foreach ($_GET as $k => $v) {
        $_GET[$k] = addslashes($v);
    }
}
include "config.php";
global $_CONFIG;
define("MONO_ON", 1);
require "class/class_db_mysql.php";
$db = new database();
$db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']);
$db->connect();
$c = $db->connection_id;
$set = array();
$settq = $db->query("SELECT * FROM settings");
$IP = mysql_real_escape_string($_SERVER['REMOTE_ADDR']);
while ($r = $db->fetch_row($settq)) {
    $set[$r['conf_name']] = $r['conf_value'];
}
if ($_POST['email'] == "" || $_POST['password'] == "") {
    die("<h3>{$set['game_name']} Error</h3>\nYou did not fill in the login form!<br>\n<a href=login.php>&gt; Back</a>");
}
예제 #5
0
    require_once 'include/getid3/getid3.php';
    $getid3 = new getID3();
    try {
        $id3data = $getid3->analyze($_FILES['upfile']['tmp_name']);
        getid3_lib::CopyTagsToComments($id3data);
        $title = htmlspecialchars(utf8_encode($id3data['comments_html']['title'][0]), ENT_QUOTES);
        $artist = htmlspecialchars(utf8_encode($id3data['comments_html']['artist'][0]), ENT_QUOTES);
        $playtime = $id3data['playtime_seconds'];
        $sample_rate = $id3data['audio']['sample_rate'];
        $filesize = $id3data['filesize'];
        $fileformat = $id3data['fileformat'];
    } catch (Exception $e) {
        echo 'ID3tag ERROR: ' . $e->message;
    }
    include 'include/class.encryption.php';
    $encryption = new encryption_class();
    $md5 = md5_file($_FILES['upfile']['tmp_name']);
    $secure_file_name = $encryption->encrypt(sha1($user), $md5);
    $secure_temporary_location = '' . $config['server']['internal_url'] . 'temp/' . $secure_file_name . '.' . strtolower(substr($_FILES['upfile']['name'], strrpos($_FILES['upfile']['name'], '.') + 1)) . '';
    rename($_FILES['upfile']['tmp_name'], $secure_temporary_location);
    $db->Raw("INSERT INTO `userdb_temporary` (`user`,`title`,`artist`,`md5`,`filesize`,`fileformat`,`sample_rate`,`location`,`playtime`) VALUES ('{$user}','{$title}','{$artist}','{$md5}','{$filesize}','{$fileformat}','{$sample_rate}','{$secure_temporary_location}','{$playtime}')");
    ?>
	
	<div style="border: 1px solid #e2c822; background-color: #fff9d7; padding: 5px;">
	<b><a href="<?php 
    echo "" . $config['fb']['fburl'] . "?tab=index&display=add&method=upload&step=3" . pages($_GET['fb_page_id']) . "";
    ?>
">Please click here if you are not automatically redirected within five seconds...</a></b>
	</div>
	<?php 
    if (isset($_GET['fb_page_id'])) {
예제 #6
0
function decrypt($value)
{
    $crypt = new encryption_class();
    return $crypt->decrypt("mysolrserver", $value);
}