0byt3m1n1-V2
Path:
/
home
/
a
/
c
/
a
/
academiac
/
www
/
[
Home
]
File: utilities.tar
buffer.php 0000666 00000010337 15137256077 0006553 0 ustar 00 <?php /** * @package Joomla.Platform * @subpackage Utilities * * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * Generic Buffer stream handler * * This class provides a generic buffer stream. It can be used to store/retrieve/manipulate * string buffers with the standard PHP filesystem I/O methods. * * @package Joomla.Platform * @subpackage Utilities * @since 11.1 */ class JBuffer { /** * Stream position * * @var integer * @since 11.1 */ public $position = 0; /** * Buffer name * * @var string * @since 11.1 */ public $name = null; /** * Buffer hash * * @var array * @since 11.1 */ public $_buffers = array(); /** * Function to open file or url * * @param string $path The URL that was passed * @param string $mode Mode used to open the file @see fopen * @param integer $options Flags used by the API, may be STREAM_USE_PATH and * STREAM_REPORT_ERRORS * @param string &$opened_path Full path of the resource. Used with STREAN_USE_PATH option * * @return boolean * * @since 11.1 * @see streamWrapper::stream_open */ public function stream_open($path, $mode, $options, &$opened_path) { $url = parse_url($path); $this->name = $url["host"]; $this->_buffers[$this->name] = null; $this->position = 0; return true; } /** * Read stream * * @param integer $count How many bytes of data from the current position should be returned. * * @return mixed The data from the stream up to the specified number of bytes (all data if * the total number of bytes in the stream is less than $count. Null if * the stream is empty. * * @see streamWrapper::stream_read * @since 11.1 */ public function stream_read($count) { $ret = substr($this->_buffers[$this->name], $this->position, $count); $this->position += strlen($ret); return $ret; } /** * Write stream * * @param string $data The data to write to the stream. * * @return integer * * @see streamWrapper::stream_write * @since 11.1 */ public function stream_write($data) { $left = substr($this->_buffers[$this->name], 0, $this->position); $right = substr($this->_buffers[$this->name], $this->position + strlen($data)); $this->_buffers[$this->name] = $left . $data . $right; $this->position += strlen($data); return strlen($data); } /** * Function to get the current position of the stream * * @return integer * * @see streamWrapper::stream_tell * @since 11.1 */ public function stream_tell() { return $this->position; } /** * Function to test for end of file pointer * * @return boolean True if the pointer is at the end of the stream * * @see streamWrapper::stream_eof * @since 11.1 */ public function stream_eof() { return $this->position >= strlen($this->_buffers[$this->name]); } /** * The read write position updates in response to $offset and $whence * * @param integer $offset The offset in bytes * @param integer $whence Position the offset is added to * Options are SEEK_SET, SEEK_CUR, and SEEK_END * * @return boolean True if updated * * @see streamWrapper::stream_seek * @since 11.1 */ public function stream_seek($offset, $whence) { switch ($whence) { case SEEK_SET: if ($offset < strlen($this->_buffers[$this->name]) && $offset >= 0) { $this->position = $offset; return true; } else { return false; } break; case SEEK_CUR: if ($offset >= 0) { $this->position += $offset; return true; } else { return false; } break; case SEEK_END: if (strlen($this->_buffers[$this->name]) + $offset >= 0) { $this->position = strlen($this->_buffers[$this->name]) + $offset; return true; } else { return false; } break; default: return false; } } } // Register the stream stream_wrapper_register("buffer", "JBuffer"); simplecrypt.php 0000666 00000012322 15137256077 0007651 0 ustar 00 <?php /** * @package Joomla.Platform * @subpackage Utilities * * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JSimpleCrypt is a very simple encryption algorithm for encrypting/decrypting strings * * @package Joomla.Platform * @subpackage Utilities * @since 11.1 * @deprecated 12.3 Use JCrypt instead. */ class JSimpleCrypt extends JObject { /** * Encryption/Decryption Key * * @var string */ protected $_key; /** * Object Constructor takes an optional key to be used for encryption/decryption. If no key is given then the * secret word from the configuration object is used. * * @param string $key Optional encryption key * * @since 11.1 * @deprecated 12.3 Use JCrypt instead. */ public function __construct($key = null) { JLog::add('JSimpleCrypt is deprecated. Use JCrypt instead.', JLog::WARNING, 'deprecated'); if ($key) { $this->_key = (string) $key; } else { $conf = &JFactory::getConfig(); $this->_key = md5($conf->get('secret')); } } /** * Decrypt a string * * @param string $s String to decrypt * * @return string * * @since 11.1 * @deprecated 12.3 Use JCrypt instead. */ public function decrypt($s) { $ai = $this->_hexToIntArray($s); (string) $s1 = $this->_xorString($ai); return $s1; } /** * Encrypt a string * * @param string $s String to encrypt * * @return string * * @since 11.1 * @deprecated 12.3 Use JCrypt instead. */ public function encrypt($s) { $ai = $this->_xorCharString($s); $s1 = ''; for ($i = 0, $count = count($ai); $i < $count; $i++) { $s1 = $s1 . $this->_intToHex((int) $ai[$i]); } return $s1; } /** * Convert hex to an integer * * @param string $s The hex string to convert. * @param integer $i The offset? * * @return integer * * @since 11.1 * @deprecated 12.3 Use JCrypt instead. */ protected function _hexToInt($s, $i) { (int) $j = $i * 2; (string) $s1 = $s; (string) $c = substr($s1, $j, 1); // get the char at position $j, length 1 (string) $c1 = substr($s1, $j + 1, 1); // get the char at postion $j + 1, length 1 (int) $k = 0; switch ($c) { case "A": $k += 160; break; case "B": $k += 176; break; case "C": $k += 192; break; case "D": $k += 208; break; case "E": $k += 224; break; case "F": $k += 240; break; case " ": $k += 0; break; default: (int) $k = $k + (16 * (int) $c); break; } switch ($c1) { case "A": $k += 10; break; case "B": $k += 11; break; case "C": $k += 12; break; case "D": $k += 13; break; case "E": $k += 14; break; case "F": $k += 15; break; case " ": $k += 0; break; default: $k += (int) $c1; break; } return $k; } /** * Convert hex to an array of integers * * @param string $s The hex string to convert to an integer array. * * @return array An array of integers. * * @since 11.1 * @deprecated 12.3 Use JCrypt instead. */ protected function _hexToIntArray($s) { (string) $s1 = $s; (int) $i = strlen($s1); (int) $j = $i / 2; for ($l = 0; $l < $j; $l++) { (int) $k = $this->_hexToInt($s1, $l); $ai[$l] = $k; } return $ai; } /** * Convert character string to integer * * @param string $c The character to convert to an integer. * * @return integer * * @since 11.1 * @deprecated 12.3 Use JCrypt instead. */ protected function _charToInt($c) { $ac[0] = $c; return $ac; } /** * XorString * * @param string $ai The string. * * @return string * * @since 11.1 * @deprecated 12.3 Use JCrypt instead. */ protected function _xorString($ai) { $s = $this->_key; (int) $i = strlen($s); $ai1 = $ai; (int) $j = count($ai1); for ($i = 0; $i < $j; $i = strlen($s)) { $s = $s . $s; } for ($k = 0; $k < $j; $k++) { (string) $c = substr($s, $k, 1); $ac[$k] = chr($ai1[$k] ^ ord($c)); } (string) $s1 = implode('', $ac); return $s1; } /** * Convert integer to hex * * @param integer $i An integer value to convert. * * @return string * * @since 11.1 * @deprecated 12.3 Use JCrypt instead. */ protected function _intToHex($i) { (int) $j = (int) $i / 16; if ((int) $j == 0) { (string) $s = " "; } else { (string) $s = strtoupper(dechex($j)); } (int) $k = (int) $i - (int) $j * 16; (string) $s = $s . strtoupper(dechex($k)); return $s; } /** * Use xor encryption * * @param string $s The string. * * @return array An array of integers * * @since 11.1 * @deprecated 12.3 Use JCrypt instead. */ protected function _xorCharString($s) { $ac = preg_split('//', $s, -1, PREG_SPLIT_NO_EMPTY); (string) $s1 = $this->_key; (int) $i = strlen($s1); (int) $j = count($ac); for ($i = 0; $i < $j; $i = strlen($s1)) { $s1 = $s1 . $s1; } for ($k = 0; $k < $j; $k++) { $c = substr($s1, $k, 1); $ai[$k] = ord($c) ^ ord($ac[$k]); } return $ai; } } .htaccess 0000666 00000000177 15137256077 0006370 0 ustar 00 <FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>