Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions action/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../../').'/');
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
require_once(DOKU_PLUGIN.'action.php');


use dokuwiki\Extension\PluginController;
use dokuwiki\Extension\Event;
/**
* @license GNU GPLv2 version 2 or later (http://www.gnu.org/licenses/gpl.html)
*
Expand All @@ -28,13 +28,19 @@ class action_plugin_ckgedit_edit extends DokuWiki_Action_Plugin {
*/
function __construct()
{
global $plugin_controller;
global $updateVersion;
$this->captcha = false;
$this->setupLocale();
$this->helper = plugin_load('helper', 'ckgedit');
if(!plugin_isdisabled('captcha')) {
if(class_exists('dokuwiki\Extension\PluginController')) {
if($plugin_controller->isEnabled('captcha')) {
$this->captcha = plugin_load('helper', 'captcha');
If(!$this->captcha) $this->captcha = false;
}
else $this->captcha = false;
}
else if(!plugin_isdisabled('captcha')) {
$this->captcha = plugin_load('helper', 'captcha');
}

}

Expand Down Expand Up @@ -714,7 +720,10 @@ class="edit" tabindex="1"><?php echo "<body style='background-color:#fff;backgro
<?php

$temp=array();
trigger_event('HTML_EDITFORM_INJECTION', $temp);
if(class_exists('dokuwiki\Extension\Event')) {
Event::createAndTrigger('HTML_EDITFORM_INJECTION', $temp);
}
else trigger_event('HTML_EDITFORM_INJECTION', $temp);

$DW_EDIT_disabled = '';
$guest_perm = auth_quickaclcheck($_REQUEST['id']);
Expand All @@ -733,12 +742,10 @@ class="edit" tabindex="1"><?php echo "<body style='background-color:#fff;backgro
}
if($INFO['client'] == 'guest') $guest_user = true;
}
$CAPTCHA_HIDE = "";

if(($guest_user || $guest_group) && $guest_perm <= 2) $DW_EDIT_disabled = 'disabled';
global $USERINFO;
if(($guest_user || $guest_group ||!$USERINFO) && $guest_perm < 4 && $this->captcha && $this->captcha->isEnabled()) $CAPTCHA_HIDE = 'display: none;';
$DW_EDIT_hide = $this->dw_edit_displayed();

$is_ckgeditChrome = false;
if(stripos($_SERVER['HTTP_USER_AGENT'],'Chrome') !== false) {
preg_match("/Chrome\/(\d+)/", $_SERVER['HTTP_USER_AGENT'],$cmatch);
Expand All @@ -763,15 +770,15 @@ class="edit" tabindex="1"><?php echo "<body style='background-color:#fff;backgro
<?php echo $DW_EDIT_disabled; ?>
name="do[delete]" value="<?php echo $lang['btn_delete']?>"
title="<?php echo $this->getLang('title_dw_delete') ?>"
style = "font-size: 100%; <?php echo $CAPTCHA_HIDE;?>"
style = "font-size: 100%;"
/>


<?php if(!$is_ckgeditChrome): ?>
<input class="button" id = "ebtn__dwedit"
<?php echo $DW_EDIT_disabled; ?>
<?php echo $DW_EDIT_hide; ?>
style = "font-size: 100%;<?php echo $CAPTCHA_HIDE;?>"
style = "font-size: 100%;"
type="submit"
name="do[save]"
value="<?php echo $this->getLang('btn_dw_edit')?>"
Expand Down Expand Up @@ -842,7 +849,7 @@ class="edit" tabindex="1"><?php echo "<body style='background-color:#fff;backgro
<input class="button" type="submit"
name ="do[edit]"
id = "no_styling_btn"
style = "font-size: 100%;<?php echo $CAPTCHA_HIDE;?>"
style = "font-size: 100%;"
value="<?php echo $this->getLang('dw_btn_styling')?>"
title="<?php echo $this->getLang('title_styling')?>"
/>
Expand Down
21 changes: 11 additions & 10 deletions action/meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
define('FCK_ACTION_SUBDIR', DOKU_PLUGIN . 'ckgedit/action/');
require_once(DOKU_PLUGIN.'action.php');
use dokuwiki\Extension\PluginController;


class action_plugin_ckgedit_meta extends DokuWiki_Action_Plugin {
var $session_id = false;
Expand All @@ -30,9 +32,6 @@ function __construct() {
io_saveFile($this->dw_priority_metafn, serialize(array()));
}

if(!plugin_isdisabled('captcha')) {
$this->captcha = true;
}
}
/*
* Register its handlers with the dokuwiki's event controller
Expand All @@ -49,6 +48,14 @@ function register(Doku_Event_Handler $controller) {
$controller->register_hook('DOKUWIKI_DONE', 'BEFORE', $this, 'restore_conf');
$controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this,'_ajax_call');
$controller->register_hook('HTML_UPDATEPROFILEFORM_OUTPUT', 'BEFORE', $this, 'handle_profile_form');
$controller->register_hook('ACTION_SHOW_REDIRECT', 'BEFORE', $this, 'handle_redirect');
}

function handle_redirect(Doku_Event $event, $param) {
global $INPUT;
$ckg_redirect = $INPUT->str('ckgedit_redirect',"");
if($ckg_redirect) $event->data['id'] = $ckg_redirect;
//msg($ckg_redirect);
}

function handle_profile_form(Doku_Event $event, $param) {
Expand Down Expand Up @@ -748,14 +755,8 @@ function file_type(Doku_Event $event, $param) {
if(isset($USERINFO)) {
$this->startup_msg();
}
$acl_defines = array('EDIT'=> 2,'CREATE'=> 4,'UPLOAD'=> 8,'DELETE'=> 16,'ADMIN'=> 255);
$_auth = $this->getConf('captcha_auth');
$auth_captcha = (int)$acl_defines[$_auth];
$auth = auth_quickaclcheck($ID);

if($auth >= $auth_captcha && $this->captcha) {
$conf['plugin']['captcha']['forusers']=0;
}
$auth = auth_quickaclcheck($ID);
$JSINFO['confirm_delete']= $this->getLang('confirm_delete');
$JSINFO['doku_base'] = DOKU_BASE ;
$JSINFO['cg_rev'] = $INPUT->str('rev');
Expand Down
2 changes: 1 addition & 1 deletion ckeditor/get_headers.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
define("FCKEDITOR", DOKU_PLUGIN . 'ckgedit/fckeditor/editor/');
define('CONNECTOR', FCKEDITOR . 'filemanager/connectors/php/');
require_once(CONNECTOR . 'check_acl.php');
require_once(DOKU_INC.'inc/Input.class.php');
require_once(CONNECTOR . 'Input.class.php' );

require_once(CONNECTOR . 'SafeFN.class.php');
global $dwfck_conf;
Expand Down
2 changes: 1 addition & 1 deletion fckeditor/editor/filemanager/browser/default/js/fckxml.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer )
oXmlHttp.open( "GET", urlToCall, bAsync ) ;
// For IE 10
//See: https://blogs.msdn.com/b/ie/archive/2012/07/19/xmlhttprequest-responsexml-in-ie10-release-preview.aspx?Redirected=true
try { oXmlHttp.responseType = 'msxml-document'; } catch(e){}
// try { oXmlHttp.responseType = 'msxml-document'; } catch(e){}

this.RespType = oXmlHttp.responseType;

Expand Down
Loading