User-specific gsconfig settings - Carlos - 2013-05-01
After reading this thread I thought it would be useful to have a very simple, small plugin that lets you define user-specific gsconfig settings (for the editor).
Download (Extend)
You can set user-specific or default settings for GSEDITORTOOL, GSEDITORHEIGHT, GSEDITORLANG and GSEDITOROPTIONS in gsconfig.php.
These settings work the same way as GS default ones but:
- for user-specific settings, append an underscore plus the user name (e.g. GSEDITORTOOL_name)
- (optional) to define default values for all users, append an underscore to the setting (e.g. GSEDITORTOOL_ instead of GSEDITORTOOL)
Note: normal default gsconfig settings for those values must be disabled (removed or commented out, with a # at the beginning of the line) for this to work. If not, they will override the specific ones.
Examples:
Advanced editor for user name1:
Code: define('GSEDITORTOOL_name1', 'advanced');
Advanced editor for all users, except name1 and name2, that will have the basic one:
Code: define('GSEDITORTOOL_', 'advanced');
define('GSEDITORTOOL_name1', 'basic');
define('GSEDITORTOOL_name2', 'basic');
UPDATE
Since version 0.3 you can use other gsconfig settings: more info
RE: User-specific gsconfig settings - Carlos - 2014-08-14
Since GS 3.3.0 this plugin doesn't work.
Here's an updated 0.2 beta version, adapted to work with GS 3.3.x too.
[attachment removed]
RE: User-specific gsconfig settings - Carlos - 2014-08-16
Version 0.2 uploaded to Extend.
Now compatible with GS 3.3.x
RE: User-specific gsconfig settings - Carlos - 2014-08-23
Version 0.3 available in Extend.
Now you can define specific user values for other gsconfig settings (for backend/administration), not only GSEDITORTOOL, etc.
You must specify those you need to use with the new USERCONFIG constant, between quotes and separated by commas and/or spaces.
For example:
PHP Code: define('USERCONFIG', 'GSDEBUG, GSNOHIGHLIGHT, GSSTYLE, GSNOVERCHECK');
will allow defining user-specific values for those settings, e.g.:
PHP Code: //debug mode enabled only for user 'admin2': define('GSDEBUG_admin2', true);
//Fred doesn't like syntax highlighting in the theme editor: define('GSNOHIGHLIGHT_fred', true);
//Automatic check for GetSimple updates disabled for all users except 'admin1': define('GSNOVERCHECK_', true); define('GSNOVERCHECK_admin1', true);
USERCONFIG can also be used for other plugins' gsconfig settings (e.g. News Manager's NMIMAGEINPUT, NMIMAGEDIR)
Note that there are several gsconfig settings that should not be used with this plugin, as they are general site (and not user-specific) settings - e.g. GSADMIN
RE: User-specific gsconfig settings - shawn_a - 2014-08-23
What hook are you using ?
RE: User-specific gsconfig settings - Carlos - 2014-08-23
It uses the 'header' hook. (I may change to 'common' so that it works for the frontend too.)
Note that this plugin does no magic: normal default gsconfig settings for those custom values must removed or commented out for this to work. If not, they'll be ignored.
RE: User-specific gsconfig settings - stwneu - 2015-04-28
I used the way described in your first post to assign a special CKEditor layout (custom-made) to one user and it's working just fine! But somehow this interferes with news-manager, where the CKEditor doesn't load at all anymore.
What did I do wrong? Thanks for your great plugin!
RE: User-specific gsconfig settings - Carlos - 2015-04-29
Can you post your custom gsconfig setting?
RE: User-specific gsconfig settings - stwneu - 2015-04-29
Of course. Please ignore the comments
PHP Code: <?php /** * GSConfig * * The base configurations for GetSimple * * @package GetSimple */
/** Prevent direct access */ if (basename($_SERVER['PHP_SELF']) == 'gsconfig.php') { die('You cannot load this page directly.'); };
/*****************************************************************************/ /** Below are constants that you can use to customize how GetSimple operates */
# Extra salt to secure your password with. Default is empty for backwards compatibility. #define('GSLOGINSALT', 'your_unique_phrase');
# Turn off auto-generation of SALT and use a custom value. Used for cookies & upload security. #define('GSUSECUSTOMSALT', 'your_new_salt_value_here');
# Default thumbnail width of uploaded image define('GSIMAGEWIDTH', '200');
# Change the administrative panel folder name #define('GSADMIN', 'admin');
# Turn on debug mode #define('GSDEBUG', TRUE);
# Ping search engines upon sitemap generation? define('GSDONOTPING', 1);
# Turn off CSRF protection. Uncomment this if you keep receiving the error message "CSRF error detected..." #define('GSNOCSRF', TRUE);
# Set override CHMOD mode #define('GSCHMOD', 0755);
# Enable Canonical Redirects? #define('GSCANONICAL', 1);
# Use Uploadify to upload files? #define('GSNOUPLOADIFY', 1);
# WYSIWYG editor height (default 500) #define('GSEDITORHEIGHT', '400');
# WYSIWYG toolbars (advanced, basic or [custom config]) define('GSEDITORTOOL', 'editor1');
#Oben festgelegt, dass alle User 'editor1' bekommmen, das ist der stark beschränkte Editor (festgelegt in config.js) #Hier werden dann User definiert, für die eine Ausnahme gemacht wird, die also einen anderen Editor bekommen. define('GSEDITORTOOL_sporrer', 'advanced');
# WYSIWYG editor language (default en) define('GSEDITORLANG', 'de');
# WYSIWYG Editor Options #define('GSEDITOROPTIONS', '');
# Set email from address #define('GSFROMEMAIL', 'noreply@get-simple.info');
# Autosave within edit.php. Value is the autosave interval in seconds #define('GSAUTOSAVE', 900);
# Enable the External API to be shown on settings page #define('GSEXTAPI', 1); # Set PHP locale # http://php.net/manual/en/function.setlocale.php #setlocale(LC_ALL, 'en_US');
# Define default timezone of server, accepts php timezone string # valid timeszones can be found here http://www.php.net/manual/en/timezones.php # define('GSTIMEZONE', 'America/Chicago');
# Disable loading of external CDN versions of scripts (jQuery/jQueryUI) #define("GSNOCDN",true);
# Disable Codemirror theme editor #define("GSNOHIGHLIGHT",true);
# Forces suppression of php errors when GSDEBUG is false, despite php ini settings define('GSSUPPRESSERRORS',true);
# Disable check for Apache web server, default false #define('GSNOAPACHECHECK', true);
# Disable header version check #define('GSNOVERCHECK', true);
# Enable alternate admin styles, current style constants are # GSSTYLE can be a comma delimied list of flags # note: stylesheets are cached, flush cache after changing # # style flags: # GSSTYLEWIDE = wide fluid # GSSTYLE_SBFIXED = fixed sidemenu # # eg. # define('GSSTYLE',GSSTYLE_SBFIXED); # define('GSSTYLE',GSSTYLEWIDE); #define('GSSTYLE',implode(',',array(GSSTYLEWIDE,GSSTYLE_SBFIXED)));
# Disable Sitemap generation and menu items # define('GSNOSITEMAP',true);
# Enable auto meta descriptions from content excerpts when empty # define('GSAUTOMETAD',true);
# Set default language for missing lang token merge, # accepts a lang string, default is 'en_US', false to disable # define('GSMERGELANG',false);
# GS prevents backend pages from being loaded in a frame # by sending an x-frame header by default to prevent clickjacking attempts # setting GSNOFRAME to false will disable this # define('GSNOFRAME',false);
?>
RE: User-specific gsconfig settings - Carlos - 2015-04-30
Default settings must have an underscore as a suffix, so it should be:
Code: define('GSEDITORTOOL_', 'editor1');
(See first post in this thread for more info)
|