Browse Source

#327 Some more progress on moving settings to DB

merge-requests/2/head
Mike Koch 6 years ago
parent
commit
22465d68dc
  1. 19
      admin/admin_settings.php
  2. 1
      admin/admin_settings_save.php
  3. 23
      css/hesk_newStyle.php
  4. 2
      download_attachment.php
  5. 2
      inc/header.inc.php
  6. 18
      install/mods-for-hesk/modsForHesk.php
  7. 3
      print.php

19
admin/admin_settings.php

@ -254,25 +254,6 @@ if ( defined('HESK_DEMO') )
?>
</td>
</tr>
<tr>
<td class="text-right">
/modsForHesk_settings.inc.php
</td>
<?php
$modsForHeskIsWritable = is_writable(HESK_PATH . 'modsForHesk_settings.inc.php');
$cellClass = $modsForHeskIsWritable ? 'success' : 'danger';
?>
<td style="padding-left: 10px" class="<?php echo $cellClass; ?>">
<?php
if ($modsForHeskIsWritable) {
$enable_save_settings=1;
echo '<span class="success">'.$hesklang['exists'].'</span>, <span class="success">'.$hesklang['writable'].'</span>';
} else {
echo '<span class="success">'.$hesklang['exists'].'</span>, <span class="error">'.$hesklang['not_writable'].'</span><br />'.$hesklang['e_mfh_settings'];
}
?>
</td>
</tr>
</table>
</div>
</div>

1
admin/admin_settings_save.php

@ -504,6 +504,7 @@ foreach ($postArray as $value) {
hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."quick_help_sections` SET `show` = '1' WHERE `id` = '".intval($value)."'");
}
//TODO change this to DB calls
// Save the modsForHesk_settings.inc.php file
$set['rtl'] = empty($_POST['rtl']) ? 0 : 1;
$set['show-icons'] = empty($_POST['show-icons']) ? 0 : 1;

23
css/hesk_newStyle.php

@ -1,21 +1,20 @@
<?php
header("Content-type: text/css; charset: UTF-8");
require_once('../modsForHesk_settings.inc.php');
$navbarBackgroundColor = $modsForHesk_settings['navbarBackgroundColor'];
$navbarBrandColor = $modsForHesk_settings['navbarBrandColor'];
$navbarBrandHoverColor = $modsForHesk_settings['navbarBrandHoverColor'];
$navbarBackgroundColor = '#414a5c';
$navbarBrandColor = '#d4dee7';
$navbarBrandHoverColor = '#ffffff';
$navbarItemTextColor = $modsForHesk_settings['navbarItemTextColor'];
$navbarItemTextHoverColor = $modsForHesk_settings['navbarItemTextHoverColor'];
$navbarItemTextSelectedColor = $modsForHesk_settings['navbarItemTextSelectedColor'];
$navbarItemSelectedBackgroundColor = $modsForHesk_settings['navbarItemSelectedBackgroundColor'];
$navbarItemTextColor = '#d4dee7';
$navbarItemTextHoverColor = '#ffffff';
$navbarItemTextSelectedColor = '#ffffff';
$navbarItemSelectedBackgroundColor = '#2d3646';
$dropdownItemTextColor = $modsForHesk_settings['dropdownItemTextColor'];
$dropdownItemTextHoverColor = $modsForHesk_settings['dropdownItemTextHoverColor'];
$dropdownItemTextHoverBackgroundColor = $modsForHesk_settings['dropdownItemTextHoverBackgroundColor'];
$dropdownItemTextColor = '#333333';
$dropdownItemTextHoverColor = '#262626';
$dropdownItemTextHoverBackgroundColor = '#f5f5f5';
$questionMarkColor = $modsForHesk_settings['questionMarkColor'];
$questionMarkColor = '#000000';
?>
.nu-rtlFloatLeft {

2
download_attachment.php

@ -37,11 +37,11 @@ define('HESK_PATH','./');
// Get all the required files and functions
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'modsForHesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
hesk_load_database_functions();
hesk_session_start();
$modsForHesk_settings = mfh_getSettings();
// Are we in maintenance mode? (check customers only)
if ( empty($SESSION['id']) )

2
inc/header.inc.php

@ -46,7 +46,7 @@ $modsForHesk_settings = mfh_getSettings();
<title><?php echo (isset($hesk_settings['tmp_title']) ? $hesk_settings['tmp_title'] : $hesk_settings['hesk_title']); ?></title>
<meta http-equiv="Content-Type" content="text/html;charset=<?php echo $hesklang['ENCODING']; ?>" />
<meta name="viewport" content="width=device-width, user-scalable=no">
<meta name="theme-color" content="<?php echo $modsForHesk_settings['navbarBackgroundColor']; ?>">
<meta name="theme-color" content="<?php echo '#414a5c'; ?>">
<?php if ($modsForHesk_settings['rtl']) { ?>
<link href="<?php echo HESK_PATH; ?>hesk_style_RTL.css?v=<?php echo $hesk_settings['hesk_version']; ?>" type="text/css" rel="stylesheet" />
<?php } else { ?>

18
install/mods-for-hesk/modsForHesk.php

@ -65,24 +65,6 @@ hesk_dbConnect();
<td>CREATE, ALTER, DROP Permissions:</td>
<td class="warning"><i class="fa fa-exclamation-triangle"></i> Please check before continuing!*</td>
</tr>
<tr>
<td>
modsForHesk_settings.inc.php
</td>
<?php
$fileperm = substr(sprintf('%o', fileperms(HESK_PATH.'modsForHesk_settings.inc.php')), -4);
$class = (intval($fileperm) < 666) ? 'class="danger"' : 'class="success"';
?>
<td <?php echo $class; ?>>
<?php if ($class == 'class="success"') {
echo '<i class="fa fa-check-circle"></i> Success';
} else {
echo '<i class="fa fa-times-circle"></i> CHMOD to 0666, yours is '.$fileperm;
$allowInstallation = false;
}
?>
</td>
</tr>
<tr>
<td colspan="2">
* Mods for HESK is unable to check database permissions automatically.

3
print.php

@ -37,17 +37,18 @@ define('HESK_PATH','./');
/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'modsForHesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
hesk_load_database_functions();
hesk_session_start();
/* Get the tracking ID */
$trackingID = hesk_cleanID() or die("$hesklang[int_error]: $hesklang[no_trackID]");
/* Connect to database */
hesk_dbConnect();
$modsForHesk_settings = mfh_getSettings();
// Perform additional checks for customers
if ( empty($_SESSION['id']) )

Loading…
Cancel
Save