PHP Classes

File: admin/ar/enable-app.php

Recommend this page to a friend!
  Classes of Subin Siby   Lobby   admin/ar/enable-app.php   Download  
File: admin/ar/enable-app.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Lobby
Web OS to install and run Web applications
Author: By
Last change:
Date: 7 years ago
Size: 551 bytes
 

Contents

Class file image Download
<?php
$action
= Request::postParam("enable") === "true" ? "enable" : "disable";
$appID = Request::postParam("appID");

if(
$action !== null && $appID !== null && CSRF::check()){
 
$App = new Lobby\Apps($appID);
  if(!
$App->exists)
   
Response::showError("Error", "I checked all over, but the app does not exist");

  if(
$action === "enable"){
    if(
$App->enableApp())
      echo
"enable";
    else
      echo
"enable-fail";
  }else if(
$action === "disable"){
    if(
$App->disableApp())
      echo
"disable";
    else
      echo
"disable-fail";
  }
}