mirror of
https://github.com/kleeja-official/kleeja.git
synced 2026-05-08 23:25:56 +02:00
6
.php_cs
6
.php_cs
@@ -37,7 +37,11 @@ return PhpCsFixer\Config::create()
|
||||
'visibility_required' => true,
|
||||
'native_function_casing' => true,
|
||||
'no_empty_comment' => true,
|
||||
'single_line_comment_style' => true
|
||||
'single_line_comment_style' => true,
|
||||
'phpdoc_add_missing_param_annotation' => true,
|
||||
'no_spaces_after_function_name' => true,
|
||||
'no_spaces_around_offset' => true,
|
||||
'no_spaces_inside_parenthesis' => true,
|
||||
])
|
||||
->setFinder($finder)
|
||||
->setIndent(" ")
|
||||
|
||||
@@ -1,52 +1,137 @@
|
||||
|
||||
<IF NAME="current_smt == general">
|
||||
|
||||
<!-- Breadcrumbs -->
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="./">{lang.R_CPINDEX}</a></li>
|
||||
<li class="breadcrumb-item active">{lang.R_CHECK_UPDATE}</li>
|
||||
</ol>
|
||||
|
||||
<div id="updateInfo" class="alert">
|
||||
<img src="{STYLE_PATH_ADMIN}images/ajax-loader-small.gif" />
|
||||
<div class="alert" id="updateInfo">
|
||||
<div class="d-flex justify-content-between align-middle">
|
||||
<p id="updateInfoStatus">
|
||||
<img src="{STYLE_PATH_ADMIN}images/ajax-loader-small.gif" /> {lang.LOADING}
|
||||
</p>
|
||||
<button id="updateButton" type="button" class="btn btn-outline-dark btn-sm d-none" onclick="updateNow(1)">{lang.UPDATE_KLJ_NOW}</button>
|
||||
</div>
|
||||
<hr id="updateInfoHr" class="d-none">
|
||||
<p id="updateInfoMessage" class="mb-0 d-none"></p>
|
||||
</div>
|
||||
|
||||
<ul class="list-group mt-5 d-none" id="updateProcess">
|
||||
<li class="list-group-item disabled" id="update1">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<h4 class="d-inline px-2">1</h4> {lang.UPDATE_PROCESS_STEP1}
|
||||
</div>
|
||||
<span class="update-status badge badge-primary badge-light p-2"></span>
|
||||
</div>
|
||||
<div class="update-message d-none alert alert-danger mt-3 mb-0"></div>
|
||||
</li>
|
||||
<li class="list-group-item disabled" id="update2">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<h4 class="d-inline px-2">2</h4> {lang.UPDATE_PROCESS_STEP2}
|
||||
</div>
|
||||
<span class="update-status badge badge-primary badge-light p-2"></span>
|
||||
</div>
|
||||
<div class="update-message d-none alert alert-danger mt-3 mb-0"></div>
|
||||
</li>
|
||||
<li class="list-group-item disabled" id="update3">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<h4 class="d-inline px-2">3</h4> {lang.UPDATE_PROCESS_STEP3}
|
||||
</div>
|
||||
<span class="update-status badge badge-primary badge-light p-2"></span>
|
||||
</div>
|
||||
<div class="update-message d-none alert alert-danger mt-3 mb-0"></div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
setTimeout(function(){
|
||||
$.ajax({
|
||||
url: './?cp=p_check_update&smt=check&_ajax_=1',
|
||||
dataType: 'json'})
|
||||
.done(function (data) {
|
||||
if(data.content){
|
||||
var info = data.content.split(":::");
|
||||
$('#updateInfo').html(info[1]).addClass(info[0] == 1 ? 'alert-warning' : 'alert-info');
|
||||
} else {
|
||||
this.fail();
|
||||
}
|
||||
<IF NAME="showMessage"> location.href = './?update_done=1'; </IF>
|
||||
})
|
||||
.fail(function() {
|
||||
$('#updateInfo').html('{lang.ERROR_CHECK_VER}').addClass('alert-warning');
|
||||
<IF NAME="showMessage"> location.href = './?update_done=1'; </IF>
|
||||
});
|
||||
}, 300);
|
||||
function loadWhenJQueryIsReady() {
|
||||
setTimeout(function() {
|
||||
if (typeof jQuery == 'undefined' && typeof window.jQuery == 'undefined') {
|
||||
loadWhenJQueryIsReady();
|
||||
} else {
|
||||
checkVersion();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
loadWhenJQueryIsReady();
|
||||
|
||||
function checkVersion() {
|
||||
$.ajax({
|
||||
url: './?cp=p_check_update&smt=check&_ajax_=1',
|
||||
dataType: 'json'})
|
||||
.done(function (data) {
|
||||
if(data.content) {
|
||||
var info = data.content.split(":::");
|
||||
$('#updateInfo').addClass(info[0] != 0 ? 'alert-warning' : 'alert-info');
|
||||
$('#updateInfoStatus').html(info[1]);
|
||||
<UNLESS NAME="showMessage">
|
||||
if(info[0] == 2) {
|
||||
var message = info[1].split("::--x--::");
|
||||
$('#updateInfoStatus').html(message[0]);
|
||||
$('#updateInfoHr').removeClass('d-none');
|
||||
$('#updateInfoMessage').removeClass('d-none').html('<span style="font-weight:bold">{lang.RELEASE_NOTE}:</span><br>'
|
||||
+ message[1].replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '<br>') + '<br>' + message[2].replace('T', ' '));
|
||||
$('#updateButton').removeClass('d-none');
|
||||
}
|
||||
</UNLESS>
|
||||
} else {
|
||||
this.fail();
|
||||
}
|
||||
<IF NAME="showMessage"> location.href = './?update_done=1'; </IF>
|
||||
})
|
||||
.fail(function() {
|
||||
$('#updateInfo').html('{lang.ERROR_CHECK_VER}').addClass('alert-warning');
|
||||
<IF NAME="showMessage"> location.href = './?update_done=1'; </IF>
|
||||
});
|
||||
}
|
||||
|
||||
function updateNow(step) {
|
||||
|
||||
if(step == 1) {
|
||||
$('#updateButton').addClass('d-none');
|
||||
$('#updateProcess').removeClass('d-none');
|
||||
$('#updateInfoHr').addClass('d-none');
|
||||
$('#updateInfoMessage').addClass('d-none')
|
||||
}
|
||||
|
||||
$('#update'+step+' .update-status').html('<img src="{STYLE_PATH_ADMIN}images/ajax-loader-small.gif">');
|
||||
$('#update'+step+'').removeClass('disabled');
|
||||
|
||||
$.ajax({
|
||||
url: './?cp=p_check_update&smt=update'+step+'&{GET_FORM_KEY}&_ajax_=1',
|
||||
dataType: 'json'})
|
||||
.done(function (data) {
|
||||
if(data.content) {
|
||||
var info = data.content.split(":::");
|
||||
if(info[1].length > 0) {
|
||||
$('#update'+step+' .update-message').removeClass('d-none').addClass('d-block').text(info[1]);
|
||||
if(info[0] == 1) {
|
||||
$('#update'+step+' .update-message').removeClass('alert-danger').addClass('alert-success');
|
||||
}
|
||||
}
|
||||
|
||||
$('#update'+step+' .update-status').html(info[0] == 1 ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-warning text-danger"></i>');
|
||||
if(info[0] == 1 && step < 3) {
|
||||
setTimeout(function() {
|
||||
updateNow(step+1);
|
||||
}, 500);
|
||||
}
|
||||
} else {
|
||||
this.fail();
|
||||
}
|
||||
})
|
||||
.fail(function(data) {
|
||||
$('#update'+step+' .update-status').html('<i class="fa fa-warning text-danger"></i>');
|
||||
$('#update'+step+' .update-message').removeClass('d-none').addClass('d-block').html(
|
||||
(data.content ? data.content : (data.responseJSON ? data.responseJSON.content : '{lang.ERROR_TRY_AGAIN}'))
|
||||
);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<ELSEIF NAME="current_smt == howto">
|
||||
|
||||
<!-- Breadcrumbs -->
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="./">{lang.R_CPINDEX}</a></li>
|
||||
<li class="breadcrumb-item active">{lang.HOW_UPDATE_KLEEJA}</li>
|
||||
</ol>
|
||||
|
||||
<ul class="update_list">
|
||||
<li>{lang.HOW_UPDATE_KLEEJA_STEP1}</li>
|
||||
<li>{lang.HOW_UPDATE_KLEEJA_STEP2}</li>
|
||||
<li>{lang.HOW_UPDATE_KLEEJA_STEP3}
|
||||
<input class="form-control" type="text" value="{update_link}" readonly>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</IF>
|
||||
|
||||
@@ -98,6 +98,7 @@
|
||||
<h5 class="mt-0 mb-1 pull-(lang.DIR==ltr?left:right)">{{name}}</h5>
|
||||
|
||||
<a class="btn btn-primary pull-(lang.DIR==ltr?right:left)" href="{plugin_install_link}{{name}}" title="{lang.ENABLE}" onclick="javascript:return confirm_form('{lang.PLUGIN_CONFIRM_ADD}');"><i class="fa fa-download" title="{lang.ENABLE}"></i></a>
|
||||
<a class="btn btn-danger pull-(lang.DIR==ltr?right:left)" href="{plugin_delete_folder_link}{{name}}" title="{lang.DELETE}" onclick="javascript:return confirm_form('{lang.PLG_DEL_CONFIRM}');"><i class="fa fa-trash" title="{lang.DELETE}"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
</LOOP>
|
||||
@@ -196,4 +197,4 @@
|
||||
</LOOP>
|
||||
</ul>
|
||||
|
||||
</IF>
|
||||
</IF>
|
||||
|
||||
@@ -34,10 +34,11 @@ $plugin_enable_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&am
|
||||
$plugin_disable_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=disable&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_download_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=download&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_update_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=update&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_delete_folder_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=delete_folder&' . $GET_FORM_KEY . '&plg=';
|
||||
|
||||
|
||||
//check _GET Csrf token
|
||||
if (! empty($case) && in_array($case, ['install', 'uninstall', 'enable', 'disable' , 'download' , 'update']))
|
||||
if (! empty($case) && in_array($case, ['install', 'uninstall', 'enable', 'disable' , 'download' , 'update' , 'delete_folder']))
|
||||
{
|
||||
if (! kleeja_check_form_key_get('PLUGINS_FORM_KEY'))
|
||||
{
|
||||
@@ -151,7 +152,7 @@ switch ($case):
|
||||
break;
|
||||
}
|
||||
|
||||
// plugins avilable in kleeja remote catalog
|
||||
// plugins avilable in kleeja remote catalog
|
||||
if (! ($catalog_plugins = $cache->get('catalog_plugins')))
|
||||
{
|
||||
$store_link = 'https://raw.githubusercontent.com/kleeja-official/store-catalog/master/catalog.json';
|
||||
@@ -179,7 +180,7 @@ switch ($case):
|
||||
}
|
||||
|
||||
// is there a new version of this in the store
|
||||
elseif ($case == 'check' && (! empty($installed_plugins[$plugin_info['name']]) &&
|
||||
elseif ($case == 'check' && (! empty($installed_plugins[$plugin_info['name']]) &&
|
||||
version_compare(
|
||||
strtolower($installed_plugins[$plugin_info['name']]['extra_info']['plugin_version']),
|
||||
strtolower($plugin_info['file']['version']),
|
||||
@@ -552,7 +553,7 @@ switch ($case):
|
||||
exit;
|
||||
}
|
||||
|
||||
// plugins avilable in kleeja store
|
||||
// plugins avilable in kleeja store
|
||||
$store_link = 'https://raw.githubusercontent.com/kleeja-official/store-catalog/master/catalog.json';
|
||||
|
||||
$catalog_plugins = fetch_remote_file($store_link);
|
||||
@@ -581,7 +582,7 @@ switch ($case):
|
||||
// check if the version of the plugin is compatible with our kleeja version or not
|
||||
if (
|
||||
version_compare(strtolower($store_plugins[$download_plugin]['kj_min_version']), KLEEJA_VERSION, '<=')
|
||||
&& version_compare(strtolower($store_plugins[$download_plugin]['kj_max_version']), KLEEJA_VERSION, '>=')
|
||||
&& version_compare(strtolower($store_plugins[$download_plugin]['kj_max_version']), KLEEJA_VERSION, '>=')
|
||||
) {
|
||||
$download_plugin_link = $store_plugins[$download_plugin]['url'];
|
||||
|
||||
@@ -610,14 +611,14 @@ switch ($case):
|
||||
// download or update msg
|
||||
kleeja_admin_info(
|
||||
sprintf($lang[ig('update') ? 'PLUGIN_UPDATED' : 'PLUGIN_DOWNLOADED'], $download_plugin),
|
||||
ADMIN_PATH . '?cp=' . basename(__file__, '.php')
|
||||
ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=local'
|
||||
);
|
||||
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
kleeja_admin_err($lang['EXTRACT_ZIP_FAILED']);
|
||||
kleeja_admin_err(sprintf($lang['EXTRACT_ZIP_FAILED'], KLEEJA_PLUGINS_FOLDER));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -656,11 +657,29 @@ switch ($case):
|
||||
|
||||
if (is_dir($plugin_folder_name))
|
||||
{
|
||||
delete_plugin_folder($plugin_folder_name);
|
||||
kleeja_unlink($plugin_folder_name);
|
||||
}
|
||||
|
||||
redirect($plugin_download_link . $update_plugin . '&update' );
|
||||
|
||||
break;
|
||||
|
||||
case 'delete_folder':
|
||||
|
||||
$plugin_folder = g('plg');
|
||||
|
||||
$plugin_folder_name = PATH . KLEEJA_PLUGINS_FOLDER . '/' . $plugin_folder;
|
||||
|
||||
if (is_dir($plugin_folder_name))
|
||||
{
|
||||
kleeja_unlink($plugin_folder_name);
|
||||
}
|
||||
|
||||
kleeja_admin_info(
|
||||
sprintf($lang['PLG_SUCSS_DEL'] , $plugin_folder),
|
||||
ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=local'
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
endswitch;
|
||||
|
||||
@@ -13,56 +13,97 @@ if (! defined('IN_ADMIN'))
|
||||
exit();
|
||||
}
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
$current_version = KLEEJA_VERSION;
|
||||
$new_version = unserialize($config['new_version']);
|
||||
$new_version = empty($new_version['version_number'])
|
||||
? KLEEJA_VERSION
|
||||
: $new_version['version_number'];
|
||||
$backup_archive_path = PATH . 'cache/backup.zip';
|
||||
$GET_FORM_KEY = kleeja_add_form_key_get('UPDATER_FORM_KEY');
|
||||
|
||||
define('KLEEJA_VERSION_CHECK_LINK', 'https://api.github.com/repos/kleeja-official/kleeja/releases/latest');
|
||||
define('KLEEJA_LATEST_PACKAGE_LINK', 'https://api.github.com/repos/kleeja-official/kleeja/zipball/');
|
||||
|
||||
$stylee = 'admin_check_update';
|
||||
$current_smt = preg_replace('/[^a-z0-9_]/i', '', g('smt', 'str', 'general'));
|
||||
$current_smt = preg_replace('/[^a-z0-9_]/i', '', g('smt', 'str', 'general'));
|
||||
$update_link = $config['siteurl'] . 'install/update.php?lang=' . $config['language'];
|
||||
|
||||
//to prevent getting the url data for all cats
|
||||
if ($current_smt == 'check'):
|
||||
|
||||
if (in_array($current_smt, ['update1', 'update2', 'update3']))
|
||||
{
|
||||
//only founders can do the upgrade process ...
|
||||
if (intval($userinfo['founder']) !== 1)
|
||||
{
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
kleeja_admin_err($lang['HV_NOT_PRVLG_ACCESS']);
|
||||
}
|
||||
|
||||
if (! kleeja_check_form_key_get('UPDATER_FORM_KEY'))
|
||||
{
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
|
||||
kleeja_admin_err($lang['INVALID_GET_KEY']);
|
||||
}
|
||||
}
|
||||
|
||||
//check latest version
|
||||
if ($current_smt == 'check')
|
||||
{
|
||||
//get data from kleeja github repo
|
||||
if (! ($version_data = $cache->get('kleeja_repo_version')))
|
||||
{
|
||||
$github_data = fetch_remote_file('https://raw.githubusercontent.com/awssat/kleeja/master/includes/version.php', false, 6);
|
||||
$github_data = fetch_remote_file(KLEEJA_VERSION_CHECK_LINK, false, 100);
|
||||
|
||||
if (! empty($github_data))
|
||||
{
|
||||
preg_match_all('/define\(\'KLEEJA_VERSION\',\s{1,4}\'([^\']+)\'\);/', $github_data, $matches, PREG_SET_ORDER, 0);
|
||||
$version_data = trim(htmlspecialchars($matches[0][1]));
|
||||
$cache->save('kleeja_repo_version', $version_data, 3600 * 2);
|
||||
$latest_release = json_decode($github_data, true);
|
||||
$version_data = null;
|
||||
|
||||
if (json_last_error() === JSON_ERROR_NONE)
|
||||
{
|
||||
$version_data = [
|
||||
'version' => trim(htmlspecialchars($latest_release['tag_name'])),
|
||||
'info' => trim(htmlspecialchars($latest_release['body'])),
|
||||
'date' => trim(htmlspecialchars($latest_release['created_at'])),
|
||||
];
|
||||
$cache->save('kleeja_repo_version', $version_data, 3600 * 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$error = 0;
|
||||
|
||||
if (empty($version_data))
|
||||
if (empty($version_data['version']))
|
||||
{
|
||||
$text = $lang['ERROR_CHECK_VER'];
|
||||
$error = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (version_compare(strtolower(KLEEJA_VERSION), strtolower($version_data), '<'))
|
||||
if (version_compare(strtolower($current_version), strtolower($version_data['version']), '<'))
|
||||
{
|
||||
$text = sprintf($lang['UPDATE_NOW_S'], KLEEJA_VERSION, strtolower($version_data)) . '<br /><br />' . $lang['UPDATE_KLJ_NOW'];
|
||||
$error = 1;
|
||||
$text = sprintf($lang['UPDATE_NOW_S'], $current_version, strtolower($version_data['version'])) .
|
||||
'::--x--::' . $version_data['info'] . '::--x--::' . $version_data['date'];
|
||||
$error = 2;
|
||||
}
|
||||
elseif (version_compare(strtolower(KLEEJA_VERSION), strtolower($version_data), '='))
|
||||
elseif (version_compare(strtolower($current_version), strtolower($version_data['version']), '='))
|
||||
{
|
||||
$text = $lang['U_LAST_VER_KLJ'];
|
||||
}
|
||||
elseif (version_compare(strtolower(KLEEJA_VERSION), strtolower($version_data), '>'))
|
||||
elseif (version_compare(strtolower($current_version), strtolower($version_data['version']), '>'))
|
||||
{
|
||||
$text = $lang['U_USE_PRE_RE'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = $lang['ERROR_CHECK_VER'] . ' [code: ' . htmlspecialchars($version_data) . ']';
|
||||
$text = $lang['ERROR_CHECK_VER'] . ' [code: ' . htmlspecialchars($version_data['version']) . ']';
|
||||
}
|
||||
}
|
||||
|
||||
$data = [
|
||||
'version_number' => $version_data,
|
||||
'version_number' => $version_data['version'],
|
||||
'last_check' => time()
|
||||
];
|
||||
|
||||
@@ -72,14 +113,10 @@ if ($current_smt == 'check'):
|
||||
delete_cache('data_config');
|
||||
|
||||
$adminAjaxContent = $error . ':::' . $text;
|
||||
|
||||
elseif ($current_smt == 'general'):
|
||||
|
||||
// if(!$error)
|
||||
// {
|
||||
|
||||
|
||||
|
||||
}
|
||||
// home of update page
|
||||
elseif ($current_smt == 'general')
|
||||
{
|
||||
//To prevent expected error [ infinit loop ]
|
||||
if (ig('show_msg'))
|
||||
{
|
||||
@@ -98,18 +135,265 @@ elseif ($current_smt == 'general'):
|
||||
}
|
||||
}
|
||||
|
||||
$showMessage = ig('show_msg');
|
||||
}
|
||||
//1. download latest kleeja version
|
||||
elseif ($current_smt == 'update1')
|
||||
{
|
||||
if (! class_exists('ZipArchive'))
|
||||
{
|
||||
$adminAjaxContent = '930:::' . $lang['NO_ZIP_ARCHIVE'];
|
||||
}
|
||||
elseif (! version_compare(strtolower($current_version), strtolower($new_version), '<='))
|
||||
{
|
||||
$adminAjaxContent = '940:::' . $lang['U_LAST_VER_KLJ'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// downloaded the last package to cache folder
|
||||
fetch_remote_file(KLEEJA_LATEST_PACKAGE_LINK . $new_version , PATH . "cache/kleeja-{$new_version}.zip", 60, false, 10, true);
|
||||
|
||||
// }
|
||||
if (file_exists(PATH . "cache/kleeja-{$new_version}.zip"))
|
||||
{
|
||||
$adminAjaxContent = '1:::';
|
||||
file_put_contents(PATH . 'cache/step1.done', time());
|
||||
}
|
||||
else
|
||||
{
|
||||
$adminAjaxContent = '2:::' . $lang['UPDATE_ERR_FETCH_PACKAGE'];
|
||||
}
|
||||
}
|
||||
}
|
||||
//2. extract new kleeja package, create backup zip file
|
||||
elseif ($current_smt == 'update2')
|
||||
{
|
||||
if (! file_exists(PATH . 'cache/step1.done'))
|
||||
{
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
kleeja_admin_err($lang['HV_NOT_PRVLG_ACCESS']);
|
||||
}
|
||||
|
||||
$showMessage = ig('show_msg');
|
||||
kleeja_unlink(PATH . 'cache/step1.done');
|
||||
|
||||
// let's extract the zip to cache
|
||||
$zip = new ZipArchive;
|
||||
|
||||
if ($zip->open(PATH . "cache/kleeja-{$new_version}.zip") == true)
|
||||
{
|
||||
// the name of folder after extracting it
|
||||
// and we are sure that there is only one folder in the zip file
|
||||
$ex_folder = trim($zip->getNameIndex(0), '/');
|
||||
$zip->extractTo(PATH . 'cache/');
|
||||
$zip->close();
|
||||
if(rename(
|
||||
PATH . "cache/{$ex_folder}",
|
||||
PATH . "cache/kleeja-{$new_version}"
|
||||
) === false)
|
||||
{
|
||||
copy(
|
||||
PATH . "cache/{$ex_folder}",
|
||||
PATH . "cache/kleeja-{$new_version}"
|
||||
);
|
||||
|
||||
kleeja_unlink(PATH . "cache/{$ex_folder}");
|
||||
}
|
||||
}
|
||||
|
||||
// let's check if there any update files in install folder
|
||||
$update_file = PATH . "cache/kleeja-{$new_version}/install/includes/update_schema.php";
|
||||
|
||||
if (file_exists($update_file))
|
||||
{
|
||||
// move the update file from install folder to cache folder to include it later and delete install folder
|
||||
// becuse if install folder is exists , it can make some problems if dev mode is not active
|
||||
if(rename($update_file, PATH . 'cache/update_schema.php') === false)
|
||||
{
|
||||
copy($update_file, PATH . 'cache/update_schema.php');
|
||||
}
|
||||
}
|
||||
|
||||
// skip some folders
|
||||
foreach (['cache', 'plugins', 'uploads', 'styles', 'install'] as $folder_name)
|
||||
{
|
||||
kleeja_unlink(PATH . "cache/kleeja-{$new_version}/{$folder_name}");
|
||||
}
|
||||
|
||||
if (file_exists($backup_archive_path))
|
||||
{
|
||||
kleeja_unlink($backup_archive_path);
|
||||
}
|
||||
|
||||
file_put_contents(PATH . 'cache/step2.done', time());
|
||||
|
||||
$adminAjaxContent = '1:::';
|
||||
}
|
||||
//3. update, or rollback on failure
|
||||
elseif ($current_smt == 'update3')
|
||||
{
|
||||
if (! file_exists(PATH . 'cache/step2.done'))
|
||||
{
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
kleeja_admin_err($lang['HV_NOT_PRVLG_ACCESS']);
|
||||
}
|
||||
|
||||
kleeja_unlink(PATH . 'cache/step2.done');
|
||||
|
||||
$backup = new ZipArchive;
|
||||
|
||||
if ($backup->open($backup_archive_path, ZipArchive::CREATE) !== true)
|
||||
{
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
kleeja_admin_err($lang['UPDATE_BACKUP_CREATE_FAILED']);
|
||||
}
|
||||
|
||||
// delete plugin folder function with some changes :)
|
||||
$it = new RecursiveDirectoryIterator(PATH . "cache/kleeja-{$new_version}/", RecursiveDirectoryIterator::SKIP_DOTS);
|
||||
$files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
|
||||
|
||||
$update_failed = false;
|
||||
$failed_files = $new_folders = [];
|
||||
|
||||
//maintenance mode on
|
||||
update_config('siteclose', 1);
|
||||
|
||||
foreach ($files as $file)
|
||||
{
|
||||
if ($file->isFile())
|
||||
{
|
||||
$file_path = str_replace("cache/kleeja-{$new_version}/", '', $file->getPathname());
|
||||
$file_dir = str_replace("cache/kleeja-{$new_version}/", '', $file->getPath());
|
||||
|
||||
// same, no need to replace
|
||||
if (file_exists($file_path) && md5_file($file_path) == md5_file($file->getPathname()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//no folder?
|
||||
if (! file_exists($file_dir))
|
||||
{
|
||||
mkdir($file_dir, K_DIR_CHMOD, true);
|
||||
array_push($new_folders, $file_dir);
|
||||
}
|
||||
|
||||
if (! is_writable($file_path))
|
||||
{
|
||||
chmod($file_path, K_FILE_CHMOD);
|
||||
}
|
||||
|
||||
//back up current file
|
||||
$backup->addFromString(
|
||||
$file_path,
|
||||
file_get_contents($file_path)
|
||||
);
|
||||
|
||||
//copy file
|
||||
if (file_put_contents(
|
||||
$file_path,
|
||||
file_get_contents($file->getPathname())
|
||||
) === false)
|
||||
{
|
||||
|
||||
if (copy($file->getPathname(), $file_path) === false)
|
||||
{
|
||||
$update_failed = true;
|
||||
array_push($failed_files, $file_path);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($file->isDir())
|
||||
{
|
||||
// here is folder , when we finish update , we will delete all folders and files
|
||||
if (! file_exists($file_path))
|
||||
{
|
||||
mkdir($file_path, K_DIR_CHMOD, true);
|
||||
array_push($new_folders, $file_path);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$backup->close();
|
||||
|
||||
if ($update_failed)
|
||||
{
|
||||
//rollback to backup
|
||||
$zip = new ZipArchive;
|
||||
$zip->open($backup_archive_path);
|
||||
$zip->extractTo(PATH);
|
||||
$zip->close();
|
||||
|
||||
foreach ($new_folders as $folder)
|
||||
{
|
||||
kleeja_unlink($folder);
|
||||
}
|
||||
|
||||
//maintenance mode off
|
||||
update_config('siteclose', 0);
|
||||
|
||||
$adminAjaxContent = '1002:::' . $lang['UPDATE_PROCESS_FAILED'] . (defined('DEV_STAGE') ? '[failed files: ' . implode(', ', $failed_files) . ']' : '');
|
||||
}
|
||||
else
|
||||
{
|
||||
// we will include what we want to do in this file , and kleeja will done
|
||||
if (file_exists($db_update_file = PATH . 'cache/update_schema.php'))
|
||||
{
|
||||
require_once $db_update_file;
|
||||
|
||||
$all_db_updates = array_keys($update_schema);
|
||||
|
||||
$available_db_updates = array_filter($all_db_updates, function ($v) use ($config) {
|
||||
return $v > $config['db_version'];
|
||||
});
|
||||
|
||||
sort($available_db_updates);
|
||||
|
||||
if (sizeof($available_db_updates))
|
||||
{
|
||||
foreach ($available_db_updates as $db_update_version)
|
||||
{
|
||||
$SQL->show_errors = false;
|
||||
|
||||
if (isset($update_schema[$db_update_version]['sql'])
|
||||
&& sizeof($update_schema[$db_update_version]['sql']) > 0)
|
||||
{
|
||||
foreach ($update_schema[$db_update_version]['sql'] as $name=>$sql_content)
|
||||
{
|
||||
$SQL->query($sql_content);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($update_schema[$db_update_version]['functions'])
|
||||
&& sizeof($update_schema[$db_update_version]['functions']) > 0)
|
||||
{
|
||||
foreach ($update_schema[$db_update_version]['functions'] as $n)
|
||||
{
|
||||
if (is_callable($n))
|
||||
{
|
||||
$n();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//end current_smt == general
|
||||
endif;
|
||||
$SQL->query(
|
||||
"UPDATE `{$dbprefix}config` SET `value` = '" . $db_update_version . "' WHERE `name` = 'db_version'"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//secondary menu
|
||||
$go_menu = [
|
||||
'general' => ['name'=>$lang['R_CHECK_UPDATE'], 'link'=> basename(ADMIN_PATH) . '?cp=p_check_update&smt=general', 'goto'=>'general', 'current'=> $current_smt == 'general'],
|
||||
'howto' => ['name'=>$lang['HOW_UPDATE_KLEEJA'], 'link'=> basename(ADMIN_PATH) . '?cp=p_check_update&smt=howto', 'goto'=>'howto', 'current'=> $current_smt == 'howto'],
|
||||
'site' => ['name'=>'Kleeja.com', 'link'=> 'http://www.kleeja.com', 'goto'=>'site', 'current'=> $current_smt == 'site'],
|
||||
];
|
||||
//maintenance mode off
|
||||
update_config('siteclose', 0);
|
||||
|
||||
// after a success update, delete files and folders in cache
|
||||
kleeja_unlink(PATH . "cache/kleeja-{$new_version}");
|
||||
kleeja_unlink(PATH . "cache/kleeja-{$new_version}.zip");
|
||||
delete_cache('', true);
|
||||
|
||||
$adminAjaxContent = '1:::' . sprintf($lang['UPDATE_PROCESS_DONE'], $new_version);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ if (! defined('PATH'))
|
||||
{
|
||||
define('__DIR__', dirname(__FILE__));
|
||||
}
|
||||
define('PATH', str_replace(DIRECTORY_SEPARATOR . 'includes', '', __DIR__) . DIRECTORY_SEPARATOR);
|
||||
define('PATH', str_replace('/includes', '', __DIR__) . '/');
|
||||
}
|
||||
|
||||
//no config
|
||||
@@ -57,11 +57,15 @@ require_once PATH . KLEEJA_CONFIG_FILE;
|
||||
define('ADM_FILES_PATH', PATH . 'includes/adm');
|
||||
|
||||
//Report all errors, except notices
|
||||
error_reporting( defined('DEV_STAGE') ? E_ALL : E_ALL ^ E_NOTICE);
|
||||
error_reporting(defined('DEV_STAGE') ? E_ALL : E_ALL ^ E_NOTICE);
|
||||
|
||||
|
||||
/**
|
||||
* functions for start
|
||||
* @param mixed $error_number
|
||||
* @param mixed $error_string
|
||||
* @param mixed $error_file
|
||||
* @param mixed $error_line
|
||||
*/
|
||||
function kleeja_show_error($error_number, $error_string = '', $error_file = '', $error_line = '')
|
||||
{
|
||||
@@ -129,9 +133,9 @@ if (empty($dbname) || empty($dbuser))
|
||||
exit;
|
||||
}
|
||||
|
||||
//include files .. & classes ..
|
||||
$root_path = PATH;
|
||||
// $db_type = isset($db_type) ? $db_type : 'mysqli';
|
||||
// solutions for hosts running under suexec, add define('HAS_SUEXEC', true) to config.php.
|
||||
define('K_FILE_CHMOD', defined('HAS_SUEXEC') ? (0644 & ~umask()) : 0644);
|
||||
define('K_DIR_CHMOD', defined('HAS_SUEXEC') ? (0755 & ~umask()) : 0755);
|
||||
|
||||
include PATH . 'includes/functions_alternative.php';
|
||||
include PATH . 'includes/version.php';
|
||||
@@ -163,7 +167,7 @@ unset($dbpass);
|
||||
|
||||
|
||||
|
||||
$tpl = new kleeja_style;
|
||||
$tpl = new kleeja_style;
|
||||
$usrcp = new usrcp;
|
||||
|
||||
//then get caches
|
||||
@@ -310,10 +314,10 @@ if (
|
||||
file_exists(PATH . 'install') &&
|
||||
! defined('IN_ADMIN') &&
|
||||
! defined('IN_LOGIN') &&
|
||||
! defined('DEV_STAGE') &&
|
||||
! defined('DEV_STAGE') &&
|
||||
! (defined('IN_GO') && in_array(g('go'), ['queue'])) &&
|
||||
! (defined('IN_UCP') && in_array(g('go'), ['captcha', 'login']))
|
||||
) {
|
||||
) {
|
||||
//Different message for admins! delete install folder
|
||||
kleeja_info((user_can('enter_acp') ? $lang['DELETE_INSTALL_FOLDER'] : $lang['WE_UPDATING_KLEEJA_NOW']), $lang['SITE_CLOSED']);
|
||||
}
|
||||
@@ -323,16 +327,16 @@ if (
|
||||
$login_page = '';
|
||||
|
||||
if (
|
||||
$config['siteclose'] == '1' &&
|
||||
! user_can('enter_acp') &&
|
||||
! defined('IN_LOGIN') &&
|
||||
! defined('IN_ADMIN') &&
|
||||
$config['siteclose'] == '1' &&
|
||||
! user_can('enter_acp') &&
|
||||
! defined('IN_LOGIN') &&
|
||||
! defined('IN_ADMIN') &&
|
||||
! (defined('IN_GO') && in_array(g('go'), ['queue'])) &&
|
||||
! (defined('IN_UCP') && in_array(g('go'), ['captcha', 'login', 'register', 'logout']))
|
||||
) {
|
||||
//if download, images ?
|
||||
if (
|
||||
( defined('IN_DOWNLOAD') && (ig('img') || ig('thmb') || ig('thmbf') || ig('imgf')) )
|
||||
(defined('IN_DOWNLOAD') && (ig('img') || ig('thmb') || ig('thmbf') || ig('imgf')))
|
||||
|| g('go', 'str', '') == 'queue'
|
||||
) {
|
||||
@$SQL->close();
|
||||
@@ -352,7 +356,8 @@ if (
|
||||
|
||||
//exceed total size
|
||||
if (($stat_sizes >= ($config['total_size'] *(1048576))) && ! defined('IN_LOGIN') && ! defined('IN_ADMIN'))
|
||||
{// convert megabytes to bytes
|
||||
{
|
||||
// convert megabytes to bytes
|
||||
// Send a 503 HTTP response code to prevent search bots from indexing the maintenace message
|
||||
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
||||
kleeja_info($lang['SIZES_EXCCEDED'], $lang['STOP_FOR_SIZE']);
|
||||
|
||||
@@ -22,7 +22,7 @@ if (! defined('IN_COMMON'))
|
||||
*/
|
||||
function kleeja_detecting_bots()
|
||||
{
|
||||
global $SQL, $usrcp, $dbprefix, $config, $klj_session;
|
||||
global $SQL, $dbprefix, $config;
|
||||
|
||||
// get information ..
|
||||
$agent = $SQL->escape($_SERVER['HTTP_USER_AGENT']);
|
||||
@@ -97,7 +97,7 @@ function get_ban()
|
||||
// if the request is an image
|
||||
//
|
||||
if (
|
||||
( defined('IN_DOWNLOAD') && (ig('img') || ig('thmb') || ig('thmbf') || ig('imgf')) )
|
||||
(defined('IN_DOWNLOAD') && (ig('img') || ig('thmb') || ig('thmbf') || ig('imgf')))
|
||||
|| g('go', 'str', '') == 'queue'
|
||||
) {
|
||||
@$SQL->close();
|
||||
@@ -271,8 +271,8 @@ function fetch_remote_file($url, $save_in = false, $timeout = 20, $head_only = f
|
||||
{
|
||||
@ini_set('default_socket_timeout', $timeout);
|
||||
}
|
||||
$allow_url_fopen = function_exists('ini_get')
|
||||
? strtolower(@ini_get('allow_url_fopen'))
|
||||
$allow_url_fopen = function_exists('ini_get')
|
||||
? strtolower(@ini_get('allow_url_fopen'))
|
||||
: strtolower(@get_cfg_var('allow_url_fopen'));
|
||||
|
||||
if (function_exists('curl_init'))
|
||||
@@ -302,7 +302,7 @@ function fetch_remote_file($url, $save_in = false, $timeout = 20, $head_only = f
|
||||
@curl_exec($ch);
|
||||
curl_close($ch);
|
||||
fclose($out);
|
||||
}
|
||||
}
|
||||
|
||||
if ($head_only)
|
||||
{
|
||||
@@ -548,7 +548,7 @@ function delete_cache($name, $all=false)
|
||||
|
||||
if (file_exists($path_to_cache . '/' . $name))
|
||||
{
|
||||
$del = kleeja_unlink ($path_to_cache . '/' . $name, true);
|
||||
$del = kleeja_unlink($path_to_cache . '/' . $name, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,23 +577,29 @@ function kleeja_unlink($filePath, $cache_file = false)
|
||||
//99.9% who use this
|
||||
if (function_exists('unlink'))
|
||||
{
|
||||
return unlink($filePath);
|
||||
if (is_dir($filePath))
|
||||
{
|
||||
$it = new RecursiveDirectoryIterator($filePath, RecursiveDirectoryIterator::SKIP_DOTS);
|
||||
$files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
|
||||
|
||||
foreach ($files as $file)
|
||||
{
|
||||
if ($file->isDir())
|
||||
{
|
||||
rmdir($file->getPathname());
|
||||
}
|
||||
else
|
||||
{
|
||||
unlink($file->getPathname());
|
||||
}
|
||||
}
|
||||
return rmdir($filePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
return unlink($filePath);
|
||||
}
|
||||
}
|
||||
//5% only who use this
|
||||
//else if (function_exists('exec'))
|
||||
//{
|
||||
// $out = array();
|
||||
// $return = null;
|
||||
// exec('del ' . escapeshellarg(realpath($filepath)) . ' /q', $out, $return);
|
||||
// return $return;
|
||||
//}
|
||||
//5% only who use this
|
||||
//else if (function_exists('system'))
|
||||
//{
|
||||
// $return = null;
|
||||
// system ('del ' . escapeshellarg(realpath($filepath)) . ' /q', $return);
|
||||
// return $return;
|
||||
//}
|
||||
//just rename cache file if there is new thing
|
||||
elseif (function_exists('rename') && $cache_file)
|
||||
{
|
||||
@@ -1301,12 +1307,12 @@ function klj_clean_old_files($from = 0)
|
||||
//delete from folder ..
|
||||
if (file_exists($row['folder'] . '/' . $row['name']))
|
||||
{
|
||||
@kleeja_unlink ($row['folder'] . '/' . $row['name']);
|
||||
@kleeja_unlink($row['folder'] . '/' . $row['name']);
|
||||
}
|
||||
//delete thumb
|
||||
if (file_exists($row['folder'] . '/thumbs/' . $row['name'] ))
|
||||
if (file_exists($row['folder'] . '/thumbs/' . $row['name']))
|
||||
{
|
||||
@kleeja_unlink ($row['folder'] . '/thumbs/' . $row['name'] );
|
||||
@kleeja_unlink($row['folder'] . '/thumbs/' . $row['name']);
|
||||
}
|
||||
|
||||
$ids[] = $row['id'];
|
||||
@@ -1496,11 +1502,11 @@ function kleeja_log($text)
|
||||
return;
|
||||
}
|
||||
|
||||
$log_file = PATH . 'cache/kleeja_log.log';
|
||||
$l_c = @file_get_contents($log_file);
|
||||
$fp = @fopen($log_file, 'w');
|
||||
@fwrite($fp, $text . ' [time : ' . date('H:i a, d-m-Y') . "] \r\n" . $l_c);
|
||||
@fclose($fp);
|
||||
file_put_contents(
|
||||
PATH . 'cache/kleeja_log.log',
|
||||
date_format(date_create(), 'Y-m-d h:i:s.ua') . ' | INFO | ' . $text . PHP_EOL,
|
||||
FILE_APPEND | LOCK_EX
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1717,11 +1723,11 @@ function parse_serve_rule($regex, $args, $is_unicode = false)
|
||||
|
||||
foreach ($parsed_args as $arg_key => $arg_value)
|
||||
{
|
||||
if ( preg_match('/^\$/', $arg_value))
|
||||
if (preg_match('/^\$/', $arg_value))
|
||||
{
|
||||
$match_number = ltrim($arg_value, '$');
|
||||
|
||||
if ( isset($matches[$match_number]))
|
||||
if (isset($matches[$match_number]))
|
||||
{
|
||||
$_GET[$arg_key] = $matches[$match_number];
|
||||
}
|
||||
|
||||
@@ -18,6 +18,13 @@ if (! defined('IN_COMMON'))
|
||||
* Print cp error function handler
|
||||
*
|
||||
* For admin
|
||||
* @param mixed $msg
|
||||
* @param mixed $navigation
|
||||
* @param mixed $title
|
||||
* @param mixed $exit
|
||||
* @param mixed $redirect
|
||||
* @param mixed $rs
|
||||
* @param mixed $style
|
||||
*/
|
||||
function kleeja_admin_err($msg, $navigation = true, $title='', $exit = true, $redirect = false, $rs = 3, $style = 'admin_err')
|
||||
{
|
||||
@@ -237,7 +244,7 @@ function build_search_query($search)
|
||||
|
||||
global $SQL;
|
||||
|
||||
$search['filename'] = ! isset($search['filename']) ? '' : $search['filename'];
|
||||
$search['filename'] = ! isset($search['filename']) ? '' : $search['filename'];
|
||||
$search['username'] = ! isset($search['username']) ? '' : $search['username'];
|
||||
$search['than'] = ! isset($search['than']) ? '' : $search['than'];
|
||||
$search['size'] = ! isset($search['size']) ? '' : $search['size'];
|
||||
@@ -249,8 +256,8 @@ function build_search_query($search)
|
||||
$search['ext'] = ! isset($search['ext']) ? '' : $search['ext'];
|
||||
$search['user_ip'] = ! isset($search['user_ip']) ? '' : $search['user_ip'];
|
||||
|
||||
$file_namee = $search['filename'] != '' ? 'AND (f.real_filename LIKE \'%' . $SQL->escape($search['filename']) . '%\' OR f.name LIKE \'%' . $SQL->escape($search['filename']) . '%\')' : '';
|
||||
$usernamee = $search['username'] != '' ? 'AND u.name LIKE \'%' . $SQL->escape($search['username']) . '%\'' : '';
|
||||
$file_namee = $search['filename'] != '' ? 'AND (f.real_filename LIKE \'%' . $SQL->escape($search['filename']) . '%\' OR f.name LIKE \'%' . $SQL->escape($search['filename']) . '%\')' : '';
|
||||
$usernamee = $search['username'] != '' ? 'AND u.name LIKE \'%' . $SQL->escape($search['username']) . '%\'' : '';
|
||||
$size_than = ' f.size ' . ($search['than']!=1 ? '<=' : '>=') . (intval($search['size']) * 1024) . ' ';
|
||||
$ups_than = $search['ups'] != '' ? 'AND f.uploads ' . ($search['uthan']!=1 ? '<' : '>') . intval($search['ups']) . ' ' : '';
|
||||
$rep_than = $search['rep'] != '' ? 'AND f.report ' . ($search['rthan']!=1 ? '<' : '>') . intval($search['rep']) . ' ' : '';
|
||||
@@ -296,7 +303,7 @@ function sync_total_files($files = true, $start = false)
|
||||
$start = ! $start ? $min_id : $start;
|
||||
$end = $start + $batch_size;
|
||||
|
||||
//now lets get this step's files number
|
||||
//now lets get this step's files number
|
||||
unset($v, $result);
|
||||
|
||||
$query['SELECT'] = 'COUNT(f.id) as num_files';
|
||||
@@ -322,7 +329,7 @@ function sync_total_files($files = true, $start = false)
|
||||
//make it zero, firstly
|
||||
if ($first_loop)
|
||||
{
|
||||
$update_query['SET'] = ($files ? 'files' : 'imgs') . '= 0';
|
||||
$update_query['SET'] = ($files ? 'files' : 'imgs') . '= 0';
|
||||
$SQL->build($update_query);
|
||||
}
|
||||
|
||||
@@ -358,7 +365,7 @@ function get_actual_stats($name)
|
||||
}
|
||||
|
||||
/**
|
||||
* check wether a start box is hidden or not
|
||||
* check wether a start box is hidden or not
|
||||
* @param string $name box name
|
||||
* @return bool
|
||||
*/
|
||||
@@ -386,31 +393,3 @@ function adm_is_start_box_hidden($name)
|
||||
|
||||
return in_array($name, $boxes);
|
||||
}
|
||||
|
||||
/**
|
||||
* delete plugin folder
|
||||
* @param string $dir plugin folder path
|
||||
* @return void
|
||||
*/
|
||||
function delete_plugin_folder($dir)
|
||||
{
|
||||
$it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS);
|
||||
$files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
|
||||
|
||||
foreach ($files as $file)
|
||||
{
|
||||
if ($file->isLink())
|
||||
{
|
||||
unlink($file->getPathname());
|
||||
}
|
||||
elseif ($file->isDir())
|
||||
{
|
||||
rmdir($file->getPathname());
|
||||
}
|
||||
else
|
||||
{
|
||||
unlink($file->getPathname());
|
||||
}
|
||||
}
|
||||
rmdir($dir);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class Plugins
|
||||
private $installed_plugins_info = [];
|
||||
|
||||
|
||||
private $plugin_path = '';
|
||||
private $plugin_path = PATH . 'plugins';
|
||||
|
||||
|
||||
private static $instance;
|
||||
@@ -55,7 +55,11 @@ class Plugins
|
||||
}
|
||||
|
||||
|
||||
$this->plugin_path = PATH . KLEEJA_PLUGINS_FOLDER;
|
||||
|
||||
if (defined('KLEEJA_PLUGINS_FOLDER'))
|
||||
{
|
||||
$this->plugin_path = PATH . KLEEJA_PLUGINS_FOLDER;
|
||||
}
|
||||
|
||||
// Get installed plugins
|
||||
$query = [
|
||||
@@ -85,7 +89,7 @@ class Plugins
|
||||
{
|
||||
$dh = opendir($this->plugin_path);
|
||||
|
||||
while (false !== ($folder_name = readdir($dh)))
|
||||
while ($dh !== false and false !== ($folder_name = readdir($dh)))
|
||||
{
|
||||
if (is_dir($this->plugin_path . '/' . $folder_name) && preg_match('/[a-z0-9_.]{3,}/', $folder_name))
|
||||
{
|
||||
|
||||
@@ -140,7 +140,7 @@ class kleeja_style
|
||||
$html = preg_replace_callback('/<LOOP\s+NAME\s*=\s*(\"|)+([a-z0-9_\.]{1,})+(\"|)\s*>/i', ['kleeja_style', '_loop_callback'], $html);
|
||||
$html = preg_replace_callback(kleeja_style::reg('var'), ['kleeja_style', '_vars_callback'], $html);
|
||||
|
||||
$rep =
|
||||
$rep =
|
||||
[
|
||||
'/<\/(LOOP|IF|END|IS_BROWSER|UNLESS)>/i' => '<?php } ?>',
|
||||
'/<INCLUDE(\s+NAME|)\s*=*\s*"(.+)"\s*>/iU' => '<?php echo $this->display("\\2"); ?>',
|
||||
@@ -364,8 +364,24 @@ class kleeja_style
|
||||
{
|
||||
$this->vars = &$GLOBALS;
|
||||
|
||||
$eval_on = false;
|
||||
eval('$eval_on = true;');
|
||||
|
||||
$parsed_html = trim($this->_parse($html));
|
||||
|
||||
ob_start();
|
||||
eval(' ?' . '>' . trim($this->_parse($html)) . '<' . '?php ');
|
||||
|
||||
if($eval_on)
|
||||
{
|
||||
eval(' ?' . '>' . $parsed_html . '<' . '?php ');
|
||||
}
|
||||
else
|
||||
{
|
||||
$path = PATH . 'cache/tpl_' . md5($parsed_html) . '.php';
|
||||
file_put_contents($path, $parsed_html);
|
||||
include_once $path;
|
||||
}
|
||||
|
||||
$page = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
|
||||
@@ -19,3 +19,7 @@ if (! defined('IN_COMMON'))
|
||||
define('KLEEJA_VERSION', '3.0.2');
|
||||
|
||||
define('KLEEJA_DB_VERSION', '9');
|
||||
|
||||
// Kleeja min requirements
|
||||
define('MIN_PHP_VERSION', '7.0');
|
||||
define('MIN_MYSQL_VERSION', '4.2.2');
|
||||
|
||||
@@ -20,7 +20,7 @@ if (! defined('IN_COMMON'))
|
||||
|
||||
$config_values = [];
|
||||
|
||||
// do it like this :
|
||||
// do it like this :
|
||||
//$config_values = array('name', 'value', 'option', 'display_order', 'type', 'plg_id', 'dynamic');
|
||||
|
||||
// General settings
|
||||
@@ -45,7 +45,7 @@ $config_values[] = ['cookie_path', $cookie_data['cookie_path'], '<input type=\"t
|
||||
$config_values[] = ['cookie_domain', $cookie_data['cookie_domain'], '<input type=\"text\" id=\"cookie_domain\" name=\"cookie_domain\" value=\"{con.cookie_domain}\" size=\"20\" style=\"direction:ltr\" />', '15', 'advanced', 0, 0];
|
||||
$config_values[] = ['cookie_secure', ($cookie_data['cookie_secure'] ? '1' : '0'), '<label>{lang.YES}<input type=\"radio\" id=\"cookie_secure\" name=\"cookie_secure\" value=\"1\" <IF NAME=\"con.cookie_secure==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"cookie_secure\" name=\"cookie_secure\" value=\"0\" <IF NAME=\"con.cookie_secure==0\"> checked=\"checked\"</IF> /></label>', '16', 'advanced', 0, 0];
|
||||
|
||||
// Upload settings
|
||||
// Upload settings
|
||||
$config_values[] = ['total_size', '10000000000', '<input type=\"text\" id=\"total_size\" name=\"total_size\" value=\"{con.total_size}\" size=\"20\" style=\"direction:ltr\" />', 17, 'upload', 0, 0];
|
||||
$config_values[] = ['foldername', 'uploads', '<input type=\"text\" id=\"foldername\" name=\"foldername\" value=\"{con.foldername}\" size=\"20\" style=\"direction:ltr\" />', 18, 'upload', 0, 0];
|
||||
$config_values[] = ['prefixname', '', '<input type=\"text\" id=\"prefixname\" name=\"prefixname\" value=\"{con.prefixname}\" size=\"20\" style=\"direction:ltr\" />', 19, 'upload', 0, 0];
|
||||
@@ -68,7 +68,7 @@ $config_values[] = ['filesnum_show', '1', '<label>{lang.YES}<input type=\"radio\
|
||||
//$config_values[] = array('imagefolderexts', '', '<input type=\"text\" id=\"imagefolderexts\" name=\"imagefolderexts\" value=\"{con.imagefolderexts}\" size=\"80\">', '20', 'KLIVE', '0', '0');
|
||||
//$config_values[] = array('imagefoldere', '1', '<label>{lang.YES}<input type=\"radio\" id=\"imagefoldere\" name=\"imagefoldere\" value=\"1\" <IF NAME=\"con.imagefoldere\"> checked=\"checked\"</IF>></label><label>{lang.NO}<input type=\"radio\" id=\"imagefoldere\" name=\"imagefoldere\" value=\"0\" <IF NAME=\"con.imagefoldere\"> <ELSE> checked=\"checked\"</IF>></label>', '30', 'KLIVE', '0', '0');
|
||||
|
||||
// Interface settings
|
||||
// Interface settings
|
||||
$config_values[] = ['welcome_msg', $lang['INST_MSGINS'], '<input type=\"text\" id=\"welcome_msg\" name=\"welcome_msg\" value=\"{con.welcome_msg}\" size=\"68\" />', 30, 'interface', 0, 0];
|
||||
$config_values[] = ['allow_stat_pg', '1', '<label>{lang.YES}<input type=\"radio\" id=\"allow_stat_pg\" name=\"allow_stat_pg\" value=\"1\" <IF NAME=\"con.allow_stat_pg==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"allow_stat_pg\" name=\"allow_stat_pg\" value=\"0\" <IF NAME=\"con.allow_stat_pg==0\"> checked=\"checked\"</IF> /></label>', 31, 'interface', 0, 0];
|
||||
$config_values[] = ['allow_online', '0', '<label>{lang.YES}<input type=\"radio\" id=\"allow_online\" name=\"allow_online\" value=\"1\" <IF NAME=\"con.allow_online==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"allow_online\" name=\"allow_online\" value=\"0\" <IF NAME=\"con.allow_online==0\"> checked=\"checked\"</IF> /></label>', 32, 'interface', 0, 0];
|
||||
@@ -81,7 +81,7 @@ $config_values[] = ['enable_captcha', '1', '<label>{lang.YES}<input type=\"radio
|
||||
$config_values[] = ['thmb_dims', '100*100', '', 0, 0, 0];
|
||||
$config_values[] = ['style', 'bootstrap', '', 0, '0', 0, 0];
|
||||
$config_values[] = ['new_version', '', '', 0, 0, 0];
|
||||
$config_values[] = ['db_version', LAST_DB_VERSION, '', 0, 0, 0];
|
||||
$config_values[] = ['db_version', KLEEJA_DB_VERSION, '', 0, 0, 0];
|
||||
$config_values[] = ['last_online_time_update', time(), '', 0, 0, 1];
|
||||
$config_values[] = ['klj_clean_files_from', '0', '', 0, 0, 1];
|
||||
$config_values[] = ['style_depend_on', '', '', 0, 0, 0];
|
||||
@@ -96,7 +96,7 @@ $config_values[] = ['default_group', '3', '', 0, 0, 1];
|
||||
// Extensions
|
||||
//
|
||||
|
||||
// do it like this :
|
||||
// do it like this :
|
||||
//$ext_values[group_id] = array('ext'=>sizeInKB);
|
||||
$ext_values = [];
|
||||
|
||||
|
||||
@@ -7,35 +7,31 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Requirements of Kleeja
|
||||
define('MIN_PHP_VERSION', '7.0');
|
||||
define('MIN_MYSQL_VERSION', '4.2.2');
|
||||
//version of latest changes at db
|
||||
define ('LAST_DB_VERSION', '9');
|
||||
//set no errors
|
||||
|
||||
// get version info and min requirement values
|
||||
require PATH . 'includes/version.php';
|
||||
|
||||
//set mysql to show no errors
|
||||
define('MYSQL_NO_ERRORS', true);
|
||||
define('EVAL_IS_ON', is_eval_is_on());
|
||||
|
||||
|
||||
// Detect choosing another lang while installing
|
||||
if (ig('change_lang'))
|
||||
if (ig('change_lang') && ip('lang'))
|
||||
{
|
||||
if (ip('lang'))
|
||||
{
|
||||
header('Location: ' . $_SERVER['PHP_SELF'] . '?step=' . p('step_is') . '&lang=' . p('lang'));
|
||||
}
|
||||
header('Location: ' . $_SERVER['PHP_SELF'] . '?step=' . p('step_is') . '&lang=' . p('lang'));
|
||||
}
|
||||
|
||||
|
||||
// Including current language
|
||||
$lang = require $_path . 'lang/' . getlang() . '/common.php';
|
||||
$lang = array_merge($lang, require $_path . 'lang/' . getlang() . '/install.php');
|
||||
$lang = require PATH . 'lang/' . getlang() . '/common.php';
|
||||
$lang = array_merge($lang, require PATH . 'lang/' . getlang() . '/install.php');
|
||||
|
||||
|
||||
$IN_DEV = false;
|
||||
// Exceptions for development
|
||||
if (file_exists($_path . '.svn/entries') || file_exists('dev.txt'))
|
||||
if (file_exists(PATH . '.git'))
|
||||
{
|
||||
define('DEV_STAGE', true);
|
||||
$IN_DEV = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,17 +42,12 @@ if (file_exists($_path . '.svn/entries') || file_exists('dev.txt'))
|
||||
*/
|
||||
function getlang ($link = false)
|
||||
{
|
||||
global $_path;
|
||||
$ln = 'en';
|
||||
|
||||
if (ig('lang'))
|
||||
{
|
||||
$lang = preg_replace('/[^a-z0-9]/i', '', g('lang', 'str', 'en'));
|
||||
|
||||
$ln = file_exists($_path . 'lang/' . $lang . '/install.php') ? $lang : 'en';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ln = 'en';
|
||||
$ln = file_exists(PATH . 'lang/' . $lang . '/install.php') ? $lang : 'en';
|
||||
}
|
||||
|
||||
return $link ? 'lang=' . $ln : $ln;
|
||||
@@ -64,85 +55,90 @@ function getlang ($link = false)
|
||||
|
||||
function getjquerylink()
|
||||
{
|
||||
global $_path;
|
||||
if (file_exists(PATH . 'admin/Masmak/js/jquery.min.js'))
|
||||
{
|
||||
return PATH . 'admin/Masmak/js/jquery.min.js';
|
||||
}
|
||||
|
||||
if (file_exists($_path . 'admin/Masmak/js/jquery.min.js'))
|
||||
{
|
||||
return $_path . 'admin/Masmak/js/jquery.min.js';
|
||||
}
|
||||
else
|
||||
{
|
||||
return 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js';
|
||||
}
|
||||
return 'http://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js';
|
||||
}
|
||||
|
||||
/**
|
||||
* Parsing installing templates
|
||||
* @param mixed $tplname
|
||||
*/
|
||||
function gettpl($tplname)
|
||||
{
|
||||
global $lang, $_path;
|
||||
global $lang;
|
||||
|
||||
$tpl = preg_replace('/{{([^}]+)}}/', '<?php \\1 ?>', file_get_contents('style/' . $tplname));
|
||||
|
||||
ob_start();
|
||||
eval('?> ' . $tpl . '<?php ');
|
||||
|
||||
if (EVAL_IS_ON)
|
||||
{
|
||||
eval('?> ' . $tpl . '<?php ');
|
||||
}
|
||||
else
|
||||
{
|
||||
include_once kleeja_eval($tpl);
|
||||
}
|
||||
|
||||
$stpl = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
return $stpl;
|
||||
}
|
||||
|
||||
function is_eval_is_on()
|
||||
{
|
||||
$eval_on = false;
|
||||
eval('$eval_on = true;');
|
||||
|
||||
return $eval_on;
|
||||
}
|
||||
|
||||
function kleeja_eval($code)
|
||||
{
|
||||
$path = PATH . 'cache/' . md5($code) . '.php';
|
||||
file_put_contents($path, $code);
|
||||
return $path;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Export config
|
||||
* @param mixed $srv
|
||||
* @param mixed $usr
|
||||
* @param mixed $pass
|
||||
* @param mixed $nm
|
||||
* @param mixed $prf
|
||||
*/
|
||||
function do_config_export($srv, $usr, $pass, $nm, $prf, $fpath = '')
|
||||
function do_config_export($srv, $usr, $pass, $nm, $prf)
|
||||
{
|
||||
global $_path;
|
||||
|
||||
if (! in_array($type, ['mysql', 'mysqli']))
|
||||
{
|
||||
$type = 'mysql';
|
||||
}
|
||||
|
||||
$data = '<?php' . "\n\n" . '//fill these variables with your data' . "\n";
|
||||
//$data .= '$db_type = \'' . $type . "'; //mysqli or mysql \n";
|
||||
$data .= '$dbserver = \'' . str_replace("'", "\'", $srv) . "'; //database server \n";
|
||||
$data .= '$dbuser = \'' . str_replace("'", "\'", $usr) . "' ; // database user \n";
|
||||
$data .= '$dbpass = \'' . str_replace("'", "\'", $pass) . "'; // database password \n";
|
||||
$data .= '$dbname = \'' . str_replace("'", "\'", $nm) . "'; // database name \n";
|
||||
$data .= '$dbprefix = \'' . str_replace("'", "\'", $prf) . "'; // if you use prefix for tables , fill it \n";
|
||||
//$data .= '$adminpath = \'admin.php\';// if you renamed your acp file , please fill the new name here \n';
|
||||
//$data .= "\n\n\n";
|
||||
//$data .= "//for integration with script must change user systen from admin cp \n";
|
||||
//$data .= '$script_path = \'' . str_replace("'", "\'", $fpath) . "'; // path of script (./forums) \n";
|
||||
//$data .= "\n\n";
|
||||
//$data .= '?'.'>';
|
||||
|
||||
$written = false;
|
||||
|
||||
if (is_writable($_path))
|
||||
if (file_put_contents(PATH . 'config.php', $data, LOCK_EX) !== false)
|
||||
{
|
||||
$fh = @fopen($_path . 'config.php', 'wb');
|
||||
|
||||
if ($fh)
|
||||
{
|
||||
fwrite($fh, $data);
|
||||
fclose($fh);
|
||||
|
||||
$written = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (! $written)
|
||||
if (defined('CLI') && CLI)
|
||||
{
|
||||
header('Content-Type: text/x-delimtext; name="config.php"');
|
||||
header('Content-disposition: attachment; filename=config.php');
|
||||
echo $data;
|
||||
|
||||
exit;
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
header('Content-Type: text/x-delimtext; name="config.php"');
|
||||
header('Content-disposition: attachment; filename=config.php');
|
||||
echo $data;
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@@ -157,12 +153,13 @@ function get_microtime()
|
||||
|
||||
/**
|
||||
* Get config value from database directly, if not return false.
|
||||
* @param mixed $name
|
||||
*/
|
||||
function inst_get_config($name)
|
||||
{
|
||||
global $SQL, $dbprefix;
|
||||
|
||||
if (! $SQL)
|
||||
if (empty($SQL))
|
||||
{
|
||||
global $dbserver, $dbuser, $dbpass, $dbname;
|
||||
|
||||
@@ -174,7 +171,7 @@ function inst_get_config($name)
|
||||
$SQL = new KleejaDatabase($dbserver, $dbuser, $dbpass, $dbname);
|
||||
}
|
||||
|
||||
if (! $SQL)
|
||||
if (empty($SQL))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<!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"><p><a target="_blank" href="http://www.kleeja.com" title="kleeja"><img border="0" src="http://kleeja.com/index.png"></a></p><br /><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 Kleeja >>> the best uploader ...</span > >> <a target="_blank" href="http://www.kleeja.com/bugs/ar/">Bugs</a> | <a target="_blank" href="http://www.kleeja.com/plugins/">Plugins</a> | <a target="_blank" href="http://www.kleeja.com/styles/">Styles</a> | </div></body></html>
|
||||
44
install/includes/update_files/1.7_to_2.0.php → install/includes/update_schema.php
Normal file → Executable file
44
install/includes/update_files/1.7_to_2.0.php → install/includes/update_schema.php
Normal file → Executable file
@@ -1,12 +1,24 @@
|
||||
<?php
|
||||
//
|
||||
// Kleeja database version : 9
|
||||
//
|
||||
/**
|
||||
*
|
||||
* @package install
|
||||
* @copyright (c) 2007 Kleeja.com
|
||||
* @license ./docs/license.txt
|
||||
*
|
||||
*/
|
||||
|
||||
// not for directly open
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
// drop older versions update support after 2 year of release or as appropriate in order to
|
||||
// make this file smaller in size.
|
||||
$update_schema = [];
|
||||
|
||||
$update_sqls =
|
||||
[
|
||||
$update_schema[9]['sql'] = [
|
||||
'files_size_big' => "ALTER TABLE `{$dbprefix}files` CHANGE `size` `size` BIGINT(20) NOT NULL DEFAULT '0';",
|
||||
'group_size_big' => "ALTER TABLE `{$dbprefix}groups_exts` CHANGE `size` `size` BIGINT(20) NOT NULL DEFAULT '0';",
|
||||
'files_index_type' => "ALTER TABLE `{$dbprefix}files` ADD INDEX `type` (`type`);",
|
||||
@@ -14,19 +26,9 @@ $update_sqls =
|
||||
];
|
||||
|
||||
|
||||
//$update_functions = array
|
||||
//(
|
||||
// function () {
|
||||
//
|
||||
// },
|
||||
// function () {
|
||||
//
|
||||
// },
|
||||
//);
|
||||
|
||||
|
||||
//$update_notes = array
|
||||
//(
|
||||
// 'note .......',
|
||||
// 'note 2 .......',
|
||||
//);
|
||||
// $update_schema[9]['functions'] = [
|
||||
// function () {
|
||||
// },
|
||||
// function () {
|
||||
// },
|
||||
// ];
|
||||
@@ -17,8 +17,7 @@ error_reporting(E_ALL ^ E_NOTICE);
|
||||
define('IN_COMMON', true);
|
||||
|
||||
//path to this file from Kleeja root folder
|
||||
$_path = '../';
|
||||
define('PATH', $_path);
|
||||
define('PATH', '../');
|
||||
|
||||
|
||||
//before anything check PHP version compatibility
|
||||
@@ -42,14 +41,14 @@ if (! function_exists('mysqli_connect'))
|
||||
|
||||
|
||||
|
||||
if (file_exists($_path . 'config.php'))
|
||||
if (file_exists(PATH . 'config.php'))
|
||||
{
|
||||
include_once $_path . 'config.php';
|
||||
include_once PATH . 'config.php';
|
||||
}
|
||||
|
||||
include_once $_path . 'includes/functions.php';
|
||||
include_once PATH . 'includes/functions.php';
|
||||
|
||||
include_once $_path . 'includes/mysqli.php';
|
||||
include_once PATH . 'includes/mysqli.php';
|
||||
|
||||
include_once 'includes/functions_install.php';
|
||||
|
||||
@@ -72,10 +71,9 @@ switch (g('step', 'str'))
|
||||
default:
|
||||
case 'language':
|
||||
|
||||
if (ig('ln') && g('ln', 'str', '') !== '')
|
||||
if (ig('ln'))
|
||||
{
|
||||
// header('Location: ./?step=official&lang=' . g('ln'));
|
||||
echo '<meta http-equiv="refresh" content="0;url=./?step=what_is_kleeja&lang=' . g('ln') . '">';
|
||||
echo '<meta http-equiv="refresh" content="0;url=./?step=what_is_kleeja&lang=' . g('ln', 'str', 'en') . '">';
|
||||
|
||||
exit;
|
||||
}
|
||||
@@ -100,16 +98,16 @@ case 'choose' :
|
||||
|
||||
$install_or_no = $php_ver = true;
|
||||
|
||||
//check version of PHP
|
||||
//check version of PHP
|
||||
if (! function_exists('version_compare')
|
||||
|| version_compare(PHP_VERSION, MIN_PHP_VERSION, '<'))
|
||||
{
|
||||
$php_ver = false;
|
||||
}
|
||||
|
||||
if (file_exists($_path . 'config.php'))
|
||||
if (file_exists(PATH . 'config.php'))
|
||||
{
|
||||
include_once $_path . 'config.php';
|
||||
include_once PATH . 'config.php';
|
||||
|
||||
if (! empty($dbuser) && ! empty($dbname))
|
||||
{
|
||||
|
||||
@@ -16,52 +16,25 @@
|
||||
* include important files
|
||||
*/
|
||||
define('IN_COMMON', true);
|
||||
$_path = '../';
|
||||
define('PATH', $_path);
|
||||
define('STOP_PLUGINS', true);
|
||||
define('PATH', '../');
|
||||
|
||||
if (file_exists($_path . 'config.php'))
|
||||
if (file_exists(PATH . 'config.php'))
|
||||
{
|
||||
include_once $_path . 'config.php';
|
||||
include_once PATH . 'config.php';
|
||||
}
|
||||
include_once $_path . 'includes/functions_display.php';
|
||||
include_once $_path . 'includes/functions_alternative.php';
|
||||
include_once $_path . 'includes/functions.php';
|
||||
|
||||
include_once $_path . 'includes/mysqli.php';
|
||||
include_once PATH . 'includes/plugins.php';
|
||||
include_once PATH . 'includes/functions_display.php';
|
||||
include_once PATH . 'includes/functions_alternative.php';
|
||||
include_once PATH . 'includes/functions.php';
|
||||
|
||||
|
||||
include_once PATH . 'includes/mysqli.php';
|
||||
|
||||
include_once 'includes/functions_install.php';
|
||||
|
||||
|
||||
/**
|
||||
* @ignore an alias class for plugins class
|
||||
*/
|
||||
class Plugins
|
||||
{
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* @return Plugins
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
if (is_null(self::$instance))
|
||||
{
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function run($name)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (! ig('step'))
|
||||
{
|
||||
@@ -71,7 +44,6 @@ if (! ig('step'))
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Kleeja must be safe ..
|
||||
//
|
||||
@@ -81,7 +53,7 @@ if (! empty($dbuser) && ! empty($dbname) && ! (ig('step') && in_array(g('step'),
|
||||
|
||||
if (! empty($d))
|
||||
{
|
||||
header('Location: index.php');
|
||||
header('Location: ./index.php');
|
||||
|
||||
exit;
|
||||
}
|
||||
@@ -90,7 +62,7 @@ if (! empty($dbuser) && ! empty($dbname) && ! (ig('step') && in_array(g('step'),
|
||||
/**
|
||||
* Print header
|
||||
*/
|
||||
if (ip('dbsubmit') && ! is_writable($_path))
|
||||
if (ip('dbsubmit') && ! is_writable(PATH))
|
||||
{
|
||||
// soon
|
||||
}
|
||||
@@ -127,20 +99,14 @@ break;
|
||||
case 'f':
|
||||
|
||||
$check_ok = true;
|
||||
$advices = $register_globals = $get_magic_quotes_gpc = false;
|
||||
$advices = $ziparchive_lib = false;
|
||||
|
||||
if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
|
||||
if(! class_exists( 'ZipArchive'))
|
||||
{
|
||||
$register_globals = true;
|
||||
$ziparchive_lib = true;
|
||||
}
|
||||
|
||||
if ( (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) ||
|
||||
(@ini_get('magic_quotes_sybase') && (strtolower(@ini_get('magic_quotes_sybase')) != 'off')) )
|
||||
{
|
||||
$get_magic_quotes_gpc = true;
|
||||
}
|
||||
|
||||
if ($register_globals || $get_magic_quotes_gpc)
|
||||
if ($ziparchive_lib)
|
||||
{
|
||||
$advices = true;
|
||||
}
|
||||
@@ -154,18 +120,13 @@ case 'c':
|
||||
// after submit, generate config file
|
||||
if (ip('dbsubmit'))
|
||||
{
|
||||
//lets do it
|
||||
do_config_export(
|
||||
p('db_server'),
|
||||
p('db_user'),
|
||||
p('db_pass'),
|
||||
p('db_name'),
|
||||
p('db_prefix')
|
||||
);
|
||||
//create config file, or export it to browser on failure
|
||||
do_config_export(p('db_server'), p('db_user'), p('db_pass'), p('db_name'), p('db_prefix'));
|
||||
}
|
||||
|
||||
$no_config = ! file_exists($_path . 'config.php') ? false : true;
|
||||
$writeable_path = is_writable($_path) ? true : false;
|
||||
|
||||
$no_config = ! file_exists(PATH . 'config.php') || ig('force') ? false : true;
|
||||
$writeable_path = is_writable(PATH) ? true : false;
|
||||
|
||||
echo gettpl('configs.html');
|
||||
|
||||
@@ -198,9 +159,9 @@ case 'check':
|
||||
//try to chmod them
|
||||
if (function_exists('chmod'))
|
||||
{
|
||||
@chmod($_path . 'cache', 0755);
|
||||
@chmod($_path . 'uploads', 0755);
|
||||
@chmod($_path . 'uploads/thumbs', 0755);
|
||||
@chmod(PATH . 'cache', 0755);
|
||||
@chmod(PATH . 'uploads', 0755);
|
||||
@chmod(PATH . 'uploads/thumbs', 0755);
|
||||
}
|
||||
|
||||
echo gettpl('check_all.html');
|
||||
@@ -243,8 +204,8 @@ case 'data' :
|
||||
//connect .. for check
|
||||
$SQL = new KleejaDatabase($dbserver, $dbuser, $dbpass, $dbname);
|
||||
|
||||
include_once '../includes/usr.php';
|
||||
include_once '../includes/functions_alternative.php';
|
||||
include_once PATH . 'includes/usr.php';
|
||||
include_once PATH . 'includes/functions_alternative.php';
|
||||
$usrcp = new usrcp;
|
||||
|
||||
$user_salt = substr(kleeja_base64_encode(pack('H*', sha1(mt_rand()))), 0, 7);
|
||||
|
||||
229
install/quick.php
Normal file
229
install/quick.php
Normal file
@@ -0,0 +1,229 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package install
|
||||
* @copyright (c) 2007 Kleeja.com
|
||||
* @license ./docs/license.txt
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// Report all errors, except notices
|
||||
@error_reporting(E_ALL ^ E_NOTICE);
|
||||
|
||||
|
||||
/**
|
||||
* include important files
|
||||
*/
|
||||
define('IN_COMMON', true);
|
||||
define('STOP_PLUGINS', true);
|
||||
define('PATH', __DIR__ . '/../');
|
||||
define('CLI', PHP_SAPI === 'cli');
|
||||
|
||||
|
||||
include_once PATH . 'includes/plugins.php';
|
||||
include_once PATH . 'includes/functions_display.php';
|
||||
include_once PATH . 'includes/functions_alternative.php';
|
||||
include_once PATH . 'includes/functions.php';
|
||||
include_once PATH . 'includes/mysqli.php';
|
||||
|
||||
include_once 'includes/functions_install.php';
|
||||
|
||||
//cli options
|
||||
$cli_options = [];
|
||||
|
||||
if (CLI)
|
||||
{
|
||||
$cli_options = getopt('', ['password::', 'link::']);
|
||||
}
|
||||
|
||||
|
||||
if (file_exists(PATH . 'config.php'))
|
||||
{
|
||||
include_once PATH . 'config.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
do_config_export('localhost', 'root', '', 'kleeja', 'klj_');
|
||||
|
||||
exit('`config.php` was missing! so we created one for you, kindly edit the file with database information.');
|
||||
}
|
||||
|
||||
$SQL = new KleejaDatabase($dbserver, $dbuser, $dbpass, $dbname);
|
||||
|
||||
if (! $SQL->is_connected())
|
||||
{
|
||||
exit('Can not connect to database, please make sure the data in `config.php` is correct!');
|
||||
}
|
||||
|
||||
if (! empty($SQL->mysql_version()) && version_compare($SQL->mysql_version(), MIN_MYSQL_VERSION, '<'))
|
||||
{
|
||||
exit('The required MySQL version is `' . MIN_MYSQL_VERSION . '` and yours is `' . $SQL->mysql_version() . '`!');
|
||||
}
|
||||
|
||||
foreach (['cache', 'uploads', 'uploads/thumbs'] as $folder)
|
||||
{
|
||||
if (! is_writable(PATH . $folder))
|
||||
{
|
||||
@chmod(PATH . $folder, 0755);
|
||||
|
||||
if (! is_writable(PATH . $folder))
|
||||
{
|
||||
exit('The folder `' . $folder . '` has to be writable!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//install
|
||||
$SQL = new KleejaDatabase($dbserver, $dbuser, $dbpass, $dbname);
|
||||
|
||||
include_once PATH . 'includes/usr.php';
|
||||
include_once PATH . 'includes/functions_alternative.php';
|
||||
|
||||
$usrcp = new usrcp;
|
||||
$password = ! empty($cli_options['password']) ? $cli_options['password'] : mt_rand();
|
||||
$user_salt = substr(kleeja_base64_encode(pack('H*', sha1(mt_rand()))), 0, 7);
|
||||
$user_pass = $usrcp->kleeja_hash_password($password . $user_salt);
|
||||
$user_name = $clean_name = 'admin';
|
||||
$user_mail = $config_sitemail = 'admin@example.com';
|
||||
$config_urls_type = 'id';
|
||||
$config_sitename = 'Yet Another Kleeja';
|
||||
$config_siteurl = ! empty($cli_options['link'])
|
||||
? $cli_options['link']
|
||||
: 'http://' . $_SERVER['HTTP_HOST'] . str_replace('install', '', dirname($_SERVER['PHP_SELF']));
|
||||
$config_time_zone = 'Asia/Buraydah';
|
||||
|
||||
// Queries
|
||||
include 'includes/install_sqls.php';
|
||||
include 'includes/default_values.php';
|
||||
|
||||
$SQL->query($install_sqls['ALTER_DATABASE_UTF']);
|
||||
|
||||
|
||||
$err = 0;
|
||||
$errors = '';
|
||||
|
||||
foreach ($install_sqls as $name => $sql_content)
|
||||
{
|
||||
if ($name == 'DROP_TABLES' || $name == 'ALTER_DATABASE_UTF')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (! $SQL->query($sql_content))
|
||||
{
|
||||
$errors .= implode(':', $SQL->get_error()) . '' . "\n___\n";
|
||||
echo $lang['INST_SQL_ERR'] . ' : ' . $name . '[basic]' . (CLI ? PHP_EOL : '<br>');
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($err == 0)
|
||||
{
|
||||
//add configs
|
||||
foreach ($config_values as $cn)
|
||||
{
|
||||
if (empty($cn[6]))
|
||||
{
|
||||
$cn[6] = 0;
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO `{$dbprefix}config` (`name`, `value`, `option`, `display_order`, `type`, `plg_id`, `dynamic`) VALUES ('$cn[0]', '$cn[1]', '$cn[2]', '$cn[3]', '$cn[4]', '$cn[5]', '$cn[6]');";
|
||||
|
||||
if (! $SQL->query($sql))
|
||||
{
|
||||
$errors .= implode(':', $SQL->get_error()) . '' . "\n___\n";
|
||||
echo $lang['INST_SQL_ERR'] . ' : [configs_values] ' . $cn . (CLI ? PHP_EOL : '<br>');
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
|
||||
//add groups configs
|
||||
foreach ($config_values as $cn)
|
||||
{
|
||||
if ($cn[4] != 'groups' or ! $cn[4])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$itxt = '';
|
||||
|
||||
foreach ([1, 2, 3] as $im)
|
||||
{
|
||||
$itxt .= ($itxt == '' ? '' : ',') . "($im, '$cn[0]', '$cn[1]')";
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO `{$dbprefix}groups_data` (`group_id`, `name`, `value`) VALUES " . $itxt . ';';
|
||||
|
||||
if (! $SQL->query($sql))
|
||||
{
|
||||
$errors .= implode(':', $SQL->get_error()) . '' . "\n___\n";
|
||||
echo $lang['INST_SQL_ERR'] . ' : [groups_configs_values] ' . $cn . (CLI ? PHP_EOL : '<br>');
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
|
||||
//add exts
|
||||
foreach ($ext_values as $gid => $exts)
|
||||
{
|
||||
$itxt = '';
|
||||
|
||||
foreach ($exts as $t => $v)
|
||||
{
|
||||
$itxt .= ($itxt == '' ? '' : ',') . "('$t', $gid, $v)";
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO `{$dbprefix}groups_exts` (`ext`, `group_id`, `size`) VALUES " . $itxt . ';';
|
||||
|
||||
if (! $SQL->query($sql))
|
||||
{
|
||||
$errors .= implode(':', $SQL->get_error()) . '' . "\n___\n";
|
||||
echo $lang['INST_SQL_ERR'] . ' : [ext_values] ' . $gid . (CLI ? PHP_EOL : '<br>');
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
|
||||
//add acls
|
||||
foreach ($acls_values as $cn => $ct)
|
||||
{
|
||||
$it = 1;
|
||||
$itxt = '';
|
||||
|
||||
foreach ($ct as $ctk)
|
||||
{
|
||||
$itxt .= ($itxt == '' ? '' : ',') . "('$cn', '$it', '$ctk')";
|
||||
$it++;
|
||||
}
|
||||
|
||||
|
||||
$sql = "INSERT INTO `{$dbprefix}groups_acl` (`acl_name`, `group_id`, `acl_can`) VALUES " . $itxt . ';';
|
||||
|
||||
if (! $SQL->query($sql))
|
||||
{
|
||||
$errors .= implode(':', $SQL->get_error()) . '' . "\n___\n";
|
||||
echo $lang['INST_SQL_ERR'] . ' : [acl_values] ' . $cn . (CLI ? PHP_EOL : '<br>');
|
||||
$err++;
|
||||
}
|
||||
$it++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($err > 0)
|
||||
{
|
||||
echo CLI ? PHP_EOL : '<br><span style="color:red">';
|
||||
echo 'We encountered a problem during installation, see the error log:';
|
||||
echo CLI ? PHP_EOL : '</span><br>';
|
||||
echo CLI ? '' : '<textarea rows="10" style="width:100%">';
|
||||
echo $errors;
|
||||
echo CLI ? '' : '</textarea>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo CLI ? '' : '<span style="color:green">';
|
||||
echo 'Kleeja has been installed successfully, enjoy ...';
|
||||
echo CLI ? PHP_EOL : '</span><br><br>';
|
||||
echo 'Username: admin' . (CLI ? PHP_EOL : '<br>');
|
||||
echo 'Password: ' . $password;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="BoxInner"><div class="BoxTopImg"></div><div class="BoxBody"><div class="inner">
|
||||
<div class="clr"></div>
|
||||
|
||||
<h2><img src="style/images/k_info.png" class="img" alt=" " /> {{echo $lang['FUNCTIONS_CHECK']}} :</h2>
|
||||
<h2><img src="style/images/k_info.png" class="img" alt=" " /> {{echo $lang['FUNCTIONS_CHECK']}} :</h2>
|
||||
<ul class="F_Check">
|
||||
{{if(function_exists('unlink')):}}
|
||||
<li class="YesCheck">
|
||||
@@ -26,11 +26,11 @@
|
||||
<p>[ {{echo $lang['FUNCTION_DISC_GD']}} ]</p>
|
||||
</li>
|
||||
{{endif;}}
|
||||
|
||||
|
||||
{{if(function_exists('fopen')):}}
|
||||
<li class="YesCheck">
|
||||
<h3><img src="style/images/ok.png" alt=" " class="img" /> {{echo sprintf($lang['FUNCTION_IS_EXISTS'], 'fopen')}}</h3>
|
||||
<p>[ {{echo $lang['FUNCTION_DISC_FOPEN']}} ]</p>
|
||||
<p>[ {{echo $lang['FUNCTION_DISC_FOPEN']}} ]</p>
|
||||
</li>
|
||||
{{else: $GLOBALS['check_ok'] = false;}}
|
||||
<li class="NoCheck">
|
||||
@@ -53,21 +53,17 @@
|
||||
</ul>
|
||||
|
||||
<div class="hr"></div>
|
||||
|
||||
{{if($GLOBALS['advices']):}}
|
||||
<h2 style="font-size:100%;"><img src="style/images/k_info.png" class="img" alt=" " /> {{echo $lang['ADVICES_CHECK']}} :</h2>
|
||||
<ul class="F_Check">
|
||||
{{if($GLOBALS['register_globals']):}}
|
||||
<li class="NoCheck"><p style="text-indent:0;"><img src="style/images/surprised.png" alt=" " class="img" />{{echo $lang['ADVICES_REGISTER_GLOBALS']}}</p></li>
|
||||
{{endif;}}
|
||||
|
||||
{{if($GLOBALS['get_magic_quotes_gpc']):}}
|
||||
<li class="NoCheck"><p style="text-indent:0;"><img src="style/images/surprised.png" alt=" " class="img" />{{echo $lang['ADVICES_MAGIC_QUOTES']}}</p></li>
|
||||
{{if($GLOBALS['advices']):}}
|
||||
<h2 style="font-size:100%;"><img src="style/images/k_info.png" class="img" alt=" " /> {{echo $lang['ADVICES_CHECK']}} :</h2>
|
||||
<ul class="F_Check">
|
||||
{{if($GLOBALS['ziparchive_lib']):}}
|
||||
<li class="NoCheck"><p style="text-indent:0;"><img src="style/images/surprised.png" alt=" " class="img" />{{echo $lang['ZIPARCHIVE_LIB']}}</p></li>
|
||||
{{endif;}}
|
||||
</ul>
|
||||
<div class="hr"></div>
|
||||
{{endif;}}
|
||||
|
||||
|
||||
<center>
|
||||
{{if($GLOBALS['check_ok']):}}
|
||||
<form method="post" action="{{echo './install.php?step=c&' . getlang(1)}}">
|
||||
@@ -82,5 +78,5 @@
|
||||
{{endif;}}
|
||||
</center>
|
||||
|
||||
<div class="clr"></div>
|
||||
</div></div><div class="BoxBottomImg"></div></div>
|
||||
<div class="clr"></div>
|
||||
</div></div><div class="BoxBottomImg"></div></div>
|
||||
|
||||
@@ -8,32 +8,32 @@
|
||||
{{endif}}
|
||||
|
||||
|
||||
|
||||
|
||||
{{if($GLOBALS['no_connection']): $GLOBALS['submit_disabled'] = true;}}
|
||||
<div class="notice">
|
||||
<p class="error2"><img src="style/images/k_info.png" class="img" alt=" " />{{echo $lang['INST_CONNCET_ERR']}}</p>
|
||||
</div>
|
||||
{{endif}}
|
||||
|
||||
|
||||
{{if($GLOBALS['mysql_ver']): $GLOBALS['submit_disabled'] = true;}}
|
||||
<div class="notice">
|
||||
<p class="error2"><img src="style/images/k_info.png" class="img" alt=" " />{{echo sprintf($lang['INST_MYSQL_LESSMIN'], MIN_MYSQL_VERSION, $GLOBALS['mysql_ver'])}}</p>
|
||||
</div>
|
||||
{{endif}}
|
||||
|
||||
{{if(!is_writable($_path . 'cache')) : $GLOBALS['submit_disabled'] = true;}}
|
||||
{{if(!is_writable(PATH . 'cache')) : $GLOBALS['submit_disabled'] = true;}}
|
||||
<div class="notice">
|
||||
<p class="error2"><img src="style/images/k_info.png" class="img" alt=" " />[ cache ] : {{echo $lang['INST_NO_WRTABLE']}}</p>
|
||||
</div>
|
||||
{{endif}}
|
||||
|
||||
{{if(!is_writable($_path . 'uploads')) : $GLOBALS['submit_disabled'] = true;}}
|
||||
|
||||
{{if(!is_writable(PATH . 'uploads')) : $GLOBALS['submit_disabled'] = true;}}
|
||||
<div class="notice">
|
||||
<p class="error2"><img src="style/images/k_info.png" class="img" alt=" " />[ uploads ] : {{echo $lang['INST_NO_WRTABLE']}}</p>
|
||||
</div>
|
||||
{{endif}}
|
||||
|
||||
{{if(!is_writable($_path . 'uploads/thumbs')) : $GLOBALS['submit_disabled'] = true;}}
|
||||
{{if(!is_writable(PATH . 'uploads/thumbs')) : $GLOBALS['submit_disabled'] = true;}}
|
||||
<div class="notice">
|
||||
<p class="error2"><img src="style/images/k_info.png" class="img" alt=" " />[ uploads/thumbs ] : {{echo $lang['INST_NO_WRTABLE']}}</p>
|
||||
</div>
|
||||
@@ -51,10 +51,10 @@
|
||||
</form>
|
||||
{{else:}}
|
||||
<form method="post" action="{{echo './install.php?step=check&' . getlang(1)}}">
|
||||
<button onclick="window.location.href='./install.php?step=c&{{echo getlang(1)}}';return false;" name="previous" type="submit" id="submit" class="btn"><span>« {{echo $lang['INST_PREVIOUS']}}</span></button>
|
||||
<button onclick="window.location.href='./install.php?step=c&force=1&{{echo getlang(1)}}';return false;" name="previous" type="submit" id="submit" class="btn"><span>« {{echo $lang['INST_PREVIOUS']}}</span></button>
|
||||
<button name="agres" type="submit" class="btn"><span>{{echo $lang['RE_CHECK']}} »</span></button>
|
||||
</form>
|
||||
</form>
|
||||
{{endif}}
|
||||
|
||||
<div class="clr"></div>
|
||||
<div class="clr"></div>
|
||||
</div></div><div class="BoxBottomImg"></div></div>
|
||||
|
||||
@@ -5,17 +5,6 @@
|
||||
<form method="post" action="{{echo './install.php?step=c&' . getlang(1)}}" onsubmit="javascript:return formCheck(this, Array('db_server','db_user' ,'db_name'));">
|
||||
<h2><img src="style/images/klj_info.png" class="img" alt="!" />{{echo $lang['DB_INFO']}}</h2>
|
||||
<table class="TableConf" dir="{{echo $lang['DIR']}}">
|
||||
<!--tr>
|
||||
<td class="TdConf">{{echo $lang['DB_TYPE']}}</td>
|
||||
<td class="TdInput">
|
||||
<select name="db_type" >
|
||||
{{if (function_exists('mysqli_connect')):}}
|
||||
<option value="mysqli">{{echo $lang['DB_TYPE_MYSQLI']}}</option>
|
||||
{{endif;}}
|
||||
<option value="mysql">{{echo $lang['DB_TYPE_MYSQL']}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr-->
|
||||
<tr>
|
||||
<td class="TdConf">{{echo $lang['DB_SERVER']}}</td>
|
||||
<td class="TdInput"><input name="db_server" type="text" value="localhost" class="InputConf" /></td>
|
||||
|
||||
@@ -23,7 +23,7 @@ var PATH_SPACER = 'style/images/spacer.gif';
|
||||
{{if(((ig('step') && g('step') != 'language') && (strpos('index.php', $_SERVER['PHP_SELF'])=== false && ig('step'))) OR (ig('step') && g('step') == 'license' || g('step') == 'action_file') ):}}
|
||||
<form action="?step={{echo g('step')}}&change_lang=1" method="post">
|
||||
<select name="lang" id="lang" class="Lang" onchange="submit()">
|
||||
{{if($dh = opendir($_path . 'lang')):}}
|
||||
{{if($dh = opendir(PATH . 'lang')):}}
|
||||
{{while (($file = readdir($dh)) !== false): if(strpos($file, '.') === false && $file != '..' && $file != '.'):}}
|
||||
{{$current_icon=file_exists('style/images/'.$file.'_16.png') ? 'style/images/'.$file.'_16.png' : (file_exists('../lang/'.$file.'/icon_16.png') ? '../lang/'.$file.'/icon_16.png' : 'style/images/zz_flag.png');}}
|
||||
<option value="{{echo $file}}" title="{{echo $current_icon}}" {{echo ig('lang') && $file==g('lang') || (!ig('lang') && $file=='en') ?'selected="selected"':''}}>{{echo $file}}</option>
|
||||
@@ -38,4 +38,4 @@ var PATH_SPACER = 'style/images/spacer.gif';
|
||||
</div>
|
||||
<div class="clr"></div>
|
||||
<div class="wrapper">
|
||||
<div class="clr"></div><br />
|
||||
<div class="clr"></div><br />
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<div class="language_choose">
|
||||
<ul id="LangChoose">
|
||||
{{if($dh = @opendir($_path . 'lang')): while (($file = readdir($dh)) !== false): if(strpos($file, '.') === false && $file != '..' && $file != '.'):}}
|
||||
{{if($dh = @opendir(PATH . 'lang')): while (($file = readdir($dh)) !== false): if(strpos($file, '.') === false && $file != '..' && $file != '.'):}}
|
||||
<li>
|
||||
<a href="{{echo './?step=language&ln=' . $file}}">
|
||||
{{if(file_exists('style/images/'.$file.'.png')):}}
|
||||
@@ -22,4 +22,4 @@
|
||||
</div>
|
||||
|
||||
<div class="clr"></div>
|
||||
</div></div><div class="BoxBottomImg"></div></div>
|
||||
</div></div><div class="BoxBottomImg"></div></div>
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<div class="BoxInner"><div class="BoxTopImg"></div><div class="BoxBody"><div class="inner">
|
||||
<div class="clr"></div>
|
||||
|
||||
<h2 class="h2"><img src="style/images/ok_Plugin.png" alt="" /><br />{{echo $lang['PLUGINS_INSTALLED'];}}<br /></h2>
|
||||
<table class="DataTable Plugins" dir="{{echo $lang['DIR']}}">
|
||||
<tr>
|
||||
<td class="tdd Pl">{{echo $lang['PLUGINS_NAME']}}</td>
|
||||
{{foreach($GLOBALS['installed_plugins'] as $plugin):}}
|
||||
<td style="color:green;"><b><img src="style/images/ok.png" class="img" alt="" />{{echo $plugin['p_name']}}</b></td>
|
||||
{{endforeach;}}
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tdd Pl">{{echo $lang['PLUGINS_DES']}}</td>
|
||||
{{foreach($GLOBALS['installed_plugins'] as $plugin):}}
|
||||
<td style="white-space:nowrap;">{{echo $plugin['p_des']}}</td>
|
||||
{{endforeach;}}
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tdd Pl">{{echo $lang['PLUGINS_VER']}}</td>
|
||||
{{foreach($GLOBALS['installed_plugins'] as $plugin):}}
|
||||
<td>{{echo $plugin['p_ver']}}</td>
|
||||
{{endforeach;}}
|
||||
</tr>
|
||||
</table>
|
||||
<div class="hr"></div>
|
||||
<form method="post" action="{{echo $_SERVER['PHP_SELF'] . '?step=end&' . getlang(1)}}">
|
||||
<button name="agres" type="submit" class="btn"><span>{{echo $lang['INST_NEXT']}} »</span></button>
|
||||
</form>
|
||||
|
||||
<div class="clr"></div>
|
||||
</div></div><div class="BoxBottomImg"></div></div>
|
||||
@@ -1,38 +0,0 @@
|
||||
<div class="BoxInner"><div class="BoxTopImg"></div><div class="BoxBody"><div class="inner">
|
||||
<div class="clr"></div>
|
||||
|
||||
<form method="post" action="{{echo './install.php?step=plugins&' . getlang(1)}}">
|
||||
<h2><img src="style/images/plugin.png" class="img" alt="" />{{echo $lang['PLUGINS_KLEEJA'];}}</h2>
|
||||
<p class="justify">{{echo $lang['PLUGINS_BUILT_IN'];}}</p>
|
||||
<table class="DataTable Plugins" dir="{{echo $lang['DIR']}}">
|
||||
<tr>
|
||||
<td class="tdd Pl">{{echo $lang['PLUGINS_NAME']}}</td>
|
||||
{{foreach($GLOBALS['plugins'] as $plugin):}}
|
||||
<td style="color:green;"><b>{{echo $plugin['p_name']}}</b></td>
|
||||
{{endforeach;}}
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tdd Pl">{{echo $lang['PLUGINS_DES']}}</td>
|
||||
{{foreach($GLOBALS['plugins'] as $plugin):}}
|
||||
<td style="white-space:nowrap;">{{echo $plugin['p_des']}}</td>
|
||||
{{endforeach;}}
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tdd Pl">{{echo $lang['PLUGINS_VER']}}</td>
|
||||
{{foreach($GLOBALS['plugins'] as $plugin):}}
|
||||
<td>{{echo $plugin['p_ver']}}</td>
|
||||
{{endforeach;}}
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tdd Pl"></td>
|
||||
{{foreach($GLOBALS['plugins'] as $plugin):}}
|
||||
<td><input type="checkbox" name="plugin_file[]" value="{{echo $plugin['p_file']}}" checked="checked" /></td>
|
||||
{{endforeach;}}
|
||||
</tr>
|
||||
</table>
|
||||
<div class="hr"></div>
|
||||
<button name="datasubmit" type="submit" class="btn"><span>{{echo $lang['INST_NEXT']}} »</span></button>
|
||||
</form>
|
||||
|
||||
<div class="clr"></div>
|
||||
</div></div><div class="BoxBottomImg"></div></div>
|
||||
@@ -604,7 +604,7 @@ li.NoCheck {
|
||||
|
||||
|
||||
.ins_klj {
|
||||
{{if($GLOBALS['IN_DEV']): echo "
|
||||
{{if(defined('DEV_STAGE')): echo "
|
||||
width: 50px;
|
||||
height: 350px;
|
||||
position: fixed;
|
||||
@@ -612,4 +612,4 @@ li.NoCheck {
|
||||
left: 10px;
|
||||
background: url('style/images/dev_mode.gif') no-repeat left center;
|
||||
";endif;}}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,31 +16,28 @@
|
||||
* include important files
|
||||
*/
|
||||
define('IN_COMMON', true);
|
||||
$_path = '../';
|
||||
define('PATH', $_path);
|
||||
define('STOP_PLUGINS', true);
|
||||
define('PATH', '../');
|
||||
|
||||
if (file_exists($_path . 'config.php'))
|
||||
if (file_exists(PATH . 'config.php'))
|
||||
{
|
||||
include_once $_path . 'config.php';
|
||||
include_once PATH . 'config.php';
|
||||
}
|
||||
|
||||
include_once $_path . 'includes/functions.php';
|
||||
include_once $_path . 'includes/functions_alternative.php';
|
||||
include_once PATH . 'includes/plugins.php';
|
||||
include_once PATH . 'includes/functions.php';
|
||||
include_once PATH . 'includes/functions_alternative.php';
|
||||
|
||||
include_once $_path . 'includes/mysqli.php';
|
||||
include_once PATH . 'includes/mysqli.php';
|
||||
|
||||
include_once 'includes/functions_install.php';
|
||||
include_once 'includes/update_schema.php';
|
||||
|
||||
|
||||
$order_update_files = [
|
||||
'1.7_to_2.0' => 9,
|
||||
// filename => db_version
|
||||
];
|
||||
|
||||
$SQL = new KleejaDatabase($dbserver, $dbuser, $dbpass, $dbname);
|
||||
|
||||
//
|
||||
// Is current db is up-to-date ?
|
||||
// fix missing db_version
|
||||
//
|
||||
$config['db_version'] = inst_get_config('db_version');
|
||||
|
||||
@@ -62,121 +59,69 @@ if (! ip('action_file_do'))
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Navigation ..
|
||||
*/
|
||||
switch (g('step', 'str', 'action_file'))
|
||||
{
|
||||
default:
|
||||
case 'action_file':
|
||||
|
||||
if (ip('action_file_do'))
|
||||
{
|
||||
if (p('action_file_do', 'str', '') !== '')
|
||||
{
|
||||
echo '<meta http-equiv="refresh" content="0;url=' . $_SERVER['PHP_SELF'] . '?step=update_now&action_file_do=' . p('action_file_do') . '&' . getlang(1) . '">';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//get fles
|
||||
$s_path = 'includes/update_files';
|
||||
$dh = opendir($s_path);
|
||||
$upfiles = [];
|
||||
|
||||
while (($file = readdir($dh)) !== false)
|
||||
{
|
||||
if (substr($file, -3) == 'php')
|
||||
{
|
||||
$file = str_replace('.php', '', $file);
|
||||
$db_ver = $order_update_files[$file];
|
||||
|
||||
// var_dump($db_ver);
|
||||
|
||||
if ((empty($config['db_version']) || $db_ver > $config['db_version']))
|
||||
{
|
||||
$upfiles[$db_ver] = $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
@closedir($dh);
|
||||
|
||||
ksort($upfiles);
|
||||
|
||||
echo gettpl('update_list.html');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'update_now':
|
||||
|
||||
if (! ig('action_file_do'))
|
||||
$complete_update = true;
|
||||
$update_msgs_arr = [];
|
||||
$current_db_version = $config['db_version'];
|
||||
|
||||
$all_db_updates = array_keys($update_schema);
|
||||
|
||||
$available_db_updates = array_filter($all_db_updates, function ($v) use ($current_db_version) {
|
||||
return $v > $current_db_version;
|
||||
});
|
||||
|
||||
sort($available_db_updates);
|
||||
|
||||
if (! sizeof($available_db_updates))
|
||||
{
|
||||
$update_msgs_arr[] = '<span style="color:green;">' . $lang['INST_UPDATE_CUR_VER_IS_UP'] . '</span>';
|
||||
$complete_update = false;
|
||||
}
|
||||
|
||||
//
|
||||
//is there any sqls
|
||||
//
|
||||
if ($complete_update)
|
||||
{
|
||||
//loop through available updates
|
||||
foreach ($available_db_updates as $db_update_version)
|
||||
{
|
||||
echo '<meta http-equiv="refresh" content="0;url=' . $_SERVER['PHP_SELF'] . '?step=action_file&' . getlang(1) . '">';
|
||||
$SQL->show_errors = false;
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
if (ig('complet_up_func'))
|
||||
{
|
||||
define('C_U_F', true);
|
||||
}
|
||||
|
||||
$file_for_up = 'includes/update_files/' . preg_replace('/[^a-z0-9_\-\.]/i', '', g('action_file_do')) . '.php';
|
||||
|
||||
if (! file_exists($file_for_up))
|
||||
{
|
||||
echo '<span style="color:red;">' . $lang['INST_ERR_NO_SELECTED_UPFILE_GOOD'] . ' [ ' . $file_for_up . ' ]</span><br />';
|
||||
}
|
||||
else
|
||||
{
|
||||
//get it
|
||||
require $file_for_up;
|
||||
$complete_update = true;
|
||||
$update_msgs_arr = [];
|
||||
|
||||
|
||||
if ($config['db_version'] >= LAST_DB_VERSION && ! defined('DEV_STAGE'))
|
||||
//sqls
|
||||
if (isset($update_schema[$db_update_version]['sql'])
|
||||
&& sizeof($update_schema[$db_update_version]['sql']) > 0)
|
||||
{
|
||||
$update_msgs_arr[] = '<span style="color:green;">' . $lang['INST_UPDATE_CUR_VER_IS_UP'] . '</span>';
|
||||
$complete_update = false;
|
||||
}
|
||||
$err = '';
|
||||
|
||||
//
|
||||
//is there any sqls
|
||||
//
|
||||
if (($complete_update || (defined('DEV_STAGE')) && ! defined('C_U_F')))
|
||||
{
|
||||
$SQL->show_errors = false;
|
||||
$complete_update = true;
|
||||
|
||||
if (isset($update_sqls) && sizeof($update_sqls) > 0)
|
||||
foreach ($update_schema[$db_update_version]['sql'] as $name=>$sql_content)
|
||||
{
|
||||
$err = '';
|
||||
$SQL->query($sql_content);
|
||||
$err = $SQL->get_error();
|
||||
|
||||
foreach ($update_sqls as $name=>$sql_content)
|
||||
if (strpos($err[1], 'Duplicate') !== false || $err[0] == '1062' || $err[0] == '1060')
|
||||
{
|
||||
$err = '';
|
||||
$SQL->query($sql_content);
|
||||
$err = $SQL->get_error();
|
||||
|
||||
if (strpos($err[1], 'Duplicate') !== false || $err[0] == '1062' || $err[0] == '1060')
|
||||
{
|
||||
$update_msgs_arr[] = '<span style="color:green;">' . $lang['INST_UPDATE_CUR_VER_IS_UP'] . '</span>';
|
||||
$complete_update = false;
|
||||
}
|
||||
$complete_update = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//is there any functions
|
||||
//
|
||||
if ($complete_update || defined('DEV_STAGE') || defined('C_U_F'))
|
||||
//functions
|
||||
if ($complete_update)
|
||||
{
|
||||
if (isset($update_functions) && sizeof($update_functions) > 0)
|
||||
if (isset($update_schema[$db_update_version]['functions']) && sizeof($update_schema[$db_update_version]['functions']) > 0)
|
||||
{
|
||||
foreach ($update_functions as $n)
|
||||
foreach ($update_schema[$db_update_version]['functions'] as $n)
|
||||
{
|
||||
if (is_callable($n))
|
||||
{
|
||||
@@ -186,31 +131,13 @@ case 'update_now':
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//is there any notes
|
||||
//
|
||||
$NOTES_CUP = false;
|
||||
|
||||
if ($complete_update || defined('DEV_STAGE'))
|
||||
{
|
||||
if (isset($update_notes) && sizeof($update_notes) > 0)
|
||||
{
|
||||
$i =1;
|
||||
$NOTES_CUP = [];
|
||||
|
||||
foreach ($update_notes as $n)
|
||||
{
|
||||
$NOTES_CUP[$i] = $n;
|
||||
++$i;
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "UPDATE `{$dbprefix}config` SET `value` = '" . LAST_DB_VERSION . "' WHERE `name` = 'db_version'";
|
||||
$SQL->query($sql);
|
||||
}
|
||||
|
||||
echo gettpl('update_end.html');
|
||||
$sql = "UPDATE `{$dbprefix}config` SET `value` = '" . UPDATE_DB_VERSION . "' WHERE `name` = 'db_version'";
|
||||
$SQL->query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo gettpl('update_end.html');
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -123,9 +123,9 @@ return [
|
||||
'PLUGIN_EXISTS_BEFORE' => 'الاضافة هذه موجودة سابقاً بنفس الاصدار أو أعلى ولاتحتاج تحديث !',
|
||||
'R_CHECK_UPDATE' => 'فحص عن تحديثات',
|
||||
'ERROR_CHECK_VER' => 'خطأ: لا يمكن جلب معلومات عن آخر نسخة في هذه اللحظة، حاول مجدداً لاحقا!.',
|
||||
'UPDATE_KLJ_NOW' => 'يجب أن تقوم بتحديث نسختك إلى آخر نسخة الآن، قم بالذهاب لموقع كليجا لمعلومات أكثر .',
|
||||
'UPDATE_KLJ_NOW' => 'تحديث الآن!',
|
||||
'U_LAST_VER_KLJ' => 'أنت تستخدم آخر نسخة من كليجا. شكراً لمتابعة نسختك بإستمرار.',
|
||||
'U_USE_PRE_RE' => 'أنت تستخدم نسخة تطويرية لم تصدر حتى الآن , اضغط <a href="mailto:info@kleeja.com">هنا</a> لإخبارنا بأي أخطاء برمجية وثغرات قد تقابلك.',
|
||||
'U_USE_PRE_RE' => 'أنت تستخدم نسخة تطويرية لم تصدر حتى الآن , اضغط <a href="https://github.com/kleeja-official/kleeja/issues">هنا</a> لإخبارنا بأي أخطاء برمجية وثغرات قد تقابلك.',
|
||||
'STYLE_IS_DEFAULT' => 'استايل افتراضي',
|
||||
'MAKE_AS_DEFAULT' => 'تعيينه افتراضي',
|
||||
'STYLE_NOW_IS_DEFAULT' => 'تم تعيين الاستايل "%s" ستايل افتراضي',
|
||||
@@ -171,18 +171,10 @@ return [
|
||||
'ADD_HEADER_EXTRA' => 'هيدر إضافي',
|
||||
'ADD_FOOTER_EXTRA' => 'فوتر إضافي',
|
||||
'ADMIN_USING_IE6' => 'أنت تستخدم متصفح "انترنت اكسبلور قديم" هذا رغم انك صاحب موقع وتعرف اكثر ممايعرفه المستخدمون العاديون ! قم بترقية متصفحك او استخدم فيرفوكس الآن.',
|
||||
|
||||
'T_CLEANING_FILES_NOW' => 'جاري تنفيذ عملية حذف الملفات الخاملة حالياً على دفعات تفادياً للضغط ,وقت العملية يعتمد على عدد الملفات وحجمها ...',
|
||||
|
||||
'HOW_UPDATE_KLEEJA' => 'كيف تقوم بتحديث كليجا ؟',
|
||||
'HOW_UPDATE_KLEEJA_STEP1' => 'توجه الى موقع سكربت كليجا الرسمي <a target="_blank" href="http://www.kleeja.com/">Kleeja.com</a> ثم توجه إلى صفحة التحميل وقم بتنزيل آخر تسخة صدرت من الاسكربت في حال توفر سكربت الترقية قم بتحميله',
|
||||
'HOW_UPDATE_KLEEJA_STEP2' => ' بعد ذلك قم بفك الضغط عن الملف الذي قمت بتحميله ثم رفعه الى موقعك لاستبدال الملفات القدييمة بالجديدة <b> عدا ملف config.php</b>.',
|
||||
'HOW_UPDATE_KLEEJA_STEP3' => 'بعد اتمام الخطوة السابقة بنجاح , قم بطلب العنوان التالي للتحديث قاعدة بيانـات الاسكربت:',
|
||||
|
||||
'DEPEND_ON_NO_STYLE_ERR' => 'هذا الستايل يعتمد على ستايل "%s" غير الموجود لديك ضمن الستايلات !.',
|
||||
'PLUGINS_REQ_NO_STYLE_ERR' => 'هذا الستايل يتطلب ان تكون الإضافة/الاضافات [ %s ] مثبتة لديك , ثبتها وحاول من جديد !.',
|
||||
'KLJ_VER_NO_STYLE_ERR' => 'هذا الستايل يتطلب على الاقل اصدار %s من كليجا .',
|
||||
|
||||
'T_CLEANING_FILES_NOW' => 'جاري تنفيذ عملية حذف الملفات الخاملة حالياً على دفعات تفادياً للضغط ,وقت العملية يعتمد على عدد الملفات وحجمها ...',
|
||||
'DEPEND_ON_NO_STYLE_ERR' => 'هذا الستايل يعتمد على ستايل "%s" غير الموجود لديك ضمن الستايلات !.',
|
||||
'PLUGINS_REQ_NO_STYLE_ERR' => 'هذا الستايل يتطلب ان تكون الإضافة/الاضافات [ %s ] مثبتة لديك , ثبتها وحاول من جديد !.',
|
||||
'KLJ_VER_NO_STYLE_ERR' => 'هذا الستايل يتطلب على الاقل اصدار %s من كليجا .',
|
||||
'STYLE_DEPEND_ON' => 'يعتمد على ستايل',
|
||||
'MESSAGE_NONE' => 'حتى الآن لا يوجد أي رسائل ..',
|
||||
'KLEEJA_TEAM' => 'فريق تطوير كليجا',
|
||||
@@ -198,10 +190,8 @@ return [
|
||||
'ADM_UNWANTED_FILES' => 'يبدوا انك قمت بالترقية من نسخة سابقة وبسبب اختلاف اسماء بعض الملفات ستلاحظ وجود ازرار متكررة بلوحة التحكم . <br /> لحل المشكلة قم بإزالة كافة الملفات في المسار "includes/adm" واعادة رفعها من جديد. ايضا قم بحذف ملف admin.php من المجلد الرئيسي اذا وجد.',
|
||||
'HTML_URLS_ENABLED_NO_HTCC' => 'لقد قمت بتفعيل روابط الهتمل ولكنك نسيت أن تقوم بإعادة تسمية الملف htaccess.txt في مجلد كليجا الرئيسي ليصبح ".htaccess". اذا لم تفهم شيئاً من هذا الكلام قم بالسؤال في الدعم الفني لكليجا او قم بتعطيل روابط الهتمل .',
|
||||
|
||||
'PLUGIN_CONFIRM_ADD' => 'انتبه, الاضافات هي تعديلات برمجية على السكربت و قد تكون ضارة أحياناً , لذا ان كنت غير متأكد من مصدر الإضافة ولم تقم بتحميلها من موقع كليجا فالافضل ان تراجع نفسك الآن . ',
|
||||
|
||||
'LOADING' => 'جاري التنفيذ',
|
||||
|
||||
'PLUGIN_CONFIRM_ADD' => 'انتبه, الاضافات هي تعديلات برمجية على السكربت و قد تكون ضارة أحياناً , لذا ان كنت غير متأكد من مصدر الإضافة ولم تقم بتحميلها من موقع كليجا فالافضل ان تراجع نفسك الآن . ',
|
||||
'LOADING' => 'جاري التنفيذ',
|
||||
'WELCOME' => 'مرحباً',
|
||||
'ENABLE_CAPTCHA' => 'تفعيل كود الامان بكليجا',
|
||||
'NO_THUMB_FOLDER' => 'يبدو ان المصغرات مُفعلة لديك ولكن في نفس الوقت مجلد %s غير متوفر مما يمنع عملية انشاء المصغرات, قم بإنشاء المجلد.',
|
||||
@@ -283,4 +273,12 @@ return [
|
||||
'VERSION' => 'الإصدار',
|
||||
'DEVELOPER' => 'المطور',
|
||||
'ALL_PLUGINS_UPDATED' => 'لا يوجد إضافات تحتاج تحديث حالياً ... ',
|
||||
'UPDATE_ERR_FETCH_PACKAGE' => 'واجهتنا مشكلة أثناء تحميل النسخة من الخادم!',
|
||||
'UPDATE_BACKUP_CREATE_FAILED' => 'لم نستطع إنشاء ملف النسخة الإحتياطية في مجلد الكاش!',
|
||||
'UPDATE_PROCESS_FAILED' => 'عملية التحديث فشلت!',
|
||||
'UPDATE_PROCESS_DONE' => 'تم تحديث كليجا إلى النسخة `%s` بنجاح...',
|
||||
'UPDATE_PROCESS_STEP1' => 'جلب حزمة آخر نسخة من كليجا...',
|
||||
'UPDATE_PROCESS_STEP2' => 'إنشاء وعاء نسخة إحتياطية وفك حزمة آخر نسخة ...',
|
||||
'UPDATE_PROCESS_STEP3' => 'الترقية للنسخة الجديدة (تحديث الملفات وقاعدة البيانات) ...',
|
||||
'RELEASE_NOTE' => 'معلومات الإصدار',
|
||||
];
|
||||
|
||||
@@ -298,4 +298,6 @@ return [
|
||||
//3.0.3
|
||||
'NOTIFICATIONS' => 'تنبيهات',
|
||||
'KJ_TWEETS' => 'تغريدات كليجا' ,
|
||||
'PLG_SUCSS_DEL' => 'تم حذف مجلد الاضافة "%s" بنجاح!' ,
|
||||
'PLG_DEL_CONFIRM' => 'سوف تقوم بحذف مجلد الاضافة' ,
|
||||
];
|
||||
|
||||
@@ -37,7 +37,7 @@ return [
|
||||
'INST_FINISH_SQL' => 'تم تثبيت كليجا بنجاح',
|
||||
'INST_NOTES' => 'ملاحظات التثبيت',
|
||||
'INST_END' => 'معالج التثبيت انتهى، يجب الآن حذف مجلد INSTALL <span style="color:red">(الموقع لن يعمل في حال وجود المجلد)</span>',
|
||||
'INST_NOTE_D' => 'أي ملاحظات أو مشاكل تتعلق بأداء كليجا، نرجوا التواصل مع مطوري كليجا!',
|
||||
'INST_NOTE_D' => 'أي ملاحظات أو مشاكل تتعلق بأداء كليجا، نرجو التبليغ عبر <a href="https://github.com/kleeja-official/kleeja/issues">مركز الأخطاء</a>',
|
||||
'INST_FINISH_ERRSQL' => 'هناك مشكلة تعيق التثبيت، تأكد من حساب مستخدم القاعدة وحاول مجدداً او استفسر من مطوري كليجا',
|
||||
'INST_KLEEJADEVELOPERS' => 'شكراً لإستخدامك كليجا ... مع أحلى و أطيب التمنيات .. من فريق عمل كليجا',
|
||||
'SITENAME' => 'اسم الموقع',
|
||||
@@ -85,16 +85,10 @@ return [
|
||||
'FUNCTION_DISC_MUF' => 'دالة move_uploaded_file تستخدم لتحميل الملفات وهي اهم دالة في السكربت.',
|
||||
|
||||
'ADVICES_CHECK' => 'فحص متقدم (يمكن تثبيت كليجا بدون تحقق هذا الفحص , لكنه مجرد معلومات لك)',
|
||||
'ADVICES_REGISTER_GLOBALS' => '<span style="color:red;padding:0 6px">خاصية register_globals مفعلة !</span><br /> هذه الخاصية غير محبب تفعيلها ويفضل تعطيلها , ومع هذا فكليجا تحاول تعطيل أثارها برمجياً .',
|
||||
'ADVICES_MAGIC_QUOTES' => '<span style="color:red;padding:0 6px">خاصية magic_quotes مفعله !</span><br /> هذه الخاصية غير محبب تفعيلها ويفضل تعطيلها , ومع هذا فكليجا تحاول تعطيل أثارها برمجياً ..',
|
||||
'ZIPARCHIVE_LIB' => '<span style="color:red;padding:0 6px">مكتبة ZipArchive غير متوفرة في خادمك !</span><br /> هذه المكتبة مهمة لفك الإضافات والترقية لنسخ جديدة من كليجا!',
|
||||
|
||||
//UPDATOR
|
||||
'INST_CHOOSE_UPDATE_FILE' => 'قم بإختيار التحديث المناسب لك ومن ثم تابع التحديث ..',
|
||||
'INST_ERR_NO_SELECTED_UPFILE_GOOD' => 'ملف التحديث غير مناسب أو أنه غير موجود من الأساس ! ..',
|
||||
'INST_UPDATE_CUR_VER_IS_UP' => 'نسختك الحالية محدثة لهذا التحديث المحدد.',
|
||||
|
||||
'INST_NOTES_UPDATE' => 'ملاحظات التحديث',
|
||||
|
||||
'INST_UPDATE_CUR_VER_IS_UP' => 'نسختك الحالية محدثة لآخر نسخة ... رائع!',
|
||||
|
||||
|
||||
'INST_UPDATE_IS_FINISH' => 'معالج التحديث انتهى .. يجب الآن حذف مجلد INSTALL و متابعة عملك في كليجا .',
|
||||
@@ -107,7 +101,7 @@ return [
|
||||
'INST_WHAT_IS_KLEEJA_T' => 'ماهي كليجا ؟',
|
||||
'INST_WHAT_IS_KLEEJA' => 'Kleeja تنطق عربياً "كليجا" ! وكتعريف مبسط "كليجا" سكربت رفع ملفات مجاني يأتي مع خصائص فريدة لمساعدة أصحاب المواقع بإمتلاك مركز تحميل قوي ويعتمد عليه , والحقيقة أن "كليجا" سكربت ضخم الامكانيات سهل الإدارة تم بناء نظام الحماية على مستوى عالي ويملك من الأنظمة المعقدة ما يؤمن لموقعك الحماية التامة بإذن الله !',
|
||||
'INST_SPECIAL_KLEEJA' => 'من أهم مميزات كليجا !',
|
||||
'INST_WHAT_IS_KLEEJA_ONE' => '1. نظام أعضاء قوي تستطيع ربطه بأغلب السكربتات المستخدمة في المواقع الاجتماعية .<br />2. لوحة تحكم مذهلة ليس فقط للتحكم بالملفات ولكن للتحكم بكل صغيرة وكبيرة .<br />3. نظام الستايلات البسيط يجعلك تستطيع ان تصنع ستايلك بنفسك.<br />4. مع كليجا ونظام الإضافات البرمجية تستطيع أن تقوم بتركيب الكثير من الاضافات الرائعة .<br />5. ليس هذا فحسب بل كليجا تملك الكثير .. لتعرف أكثر رجاءاً قم بزيارة صفحه <a target="_blank" href="http://ar.kleeja.com/features/">معلومات ومميزات</a> .',
|
||||
'INST_WHAT_IS_KLEEJA_ONE' => '1. نظام أعضاء قوي تستطيع ربطه بأغلب السكربتات المستخدمة في المواقع الاجتماعية .<br />2. لوحة تحكم مذهلة ليس فقط للتحكم بالملفات ولكن للتحكم بكل صغيرة وكبيرة .<br />3. نظام الستايلات البسيط يجعلك تستطيع ان تصنع ستايلك بنفسك.<br />4. مع كليجا ونظام الإضافات البرمجية تستطيع أن تقوم بتركيب الكثير من الاضافات الرائعة .<br />5. ليس هذا فحسب بل كليجا تملك الكثير .. لتعرف أكثر رجاءاً قم بزيارة صفحه <a target="_blank" href="https://kleeja.com/">معلومات ومميزات</a> .',
|
||||
'YES' => 'نعم',
|
||||
'NO' => 'لا',
|
||||
|
||||
|
||||
@@ -125,9 +125,9 @@ return [
|
||||
'PLUGIN_EXISTS_BEFORE' => 'This plugin exists before with same version or above, so no need to update it!.',
|
||||
'R_CHECK_UPDATE' => 'Check for updates',
|
||||
'ERROR_CHECK_VER' => 'Error: cannot get any update information at this moment , try again later !',
|
||||
'UPDATE_KLJ_NOW' => 'You Have to update your version now!. visit Kleeja.com for more information',
|
||||
'UPDATE_KLJ_NOW' => 'update now!',
|
||||
'U_LAST_VER_KLJ' => 'You are using the latest version of Kleeja...',
|
||||
'U_USE_PRE_RE' => 'You are using a Pre-release version, Click <a href="mailto:info@kleeja.com">here</a> to report any bugs or exploits.',
|
||||
'U_USE_PRE_RE' => 'You are using a Pre-release version, Click <a href="https://github.com/kleeja-official/kleeja/issues">here</a> to report any bugs or exploits.',
|
||||
'STYLE_IS_DEFAULT' => 'Default style',
|
||||
'MAKE_AS_DEFAULT' => 'Set as default',
|
||||
|
||||
@@ -153,7 +153,6 @@ return [
|
||||
'COOKIE_NAME' => 'Cookie prefix',
|
||||
'COOKIE_PATH' => 'Cookie path',
|
||||
'COOKIE_SECURE' => 'Cookie secure',
|
||||
//'ADMINISTRATORS' => 'Administrators',
|
||||
'DELETEALLRES' => 'Delete all results',
|
||||
'ADMIN_DELETE_FILES_OK' => 'File %s successfully deleted',
|
||||
'ADMIN_DELETE_FILES_NOF' => 'No files to delete',
|
||||
@@ -174,12 +173,7 @@ return [
|
||||
'ADD_HEADER_EXTRA' => 'Extra Header',
|
||||
'ADD_FOOTER_EXTRA' => 'Extra footer',
|
||||
'ADMIN_USING_IE6' => 'You are using an outdated IE browser, Please update your browser or use FireFox now!',
|
||||
|
||||
'T_CLEANING_FILES_NOW' => 'Deleting Un-downloaded files, The process could take a while depending on the size and number of the files.',
|
||||
'HOW_UPDATE_KLEEJA' => 'How to update Kleeja?',
|
||||
'HOW_UPDATE_KLEEJA_STEP1' => 'Visit the official website <a target="_blank" href="http://www.kleeja.com/">Kleeja.com</a> then go to the Download page and download the latest version of the script, or download an upgrade copy if available.',
|
||||
'HOW_UPDATE_KLEEJA_STEP2' => 'Unzip the file and upload it to your website to replace the old files with the new ones <b>Except config.php and uploads folder</b>.',
|
||||
'HOW_UPDATE_KLEEJA_STEP3' => 'When done, go to the following URL to update the database.',
|
||||
'DEPEND_ON_NO_STYLE_ERR' => 'This style is based on the "%s" style which you dont seem to have',
|
||||
'PLUGINS_REQ_NO_STYLE_ERR' => 'This style requires the [ s% ] plugin(s), install it/them and try again.',
|
||||
'KLJ_VER_NO_STYLE_ERR' => 'This style requires Kleeja version %s or above',
|
||||
@@ -269,16 +263,24 @@ return [
|
||||
'INSTALL' => 'Install',
|
||||
'CLOSE' => 'Close',
|
||||
'STATS_BOXES' => 'Stats Boxes',
|
||||
'PLUGIN_UPDATED' => 'Plugin "%s" has been updated successfully ..',
|
||||
'PLUGIN_UPDATED' => 'Plugin "%s" has been updated successfully ..',
|
||||
'PLUGIN_DOWNLOADED' => 'Plugin "%s" has been downloaded successfully ..',
|
||||
'PLUGIN_FILE_NOT_FOUND' => 'The plugin file is missing!',
|
||||
'PLUGIN_REMOTE_FILE_MISSING'=> 'The plugin "%s" is not on Kleeja remote server!',
|
||||
'PLUGINS_SERVER_ERROR' => 'We encountered an error while connecting to the plugins remote server ...',
|
||||
'PLUGIN_FILE_NOT_FOUND' => 'The plugin file is missing!',
|
||||
'PLUGIN_REMOTE_FILE_MISSING' => 'The plugin "%s" is not on Kleeja remote server!',
|
||||
'PLUGINS_SERVER_ERROR' => 'We encountered an error while connecting to the plugins remote server ...',
|
||||
'INSTALLED_PLUGINS' => 'Installed Plugins',
|
||||
'LOCAL_PLUGINS' => 'Local Plugins',
|
||||
'KLEEJA_STORE' => 'Kleeja Store',
|
||||
'LOCAL_PLUGINS' => 'Local Plugins',
|
||||
'KLEEJA_STORE' => 'Kleeja Store',
|
||||
'KLJ_VER_NO_PLUGIN' => 'This plugin can works on Kleeja version %1$s up to version %2$s.',
|
||||
'VERSION' => 'Version',
|
||||
'DEVELOPER' => 'Developer',
|
||||
'ALL_PLUGINS_UPDATED' => 'There are no plugins that require an update currently...',
|
||||
'VERSION' => 'Version',
|
||||
'DEVELOPER' => 'Developer',
|
||||
'ALL_PLUGINS_UPDATED' => 'There are no plugins that require an update currently...',
|
||||
'UPDATE_ERR_FETCH_PACKAGE' => 'We have encountered a problem while downloading the package from the server!',
|
||||
'UPDATE_BACKUP_CREATE_FAILED' => 'We couldn\'t create a backup archive in cache folder!',
|
||||
'UPDATE_PROCESS_FAILED' => 'The update process has failed!',
|
||||
'UPDATE_PROCESS_DONE' => 'Kleeja has been updated to version `%s` successfully...',
|
||||
'UPDATE_PROCESS_STEP1' => 'Fetching the package of latest version of Kleeja ...',
|
||||
'UPDATE_PROCESS_STEP2' => 'Create a backup container and extract the new package ...',
|
||||
'UPDATE_PROCESS_STEP3' => 'Updating to new version (files & database upgrade) ...',
|
||||
'RELEASE_NOTE' => 'Release Notes',
|
||||
];
|
||||
|
||||
@@ -288,4 +288,6 @@ return [
|
||||
//3.0.3
|
||||
'NOTIFICATIONS' => 'Notifications',
|
||||
'KJ_TWEETS' => 'Kleeja Tweets' ,
|
||||
'PLG_SUCSS_DEL' => 'the Folder of plugin "%s" is deleted successfuly !!' ,
|
||||
'PLG_DEL_CONFIRM' => 'You will delete the plugin folder' ,
|
||||
];
|
||||
|
||||
@@ -85,15 +85,10 @@ return [
|
||||
'FUNCTION_DISC_MUF' => 'The function move_uploaded_file is used to upload files and it\'s the most important function in the script.',
|
||||
|
||||
'ADVICES_CHECK' => 'Advanced check (Optional)',
|
||||
'ADVICES_REGISTER_GLOBALS' => '<span style="color:red;padding:0 6px;">register_globals function is enabled ..!</span><br /> its recommended that you disable it.',
|
||||
'ADVICES_MAGIC_QUOTES' => '<span style="color:red;padding:0 6px;">magic_quotes function is enabled ..!</span><br /> it is recommended that you disable it.',
|
||||
'ZIPARCHIVE_LIB' => '<span style="color:red;padding:0 6px">ZipArchive Lib is not available..!</span><br /> It is required to install plugins, styles and to upgrade to newer Kleeja versions!',
|
||||
|
||||
//UPDATE
|
||||
'INST_CHOOSE_UPDATE_FILE' => 'Choose the appropriate update file',
|
||||
'INST_ERR_NO_SELECTED_UPFILE_GOOD' => 'Inappropriate update file, or it is missing!',
|
||||
'INST_UPDATE_CUR_VER_IS_UP' => 'Your current version is newer than this update.',
|
||||
|
||||
'INST_NOTES_UPDATE' => 'Update Notes',
|
||||
'INST_UPDATE_CUR_VER_IS_UP' => 'Your current version database is up-to-date ... hooray!',
|
||||
|
||||
|
||||
'INST_UPDATE_IS_FINISH' => 'Installation completed! you can now delete the INSTALL directory...',
|
||||
@@ -107,11 +102,11 @@ return [
|
||||
'INST_WHAT_IS_KLEEJA' => 'Keeja is a free, features rich, files and images upload system. Kleeja is developed to help webmasters to provide a decent files hosting service on their sites . Kleeja comes with a simple source code and powerful User system , also with easy template system so you can easily customize your styles ',
|
||||
|
||||
'INST_SPECIAL_KLEEJA' => 'Some Kleeja features .. !',
|
||||
'INST_WHAT_IS_KLEEJA_ONE' => 'Kleeja has a simple and powerful user system which can be easily integrated with many boards . Kleeja provide simple admin control panel that enables you to control over everything in your site . Also you can customize Kleeja\'s style and install a lot of add-ons .... <a target="_blank" href="http://www.kleeja.com/features/">more details in Kleeja site </a>',
|
||||
'INST_WHAT_IS_KLEEJA_ONE' => 'Kleeja has a simple and powerful user system which can be easily integrated with many boards . Kleeja provide simple admin control panel that enables you to control over everything in your site . Also you can customize Kleeja\'s style and install a lot of add-ons .... <a target="_blank" href="https://www.kleeja.com">more details in Kleeja site </a>',
|
||||
'YES' => 'Yes',
|
||||
'NO' => 'No',
|
||||
|
||||
'KLEEJA_TEAM_MSG_NAME' => 'Kleeja Development Team',
|
||||
'KLEEJA_TEAM_MSG_TEXT' => "Thank you for choosing Kleeja to empower your website,\n We really hope you enjoy the unique experience that Kleeja offers to you.\nDon't forget to visit http://kleeja.com for future updates.",
|
||||
'KLEEJA_TEAM_MSG_TEXT' => "Thank you for choosing Kleeja to empower your website,\n We really hope you enjoy the unique experience that Kleeja offers to you.\nDon't forget to visit http://kleeja.com for future updates, to report bugs/issues kindly visit our <a href=\"https://github.com/kleeja-official/kleeja/issues\">Issues page</a>",
|
||||
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user