ppypp伦理天堂,91手机在线视频,免费在线观看黄色毛片,夜夜穞天天穞狠狠穞AV美女按摩

聯系官方銷售客服

1835022288

028-61286886

投訴 已解決 搭建演示站,怎么禁止用戶修改數據 1 0
大兔子(全能人才) SVIP會員 OEM版權 2022-05-26 10:53:48 私信
迅睿CMS版本:4.5.6

搭建演示站,怎么禁止用戶修改數據,實現官方演示站的這種效果


8be92c70114ce2295257a383be523c8

解決方案
  • 需要二次開發了,用鉤子實現攔截提交

    下面是官網的代碼可以參考

    \Phpcmf\Hooks::on('cms_init', function() {
    
        
    
      	$msg = '演示系統禁止變更數據的操作';
        
        
        if (\Phpcmf\Service::L('Router')->class == 'login') {
        	
            return;
        }
      	if (\Phpcmf\Service::L('Router')->class == 'file') {
        	exit(\Phpcmf\Service::C()->_json(0, $msg));
        }
        // cms 初始化后的運行
    
        if (in_array($uri, [
            'cloud/index',
            'cloud/update',
            'cloud/down_file',
            'cloud/install_app',
            'menu/use_edit',
            'api/menu',
            'backup/index',
            'backup/add',
            'form/add',
            'site/add',
          	'module/install',
          	'module/uninstall',
            'content/index',
            'backup/index',
            'module/form_index',
            'check/php_index',
        ])) {
            exit($msg);
        }
    
        if (IS_API_HTTP) {
            exit(\Phpcmf\Service::C()->_json(0, $msg));
        }
    
        if (in_array(\Phpcmf\Service::L('Router')->method, [
            'del', 
            'install', 
            'uninstall',
            'uninstall',
        ]) || strpos(\Phpcmf\Service::L('Router')->method, 'del') !== false) {
            exit(\Phpcmf\Service::C()->_json(0, $msg));
        }
    
    
        if (strpos(\Phpcmf\Service::L('Router')->method, '_edit') !== false) {
            exit(\Phpcmf\Service::C()->_json(0, $msg));
        }
    
    
        if (IS_POST) {
          
          	if (!IS_ADMIN) {
              
                exit(\Phpcmf\Service::C()->_msg(0, $msg));
            }
          
            if (in_array(\Phpcmf\Service::L('Router')->class, [
                'tpl_pc',
                'tpl_mobile',
                'module_create',
                'module_content',
                'theme',
                'system_theme',
            ])) {
                exit(\Phpcmf\Service::C()->_json(0, $msg));
            }
          	exit(\Phpcmf\Service::C()->_json(0, $msg));
        }
    });
    滿意答案
    短信幣+1
  • 2022-05-26 11:05:58
    Chrome 12分鐘10秒 0
    迅睿框架創始人:搞定了,老大