Commit 76d17606 authored by killianebel's avatar killianebel

[ADD] Autoapprove right on wiki plugins

parent 4090a3db
......@@ -1412,6 +1412,7 @@ installer/schema/20101207_feature_file_drafts_tiki.sql -text
installer/schema/20101207_unique_login_tiki.php -text
installer/schema/20101208_webservice_soap_tiki.sql -text
installer/schema/20101210_sync_users_ldap_tiki.sql -text
installer/schema/20101215_plugin_autoapprove_tiki.sql -text
installer/schema/99999999_image_plugins_kill_tiki.php -text
installer/schema/index.php -text
installer/shell.php -text
......
......@@ -2935,6 +2935,7 @@ INSERT INTO `users_permissions` (`permName`, `permDesc`, `level`, `type`, `admin
INSERT INTO `users_permissions` (`permName`, `permDesc`, `level`, `type`, `admin`, `feature_check`) VALUES('tiki_p_plugin_viewdetail', 'Can view unapproved plugin details', 'registered', 'wiki', NULL, 'feature_wiki');
INSERT INTO `users_permissions` (`permName`, `permDesc`, `level`, `type`, `admin`, `feature_check`) VALUES('tiki_p_plugin_preview', 'Can execute unapproved plugin', 'registered', 'wiki', NULL, 'feature_wiki');
INSERT INTO `users_permissions` (`permName`, `permDesc`, `level`, `type`, `admin`, `feature_check`) VALUES('tiki_p_plugin_approve', 'Can approve plugin execution', 'editors', 'wiki', NULL, 'feature_wiki');
INSERT INTO `users_permissions` (`permName`, `permDesc`, `level`, `type`, `admin`, `feature_check`) VALUES('tiki_p_plugin_autoapprove', 'Auto approve plugin execution', 'editors', 'wiki', NULL, 'feature_wiki');
INSERT INTO `users_permissions` (`permName`, `permDesc`, `level`, `type`, `admin`, `feature_check`) VALUES('tiki_p_trust_input', 'Trust all user inputs including plugins (no security checks)', 'admin', 'tiki', NULL, NULL);
INSERT INTO `users_permissions` (`permName`, `permDesc`, `level`, `type`, `admin`, `feature_check`) VALUES('tiki_p_view_backlink', 'View page backlinks', 'basic', 'wiki', NULL, 'feature_wiki');
INSERT INTO `users_permissions` (`permName`, `permDesc`, `level`, `type`, `admin`, `feature_check`) VALUES('tiki_p_admin_notifications', 'Can admin mail notifications', 'editors', 'tiki', NULL, NULL);
......
INSERT INTO `users_permissions` (`permName`, `permDesc`, `level`, `type`, `admin`, `feature_check`) VALUES('tiki_p_plugin_autoapprove', 'Auto approve plugin execution', 'editors', 'wiki', NULL, 'feature_wiki');
\ No newline at end of file
......@@ -5095,7 +5095,16 @@ if( \$('#$id') ) {
elseif( strpos( $val, 'reject' ) === 0 )
return 'rejected';
else {
global $tiki_p_plugin_approve, $tiki_p_plugin_preview, $user;
global $tiki_p_plugin_approve, $tiki_p_plugin_preview, $tiki_p_plugin_autoapprove, $user;
if ( $tiki_p_plugin_approve == 'y' && $tiki_p_plugin_autoapprove == 'y' ) {
// Autoapprove the plugin
global $page;
$this->plugin_fingerprint_store( $fingerprint, 'accept' );
$this->invalidate_cache( $page );
return true;
}
if(
isset($_SERVER['REQUEST_METHOD'])
&& $_SERVER['REQUEST_METHOD'] == 'POST'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment