mirror of
https://github.com/kleeja-official/kleeja.git
synced 2025-12-14 20:19:43 +01:00
new plugin: x_sendfile
This commit is contained in:
1
plugins/kj_x_sendfile/index.html
Executable file
1
plugins/kj_x_sendfile/index.html
Executable file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1256" /><title>Powered by Kleeja</title><style type="text/css">* {font-size: 100%;margin:0;padding: 0; color:#CECFCE;}body { font-family: Tahoma ,Arial, sans-serif;font-size: 100%;color: #69788E; margin: 10px 30px;background: #F7F7F7;}a:link, a:visited {text-decoration: none;color:#CECFCE;}a:active, a:hover {text-decoration: underline;color: #111;}h1 {font-family: "Trebuchet MS", Helvetica, sans-serif; font-size: 1.70em;font-weight: normal;color: #333333;margin-top: 0; margin-bottom: 10px;}.content_box {border: 1px dashed #CECFCE;background: #FFFFFF;padding: 10px;margin-right: auto;margin-left: auto;}</style> </head> <body title="كليجا"><br /><div class="content_box"><h1><span style="font-size:250%;color:#D80000;">403 - Access forbidden!</span></h1></div><br /><div class="content_box"><span style="font-size: 140%">Powered by <a target="_blank" href="http://www.kleeja.com">Kleeja</a></span> </div></body></html>
|
||||
136
plugins/kj_x_sendfile/init.php
Normal file
136
plugins/kj_x_sendfile/init.php
Normal file
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
# Kleeja Plugin
|
||||
# kj_x_sendfile
|
||||
# Version: 1.0
|
||||
# Developer: Kleeja team
|
||||
|
||||
# Prevent illegal run
|
||||
if (!defined('IN_PLUGINS_SYSTEM'))
|
||||
{
|
||||
exit();
|
||||
}
|
||||
|
||||
//
|
||||
// this plugin is under heavy testing,
|
||||
// you should also test it and send your test results to us. (github.com/awssat/kleeja)
|
||||
//
|
||||
|
||||
|
||||
|
||||
# Plugin Basic Information
|
||||
$kleeja_plugin['kj_x_sendfile']['information'] = array(
|
||||
# The casucal name of this plugin, anything can a human being understands
|
||||
'plugin_title' => __('Kleeja X SendFile', 'klj_x_sendfile'),
|
||||
# Who wrote this plugin?
|
||||
'plugin_developer' => 'Kleeja.com',
|
||||
# This plugin version
|
||||
'plugin_version' => '1.0',
|
||||
# Explain what is this plugin, why should I use it?
|
||||
'plugin_description' => __('Enable x-sendfile or X-Accel-Redirect for both Apache or Nginx for better performance.', 'klj_x_sendfile'),
|
||||
|
||||
# Min version of Kleeja that's requiered to run this plugin
|
||||
'plugin_kleeja_version_min' => '2.0',
|
||||
# Max version of Kleeja that support this plugin, use 0 for unlimited
|
||||
'plugin_kleeja_version_max' => '0',
|
||||
# Should this plugin run before others?, 0 is normal, and higher number has high priority
|
||||
'plugin_priority' => 0
|
||||
);
|
||||
|
||||
//after installation message, you can remove it, it's not requiered
|
||||
$kleeja_plugin['kj_x_sendfile']['first_run'] = __("Thanks for using our klj_x_sendfile plugin. To report bugs contact us on: \ninfo@kleeja.com");
|
||||
|
||||
# Plugin Installation function
|
||||
$kleeja_plugin['kj_x_sendfile']['install'] = function()
|
||||
{
|
||||
//new options
|
||||
$options = array(
|
||||
'kj_x_sendfile_enable' =>
|
||||
array(
|
||||
'title' => 'Enable kj_x_sendfile',
|
||||
'value'=> '0',
|
||||
'plg_name' => 'kj_x_sendfile',
|
||||
'field' => 'yesno',
|
||||
),
|
||||
'kj_x_sendfile_type' =>
|
||||
array(
|
||||
'title' => 'Current Server for your hosting',
|
||||
'value'=> 'apache',
|
||||
'plg_name' => 'kj_x_sendfile',
|
||||
'field' => 'select',
|
||||
),
|
||||
);
|
||||
|
||||
add_config($options);
|
||||
};
|
||||
|
||||
|
||||
//Plugin update function, called if plugin is already installed but version is different than current
|
||||
$kleeja_plugin['kj_x_sendfile']['update'] = function($old_version, $new_version)
|
||||
{
|
||||
// if(version_compare($old_version, '0.5', '<')){
|
||||
// //... update to 0.5
|
||||
// }
|
||||
//
|
||||
// if(version_compare($old_version, '0.6', '<')){
|
||||
// //... update to 0.6
|
||||
// }
|
||||
};
|
||||
|
||||
|
||||
# Plugin Uninstallation, function to be called at unistalling
|
||||
$kleeja_plugin['kj_x_sendfile']['uninstall'] = function()
|
||||
{
|
||||
//delete options
|
||||
delete_config(array(
|
||||
'kj_x_sendfile_enable',
|
||||
'kj_x_sendfile_type'
|
||||
));
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
# Plugin functions
|
||||
$kleeja_plugin['kj_x_sendfile']['functions'] = array(
|
||||
|
||||
//select options for kj_x_sendfile_type
|
||||
'option_select_values_func' => function($args){
|
||||
if($args[0] == 'kj_x_sendfile_type')
|
||||
{
|
||||
$args[2] = '<option ' . ($args[1] == 'apache' ? 'selected="selected" ' : '') . 'value="apache">Apache</option>' . "\n" .
|
||||
'<option ' . ($args[1] == 'nginx' ? 'selected="selected" ' : '') . 'value="nginx">Nginx</option>';
|
||||
}
|
||||
|
||||
//$args[2] is return by reference
|
||||
},
|
||||
|
||||
'after_endforeach_admin_page' => function(){
|
||||
add_to_adm_menu('kj_x_sendfile', __('kljXsendfile Settings', 'klj_x_sendfile'));
|
||||
},
|
||||
'do_page_before_headers_set' => function(){
|
||||
global $path_file, $config;
|
||||
|
||||
if($config['kj_x_sendfile_enable'] == 0)
|
||||
return;
|
||||
|
||||
if($config['kj_x_sendfile_type'] == 'apache')
|
||||
header('X-Sendfile: '. $path_file);
|
||||
else
|
||||
header('X-Accel-Redirect: ' . $path_file);
|
||||
|
||||
// die();
|
||||
},
|
||||
|
||||
'do_page_headers_set' => function(){
|
||||
//die();
|
||||
},
|
||||
'adm_xoptions_titles' => function($args){
|
||||
$args[0] = array_merge($args[0], array(
|
||||
'kj_x_sendfile_enable' => __('Enable x-Sendfile/X-Accel-Redirect: header', 'klj_x_sendfile'),
|
||||
'kj_x_sendfile_type' => __('Current Server type for your hosting', 'klj_x_sendfile'),
|
||||
));
|
||||
},
|
||||
'end_common' => function(){
|
||||
get_lang('klj_x_sendfile', dirname(__FILE__) . '/languages', true);
|
||||
}
|
||||
);
|
||||
1
plugins/kj_x_sendfile/languages/ar/LC_MESSAGES/index.html
Executable file
1
plugins/kj_x_sendfile/languages/ar/LC_MESSAGES/index.html
Executable file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1256" /><title>Powered by Kleeja</title><style type="text/css">* {font-size: 100%;margin:0;padding: 0; color:#CECFCE;}body { font-family: Tahoma ,Arial, sans-serif;font-size: 100%;color: #69788E; margin: 10px 30px;background: #F7F7F7;}a:link, a:visited {text-decoration: none;color:#CECFCE;}a:active, a:hover {text-decoration: underline;color: #111;}h1 {font-family: "Trebuchet MS", Helvetica, sans-serif; font-size: 1.70em;font-weight: normal;color: #333333;margin-top: 0; margin-bottom: 10px;}.content_box {border: 1px dashed #CECFCE;background: #FFFFFF;padding: 10px;margin-right: auto;margin-left: auto;}</style> </head> <body title="كليجا"><br /><div class="content_box"><h1><span style="font-size:250%;color:#D80000;">403 - Access forbidden!</span></h1></div><br /><div class="content_box"><span style="font-size: 140%">Powered by <a target="_blank" href="http://www.kleeja.com">Kleeja</a></span> </div></body></html>
|
||||
BIN
plugins/kj_x_sendfile/languages/ar/LC_MESSAGES/klj_x_sendfile.mo
Normal file
BIN
plugins/kj_x_sendfile/languages/ar/LC_MESSAGES/klj_x_sendfile.mo
Normal file
Binary file not shown.
@@ -0,0 +1,53 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR Kleeja Team
|
||||
# This file is distributed under the same license as the klj_x_sendfile package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: klj_x_sendfile 1.0\n"
|
||||
"Report-Msgid-Bugs-To: <info@kleeja.com>\n"
|
||||
"POT-Creation-Date: 2017-04-16 00:25+0300\n"
|
||||
"PO-Revision-Date: 2017-04-16 00:27+0300\n"
|
||||
"Language: ar\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"X-Generator: Poedit 2.0.1\n"
|
||||
|
||||
#: init.php:24
|
||||
msgid "Kleeja X SendFile"
|
||||
msgstr "إضافة إكس سيدفايل"
|
||||
|
||||
#: init.php:30
|
||||
msgid ""
|
||||
"Enable x-sendfile or X-Accel-Redirect for both Apache or Nginx for better "
|
||||
"performance."
|
||||
msgstr ""
|
||||
"قم بتفعيل الخاصية x-sendfile أو X-Accel-Redirect الموجودة على خوادم "
|
||||
"أباتشي أو انجن اكس لأداء أفضل في التحمل."
|
||||
|
||||
#: init.php:41
|
||||
msgid ""
|
||||
"Thanks for using our klj_x_sendfile plugin. To report bugs contact us "
|
||||
"on: \n"
|
||||
"info@kleeja.com"
|
||||
msgstr ""
|
||||
"شكرا لإستخدام إضافتنا klj_x_sendfile . عند وجود أي أخطاء قم بإبلاغنا "
|
||||
"على : \n"
|
||||
"\n"
|
||||
"info@kleeja.com"
|
||||
|
||||
#: init.php:109
|
||||
msgid "kljXsendfile Settings"
|
||||
msgstr "إعدادات kljXsendfile"
|
||||
|
||||
#: init.php:130
|
||||
msgid "Enable x-Sendfile/X-Accel-Redirect: header"
|
||||
msgstr "تفعيل خاصية x-Sendfile/X-Accel-Redirect"
|
||||
|
||||
#: init.php:131
|
||||
msgid "Current Server type for your hosting"
|
||||
msgstr "نوع السيرفر الخاص بإستضافتك"
|
||||
1
plugins/kj_x_sendfile/languages/ar/index.html
Executable file
1
plugins/kj_x_sendfile/languages/ar/index.html
Executable file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1256" /><title>Powered by Kleeja</title><style type="text/css">* {font-size: 100%;margin:0;padding: 0; color:#CECFCE;}body { font-family: Tahoma ,Arial, sans-serif;font-size: 100%;color: #69788E; margin: 10px 30px;background: #F7F7F7;}a:link, a:visited {text-decoration: none;color:#CECFCE;}a:active, a:hover {text-decoration: underline;color: #111;}h1 {font-family: "Trebuchet MS", Helvetica, sans-serif; font-size: 1.70em;font-weight: normal;color: #333333;margin-top: 0; margin-bottom: 10px;}.content_box {border: 1px dashed #CECFCE;background: #FFFFFF;padding: 10px;margin-right: auto;margin-left: auto;}</style> </head> <body title="كليجا"><br /><div class="content_box"><h1><span style="font-size:250%;color:#D80000;">403 - Access forbidden!</span></h1></div><br /><div class="content_box"><span style="font-size: 140%">Powered by <a target="_blank" href="http://www.kleeja.com">Kleeja</a></span> </div></body></html>
|
||||
1
plugins/kj_x_sendfile/languages/index.html
Executable file
1
plugins/kj_x_sendfile/languages/index.html
Executable file
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1256" /><title>Powered by Kleeja</title><style type="text/css">* {font-size: 100%;margin:0;padding: 0; color:#CECFCE;}body { font-family: Tahoma ,Arial, sans-serif;font-size: 100%;color: #69788E; margin: 10px 30px;background: #F7F7F7;}a:link, a:visited {text-decoration: none;color:#CECFCE;}a:active, a:hover {text-decoration: underline;color: #111;}h1 {font-family: "Trebuchet MS", Helvetica, sans-serif; font-size: 1.70em;font-weight: normal;color: #333333;margin-top: 0; margin-bottom: 10px;}.content_box {border: 1px dashed #CECFCE;background: #FFFFFF;padding: 10px;margin-right: auto;margin-left: auto;}</style> </head> <body title="كليجا"><br /><div class="content_box"><h1><span style="font-size:250%;color:#D80000;">403 - Access forbidden!</span></h1></div><br /><div class="content_box"><span style="font-size: 140%">Powered by <a target="_blank" href="http://www.kleeja.com">Kleeja</a></span> </div></body></html>
|
||||
Reference in New Issue
Block a user