mirror of
https://github.com/avecms/AVE.cms.git
synced 2025-02-11 23:03:36 +00:00
Ver. 3.2
This commit is contained in:
commit
315d1fded7
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.DS_Store
|
328
.htaccess
Normal file
328
.htaccess
Normal file
@ -0,0 +1,328 @@
|
||||
###################### AVE.CMS_HTACCESS_BEGIN ##########################
|
||||
# Options:
|
||||
# -MultiViews: Turns off multiviews so it doesn't interfer with our rewrite rules
|
||||
# -Indexes: Stop directory listings
|
||||
# +FollowSymlinks: Let out rewrite rules work
|
||||
|
||||
Options -Indexes +FollowSymLinks
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# | PHP Configuration |
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
<ifModule mod_php5.c>
|
||||
php_value default_charset utf-8
|
||||
|
||||
#Отлючаем вывод ошибок
|
||||
#php_value error_reporting E_NONE
|
||||
|
||||
# Этот параметр устанавливает максимальное время в секундах, позволяющее скрипту запускаться прежде, чем он завершается синтаксическим анализатором.
|
||||
#php_value max_execution_time 300
|
||||
|
||||
# Максимальное время загрузки данных для скрипта, в том числе и файлов из формы
|
||||
#php_value max_input_time 300
|
||||
|
||||
# Ограничивает максимальный объем данных, получаемых от пользователя методом POST
|
||||
#php_value post_max_size 512M
|
||||
|
||||
# Устанавливает максимальный размер файла, который может быть получен методом POST (меньше, чем post_max_size)
|
||||
#php_value upload_max_filesize 128M
|
||||
|
||||
# Максимальное кол-во загружаемых файлов
|
||||
#php_value max_file_uploads 50
|
||||
|
||||
# Включаем у PHP короткие <?
|
||||
#php_value short_open_tag On
|
||||
|
||||
php_flag magic_quotes_gpc off
|
||||
|
||||
php_flag magic_quotes_runtime off
|
||||
|
||||
php_flag register_globals off
|
||||
</ifModule>
|
||||
|
||||
<ifModule !mod_php5.c>
|
||||
php_value default_charset utf-8
|
||||
|
||||
#Отлючаем вывод ошибок
|
||||
#php_value error_reporting E_NONE
|
||||
|
||||
# Этот параметр устанавливает максимальное время в секундах, позволяющее скрипту запускаться прежде, чем он завершается синтаксическим анализатором.
|
||||
#php_value max_execution_time 300
|
||||
|
||||
# Максимальное время загрузки данных для скрипта, в том числе и файлов из формы
|
||||
#php_value max_input_time 300
|
||||
|
||||
# Ограничивает максимальный объем данных, получаемых от пользователя методом POST
|
||||
#php_value post_max_size 32M
|
||||
|
||||
# Устанавливает максимальный размер файла, который может быть получен методом POST (меньше, чем post_max_size)
|
||||
#php_value upload_max_filesize 32M
|
||||
|
||||
# Максимальное кол-во загружаемых файлов
|
||||
#php_value max_file_uploads 50
|
||||
|
||||
# Включаем у PHP короткие <?
|
||||
#php_value short_open_tag On
|
||||
|
||||
php_flag magic_quotes_gpc off
|
||||
|
||||
php_flag magic_quotes_runtime off
|
||||
|
||||
php_flag register_globals off
|
||||
</ifModule>
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# | CORS-enabled images |
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# Send the CORS header for images when browsers request it.
|
||||
# https://developer.mozilla.org/en-US/docs/HTML/CORS_Enabled_Image
|
||||
# http://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
|
||||
# http://hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/
|
||||
|
||||
<IfModule mod_setenvif.c>
|
||||
<IfModule mod_headers.c>
|
||||
<FilesMatch "\.(cur|gif|ico|jpe?g|png|svgz?|webp)$">
|
||||
SetEnvIf Origin ":" IS_CORS
|
||||
Header set Access-Control-Allow-Origin "*" env=IS_CORS
|
||||
</FilesMatch>
|
||||
</IfModule>
|
||||
</IfModule>
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# | Web fonts access |
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# Allow access to web fonts from all domains.
|
||||
|
||||
<IfModule mod_headers.c>
|
||||
<FilesMatch "\.(eot|otf|tt[cf]|woff)$">
|
||||
Header set Access-Control-Allow-Origin "*"
|
||||
</FilesMatch>
|
||||
</IfModule>
|
||||
|
||||
|
||||
# ##############################################################################
|
||||
# # INTERNET EXPLORER #
|
||||
# ##############################################################################
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# | Better website experience |
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# Force Internet Explorer to render pages in the highest available mode
|
||||
# in the various cases when it may not.
|
||||
# http://hsivonen.iki.fi/doctype/ie-mode.pdf
|
||||
|
||||
<IfModule mod_headers.c>
|
||||
Header set X-UA-Compatible "IE=edge"
|
||||
# `mod_headers` cannot match based on the content-type, however, this
|
||||
# header should be send only for HTML pages and not for the other resources
|
||||
<FilesMatch "\.(appcache|atom|crx|css|cur|eot|f4[abpv]|flv|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|tt[cf]|vcf|vtt|webapp|web[mp]|woff|xml|xpi)$">
|
||||
Header unset X-UA-Compatible
|
||||
</FilesMatch>
|
||||
</IfModule>
|
||||
|
||||
|
||||
# ##############################################################################
|
||||
# # MIME TYPES AND ENCODING #
|
||||
# ##############################################################################
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# | Proper MIME types for all files |
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
<IfModule mod_mime.c>
|
||||
|
||||
# Audio
|
||||
AddType audio/mp4 m4a f4a f4b
|
||||
AddType audio/ogg oga ogg opus
|
||||
|
||||
# Data interchange
|
||||
AddType application/json json map
|
||||
AddType application/ld+json jsonld
|
||||
|
||||
# JavaScript
|
||||
# Normalize to standard type.
|
||||
# http://tools.ietf.org/html/rfc4329#section-7.2
|
||||
AddType application/javascript js
|
||||
|
||||
# Video
|
||||
AddType video/mp4 f4v f4p m4v mp4
|
||||
AddType video/ogg ogv
|
||||
AddType video/webm webm
|
||||
AddType video/x-flv flv
|
||||
|
||||
# Web fonts
|
||||
AddType application/font-woff woff
|
||||
AddType application/vnd.ms-fontobject eot
|
||||
|
||||
# Browsers usually ignore the font MIME types and simply sniff the bytes
|
||||
# to figure out the font type.
|
||||
# http://mimesniff.spec.whatwg.org/#matching-a-font-type-pattern
|
||||
|
||||
# Chrome however, shows a warning if any other MIME types are used for
|
||||
# the following fonts.
|
||||
|
||||
AddType application/x-font-ttf ttc ttf
|
||||
AddType font/opentype otf
|
||||
|
||||
# Make SVGZ fonts work on the iPad.
|
||||
# https://twitter.com/FontSquirrel/status/14855840545
|
||||
AddType image/svg+xml svgz
|
||||
AddEncoding gzip svgz
|
||||
|
||||
# Other
|
||||
AddType application/octet-stream safariextz
|
||||
AddType application/x-chrome-extension crx
|
||||
AddType application/x-opera-extension oex
|
||||
AddType application/x-web-app-manifest+json webapp
|
||||
AddType application/x-xpinstall xpi
|
||||
AddType application/xml atom rdf rss xml
|
||||
AddType image/webp webp
|
||||
AddType image/x-icon cur
|
||||
AddType text/cache-manifest appcache manifest
|
||||
AddType text/vtt vtt
|
||||
AddType text/x-component htc
|
||||
AddType text/x-vcard vcf
|
||||
</IfModule>
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# | UTF-8 encoding |
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# Use UTF-8 encoding for anything served as `text/html` or `text/plain`.
|
||||
AddDefaultCharset utf-8
|
||||
|
||||
# Force UTF-8 for certain file formats.
|
||||
<IfModule mod_mime.c>
|
||||
AddCharset utf-8 .atom .css .js .json .jsonld .rss .vtt .webapp .xml
|
||||
</IfModule>
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# | Expires headers |
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# The following expires headers are set pretty far in the future. If you
|
||||
# don't control versioning with filename-based cache busting, consider
|
||||
# lowering the cache time for resources such as style sheets and JavaScript
|
||||
# files to something like one week.
|
||||
|
||||
<IfModule mod_expires.c>
|
||||
|
||||
ExpiresActive on
|
||||
ExpiresDefault "access plus 1 month"
|
||||
|
||||
# CSS
|
||||
ExpiresByType text/css "access plus 1 year"
|
||||
|
||||
# Data interchange
|
||||
ExpiresByType application/json "access plus 0 seconds"
|
||||
ExpiresByType application/ld+json "access plus 0 seconds"
|
||||
ExpiresByType application/xml "access plus 0 seconds"
|
||||
ExpiresByType text/xml "access plus 0 seconds"
|
||||
|
||||
# Favicon (cannot be renamed!) and cursor images
|
||||
ExpiresByType image/x-icon "access plus 1 week"
|
||||
|
||||
# HTML components (HTCs)
|
||||
ExpiresByType text/x-component "access plus 1 month"
|
||||
|
||||
# HTML
|
||||
ExpiresByType text/html "access plus 0 seconds"
|
||||
|
||||
# JavaScript
|
||||
ExpiresByType application/javascript "access plus 1 year"
|
||||
|
||||
# Manifest files
|
||||
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
|
||||
ExpiresByType text/cache-manifest "access plus 0 seconds"
|
||||
|
||||
# Media
|
||||
ExpiresByType audio/ogg "access plus 1 month"
|
||||
ExpiresByType image/gif "access plus 1 month"
|
||||
ExpiresByType image/jpeg "access plus 1 month"
|
||||
ExpiresByType image/png "access plus 1 month"
|
||||
ExpiresByType video/mp4 "access plus 1 month"
|
||||
ExpiresByType video/ogg "access plus 1 month"
|
||||
ExpiresByType video/webm "access plus 1 month"
|
||||
|
||||
# Web feeds
|
||||
ExpiresByType application/atom+xml "access plus 1 hour"
|
||||
ExpiresByType application/rss+xml "access plus 1 hour"
|
||||
|
||||
# Web fonts
|
||||
ExpiresByType application/font-woff "access plus 1 month"
|
||||
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
|
||||
ExpiresByType application/x-font-ttf "access plus 1 month"
|
||||
ExpiresByType font/opentype "access plus 1 month"
|
||||
ExpiresByType image/svg+xml "access plus 1 month"
|
||||
</IfModule>
|
||||
|
||||
|
||||
<FilesMatch "\.(backup|cache|class|fields|functions|inc|modules|lib|session|templates)$">
|
||||
Order allow,deny
|
||||
</FilesMatch>
|
||||
|
||||
<IfModule mod_security.c>
|
||||
SecFilterScanPOST Off
|
||||
</IfModule>
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# | Rewrite engine |
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine on
|
||||
RewriteBase /
|
||||
|
||||
# Заглушка для index.php
|
||||
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
|
||||
RewriteRule ^index\.php$ http://%{HTTP_HOST}/ [R=301,L]
|
||||
|
||||
# Убираем слеш в конце
|
||||
# RewriteCond %{HTTP_HOST} (.*)
|
||||
# RewriteCond %{REQUEST_URI} /$ [NC]
|
||||
# RewriteRule ^(.*)(/)$ $1 [L,R=301]
|
||||
|
||||
# Редирект с www.domain.com на domain.com
|
||||
# RewriteCond %{HTTP_HOST} ^www\.(.+) [NC]
|
||||
# RewriteRule (.*) http://%1/$1 [R=permanent,L]
|
||||
|
||||
# Редирект с domain.com на www.domain.com
|
||||
# RewriteCond %{HTTP_HOST} !^www\. [NC]
|
||||
# RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [QSA,L]
|
||||
|
||||
# RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
|
||||
# RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
|
||||
# RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
|
||||
|
||||
RewriteCond %{REQUEST_URI} !^/(backup|cache|class|fields|functions|inc|modules|lib|session|templates)/
|
||||
|
||||
# Файл robots.txt
|
||||
RewriteCond %{REQUEST_URI} !^/robots\.txt$ [NC]
|
||||
|
||||
# Файл sitemap.xml
|
||||
RewriteRule ^sitemap.xml$ inc/sitemap.php [QSA,L]
|
||||
|
||||
#--start-ave-editor--#
|
||||
|
||||
#--end-ave-editor--#
|
||||
|
||||
# RSS
|
||||
RewriteRule ^rss/rss-([0-9]+).xml$ inc/rss.php?id=$1 [QSA,L]
|
||||
|
||||
RewriteRule \.(ico)$ - [NC,L]
|
||||
|
||||
RewriteRule ^index.php$ - [L]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule .* index.php [L]
|
||||
</IfModule>
|
||||
####################### AVE.CMS_HTACCESS_END ###########################
|
78
README.md
Normal file
78
README.md
Normal file
@ -0,0 +1,78 @@
|
||||
# AVE.cms v3.2
|
||||
###### Многофункциональная, система управления сайтом.
|
||||
|
||||
## Оглавление
|
||||
|
||||
* [Системные требования](#Системные-требования)
|
||||
|
||||
* [Модули](#Модули)
|
||||
|
||||
* [Установка](#Установка)
|
||||
|
||||
* [Ресурсы](#Ресурсы)
|
||||
|
||||
|
||||
## Системные требования
|
||||
|
||||
* Операционная система:
|
||||
* Unix
|
||||
* Windows Server
|
||||
|
||||
* ПО WEB сервера:
|
||||
* Apache >= 1.3
|
||||
* Nginx >= 1.6.2
|
||||
* IIS >= 5
|
||||
* PHP >= 5.5
|
||||
* PHP >= 5.5.x ... <= 5.6.x разрешить использовать короткие теги short_open_tag = On (zlib, cURL, mbString, JSON)
|
||||
* PHP >= 7.x ... <= 7.1.x
|
||||
|
||||
|
||||
## Модули
|
||||
Описание и загрузка модулей
|
||||
|
||||
| Наименование | Описание |
|
||||
|---------------------------------|-----------------------------|
|
||||
| [Комментарии] | Система комментирования публикаций. |
|
||||
| [Контактные формы] | Модуль предназначен для создания различных веб-форм для контактов.Поддержка различных типов полей. |
|
||||
| [Публикатор документов] | Данный модуль предназначен для создания форм ввода и редактирования документов на сайте. |
|
||||
| [Вопрос-Ответ (FAQ)] | Модуль создания раширенной справочной системы на основе тегов. |
|
||||
| [Галерея] | Модуль для создания и управления галереями изображений. |
|
||||
| [Авторизация] | Модуль поддержки Регистрации/Авторизации пользователей. |
|
||||
| [Рассылки] | Модуль позволяет осуществлять рассылки новостей и другой информации пользователям. |
|
||||
| [Похожие документы] | Модуль позволяет выводить список связанных документов *(Связующим элементом документов является первое слово из поля Ключевые слова.)* |
|
||||
| [Быстрый переход] | Данный модуль является альтернативным способом организации меню навигации на сайте. Он представлен в виде выпадающего списка разделов и подразделов вашего сайта. |
|
||||
| [RSS] | Данный модуль предзназначен для организации RSS потоков на вашем сайте. |
|
||||
| [Поиск] | Организация поиска по сайту. |
|
||||
| [Карта сайта] | Построение карты сайта на базе пунктов меню навигации. |
|
||||
| [Корзина] | Модуль электронной комерции. |
|
||||
| [Импорт] | Импорт документов в выбранную рубрику. |
|
||||
| [Рейтинг документов] | Поддержка оценок для публикаций. |
|
||||
| [Навигация по документам рубрики] | Данный модуль позволяет организовать навигацию по документам в пределах рубрики. |
|
||||
|
||||
И другие
|
||||
|
||||
## Установка
|
||||
|
||||
1. Распакуйте содержимое архива в новую папку на вашем локальном компьютере.
|
||||
2. Загрузить эту папку целиком через FTP-клиент на ваш хост.
|
||||
3. Вам также может потребоваться установить права доступа (CHMOD 777) рекурсивно, на папки /cache/, /session/ и /uploads/, если ваш хостинг не установливает это по умолчанию.
|
||||
4. Также вам может потребоваться установить права доступа (CHMOD 777) рекурсивно, на файлы inc/db.config.php и inc/config.inc.php, если ваш хостинг не установливает это по умолчанию.
|
||||
5. Наберите http://адрес вашего сайта/ в браузере.
|
||||
6. Следуйте инструкциям.
|
||||
7. После установки системы настоятельно рекомендуем устанавливать права доступа на папку uploads не выше CHMOD 755.
|
||||
|
||||
## Ресурсы
|
||||
|
||||
Сайт: [ave-cms.ru](https://ave-cms.ru/)
|
||||
|
||||
Форум: [forum.ave-cms.ru](https://forum.ave-cms.ru/)
|
||||
|
||||
E-mail: support@ave-cms.ru
|
||||
|
||||
Google+: [Google+](https://plus.google.com/106406255345948508717)
|
||||
|
||||
Вконтакте: [vk.com/ave_cms](http://vk.com/ave_cms)
|
||||
|
||||
|
||||
---
|
||||
Copyright © 2007-2017 [Ave-Cms.Ru](https://ave-cms.ru) | [AVE.cms 3.2](https://ave-cms.ru)
|
1
admin/.htaccess
Normal file
1
admin/.htaccess
Normal file
@ -0,0 +1 @@
|
||||
RewriteEngine off
|
BIN
admin/admin.favicon.ico
Normal file
BIN
admin/admin.favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
97
admin/admin.php
Normal file
97
admin/admin.php
Normal file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* AVE.cms
|
||||
*
|
||||
* @package AVE.cms
|
||||
* @version 3.x
|
||||
* @filesource
|
||||
* @copyright © 2007-2014 AVE.cms, http://www.ave-cms.ru
|
||||
*
|
||||
* @license GPL v.2
|
||||
*/
|
||||
|
||||
define('ACP', 1);
|
||||
define('ACPL', 1);
|
||||
define('BASE_DIR', str_replace("\\", "/", dirname(dirname(__FILE__))));
|
||||
|
||||
if (! @filesize(BASE_DIR . '/inc/db.config.php')) {
|
||||
header('Location:/install/index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
require(BASE_DIR . '/admin/init.php');
|
||||
|
||||
unset ($captcha_ok);
|
||||
|
||||
if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'logout')
|
||||
{
|
||||
// Завершение работы в админке
|
||||
reportLog($AVE_Template->get_config_vars('EXIT_ADMIN'));
|
||||
user_logout();
|
||||
header('Location:admin.php');
|
||||
}
|
||||
|
||||
if(auth_cookie())
|
||||
{
|
||||
header('Location:index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'login')
|
||||
{
|
||||
// Авторизация
|
||||
if (!empty($_POST['user_login']) && !empty($_POST['user_pass']))
|
||||
{
|
||||
if (ADMIN_CAPTCHA)
|
||||
{
|
||||
if (isset($_SESSION['captcha_keystring']) && isset($_POST['securecode']) && $_SESSION['captcha_keystring'] == $_POST['securecode']) $captcha_ok = 1;
|
||||
else
|
||||
{
|
||||
unset($_SESSION['user_id'], $_SESSION['user_pass']);
|
||||
unset($_SESSION['captcha_keystring']);
|
||||
$error = $AVE_Template->get_config_vars('WRONG_CAPTCHA');
|
||||
$AVE_Template->assign('error', $error);
|
||||
}
|
||||
}
|
||||
else
|
||||
$captcha_ok = 1;
|
||||
|
||||
if ($captcha_ok)
|
||||
{
|
||||
if (true === user_login($_POST['user_login'], $_POST['user_pass'], 1,(int)(isset($_POST['SaveLogin']) && $_POST['SaveLogin'] == '1')))
|
||||
{
|
||||
//_echo($_SESSION);
|
||||
if (!empty($_SESSION['redirectlink']))
|
||||
{
|
||||
header('Location:' . $_SESSION['redirectlink']);
|
||||
unset($_SESSION['redirectlink']);
|
||||
exit;
|
||||
}
|
||||
|
||||
reportLog($AVE_Template->get_config_vars('LOGIN_ADMIN'));
|
||||
//Перенапрявляем пользователя
|
||||
header('Location:'.get_referer_admin_link().'');
|
||||
exit;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
reportLog($AVE_Template->get_config_vars('ERROR_ADMIN') . ' - '
|
||||
. stripslashes($_POST['user_login']) . ' / '
|
||||
. stripslashes($_POST['user_pass']));
|
||||
|
||||
unset($_SESSION['user_id'], $_SESSION['user_pass']);
|
||||
unset($_SESSION['captcha_keystring']);
|
||||
$error = $AVE_Template->get_config_vars('WRONG_PASS');
|
||||
$AVE_Template->assign('error', $error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$AVE_Template->assign('captcha', ADMIN_CAPTCHA);
|
||||
$AVE_Template->display('login.tpl');
|
||||
?>
|
133
admin/blocks.php
Normal file
133
admin/blocks.php
Normal file
@ -0,0 +1,133 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* AVE.cms
|
||||
*
|
||||
* @package AVE.cms
|
||||
* @version 3.x
|
||||
* @filesource
|
||||
* @copyright © 2007-2017 AVE.cms, http://www.ave-cms.ru
|
||||
*
|
||||
* @license GPL v.2
|
||||
*/
|
||||
|
||||
if (! defined('ACP'))
|
||||
{
|
||||
header('Location:index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
global $AVE_DB, $AVE_Template;
|
||||
|
||||
require(BASE_DIR . '/class/class.blocks.php');
|
||||
|
||||
$AVE_Block = new AVE_Block;
|
||||
|
||||
$AVE_Template->config_load(BASE_DIR . '/admin/lang/' . $_SESSION['admin_language'] . '/blocks.txt', 'blocks');
|
||||
|
||||
switch ($_REQUEST['action'])
|
||||
{
|
||||
case '':
|
||||
if (check_permission_acp('blocks_view'))
|
||||
{
|
||||
$AVE_Block->blockList();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'new':
|
||||
if (check_permission_acp('blocks_edit'))
|
||||
{
|
||||
$_SESSION['use_editor'] = get_settings('use_editor');
|
||||
$AVE_Block->blockNew();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
if (check_permission_acp('blocks_edit'))
|
||||
{
|
||||
$_SESSION['use_editor'] = get_settings('use_editor');
|
||||
$AVE_Block->blockEdit(isset($_REQUEST['id']) ? $_REQUEST['id'] : null);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'save':
|
||||
if (check_permission_acp('blocks_edit'))
|
||||
{
|
||||
$AVE_Block->blockSave(isset($_REQUEST['id']) ? $_REQUEST['id'] : null);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'del':
|
||||
if (check_permission_acp('blocks_edit'))
|
||||
{
|
||||
$AVE_Block->blockDelete($_REQUEST['id']);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'alias':
|
||||
if (check_permission_acp('blocks_edit'))
|
||||
{
|
||||
echo $AVE_Block->blockValidate($_REQUEST['alias'], (int)$_REQUEST['id']);
|
||||
}
|
||||
exit;
|
||||
|
||||
case 'multi':
|
||||
if (check_permission_acp('blocks_edit'))
|
||||
{
|
||||
$_REQUEST['sub'] = (!isset($_REQUEST['sub'])) ? '' : $_REQUEST['sub'];
|
||||
$errors = array();
|
||||
switch ($_REQUEST['sub'])
|
||||
{
|
||||
case 'save':
|
||||
$ok = true;
|
||||
$row = $AVE_DB->Query("
|
||||
SELECT block_name
|
||||
FROM " . PREFIX . "_blocks
|
||||
WHERE block_name = '" . $_REQUEST['block_name'] . "'
|
||||
")->FetchRow();
|
||||
|
||||
if (@$row->block_name != '')
|
||||
{
|
||||
array_push($errors, $AVE_Template->get_config_vars('BLOCK_EXIST'));
|
||||
$AVE_Template->assign('errors', $errors);
|
||||
$ok = false;
|
||||
}
|
||||
|
||||
if ($_REQUEST['block_name'] == '')
|
||||
{
|
||||
array_push($errors, $AVE_Template->get_config_vars('BLOCK_COPY_TIP'));
|
||||
$AVE_Template->assign('errors', $errors);
|
||||
$ok = false;
|
||||
}
|
||||
|
||||
if ($ok)
|
||||
{
|
||||
$row = $AVE_DB->Query("
|
||||
SELECT block_text
|
||||
FROM " . PREFIX . "_blocks
|
||||
WHERE id = '" . (int)$_REQUEST['id'] . "'
|
||||
")->FetchRow();
|
||||
|
||||
$AVE_DB->Query("
|
||||
INSERT
|
||||
INTO " . PREFIX . "_blocks
|
||||
SET
|
||||
Id = '',
|
||||
block_name = '" . $_REQUEST['block_name'] . "',
|
||||
block_text = '" . addslashes($row->block_text) . "',
|
||||
block_author_id = '" . $_SESSION['user_id'] . "',
|
||||
block_created = '" . time() . "'
|
||||
");
|
||||
|
||||
reportLog($_SESSION['user_name'] . ' - создал копию блока (' . (int)$_REQUEST['id'] . ')', 2, 2);
|
||||
|
||||
header('Location:index.php?do=blocks'.'&cp=' . SESSION);
|
||||
}
|
||||
|
||||
$AVE_Template->assign('content', $AVE_Template->fetch('blocks/multi.tpl'));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
192
admin/browser.php
Normal file
192
admin/browser.php
Normal file
@ -0,0 +1,192 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* AVE.cms
|
||||
*
|
||||
* @package AVE.cms
|
||||
* @version 3.x
|
||||
* @filesource
|
||||
* @copyright © 2007-2014 AVE.cms, http://www.ave-cms.ru
|
||||
*
|
||||
* @license GPL v.2
|
||||
*/
|
||||
|
||||
if (!defined('ACP') || !check_permission('mediapool_int'))
|
||||
{
|
||||
header('Location:index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
global $AVE_DB, $AVE_Template;
|
||||
|
||||
ob_start();
|
||||
ob_implicit_flush(0);
|
||||
|
||||
$_REQUEST['onlycontent'] = 1;
|
||||
|
||||
$max_size = 128; // максимальный размер миниатюры
|
||||
$thumb_size = '-t' . $max_size . 'x' . $max_size; // формат миниатюр
|
||||
$images_ext = array('jpg', 'jpeg', 'png', 'gif', 'JPG', 'JPEG', 'PNG', 'GIF');
|
||||
|
||||
$upload_path = BASE_DIR . '/' . UPLOAD_DIR;
|
||||
|
||||
$lang = empty($_SESSION['admin_language']) ? 'ru' : $_SESSION['admin_language'];
|
||||
|
||||
$AVE_Template = new AVE_Template(BASE_DIR . '/admin/templates/browser');
|
||||
$AVE_Template->config_load(BASE_DIR . '/admin/lang/' . $lang . '/main.txt');
|
||||
$AVE_Template->assign('tpl_dir', 'templates/');
|
||||
$AVE_Template->assign('ABS_PATH', '../');
|
||||
|
||||
if (!isset($_REQUEST['action'])) $_REQUEST['action'] = '';
|
||||
|
||||
switch ($_REQUEST['action'])
|
||||
{
|
||||
case 'list':
|
||||
$dir = (empty($_REQUEST['dir'])
|
||||
|| strpos($_REQUEST['dir'], '..') !== false
|
||||
|| strpos($_REQUEST['dir'], '//') !== false) ? '/' : $_REQUEST['dir'];
|
||||
|
||||
$path = $upload_path . (is_dir($upload_path . $dir) ? $dir : '/');
|
||||
|
||||
$new_dir = $path . (isset($_REQUEST['newdir']) ? $_REQUEST['newdir'] : '');
|
||||
$new_dir_rezult = (!is_dir($new_dir) && !mkdir($new_dir, 0777));
|
||||
|
||||
$skip_entry = array(THUMBNAIL_DIR, 'recycled', 'index.php');
|
||||
|
||||
$dirs = array();
|
||||
$files = array();
|
||||
|
||||
$d = @dir($path);
|
||||
while (false !== ($entry = @$d->read()))
|
||||
{
|
||||
if (in_array($entry, $skip_entry) || $entry{0} === '.') continue;
|
||||
|
||||
if (is_dir($path . $entry))
|
||||
{
|
||||
$dirs[$entry] = 'index.php?do=browser&type=' . $_REQUEST['type']
|
||||
. '&action=list&dir=' . $dir . $entry . '/';
|
||||
}
|
||||
else
|
||||
{
|
||||
$nameParts = explode('.', $entry);
|
||||
$ext = strtolower(end($nameParts));
|
||||
|
||||
$file['icon'] = file_exists("templates/images/mediapool/{$ext}.gif") ? $ext : 'attach';
|
||||
$file['filesize'] = @round(@filesize($path . $entry)/1024, 2);
|
||||
$file['moddate'] = date("d.m.y, H:i", @filemtime($path . $entry));
|
||||
|
||||
if (in_array($ext, $images_ext))
|
||||
{
|
||||
$nameParts[count($nameParts)-2] .= $thumb_size;
|
||||
$file['bild'] = '/' . UPLOAD_DIR . $dir . THUMBNAIL_DIR . '/' . implode('.', $nameParts);
|
||||
}
|
||||
else
|
||||
{
|
||||
$file['bild'] = 'templates/images/file.gif';
|
||||
}
|
||||
|
||||
$files[$entry] = $file;
|
||||
}
|
||||
}
|
||||
$d->close();
|
||||
|
||||
ksort($dirs);
|
||||
ksort($files);
|
||||
|
||||
$AVE_Template->assign('new_dir_rezult', $new_dir_rezult);
|
||||
$AVE_Template->assign('recycled', strpos($dir, '/recycled/') === 0);
|
||||
$AVE_Template->assign('dirs', $dirs);
|
||||
$AVE_Template->assign('files', $files);
|
||||
$AVE_Template->assign('max_size', $max_size);
|
||||
$AVE_Template->assign('dir', $dir);
|
||||
$AVE_Template->assign('dirup', rtrim(dirname($dir), '\\/') . '/');
|
||||
$AVE_Template->assign('mediapath', UPLOAD_DIR);
|
||||
|
||||
$AVE_Template->display('browser.tpl');
|
||||
break;
|
||||
|
||||
case 'upload':
|
||||
if (check_permission('mediapool_add'))
|
||||
{
|
||||
$AVE_Template->display('browser_upload.tpl');
|
||||
}else{
|
||||
echo '<script type="text/javascript">window.close();</script>';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'upload2':
|
||||
header('Location:index.php?do=browser&type=image&target=' . $_REQUEST['target'] . '&tval=/' . UPLOAD_DIR . $_REQUEST['tval']);
|
||||
break;
|
||||
|
||||
case 'delfile':
|
||||
if (check_permission('mediapool_del'))
|
||||
{
|
||||
if (empty($_REQUEST['file']) || empty($_REQUEST['dir'])) exit(0);
|
||||
|
||||
$file_name = basename($_REQUEST['file']);
|
||||
|
||||
$del_file = $upload_path . $_REQUEST['dir'] . $file_name;
|
||||
if (strpos($del_file, '..') !== false || !is_file($del_file)) exit(0);
|
||||
|
||||
$recycled_path = $upload_path . '/recycled/';
|
||||
if (!is_dir($recycled_path) && !mkdir($recycled_path)) exit(0);
|
||||
|
||||
do {$nameParts = explode('.', $file_name);
|
||||
$nameParts[count($nameParts)-2] .= '-' . uniqid(rand());
|
||||
$recycled_file_name = implode('.', $nameParts);
|
||||
} while (file_exists($recycled_path . $recycled_file_name));
|
||||
|
||||
@copy($del_file, $recycled_path . $recycled_file_name);
|
||||
|
||||
if (@unlink($del_file))
|
||||
{
|
||||
$nameParts = explode('.', $file_name);
|
||||
$ext = strtolower(end($nameParts));
|
||||
if (in_array($ext, $images_ext))
|
||||
{
|
||||
$nameParts[count($nameParts)-2] .= $thumb_size;
|
||||
@unlink($upload_path . $_REQUEST['dir'] . THUMBNAIL_DIR . '/' . implode('.', $nameParts));
|
||||
}
|
||||
|
||||
reportLog($_SESSION['user_name'] . ' - удалил файл ('
|
||||
. UPLOAD_DIR . $_REQUEST['dir'] . $file_name . ')');
|
||||
}
|
||||
}
|
||||
|
||||
echo '<script type="text/javascript">
|
||||
parent.frames[\'zf\'].location.href="index.php?do=browser&type=', $_REQUEST['type'], '&action=list&dir=', $_REQUEST['dir'], '";
|
||||
</script>';
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@list($target, $target_id) = explode('__', $_REQUEST['target']);
|
||||
|
||||
$tval = '/';
|
||||
|
||||
if (!empty($_REQUEST['tval']) && 0 === strpos($_REQUEST['tval'], '/' . UPLOAD_DIR . '/'))
|
||||
{
|
||||
if (is_dir(BASE_DIR . '/' . $_REQUEST['tval'])) {
|
||||
$tval = rtrim(substr($_REQUEST['tval'], strlen('/' . UPLOAD_DIR)), '\\/') . '/';
|
||||
}
|
||||
|
||||
if (is_file(BASE_DIR . '/' . $_REQUEST['tval'])) {
|
||||
$tval = rtrim(dirname(substr($_REQUEST['tval'], strlen('/' . UPLOAD_DIR))), '\\/') . '/';
|
||||
}
|
||||
}
|
||||
|
||||
$AVE_Template->assign('dir', $tval);
|
||||
$AVE_Template->assign('target', $target);
|
||||
$AVE_Template->assign('target_id', $target_id);
|
||||
$AVE_Template->assign('cppath', substr($_SERVER['PHP_SELF'], 0, -18));
|
||||
$AVE_Template->assign('mediapath', UPLOAD_DIR);
|
||||
|
||||
$AVE_Template->display('browser_2frames.tpl');
|
||||
break;
|
||||
}
|
||||
|
||||
$out = ob_get_clean();
|
||||
|
||||
echo $out;
|
||||
|
||||
?>
|
70
admin/dbsettings.php
Normal file
70
admin/dbsettings.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* AVE.cms
|
||||
*
|
||||
* @package AVE.cms
|
||||
* @version 3.x
|
||||
* @filesource
|
||||
* @copyright © 2007-2014 AVE.cms, http://www.ave-cms.ru
|
||||
*
|
||||
* @license GPL v.2
|
||||
*/
|
||||
|
||||
if (!defined('ACP'))
|
||||
{
|
||||
header('Location:index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
check_permission_acp('db_actions');
|
||||
|
||||
$AVE_Template->config_load(BASE_DIR . '/admin/lang/' . $_SESSION['admin_language'] . '/dbactions.txt', 'db');
|
||||
|
||||
require(BASE_DIR . '/class/class.dbdump.php');
|
||||
$AVE_DB_Service = new AVE_DB_Service;
|
||||
|
||||
if (!empty($_REQUEST['action']))
|
||||
{
|
||||
switch ($_REQUEST['action'])
|
||||
{
|
||||
case 'optimize':
|
||||
$AVE_DB_Service->databaseTableOptimize();
|
||||
break;
|
||||
|
||||
case 'repair':
|
||||
$AVE_DB_Service->databaseTableRepair();
|
||||
break;
|
||||
|
||||
case 'dump_top':
|
||||
$AVE_DB_Service->databaseDumpExport(1);
|
||||
exit;
|
||||
|
||||
case 'dump':
|
||||
$AVE_DB_Service->databaseDumpExport();
|
||||
exit;
|
||||
|
||||
case 'restore':
|
||||
$AVE_DB_Service->databaseDumpImport(BASE_DIR . "/" . ATTACH_DIR . "/");
|
||||
break;
|
||||
|
||||
case 'download':
|
||||
$AVE_DB_Service->databaseDumpFileSave($_REQUEST['file']);
|
||||
break;
|
||||
|
||||
case 'restorefile':
|
||||
$AVE_DB_Service->databaseDumpFileImport($_REQUEST['file']);
|
||||
break;
|
||||
|
||||
case 'deletefile':
|
||||
$AVE_DB_Service->databaseDumpFileDelete($_REQUEST['file']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$AVE_Template->assign('db_size', get_mysql_size());
|
||||
$AVE_Template->assign('files', $AVE_DB_Service->databaseFilesGet());
|
||||
$AVE_Template->assign('tables', $AVE_DB_Service->databaseTableGet());
|
||||
$AVE_Template->assign('content', $AVE_Template->fetch('dbactions/actions.tpl'));
|
||||
|
||||
?>
|
298
admin/docs.php
Normal file
298
admin/docs.php
Normal file
@ -0,0 +1,298 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* AVE.cms
|
||||
*
|
||||
* @package AVE.cms
|
||||
* @version 3.x
|
||||
* @filesource
|
||||
* @copyright © 2007-2014 AVE.cms, http://www.ave-cms.ru
|
||||
*
|
||||
* @license GPL v.2
|
||||
*/
|
||||
|
||||
if (!defined('ACP'))
|
||||
{
|
||||
header('Location:index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
global $AVE_DB, $AVE_Template;
|
||||
|
||||
require(BASE_DIR . '/class/class.docs.php');
|
||||
require(BASE_DIR . '/class/class.rubs.php');
|
||||
require(BASE_DIR . '/class/class.navigation.php');
|
||||
require(BASE_DIR . '/class/class.request.php');
|
||||
|
||||
$AVE_Document = new AVE_Document;
|
||||
$AVE_Rubric = new AVE_Rubric;
|
||||
$AVE_Navigation = new AVE_Navigation;
|
||||
$AVE_Request = new AVE_Request;
|
||||
|
||||
$AVE_Document->documentTemplateTimeAssign();
|
||||
|
||||
$AVE_Rubric->rubricPermissionFetch();
|
||||
|
||||
$AVE_Template->config_load(BASE_DIR . '/admin/lang/' . $_SESSION['admin_language'] . '/docs.txt', 'docs');
|
||||
|
||||
$AVE_Template->assign("navi", $AVE_Template->fetch("navi/navi.tpl"));
|
||||
|
||||
switch($_REQUEST['action'])
|
||||
{
|
||||
case '' :
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
switch($_REQUEST['sub'])
|
||||
{
|
||||
case 'quicksave':
|
||||
$_SESSION['use_editor'] = get_settings('use_editor');
|
||||
$AVE_Document->quickSave();
|
||||
break;
|
||||
}
|
||||
$AVE_Document->documentListGet();
|
||||
}
|
||||
$AVE_Template->assign('content', $AVE_Template->fetch('documents/docs.tpl'));
|
||||
break;
|
||||
|
||||
case 'add_new':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Request->requestListFetch();
|
||||
$AVE_Template->assign('content', $AVE_Template->fetch('documents/docs_add_new.tpl'));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'showsimple':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Document->documentListGet();
|
||||
$AVE_Template->assign('content', $AVE_Template->fetch('documents/docs_simple.tpl'));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$_SESSION['use_editor'] = get_settings('use_editor');
|
||||
$AVE_Navigation->navigationAllItemList();
|
||||
$AVE_Request->requestListFetch();
|
||||
$AVE_Document->documentEdit((int)$_REQUEST['Id']);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'copy':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$_SESSION['use_editor'] = get_settings('use_editor');
|
||||
$AVE_Navigation->navigationAllItemList();
|
||||
$AVE_Request->requestListFetch();
|
||||
$AVE_Document->documentCopy((int)$_REQUEST['Id']);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'new':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$_SESSION['use_editor'] = get_settings('use_editor');
|
||||
$AVE_Navigation->navigationAllItemList();
|
||||
$AVE_Request->requestListFetch();
|
||||
$AVE_Document->documentNew((int)$_REQUEST['rubric_id']);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'innavi':
|
||||
if (check_permission_acp('document_view') && check_permission_acp('navigation_new'))
|
||||
{
|
||||
$AVE_Document->documentInNavi();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'after':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Navigation->navigationAllItemList();
|
||||
$AVE_Document->documentFormAfter();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'open':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Navigation->navigationItemStatusOn((int)$_REQUEST['Id']);
|
||||
$AVE_Document->documentStatusSet((int)$_REQUEST['Id'], 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'close':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Navigation->navigationItemStatusOff((int)$_REQUEST['Id']);
|
||||
$AVE_Document->documentStatusSet((int)$_REQUEST['Id'], 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Navigation->navigationItemStatusOff((int)$_REQUEST['Id']);
|
||||
$AVE_Document->documentMarkDelete((int)$_REQUEST['Id']);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'redelete':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Navigation->navigationItemStatusOn((int)$_REQUEST['Id']);
|
||||
$AVE_Document->documentUnmarkDelete((int)$_REQUEST['Id']);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'enddelete':
|
||||
if (check_permission_acp('alles'))
|
||||
{
|
||||
$AVE_Navigation->navigationItemDeleteFromDoc((int)$_REQUEST['Id']);
|
||||
$AVE_Document->documentDelete((int)$_REQUEST['Id']);
|
||||
// Выполняем обновление страницы
|
||||
header('Location:index.php?do=docs&cp=' . SESSION);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'revision_recover':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Document->documentRevissionRestore((int)$_REQUEST['doc_id'], (int)$_REQUEST['revission'], (int)$_REQUEST['rubric_id']);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'revision_delete':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Document->documentRevissionDelete((int)$_REQUEST['doc_id'], (int)$_REQUEST['revission'], (int)$_REQUEST['rubric_id']);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'remark':
|
||||
if (check_permission_acp('remark_view'))
|
||||
{
|
||||
$AVE_Document->documentRemarkNew((int)$_REQUEST['Id'], 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'remark_reply':
|
||||
if (check_permission_acp('remark_view'))
|
||||
{
|
||||
$AVE_Document->documentRemarkNew((int)$_REQUEST['Id'], 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'remark_status':
|
||||
if (check_permission_acp('remark_edit'))
|
||||
{
|
||||
$AVE_Document->documentRemarkStatus((int)$_REQUEST['Id'], (int)$_REQUEST['remark_status']);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'remark_del':
|
||||
if (check_permission_acp('remark_edit'))
|
||||
{
|
||||
$AVE_Document->documentRemarkDelete((int)$_REQUEST['Id'], (int)$_REQUEST['remark_first']);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'change':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Document->documentRubricChange();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'change_user':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
switch($_REQUEST['sub'])
|
||||
{
|
||||
case 'save':
|
||||
$AVE_Document->changeAutorSave();
|
||||
break;
|
||||
}
|
||||
$AVE_Template->assign('content', $AVE_Template->fetch('documents/user.tpl'));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'find_user':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
findautor($_REQUEST['q'], 10);
|
||||
}
|
||||
exit;
|
||||
|
||||
case 'keywords':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
searchKeywords($_REQUEST['q']);
|
||||
}
|
||||
exit;
|
||||
|
||||
case 'editstatus':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Document->documentEditStatus();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'image_import':
|
||||
echo json_encode(array("respons"=>image_multi_import($_REQUEST['path']), "status"=>"error", "action"=>"return"));
|
||||
exit;
|
||||
|
||||
case 'translit':
|
||||
echo($AVE_Document->documentAliasCreate());
|
||||
exit;
|
||||
|
||||
case 'checkurl':
|
||||
echo($AVE_Document->documentAliasCheck());
|
||||
exit;
|
||||
|
||||
case 'aliases':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Document->documentAliasHistoryList();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'aliases_doc':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Document->documentAliasListDoc((int)$_REQUEST['doc_id']);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'aliases_new':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Document->documentAliasNew();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'aliases_edit':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Document->documentAliasEdit();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'aliases_save':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Document->documentAliasSave();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'aliases_del':
|
||||
if (check_permission_acp('document_view'))
|
||||
{
|
||||
$AVE_Document->documentAliasDel();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
84
admin/fields.php
Normal file
84
admin/fields.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* AVE.cms
|
||||
*
|
||||
* @package AVE.cms
|
||||
* @version 3.x
|
||||
* @filesource
|
||||
* @copyright © 2007-2014 AVE.cms, http://www.ave-cms.ru
|
||||
*
|
||||
* @license GPL v.2
|
||||
*/
|
||||
|
||||
if (!defined('ACP') || !check_permission('document_view'))
|
||||
{
|
||||
header('Location:index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!(isset($_REQUEST['doc_id']) && isset($_REQUEST['type']) && isset($_REQUEST['field_id']))) exit;
|
||||
|
||||
/**
|
||||
*(int)$_REQUEST['doc_id']
|
||||
*(int)$_REQUEST['rubric_id']
|
||||
*/
|
||||
$show = true;
|
||||
|
||||
// Выполняем запрос к БД на получение данных о документе
|
||||
$document = $AVE_DB->Query("
|
||||
SELECT *
|
||||
FROM " . PREFIX . "_documents
|
||||
WHERE Id = '" . (int)$_REQUEST['doc_id'] . "'
|
||||
")->FetchRow();
|
||||
|
||||
// запрещаем доступ,
|
||||
// если автору документа не разрешено изменять свои документы в рубрике
|
||||
// или пользователю не разрешено изменять все документы в рубрике
|
||||
if (is_object($document)) {
|
||||
$_REQUEST['rubric_id'] = (int)$document->rubric_id;
|
||||
if (!
|
||||
(
|
||||
(
|
||||
isset($_SESSION['user_id']) && $document->document_author_id == $_SESSION['user_id']
|
||||
&& isset($_SESSION[$_REQUEST['rubric_id'] . '_editown']) && $_SESSION[$_REQUEST['rubric_id'] . '_editown'] == 1
|
||||
)
|
||||
|| (isset($_SESSION[$_REQUEST['rubric_id'] . '_editall']) && $_SESSION[$_REQUEST['rubric_id'] . '_editall'] == 1)
|
||||
)
|
||||
)
|
||||
{
|
||||
$show = false;
|
||||
}
|
||||
} else {
|
||||
$_REQUEST['rubric_id'] = (isset($_REQUEST['rubric_id']) && !empty($_REQUEST['rubric_id'])) ? (int)$_REQUEST['rubric_id'] : 0;
|
||||
$show = false;
|
||||
}
|
||||
|
||||
// разрешаем доступ, если пользователь принадлежит группе Администраторов или имеет все права на рубрику
|
||||
if ( (defined('UGROUP') && UGROUP == 1)
|
||||
|| (isset($_SESSION[$_REQUEST['rubric_id'] . '_alles']) && $_SESSION[$_REQUEST['rubric_id'] . '_alles'] == 1) )
|
||||
{
|
||||
$show = true;
|
||||
}
|
||||
|
||||
if ($show)
|
||||
{
|
||||
// Выполняем запрос к БД и получаем значение по умолчанию
|
||||
$default = $AVE_DB->Query("
|
||||
SELECT
|
||||
rubric_field_default
|
||||
FROM " . PREFIX . "_rubric_fields
|
||||
WHERE Id = '" . (int)$_REQUEST['field_id'] . "' AND rubric_id = '" . (int)$_REQUEST['rubric_id'] . "'
|
||||
")->GetCell();
|
||||
|
||||
$field_value = (isset($_REQUEST['field_value']) ? (string)$_REQUEST['field_value'] : '');
|
||||
|
||||
$field_function = 'get_field_' . (string)$_REQUEST['field'];
|
||||
$field_function($field_value, $_REQUEST['type'], (int)$_REQUEST['field_id'], '', 0, $x, 0, 0, $default);
|
||||
}
|
||||
else
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
24
admin/finder.php
Normal file
24
admin/finder.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* AVE.cms
|
||||
*
|
||||
* @package AVE.cms
|
||||
* @version 3.x
|
||||
* @filesource
|
||||
* @copyright © 2007-2014 AVE.cms, http://www.ave-cms.ru
|
||||
*
|
||||
* @license GPL v.2
|
||||
*/
|
||||
if (!defined('ACP'))
|
||||
{
|
||||
header('Location:index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
global $AVE_DB, $AVE_Template;
|
||||
if(check_permission_acp('mediapool_finder'))
|
||||
{
|
||||
$AVE_Template->assign('content', $AVE_Template->fetch('finder/finder.tpl'));
|
||||
}
|
||||
?>
|
585
admin/functions/func.admin.common.php
Normal file
585
admin/functions/func.admin.common.php
Normal file
@ -0,0 +1,585 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* AVE.cms
|
||||
*
|
||||
* @package AVE.cms
|
||||
* @subpackage admin
|
||||
* @filesource
|
||||
*/
|
||||
|
||||
/**
|
||||
* Если был referer, то перенапрявляем на него
|
||||
*
|
||||
* @param
|
||||
* @return $link
|
||||
*/
|
||||
function get_referer_admin_link()
|
||||
{
|
||||
static $link = null;
|
||||
|
||||
if ($link === null)
|
||||
{
|
||||
if (isset($_SERVER['HTTP_REFERER']))
|
||||
{
|
||||
$link = parse_url($_SERVER['HTTP_REFERER']);
|
||||
$ok = (trim($link['host']) == $_SERVER['HTTP_HOST']) ? true : false;
|
||||
$ok = (trim($link['path']) != '/admin/admin.php') ? true : false;
|
||||
|
||||
}
|
||||
$link = ($ok === true ? $_SERVER['HTTP_REFERER'] : '/admin/index.php');
|
||||
}
|
||||
|
||||
return $link;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Получаем кол-во записей в журналах событий
|
||||
*
|
||||
* @return Array массив из кол-ва записей
|
||||
*/
|
||||
function getLogRecords(){
|
||||
global $AVE_DB, $AVE_Template;
|
||||
|
||||
$logs = array();
|
||||
$logdata = array();
|
||||
$log404 = array();
|
||||
$logsql = array();
|
||||
|
||||
$_404dir = BASE_DIR . '/cache/404.php';
|
||||
$_logdir = BASE_DIR . '/cache/log.php';
|
||||
$_sqldir = BASE_DIR . '/cache/sql.php';
|
||||
|
||||
if(file_exists($_logdir))
|
||||
@eval('?>' . file_get_contents($_logdir) . '<?');
|
||||
|
||||
$logs['logs'] = count($logdata);
|
||||
|
||||
if(file_exists($_404dir))
|
||||
@eval('?>' . file_get_contents($_404dir) . '<?');
|
||||
|
||||
$logs['404'] = count($log404);
|
||||
|
||||
if(file_exists($_sqldir))
|
||||
@eval('?>' . file_get_contents($_sqldir) . '<?');
|
||||
|
||||
$logs['sql'] = count($logsql);
|
||||
|
||||
unset($logdata);
|
||||
unset($log404);
|
||||
unset($logsql);
|
||||
|
||||
// Передаем данные в шаблон для вывода
|
||||
$AVE_Template->assign('logs', $logs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Список пользователей за последние $onlinetime секунд
|
||||
*
|
||||
* @param int $onlinetime количество секунд
|
||||
* @return Array массив из пользователей отсортированный по последней активности
|
||||
*/
|
||||
function get_online_users($onlinetime=USERS_TIME_SHOW){
|
||||
global $AVE_DB, $AVE_Template;
|
||||
$time=(time()-intval($onlinetime));
|
||||
$sql=@$AVE_DB->Query("SELECT * FROM ".PREFIX."_users WHERE last_visit>".$time." ORDER BY last_visit DESC");
|
||||
$online_users=Array();
|
||||
while ($row = $sql->FetchRow())
|
||||
{
|
||||
$row->user_name = get_username_by_id($row->Id);
|
||||
$row->user_group_name = get_usergroup_by_id($row->user_group);
|
||||
array_push($online_users,$row);
|
||||
}
|
||||
$AVE_Template->assign('online_users', $online_users);
|
||||
}
|
||||
|
||||
/**
|
||||
* Форматированный вывод размера
|
||||
*
|
||||
* @param int $file_size размер
|
||||
* @return string нормированный размер с единицой измерения
|
||||
*/
|
||||
function format_size($file_size)
|
||||
{
|
||||
if ($file_size >= 1073741824)
|
||||
{
|
||||
$file_size = round($file_size / 1073741824 * 100) / 100 . ' Gb';
|
||||
}
|
||||
elseif ($file_size >= 1048576)
|
||||
{
|
||||
$file_size = round($file_size / 1048576 * 100) / 100 . ' Mb';
|
||||
}
|
||||
elseif ($file_size >= 1024)
|
||||
{
|
||||
$file_size = round($file_size / 1024 * 100) / 100 . ' Kb';
|
||||
}
|
||||
else
|
||||
{
|
||||
$file_size = $file_size . ' b';
|
||||
}
|
||||
|
||||
return $file_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Извлечение из БД статистики по основным компонентам системы
|
||||
*
|
||||
*/
|
||||
function get_ave_info()
|
||||
{
|
||||
global $AVE_DB, $AVE_Template;
|
||||
|
||||
$cnts = array();
|
||||
|
||||
$cnts['templates'] = $AVE_DB->Query("SELECT COUNT(*) FROM " . PREFIX . "_templates")->GetCell();
|
||||
$cnts['documents'] = $AVE_DB->Query("SELECT COUNT(*) FROM " . PREFIX . "_documents")->GetCell();
|
||||
$cnts['request'] = $AVE_DB->Query("SELECT COUNT(*) FROM " . PREFIX . "_request") ->GetCell();
|
||||
$cnts['rubrics'] = $AVE_DB->Query("SELECT COUNT(*) FROM " . PREFIX . "_rubrics") ->GetCell();
|
||||
|
||||
$sql = $AVE_DB->Query("
|
||||
SELECT
|
||||
`ModuleStatus`,
|
||||
COUNT(`ModuleStatus`) AS cntStatus
|
||||
FROM " . PREFIX . "_module
|
||||
GROUP BY `ModuleStatus`
|
||||
");
|
||||
while ($row = $sql->FetchRow())
|
||||
{
|
||||
$cnts['modules_' . $row->ModuleStatus] = $row->cntStatus;
|
||||
}
|
||||
|
||||
$sql = $AVE_DB->Query("
|
||||
SELECT
|
||||
status,
|
||||
COUNT(status) AS cntStatus
|
||||
FROM " . PREFIX . "_users
|
||||
GROUP BY status
|
||||
");
|
||||
while ($row = $sql->FetchRow())
|
||||
{
|
||||
$cnts['users_' . $row->status] = $row->cntStatus;
|
||||
}
|
||||
|
||||
$AVE_Template->assign('cnts', $cnts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Размер дириктории
|
||||
*
|
||||
* @param string $directory наименование директории
|
||||
* @return int
|
||||
*/
|
||||
function get_dir_size($directory)
|
||||
{
|
||||
if (!is_dir($directory)) return -1;
|
||||
$size = 0;
|
||||
if ($DIR = opendir($directory))
|
||||
{
|
||||
while (($dirfile = readdir($DIR)) !== false)
|
||||
{
|
||||
if (@is_link($directory . '/' . $dirfile) || $dirfile == '.' || $dirfile == '..') continue;
|
||||
if (@is_file($directory . '/' . $dirfile))
|
||||
{
|
||||
$size += filesize($directory . '/' . $dirfile);
|
||||
}
|
||||
elseif (@is_dir($directory . '/' . $dirfile))
|
||||
{
|
||||
$dirSize = get_dir_size($directory . '/' . $dirfile);
|
||||
if ($dirSize >= 0)
|
||||
{
|
||||
$size += $dirSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($DIR);
|
||||
}
|
||||
|
||||
return $size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Размер базы данных
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function get_mysql_size()
|
||||
{
|
||||
global $AVE_DB;
|
||||
|
||||
$mysql_size = 0;
|
||||
$sql = $AVE_DB->Query("SHOW TABLE STATUS LIKE '" . PREFIX . "_%'");
|
||||
while ($row = $sql->FetchAssocArray())
|
||||
{
|
||||
$mysql_size += $row['Data_length'] + $row['Index_length'];
|
||||
}
|
||||