diff --git a/e107_plugins/download/includes/admin.php b/e107_plugins/download/includes/admin.php index e992375aa..8cf6abd51 100644 --- a/e107_plugins/download/includes/admin.php +++ b/e107_plugins/download/includes/admin.php @@ -286,7 +286,11 @@ class download_main_admin_ui extends e_admin_ui //required - default column user prefs protected $fieldpref = array('checkboxes', 'download_image', 'download_id', 'download_datestamp', 'download_category', 'download_name', 'download_active', 'download_class', 'fb_order', 'options'); - // + // Security modes + protected $security_options = array( + 'none' => LAN_DL_SECURITY_MODE_NONE, + 'nginx-secure_link_md5' => LAN_DL_SECURITY_MODE_NGINX_SECURELINKMD5 + ); // optional - required only in case of e.g. tables JOIN. This also could be done with custom model (set it in init()) //protected $editQry = "SELECT * FROM #release WHERE release_id = {ID}"; @@ -1149,6 +1153,19 @@ $columnInfo = array( if ($_POST['download_subsub']) $temp['download_subsub'] = '1'; else $temp['download_subsub'] = '0'; if ($_POST['download_incinfo']) $temp['download_incinfo'] = '1'; else $temp['download_incinfo'] = '0'; + + if ($_POST['download_security_mode'] === 'nginx-secure_link_md5') + { + $temp['download_security_mode'] = $_POST['download_security_mode']; + $temp['download_security_expression'] = $_POST['download_security_expression']; + $temp['download_security_link_expiry'] = $_POST['download_security_link_expiry']; + } + else + { + e107::getConfig('core')->removePref('download_security_mode'); + e107::getConfig('core')->removePref('download_security_expression'); + e107::getConfig('core')->removePref('download_security_link_expiry'); + } e107::getConfig('core')->setPref($temp)->save(false); @@ -2115,14 +2132,15 @@ $columnInfo = array( "ASC" => DOWLAN_62, "DESC" => DOWLAN_63 ); - + $text = "