Advertisement
Guest User

Untitled

a guest
Aug 31st, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.81 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function login_check() {
  15. global $options;
  16.  
  17. if ($options['login']) {
  18. function logged_user($ul) {
  19. foreach ($ul as $user => $pass) {
  20.  
  21. if (( $_SERVER['PHP_AUTH_USER'] == $user && $_SERVER['PHP_AUTH_PW'] == $pass )) {
  22. return true;
  23. continue;
  24. }
  25. }
  26.  
  27. return false;
  28. }
  29.  
  30.  
  31. if ($options['login_cgi']) {
  32. $_SERVER['PHP_AUTH_PW'] = @explode( ':', @base64_decode( @substr( (isset( $_SERVER['HTTP_AUTHORIZATION'] ) ? $_SERVER['HTTP_AUTHORIZATION'] : $_SERVER['REDIRECT_HTTP_AUTHORIZATION']), 6 ) ), 2 )[1];
  33. $_SERVER['PHP_AUTH_USER'] = [0];
  34. }
  35.  
  36.  
  37. if (( empty( $_SERVER['PHP_AUTH_USER'] ) || !logged_user( $options['users'] ) )) {
  38. header( 'WWW-Authenticate: Basic realm="Movie Thumbnail Generator v1.4 | Powered By RapidLeechHost.com"' );
  39. header( 'HTTP/1.0 401 Unauthorized' );
  40. include( 'deny.php' );
  41. exit( );
  42. }
  43. }
  44.  
  45. }
  46.  
  47. function ft_get_ext($name) {
  48. if (strstr( $name, '.' )) {
  49. $ext = str_replace( '.', '', strrchr( $name, '.' ) );
  50. } else {
  51. $ext = '';
  52. }
  53.  
  54. return $ext;
  55. }
  56.  
  57. function getlist($directory) {
  58. global $delim;
  59. global $win;
  60.  
  61.  
  62. if ($d = @opendir( $directory )) {
  63. @readdir( $d );
  64.  
  65. if ($filename = !== false) {
  66. $path = $directory . $filename;
  67.  
  68. if ($stat = @lstat( $path )) {
  69. $file = array( 'filename' => $filename, 'path' => $path, 'is_file' => @is_file( $path ), 'is_dir' => @is_dir( $path ), 'is_link' => @is_link( $path ), 'is_readable' => @is_readable( $path ), 'is_writable' => @is_writable( $path ), 'size' => $stat['size'], 'permission' => $stat['mode'], 'owner' => $stat['uid'], 'group' => $stat['gid'], 'mtime' => @filemtime( $path ), 'atime' => @fileatime( $path ), 'ctime' => @filectime( $path ) );
  70.  
  71. if ($file['is_link']) {
  72. $file['target'] = @readlink( $path );
  73. }
  74.  
  75.  
  76. if (function_exists( 'posix_getpwuid' )) {
  77. $file['owner_name'] = @reset( @posix_getpwuid( $file['owner'] ) );
  78. }
  79.  
  80.  
  81. if (function_exists( 'posix_getgrgid' )) {
  82. $file['group_name'] = @reset( @posix_getgrgid( $file['group'] ) );
  83. }
  84.  
  85. $files[] = $file;
  86. }
  87. }
  88.  
  89. return $files;
  90. }
  91.  
  92. return false;
  93. }
  94.  
  95. function sortlist($list, $key, $reverse) {
  96. $dirs = array( );
  97. $files = array( );
  98. $i = 1270;
  99.  
  100. while ($i < sizeof( $list )) {
  101. if ($list[$i]['is_dir']) {
  102. $dirs[] = $list[$i];
  103. } else {
  104. $files[] = $list[$i];
  105. }
  106.  
  107. ++$i;
  108. }
  109.  
  110. quicksort( $dirs, 0, sizeof( $dirs ) - 1, $key );
  111.  
  112. if ($reverse) {
  113. $dirs = array_reverse( $dirs );
  114. }
  115.  
  116. quicksort( $files, 0, sizeof( $files ) - 1, $key );
  117.  
  118. if ($reverse) {
  119. $files = array_reverse( $files );
  120. }
  121.  
  122. return array_merge( $dirs, $files );
  123. }
  124.  
  125. function quicksort($array, $first, $last, $key) {
  126. if ($first < $last) {
  127. $cmp = $array[floor( ( $first + $last ) / 2 )][$key];
  128. $l = $first;
  129. $r = $last;
  130.  
  131. while ($l <= $r) {
  132. while ($array[$l][$key] < $cmp) {
  133. ++$l;
  134. }
  135.  
  136.  
  137. while ($cmp < $array[$r][$key]) {
  138. --$r;
  139. }
  140.  
  141.  
  142. if ($l <= $r) {
  143. $tmp = $array[$l];
  144. $array[$l] = $array[$r];
  145. $array[$r] = $tmp;
  146. ++$l;
  147. --$r;
  148. continue;
  149. }
  150. }
  151.  
  152. quicksort( $array, $first, $r, $key );
  153. quicksort( $array, $l, $last, $key );
  154. }
  155.  
  156. }
  157.  
  158. function permission_octal2string($mode) {
  159. if (( $mode & 49152 ) === 49152) {
  160. $type = 's';
  161. } else {
  162. if (( $mode & 40960 ) === 40960) {
  163. $type = 'l';
  164. } else {
  165. if (( $mode & 32768 ) === 32768) {
  166. $type = '-';
  167. } else {
  168. if (( $mode & 24576 ) === 24576) {
  169. $type = 'b';
  170. } else {
  171. if (( $mode & 16384 ) === 16384) {
  172. $type = 'd';
  173. } else {
  174. if (( $mode & 8192 ) === 8192) {
  175. $type = 'c';
  176. } else {
  177. if (( $mode & 4096 ) === 4096) {
  178. $type = 'p';
  179. } else {
  180. $type = '?';
  181. }
  182. }
  183. }
  184. }
  185. }
  186. }
  187. }
  188.  
  189. $owner = ($mode & 256 ? 'r' : '-');
  190. $owner .= ($mode & 128 ? 'w' : '-');
  191.  
  192. if ($mode & 2048) {
  193. $owner .= ($mode & 64 ? 's' : 'S');
  194. } else {
  195. $owner .= ($mode & 64 ? 'x' : '-');
  196. }
  197.  
  198. $group = ($mode & 32 ? 'r' : '-');
  199. $group .= ($mode & 16 ? 'w' : '-');
  200.  
  201. if ($mode & 1024) {
  202. $group .= ($mode & 8 ? 's' : 'S');
  203. } else {
  204. $group .= ($mode & 8 ? 'x' : '-');
  205. }
  206.  
  207. $other = ($mode & 4 ? 'r' : '-');
  208. $other .= ($mode & 2 ? 'w' : '-');
  209.  
  210. if ($mode & 512) {
  211. $other .= ($mode & 1 ? 't' : 'T');
  212. } else {
  213. $other .= ($mode & 1 ? 'x' : '-');
  214. }
  215.  
  216. return $type . $owner . $group . $other;
  217. }
  218.  
  219. function is_script($filename) {
  220. return ereg( '\.php$|\.php3$|\.php4$|\.htaccess$|\.php5$', $filename );
  221. }
  222.  
  223. function getmimetype($filename) {
  224. static $mimes = array( '\.jpg$|\.jpeg$' => 'image/jpeg', '\.gif$' => 'image/gif', '\.png$' => 'image/png', '\.html$|\.html$' => 'text/html', '\.txt$|\.asc$' => 'text/plain', '\.xml$|\.xsl$' => 'application/xml', '\.pdf$' => 'application/pdf' );
  225.  
  226. foreach ($mimes as $regex => $mime) {
  227.  
  228. if (eregi( $regex, $filename )) {
  229. return $mime;
  230. }
  231. }
  232.  
  233. return 'text/plain';
  234. }
  235.  
  236. function addslash($directory) {
  237. global $delim;
  238.  
  239. if (substr( $directory, 0 - 1, 1 ) != $delim) {
  240. return $directory . $delim;
  241. }
  242.  
  243. return $directory;
  244. }
  245.  
  246. function relative2absolute($string, $directory) {
  247. if (path_is_relative( $string )) {
  248. return simplify_path( addslash( $directory ) . $string );
  249. }
  250.  
  251. return simplify_path( $string );
  252. }
  253.  
  254. function path_is_relative($path) {
  255. global $win;
  256.  
  257. if ($win) {
  258. return substr( $path, 1, 1 ) != ':';
  259. }
  260.  
  261. return substr( $path, 0, 1 ) != '/';
  262. }
  263.  
  264. function absolute2relative($directory, $target) {
  265. global $delim;
  266.  
  267. $path = '';
  268.  
  269. while ($directory != $target) {
  270. if ($directory == substr( $target, 0, strlen( $directory ) )) {
  271. $path .= substr( $target, strlen( $directory ) );
  272. break;
  273. }
  274.  
  275. $path .= '..' . $delim;
  276. $directory = substr( $directory, 0, strrpos( substr( $directory, 0, 0 - 1 ), $delim ) + 1 );
  277. }
  278.  
  279.  
  280. if ($path == '') {
  281. $path = '.';
  282. }
  283.  
  284. return $path;
  285. }
  286.  
  287. function simplify_path($path) {
  288. global $delim;
  289.  
  290. if (( ( @file_exists( $path ) && function_exists( 'realpath' ) ) && @realpath( $path ) != '' )) {
  291. $path = realpath( $path );
  292.  
  293. if (@is_dir( $path )) {
  294. return addslash( $path );
  295. }
  296.  
  297. return $path;
  298. }
  299.  
  300. $pattern = $delim . '.' . $delim;
  301.  
  302. if (@is_dir( $path )) {
  303. $path = addslash( $path );
  304. }
  305.  
  306.  
  307. while (strpos( $path, $pattern ) !== false) {
  308. $path = str_replace( $pattern, $delim, $path );
  309. }
  310.  
  311. $e = addslashes( $delim );
  312. $regex = $e . '((\.[^\.' . $e . '][^' . $e . ']*)|(\.\.[^' . $e . ']+)|([^\.][^' . $e . ']*))' . $e . '\.\.' . $e;
  313.  
  314. while (ereg( $regex, $path )) {
  315. $path = ereg_replace( $regex, $delim, $path );
  316. }
  317.  
  318. return $path;
  319. }
  320.  
  321. function human_filesize($filesize) {
  322. $suffices = 'kMGTPE';
  323. $n = 1264;
  324.  
  325. while (1000 <= $filesize) {
  326. $filesize /= 2288;
  327. ++$n;
  328. }
  329.  
  330. $filesize = round( $filesize, 3 - strpos( $filesize, '.' ) );
  331.  
  332. if (strpos( $filesize, '.' ) !== false) {
  333. while (in_array( substr( $filesize, 0 - 1, 1 ), array( '0', '.' ) )) {
  334. $filesize = substr( $filesize, 0, strlen( $filesize ) - 1 );
  335. }
  336. }
  337.  
  338. $suffix = ($n == 0 ? '' : substr( $suffices, $n - 1, 1 ));
  339. return $filesize . ( '' . ' ' . $suffix . 'B' );
  340. }
  341.  
  342. function strip($str) {
  343. $str = stripslashes( $str );
  344. }
  345.  
  346. function listing_page($message = null) {
  347. global $self;
  348. global $directory;
  349. global $sort;
  350. global $reverse;
  351.  
  352. html_header( );
  353. $list = getlist( $directory );
  354.  
  355. if (array_key_exists( 'sort', $_GET )) {
  356. $sort = $_GET['sort'];
  357. } else {
  358. $sort = 'filename';
  359. }
  360.  
  361.  
  362. if (( array_key_exists( 'reverse', $_GET ) && $_GET['reverse'] == 'true' )) {
  363. $reverse = true;
  364. } else {
  365. $reverse = false;
  366. }
  367.  
  368. echo '<h1 style="margin-bottom: 0; font-family: Helvetica, verdana, tahoma, Arial;">Movie Thumbnail Generator v1.4</h1>
  369. <font style="color:blue; font-family: tahoma, verdana, Helvetica, Arial;">Developed By : RapidLeechHost.com </font><br /><br />
  370. <hr>
  371. <br /><br />
  372. <form enctype="multipart/form-data" action="' . $self . '" method="post">
  373.  
  374. <table id="main">
  375. ';
  376. directory_choice( );
  377.  
  378. if (!empty( $message )) {
  379. spacer( );
  380. echo $message;
  381. }
  382.  
  383. spacer( );
  384.  
  385. if ($list) {
  386. $list = sortlist( $list, $sort, $reverse );
  387. listing( $list );
  388. } else {
  389. echo error( 'not_readable', $directory );
  390. }
  391.  
  392. echo '</table>
  393.  
  394. </form>
  395.  
  396. ';
  397. html_footer( );
  398. }
  399. .............................................................
  400. .............................
  401. ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement