예제 #1
0
파일: index.php 프로젝트: TheFox/phpdl
     }
 }
 $source = preg_replace('/["\']/', '', $_POST['source']);
 $password = preg_replace('/["\']/', '', $_POST['password']);
 $httpUser = checkInput($_POST['httpUser'], null, 256);
 $httpUser = preg_replace('/["\']/', '', $httpUser);
 $httpPassword = checkInput($_POST['httpPassword'], null, 256);
 $httpPassword = preg_replace('/["\']/', '', $httpPassword);
 $speed = checkInput($_POST['speed'], '0-9', 11);
 $sortnr = (int) $_POST['sortnr'];
 $dbh = dbConnect();
 if ($id) {
     // Edit
     $packet = new dlpacket($CONFIG['DB_HOST'], $CONFIG['DB_NAME'], $CONFIG['DB_USER'], $CONFIG['DB_PASS']);
     if ($packet->loadById($id)) {
         if ($user->get('id') != $packet->get('_user') || $packet->filesDownloading() || $packet->get('ftime')) {
             exit;
         }
         $files = getDbTable($dbh, 'files', "where _packet = '{$id}'");
         foreach ($files as $fileId => $file) {
             foreach ($urls as $urlNum => $url) {
                 if ($file['uri'] == $url) {
                     $files[$fileId]['__hold'] = true;
                     break;
                 }
             }
         }
         foreach ($files as $fileId => $file) {
             if (!isset($file['__hold'])) {
                 mysql_query("delete from files where id = '" . $file['id'] . "' limit 1;", $dbh);
             }