Example #1
0
 function delete_app()
 {
     $id = addslashes($_GET['app_id']);
     $acc = new App2Acc();
     $apps = $acc->getWhereFromMultipleTable("ac_admin_id = '" . Account::getMyID() . "' AND ac_app_id = app_id AND ac_app_id = '{$id}' ", array("AppAccount"));
     if (count($apps) < 1) {
         die("hacking attempt");
     } else {
         $app = $apps[0];
     }
     if ($app->app_active) {
         header("Location:" . _SPPATH . "myapps");
         die;
     }
     AppAccount::checkOwnership($app);
     $appAcc = new AppAccount();
     $appAcc->delete($id);
     $app2Acc = new App2Acc();
     $app2Acc->delete($app->ac_id);
     //delete JSON also
     unlink(_PHOTOPATH . "json/" . $app->app_keywords . ".json");
     header("Location:" . _SPPATH . "myapps");
     die;
 }