#169 Add can_manage_email_template permission
This commit is contained in:
parent
5b68f5f926
commit
570ab0e54f
@ -13,7 +13,7 @@ hesk_session_start();
|
|||||||
hesk_dbConnect();
|
hesk_dbConnect();
|
||||||
hesk_isLoggedIn();
|
hesk_isLoggedIn();
|
||||||
|
|
||||||
// TODO Check permissions for this feature
|
hesk_checkPermission('can_manage_email_templates');
|
||||||
|
|
||||||
define('WYSIWYG',1);
|
define('WYSIWYG',1);
|
||||||
|
|
||||||
|
@ -735,6 +735,18 @@ function hesk_checkPermission($feature,$showerror=1) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($feature == 'can_manage_email_templates') {
|
||||||
|
if ($_SESSION['can_manage_email_templates']) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
if ($showerror) {
|
||||||
|
hesk_error($hesklang['no_permission'].'<p> </p><p align="center"><a href="index.php">'.$hesklang['click_login'].'</a>');
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Check other staff for permissions */
|
/* Check other staff for permissions */
|
||||||
if (strpos($_SESSION['heskprivileges'], $feature) === false)
|
if (strpos($_SESSION['heskprivileges'], $feature) === false)
|
||||||
{
|
{
|
||||||
|
@ -337,8 +337,8 @@ function execute210Scripts() {
|
|||||||
executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.1.0' WHERE `Key` = 'modsForHeskVersion'");
|
executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.1.0' WHERE `Key` = 'modsForHeskVersion'");
|
||||||
|
|
||||||
// Some old tables may not have been dropped during the 2.0.0 upgrade. Check and drop if necessary
|
// Some old tables may not have been dropped during the 2.0.0 upgrade. Check and drop if necessary
|
||||||
executeQuery("DROP TABLE IF EXISTS `".hesk_dbEscape($hesk['db_pfix'])."denied_ips`");
|
executeQuery("DROP TABLE IF EXISTS `".hesk_dbEscape($hesk_settings['db_pfix'])."denied_ips`");
|
||||||
executeQuery("DROP TABLE IF EXISTS `".hesk_dbEscape($hesk['db_pfix'])."denied_emails`");
|
executeQuery("DROP TABLE IF EXISTS `".hesk_dbEscape($hesk_settings['db_pfix'])."denied_emails`");
|
||||||
}
|
}
|
||||||
|
|
||||||
function execute210FileUpdate() {
|
function execute210FileUpdate() {
|
||||||
@ -395,4 +395,15 @@ $modsForHesk_settings[\'new_kb_article_visibility\'] = 0;';
|
|||||||
|
|
||||||
return file_put_contents(HESK_PATH.'modsForHesk_settings.inc.php', $file);
|
return file_put_contents(HESK_PATH.'modsForHesk_settings.inc.php', $file);
|
||||||
}
|
}
|
||||||
// END Version 2.1.1
|
// END Version 2.1.1
|
||||||
|
|
||||||
|
// BEGIN Version 2.2.0
|
||||||
|
function execute220Scripts() {
|
||||||
|
global $hesk_settings;
|
||||||
|
|
||||||
|
hesk_dbConnect();
|
||||||
|
|
||||||
|
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` ADD COLUMN `can_manage_email_templates` ENUM('0','1') NOT NULL DEFAULT '0'");
|
||||||
|
executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` SET `can_manage_email_templates` = '1' WHERE `isadmin` = '1'");
|
||||||
|
executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.2.0' WHERE `Key` = 'modsForHeskVersion'");
|
||||||
|
}
|
@ -136,4 +136,12 @@ function executeMiscellaneousSql() {
|
|||||||
// These queries are ran in case someone used an unfortunate installation they may have not properly cleaned up tables
|
// These queries are ran in case someone used an unfortunate installation they may have not properly cleaned up tables
|
||||||
executeQuery('DROP TABLE IF EXISTS `'.hesk_dbEscape($hesk_settings['db_pfix']).'denied_ips`');
|
executeQuery('DROP TABLE IF EXISTS `'.hesk_dbEscape($hesk_settings['db_pfix']).'denied_ips`');
|
||||||
executeQuery('DROP TABLE IF EXISTS `'.hesk_dbEscape($hesk_settings['db_pfix']).'denied_emails`');
|
executeQuery('DROP TABLE IF EXISTS `'.hesk_dbEscape($hesk_settings['db_pfix']).'denied_emails`');
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeEmailTemplatePermission() {
|
||||||
|
global $hesk_settings;
|
||||||
|
|
||||||
|
hesk_dbConnect();
|
||||||
|
|
||||||
|
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` DROP COLUMN `can_manage_email_templates`");
|
||||||
}
|
}
|
@ -26,8 +26,8 @@ $hesklang['email_templates'] = 'Email templates';
|
|||||||
$hesklang['email_templates_intro'] = 'You can edit your plaintext and HTML email templates here.';
|
$hesklang['email_templates_intro'] = 'You can edit your plaintext and HTML email templates here.';
|
||||||
$hesklang['edit_plain_text_template'] = 'Edit plain text template';
|
$hesklang['edit_plain_text_template'] = 'Edit plain text template';
|
||||||
$hesklang['edit_html_template'] = 'Edit HTML template';
|
$hesklang['edit_html_template'] = 'Edit HTML template';
|
||||||
$hesklang['editing_plain_text_template'] = 'Editing plain text template <code>%s</code>'; // %s: The name of the template file (XXXX.txt)
|
$hesklang['editing_plain_text_template'] = 'Editing plain text template <code>%s</code>'; // %s: The name of the template file, then language name
|
||||||
$hesklang['editing_html_template'] = 'Editing HTML template <code>%s</code>'; // %s: The name of the template file
|
$hesklang['editing_html_template'] = 'Editing HTML template <code>%s</code>'; // %s: The name of the template file, then language name
|
||||||
$hesklang['show_special_tags'] = 'Show Special Tags';
|
$hesklang['show_special_tags'] = 'Show Special Tags';
|
||||||
$hesklang['hide_special_tags'] = 'Hide Special Tags';
|
$hesklang['hide_special_tags'] = 'Hide Special Tags';
|
||||||
$hesklang['special_tag'] = 'Special Tag';
|
$hesklang['special_tag'] = 'Special Tag';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user