Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function rrmdir($dir) {
- if (is_dir($dir)) {
- $objects = scandir($dir);
- foreach ($objects as $object) {
- if ($object != "." && $object != "..") {
- if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object);
- else unlink($dir."/".$object);
- }
- }
- reset($objects);
- rmdir($dir);
- }
- }
- function copy_directory($source, $destination) {
- if (is_dir($source)) {
- @mkdir($destination);
- $directory = dir($source);
- while ( FALSE !== ($readdirectory = $directory->read())) {
- if ($readdirectory == '.' || $readdirectory == '..') continue;
- $PathDir = $source . '/' . $readdirectory;
- if (is_dir($PathDir)) {
- copy_directory($PathDir, $destination . '/' . $readdirectory);
- continue;
- }
- copy($PathDir, $destination . '/' . $readdirectory);
- }
- $directory->close();
- } else copy($source, $destination);
- }
- $templateGlobals['pageSublineDeactivated'] = 0;
- $pageIDNext = (int)$pageID+1;
- if (isset($_POST['submitted'])) {
- if (isset($_POST['base'])) $base_post = $_POST['base'];
- if (isset($_POST['kernel'])) $kernel = $_POST['kernel'];
- /* rom base */
- if ($base_post == "rom_cyanogenmod9") {
- $base = "CM9";
- }
- else if ($base_post == "rom_cyanogenmod9_nightly") {
- $base = "CM9_nightly";
- }
- if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
- {
- $ip=$_SERVER['HTTP_CLIENT_IP'];
- }
- if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
- {
- $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
- }
- else
- {
- $ip=$_SERVER['REMOTE_ADDR'];
- }
- $dir = "download/" . $ip . $base;
- // if dir exist, will be deleted right now
- if(is_dir($dir) == true) rrmdir($dir);
- // copy base-package to modding
- copy_directory($base, $dir);
- /* add a new kernel */
- // CM-kernel (default)
- if ($kernel == "kernel_cm9") {
- $array_source[] = 'kernel/cm9/zImage';
- $array_target[] = 'xbin/zImage';
- }
- // dorimanx
- if ($kernel == "kernel_dorimanx_stable") {
- $array_source[] = 'kernel/dorimanx/v1111/zImage';
- $array_target[] = 'xbin/zImage';
- }
- if ($kernel == "kernel_dorimanx_new") {
- $array_source[] = 'kernel/dorimanx/v2222/zImage';
- $array_target[] = 'xbin/zImage';
- }
- $count = count($array_source);
- for ($i = 0; $i < $count; $i++) {
- if(file_exists($array_source[$i])) copy($array_source[$i], $dir . $array_target[$i]);
- else echo "404: The requested file was not found!!! -> " . $array_source[$i];
- }
- }
- $pageContent .= '
- <form action="index.php?pid=' . $pageIDNext . '" method="post">
- <input name="submitted" type="hidden" value="1" />
- <fieldset style="text-align:left;">
- <legend><strong>Base-package</strong></legend>
- <input type="radio" name="base" value="rom_cyanogenmod9_nightly" style="width: 20px;" checked="checked" />
- <strong><a href="http://download.cyanogenmod.com/?type=nightly&device=galaxys2" target="_blank">CyanogenMod | Galaxys2 / Nightly</a></strong>
- <br>
- <input type="radio" name="base" value="rom_other" style="width: 20px;" />
- <strong><a href="" target="_blank">other base</a></strong><br />
- <input type="radio" name="base" value="rom_no" style="width: 20px;" /><strong>No Base Package</strong>
- </fieldset>
- <fieldset style="text-align:left;"><legend><strong>Select kernel</strong></legend>
- <table border="0">
- <tr>
- <td width="65%">
- <table border="0">
- <tr>
- <td>other</td>
- <td align="center">
- <input type="radio" name="kernel" value="kernel_other_stable" />v1
- </td>
- </tr>
- <tr>
- <td><a href="http://forum.xda-developers.com/showthread.php?t=1617219" target="_blank">Dorimanx</a></td>
- <td align="center">
- <input type="radio" name="kernel" value="kernel_dorimanx_stable" />v1111
- </td>
- <td align="center">
- <input type="radio" name="kernel" value="kernel_dorimanx_new" />v2222
- </td>
- </tr>
- <tr>
- <td><a href="" target="_blank">other2</a></td>
- <td align="center">
- <input type="radio" name="kernel" value="kernel_other_stable" />v1111
- </td>
- <td align="center">
- <input type="radio" name="kernel" value="kernel_other_new" />v2222
- </td>
- </tr>
- <tr>
- </table>
- </td>
- <td>
- <div id="div1"></div>
- </td>
- </tr>
- </table>
- </fieldset>
- <input type="image" src="images/next.jpg" alt="Next step..." /><br />
- </form>
- ';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement