mirror of
https://github.com/optim-enterprises-bv/control-pane.git
synced 2025-10-30 01:22:24 +00:00
* Moved register_media under CBSD
This commit is contained in:
13
php/cbsd.php
13
php/cbsd.php
@@ -54,5 +54,18 @@ class CBSD {
|
||||
}
|
||||
}
|
||||
|
||||
function register_media($path,$file,$ext)
|
||||
{
|
||||
$cmd='cbsd media mode=register name=%s path=%s type=%s';
|
||||
$res=self::run($cmd, array($file, $path.$file, $ext));
|
||||
if($res['error']){
|
||||
$arr['error']=true;
|
||||
$arr['error_message']='File image not registered!';
|
||||
} else {
|
||||
$arr['error']=false;
|
||||
}
|
||||
|
||||
echo json_encode($arr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2239,19 +2239,6 @@ class ClonOS {
|
||||
return '<span class="cbsd-str">'.$cmd_string.'</span>';
|
||||
}
|
||||
|
||||
function register_media($path,$file,$ext){
|
||||
$cmd='cbsd media mode=register name=%s path=%s type=%s';
|
||||
$res=CBSD::run($cmd, array($file, $path.$file, $ext));
|
||||
if($res['error']){
|
||||
$arr['error']=true;
|
||||
$arr['error_message']='File image not registered!';
|
||||
} else {
|
||||
$arr['error']=false;
|
||||
}
|
||||
|
||||
echo json_encode($arr);
|
||||
}
|
||||
|
||||
function media_iso_list_html(){
|
||||
// $form=$this->form;
|
||||
$db=new Db('base','storage_media');
|
||||
|
||||
@@ -11,17 +11,18 @@ require_once($_real_path.'/php/clonos.php');
|
||||
require_once($_real_path.'/php/menu.php');
|
||||
$chunks=Utils::gen_uri_chunks($uri);
|
||||
$clonos=new ClonOS($_real_path, $chunks);
|
||||
$cbsd = new CBSD();
|
||||
$locale = new Locale($_real_path.'/public/'); # /usr/home/web/cp/clonos/public/
|
||||
$menu=new Menu($locale, $chunks);
|
||||
|
||||
if(isset($_GET['upload'])){
|
||||
include('upload.php');
|
||||
$clonos->register_media($path,$file,$ext);
|
||||
$cbsd->register_media($path,$file,$ext);
|
||||
exit;
|
||||
}
|
||||
if(isset($_GET['download'])){
|
||||
include('download.php');
|
||||
$clonos->register_media($path,$file,$ext);
|
||||
$cbsd->register_media($path,$file,$ext);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user