Beispiel #1
0
 if ($request->valid($vPackageId)) {
     $package_id = $request->get('id');
 } else {
     $GLOBALS['Response']->redirect('../showfiles.php?group_id=' . $group_id);
 }
 if ($package =& $frspf->getFRSPackageFromDb($package_id, $group_id)) {
     $package_data = $request->get('package');
     // we check if the name already exist only if the name has changed
     if ($package_data['name'] == html_entity_decode($package->getName()) || !$frspf->isPackageNameExist($package_data['name'], $group_id)) {
         if ($package_data['status_id'] == $frspf->STATUS_HIDDEN) {
             //if hiding a package, refuse if it has releases under it
             // LJ Wrong SQL statement. It should only check for the existence of
             // LJ active packages. If only hidden releases are in this package
             // LJ then we can safely hide it.
             // LJ $res=db_query("SELECT * FROM frs_release WHERE package_id='$package_id'");
             if ($frsrf->isActiveReleases($package_id)) {
                 $GLOBALS['Response']->addFeedback('warning', $Language->getText('file_admin_editpackages', 'cannot_hide'));
                 $package_data['status_id'] = $frspf->STATUS_ACTIVE;
             }
         }
         //update an existing package
         $package->setName(htmlspecialchars($package_data['name']));
         $package->setRank($package_data['rank']);
         $package->setStatusId($package_data['status_id']);
         $package->setApproveLicense($package_data['approve_license']);
         $package_is_updated = $frspf->update($package);
         //Permissions
         $vUgroups = new Valid_UInt('ugroups');
         if ($request->validArray($vUgroups)) {
             $ugroups = $request->get('ugroups');
         } else {