Exemplo n.º 1
0
 private function pending_actions()
 {
     ALogger::step('PENDING ACTIONS');
     BogusArchive::deleteWhereCondition("pending_action_bga = 'delete'");
     BogusArchive::unpackWhereCondition("pending_action_bga = 'rescan'");
     ALogger::end_step();
 }
Exemplo n.º 2
0
 public function actionUrls()
 {
     $model = new BogusArchive('search');
     if (isset($_GET['action'])) {
         $id = (int) $_GET['id'];
         switch ($_GET['action']) {
             case 'download':
                 $file = $model->findByPk($id);
                 header("Content-type: application/octet-stream");
                 header("Content-Disposition: attachment; filename=\"" . $file->name_bga . "\"");
                 echo file_get_contents(PathFinder::get(VIREX_STORAGE_PATH, $file->detection_bga, 'bogus', true) . $file->id_bga);
                 die;
                 break;
             case 'unpack':
                 Yii::app()->db->createCommand("UPDATE bogus_archives_bga SET pending_action_bga='Rescan' WHERE id_bga={$id}")->execute();
                 Yii::app()->user->setFlash('_success', "Urls file will be reprocessed soon!");
                 header("Location: " . $_SERVER['HTTP_REFERER']);
                 break;
             case 'delete':
                 Yii::app()->db->createCommand("UPDATE bogus_archives_bga SET pending_action_bga='Delete' WHERE id_bga={$id}")->execute();
                 Yii::app()->user->setFlash('_success', "Urls file will be deleted soon!");
                 header("Location: " . $_SERVER['HTTP_REFERER']);
                 break;
         }
     }
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['BogusArchive'])) {
         $model->attributes = $_GET['BogusArchive'];
     }
     $this->render('urls', array('model' => $model));
 }