Example #1
0
 public function downloadAction()
 {
     $settings = Globals::get("settings");
     $path = Globals::get("path");
     $plugin = isset($_POST['plugin']) ? $_POST['plugin'] : null;
     //if($plugin == null){return;}
     $version = isset($_POST['version']) ? $_POST['version'] : '*';
     $source = $_POST['source'];
     //foreach ($source as $key => $value) {
     //$pathPlugin = $value.'plugins/'.$plugin.'/'.$plugin.'.tar.gz';
     $pathPlugin = $source . '/plugins/' . $plugin . '/' . $plugin . '.tar.gz';
     $resultData = @file_get_contents($pathPlugin);
     //if($resultData !== false){
     //	break;
     //}
     //}
     if ($resultData !== false) {
         $pluginspath = Globals::get('path/app/plugins/path');
         $pluginsFilename = $plugin . '.tar.gz';
         $pluginsFilenamePath = $pluginspath . '' . $pluginsFilename;
         file_put_contents($pluginsFilenamePath, $resultData);
         $phar = new PharData($pluginsFilenamePath);
         $phar->extractTo($pluginspath, null, true);
         exec('find ' . $pluginspath . ' -type d -exec chmod 0777 {} +');
         exec('find ' . $pluginsFilenamePath . ' -type f -exec chmod 0777 {} +');
         unlink($pluginsFilenamePath);
         // salva as operações no options
         Options::addOptions("_control", array('dependence' => array($plugin => $version)));
         Options::saveOptions("_control");
         // captura a lista de plugins
         $pluginsList = Globals::get("plugins/list");
         //Plugins::getList($path,$settings);
         $status = 'success';
         $data = $pluginsList;
     } else {
         $status = 'error';
         $data = null;
     }
     echo json_encode(array('status' => $status, 'data' => null));
     return array('continue' => false);
 }
include "../../../classes/Database.php";
include "../../../classes/Connection.php";
include_once "../../../includes/bootstrap.php";
include "../../../classes/OptionsCategory.php";
include "../../../classes/Options.php";
include "../../../classes/AdminAction.php";
include "../../../includes/security.funcs.inc";
include_once "../../../includes/Pagination.php";
include_once 'thumbnail/thumbnail_images.class.php';
include_once 'functions/myFunctions.php';
if (isset($_POST['submit'])) {
    $_POST = sanitize($_POST);
    $category = $_POST;
    settype($category, 'object');
    Options::addOptions($category);
    $success = "Options Successfully Saved!";
    $updates = 'Add new options  content';
    AdminAction::addAdminAction($_SESSION['admin_name'], $updates);
}
$category = OptionsCategory::findOptionsCategory($_REQUEST['category_id']);
?>
<!DOCTYPE html>  
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">  
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  <link rel="stylesheet" type="text/css" media="screen" href="<?php 
echo $ROOT_URL;
?>
_admin/_assets/css/core3.css" />