📄 vodcmscontroller.php
字号:
<?php
/*
秀影6.x系统管理控制器
qq:24498936
*/
class VodcmsController extends Easy_Controller_Action {
public function Init(){
$this->_Vodcms = new VodcmsModel();
}
public function backupAction(){
$path = $this->_Request->getParam('path');
if( strlen(ROOT) >= strlen( base64_decode($path) ) ) {
$path = base64_encode($this->_Vodcms->dir);
$this->_View->path = '/';
$this->_View->files = $this->_Vodcms->view( $path );
}else{
$this->_View->files = $this->_Vodcms->view( $path );
$this->_View->path = $this->_Vodcms->path;
}
$this->_View->printpage = $this->_Vodcms->printpage;
if ($this->_Request->isPost()){
$this->_Vodcms->export();
$this->_View->message = _('备份成功!');
exit($this->_View->render('message'));
}elseif ($this->_Request->getParam('table')){
$this->_Vodcms->exportData($this->_Request->getParam('table'));
$this->_View->message = _($this->_Request->getParam('table').'表备份成功!');
exit($this->_View->render('message'));
}
}
public function downAction(){
$filename = base64_decode($this->_Request->getParam('filename'));
$IO = new Easy_Filesystem();
$IO->attachment($filename);
exit;
}
public function importAction(){//导入数据库
$filename = base64_decode($this->_Request->getParam('filename'));
$num = $this->_Vodcms->import($filename);
if($num===false){
$this->_View->message = _('数据库还原成功!');
$this->_View->jumpurl = '?mod=vodcms&action=backup';
}else{
$uri = $_SERVER['REQUEST_URI'].'&num='.$num;
$this->_View->jumpurl = $uri;
$this->_View->meta = '<meta http-equiv="Refresh" content="3;URL='.$uri.'" />';
$this->_View->message = _('还原文件'.$this->_Vodcms->sqlfile.'成功.3秒后自动还原下一个分卷');
$this->_View->button = _('点击手动导入下一个分卷');
}
exit($this->_View->render('message'));
exit;
}
public function deleteAction(){
$filename = base64_decode($this->_Request->getParam('filename'));
$rows = $this->_Vodcms->delete($filename);
$this->_View->message = _('删除'.$rows.'个文件成功!');
exit($this->_View->render('message'));
}
public function optimzerAction(){
if ($this->_Request->isPost()){
if(count($this->_Request->getPost('table'))>0){
if ($this->_Request->getPost('select') == 'optimize'){
$this->_Vodcms->optimize($this->_Request->getPost('table'));
$this->_View->message = _('优化成功');
}else{
$this->_Vodcms->repair($this->_Request->getPost('table'));
$this->_View->message = _('修复成功');
}
}else{
$this->_View->message = _('请选择表');
}
exit($this->_View->render('message'));
}
$this->_View->tableStat = $this->_Vodcms->getStat();
//print_r($this->_View->tableStat);
}
/*
图片管理
*/
public function clearupAction(){
$this->_View->pic = $this->_Vodcms->getPic();
}
/*sql*/
public function sqlAction(){
if ($this->_Request->isPost()){
if ($this->_Vodcms->exec($this->_Request->getPost('sql'))){
$this->_View->message = _('命令执行成功');
}elseif ($this->config['createuser'] != $this->_Request->getCookie('admin') ){
$this->_View->message = _('您不是VODCMS创建者,无法执行SQL命令行');
}else{
$this->_View->message = $this->_Vodcms->error;
}
$this->_View->jumpurl = $this->_View->installdir.'?mod=vodcms&action=sql&string='.base64_encode($this->_Request->getPost('sql'));
exit($this->_View->render('message'));
}else{
if ($this->_Request->getParam('string')){
$this->_View->sql = base64_decode($this->_Request->getParam('string'));
}
}
}
/*
*/
public function clearAction(){
if ($this->_Request->isPost()){
$this->_Vodcms->clean();
$this->_View->message = _('缓存清理成功');
exit($this->_View->render('message'));
}
}
/*
*/
public function supperAction(){
$Movie = new MovieModel();
$Category = new CategoryModel();
$this->_View->AreaOption = $Movie->AreaOption();
$this->_View->ServerOption = $Movie->ServerOption(0);
$this->_View->PlayerOption = $Movie->PlayerOption(0);
$this->_View->CategoryOption = $Category->CreateOptions();
}
/*文件权限检查*/
public function checkfileAction() {
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -