Commit 1794ab32 authored by Vitaly Lipatov's avatar Vitaly Lipatov

remove old cp and rename new to just cp/

parent e8fa9086

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

configuration.php
/nbproject
gi
new_cp/application/config/database.php
<?php>
const DB_DRIVER = 'mysql';
const DB_DATABASE = 'eterfund_typos';
const DB_HOSTNAME = 'mysql';
const DB_USERNAME = 'eterfund';
const DB_PASSWORD = 'yEnHwGY5LEcR3R4a';
# 404
ErrorDocument 404 /index.php
#
DirectoryIndex index.php
# mod_rewrite
<IfModule mod_rewrite.c>
RewriteBase /
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /api/typos/cp/index.php/$1 [L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
\ No newline at end of file
Deny from all
\ No newline at end of file
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>
\ No newline at end of file
deny from all
\ No newline at end of file
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
......@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
</html>
\ No newline at end of file
</html>
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| AUTO-LOADER
......@@ -20,40 +22,64 @@
|
| 1. Packages
| 2. Libraries
| 3. Helper files
| 4. Custom config files
| 5. Language files
| 6. Models
| 3. Drivers
| 4. Helper files
| 5. Custom config files
| 6. Language files
| 7. Models
|
*/
/*
| -------------------------------------------------------------------
| Auto-load Packges
| Auto-load Packages
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/
$autoload['packages'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in the system/libraries folder
| or in your application/libraries folder.
| These are the classes located in system/libraries/ or your
| application/libraries/ directory, with the addition of the
| 'database' library, which is somewhat of a special case.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'session', 'xmlrpc');
| $autoload['libraries'] = array('database', 'email', 'session');
|
| You can also supply an alternative library name to be assigned
| in the controller:
|
| $autoload['libraries'] = array('user_agent' => 'ua');
*/
$autoload['libraries'] = array( 'database', 'session' );
$autoload['libraries'] = array('database', 'session');
/*
| -------------------------------------------------------------------
| Auto-load Drivers
| -------------------------------------------------------------------
| These classes are located in system/libraries/ or in your
| application/libraries/ directory, but are also placed inside their
| own subdirectory and they extend the CI_Driver_Library class. They
| offer multiple interchangeable driver options.
|
| Prototype:
|
| $autoload['drivers'] = array('cache');
|
| You can also supply an alternative property name to be assigned in
| the controller:
|
| $autoload['drivers'] = array('cache' => 'cch');
|
*/
$autoload['drivers'] = array();
/*
| -------------------------------------------------------------------
......@@ -63,10 +89,8 @@ $autoload['libraries'] = array('database', 'session');
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('url');
/*
| -------------------------------------------------------------------
| Auto-load Config files
......@@ -79,9 +103,7 @@ $autoload['helper'] = array('url');
| config files. Otherwise, leave it blank.
|
*/
$autoload['config'] = array('typos_config');
$autoload['config'] = array( 'typos_config' );
/*
| -------------------------------------------------------------------
......@@ -95,22 +117,19 @@ $autoload['config'] = array('typos_config');
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/
$autoload['language'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Models
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['model'] = array('model1', 'model2');
| $autoload['model'] = array('first_model', 'second_model');
|
| You can also supply an alternative model name to be assigned
| in the controller:
|
| $autoload['model'] = array('first_model' => 'first');
*/
$autoload['model'] = array('mdl_views', 'mdl_post', 'mdl_query', 'mdl_search', 'mdl_session', 'mdl_authorized', 'mdl_menu');
/* End of file autoload.php */
/* Location: ./application/config/autoload.php */
\ No newline at end of file
$autoload['model'] = array();
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Display Debug backtrace
|--------------------------------------------------------------------------
|
| If set to TRUE, a backtrace will be displayed along with php errors. If
| error_reporting is disabled, the backtrace will not display, regardless
| of this setting
|
*/
defined('SHOW_DEBUG_BACKTRACE') OR define('SHOW_DEBUG_BACKTRACE', TRUE);
/*
|--------------------------------------------------------------------------
......@@ -13,10 +26,10 @@
| always be used to set the mode correctly.
|
*/
define('FILE_READ_MODE', 0644);
define('FILE_WRITE_MODE', 0666);
define('DIR_READ_MODE', 0755);
define('DIR_WRITE_MODE', 0777);
defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644);
defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666);
defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755);
defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755);
/*
|--------------------------------------------------------------------------
......@@ -26,16 +39,47 @@ define('DIR_WRITE_MODE', 0777);
| These modes are used when working with fopen()/popen()
|
*/
defined('FOPEN_READ') OR define('FOPEN_READ', 'rb');
defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b');
defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
defined('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab');
defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
define('FOPEN_READ', 'rb');
define('FOPEN_READ_WRITE', 'r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
define('FOPEN_WRITE_CREATE', 'ab');
define('FOPEN_READ_WRITE_CREATE', 'a+b');
define('FOPEN_WRITE_CREATE_STRICT', 'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
/* End of file constants.php */
/* Location: ./application/config/constants.php */
\ No newline at end of file
/*
|--------------------------------------------------------------------------
| Exit Status Codes
|--------------------------------------------------------------------------
|
| Used to indicate the conditions under which the script is exit()ing.
| While there is no universal standard for error codes, there are some
| broad conventions. Three such conventions are mentioned below, for
| those who wish to make use of them. The CodeIgniter defaults were
| chosen for the least overlap with these conventions, while still
| leaving room for others to be defined in future versions and user
| applications.
|
| The three main conventions used for determining exit status codes
| are as follows:
|
| Standard C/C++ Library (stdlibc):
| http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
| (This link also contains other GNU-specific conventions)
| BSD sysexits.h:
| http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
| Bash scripting:
| http://tldp.org/LDP/abs/html/exitcodes.html
|
*/
defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors
defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error
defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error
defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found
defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input
defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error
defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
......@@ -12,14 +14,17 @@
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
| ['dsn'] The full DSN string describe a connection to the database.
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database type. ie: mysql. Currently supported:
mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
| ['dbdriver'] The database driver. e.g.: mysqli.
| Currently supported:
| cubrid, ibase, mssql, mysql, mysqli, oci8,
| odbc, pdo, postgre, sqlite, sqlite3, sqlsrv
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Active Record class
| to the table name when using the Query Builder class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
......@@ -34,53 +39,59 @@
| multi-byte character set and are running versions lower than these.
| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
| ['autoinit'] Whether or not to automatically initialize the database.
| ['encrypt'] Whether or not to use an encrypted connection.
|
| 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE
| 'mysqli' and 'pdo/mysql' drivers accept an array with the following options:
|
| 'ssl_key' - Path to the private key file
| 'ssl_cert' - Path to the public key certificate file
| 'ssl_ca' - Path to the certificate authority file
| 'ssl_capath' - Path to a directory containing trusted CA certificats in PEM format
| 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':')
| 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not ('mysqli' only)
|
| ['compress'] Whether or not to use client compression (MySQL only)
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
| ['ssl_options'] Used to set various SSL options that can be used when making SSL connections.
| ['failover'] array - A array with 0 or more data for connections if the main should fail.
| ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries.
| NOTE: Disabling this will also effectively disable both
| $this->db->last_query() and profiling of DB queries.
| When you run a query, with this setting set to TRUE (default),
| CodeIgniter will store the SQL statement for debugging purposes.
| However, this may cause high memory usage, especially if you run
| a lot of SQL queries ... disable this to avoid that problem.
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $active_record variables lets you determine whether or not to load
| the active record class
| The $query_builder variables lets you determine whether or not to load
| the query builder class.
*/
$active_group = 'default';
$query_builder = TRUE;
$active_group = 'typos';
$active_record = TRUE;
/*Подключение к основной базе с опечатками*/
$db['typos']['hostname'] = 'mysql';
$db['typos']['username'] = 'eterfund';
$db['typos']['password'] = 'yEnHwGY5LEcR3R4a';
$db['typos']['database'] = 'eterfund_typos';
$db['typos']['dbdriver'] = 'mysql';
$db['typos']['dbprefix'] = '';
$db['typos']['pconnect'] = TRUE;
$db['typos']['db_debug'] = TRUE;
$db['typos']['cache_on'] = FALSE;
$db['typos']['cachedir'] = '';
$db['typos']['char_set'] = 'utf8';
$db['typos']['dbcollat'] = 'utf8_general_ci';
$db['typos']['swap_pre'] = '';
$db['typos']['autoinit'] = TRUE;
$db['typos']['stricton'] = FALSE;
/*Подключение к TIME@ETERSOFT*/
$db['time']['hostname'] = 'localhost';
$db['time']['username'] = 'root';
$db['time']['password'] = '';
$db['time']['database'] = '';
$db['time']['dbdriver'] = 'mysql';
$db['time']['dbprefix'] = '';
$db['time']['pconnect'] = TRUE;
$db['time']['db_debug'] = TRUE;
$db['time']['cache_on'] = FALSE;
$db['time']['cachedir'] = '';
$db['time']['char_set'] = 'utf8';
$db['time']['dbcollat'] = 'utf8_general_ci';
$db['time']['swap_pre'] = '';
$db['time']['autoinit'] = TRUE;
$db['time']['stricton'] = FALSE;
/* End of file database.php */
/* Location: ./application/config/database.php */
// Default group can be loaded by $this->load->database()
$db['default'] = array(
'dsn' => 'mysql:host=mysql; dbname=eterfund_typos; charset=utf8;',
'hostname' => 'mysql',
'username' => 'eterfund',
'password' => 'yEnHwGY5LEcR3R4a',
'database' => 'eterfund_typos',
'dbdriver' => 'pdo',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
| ['dsn'] The full DSN string describe a connection to the database.
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database driver. e.g.: mysqli.
| Currently supported:
| cubrid, ibase, mssql, mysql, mysqli, oci8,
| odbc, pdo, postgre, sqlite, sqlite3, sqlsrv
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Query Builder class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
| ['cachedir'] The path to the folder where cache files should be stored
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
| NOTE: For MySQL and MySQLi databases, this setting is only used
| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
| (and in table creation queries made with DB Forge).
| There is an incompatibility in PHP with mysql_real_escape_string() which
| can make your site vulnerable to SQL injection if you are using a
| multi-byte character set and are running versions lower than these.
| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
| ['encrypt'] Whether or not to use an encrypted connection.
|
| 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE
| 'mysqli' and 'pdo/mysql' drivers accept an array with the following options:
|
| 'ssl_key' - Path to the private key file
| 'ssl_cert' - Path to the public key certificate file
| 'ssl_ca' - Path to the certificate authority file
| 'ssl_capath' - Path to a directory containing trusted CA certificats in PEM format
| 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':')
| 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not ('mysqli' only)
|
| ['compress'] Whether or not to use client compression (MySQL only)
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
| ['ssl_options'] Used to set various SSL options that can be used when making SSL connections.
| ['failover'] array - A array with 0 or more data for connections if the main should fail.
| ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries.
| NOTE: Disabling this will also effectively disable both
| $this->db->last_query() and profiling of DB queries.
| When you run a query, with this setting set to TRUE (default),
| CodeIgniter will store the SQL statement for debugging purposes.
| However, this may cause high memory usage, especially if you run
| a lot of SQL queries ... disable this to avoid that problem.
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $query_builder variables lets you determine whether or not to load
| the query builder class.
*/
$active_group = 'default';
$query_builder = TRUE;
// Default group can be loaded by $this->load->database()
$db['default'] = array(
'dsn' => 'mysql:host=mysql.eterhost.ru; dbname=eterfund_typos; charset=utf8;',
'hostname' => 'mysql',
'username' => 'eterfund',
'password' => 'yEnHwGY5LEcR3R4a',
'database' => 'eterfund_typos',
'dbdriver' => 'pdo',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$_doctypes = array(
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
'html5' => '<!DOCTYPE html>',
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'
);
/* End of file doctypes.php */
/* Location: ./application/config/doctypes.php */
\ No newline at end of file
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
'xhtml1-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
'xhtml1-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
'xhtml-basic11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">',
'html5' => '<!DOCTYPE html>',
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
'mathml1' => '<!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd">',
'mathml2' => '<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">',
'svg10' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">',
'svg11' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',
'svg11-basic' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">',
'svg11-tiny' => '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">',
'xhtml-math-svg-xh' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
'xhtml-math-svg-sh' => '<!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">',
'xhtml-rdfa-1' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">',
'xhtml-rdfa-2' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">'
);
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| Foreign Characters
......@@ -14,51 +16,88 @@ $foreign_characters = array(
'/Ä/' => 'Ae',
'/Ü/' => 'Ue',
'/Ö/' => 'Oe',
'/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A',
'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a',
'/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά|Ả|Ạ|Ầ|Ẫ|Ẩ|Ậ|Ằ|Ắ|Ẵ|Ẳ|Ặ|А/' => 'A',
'/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά|ả|ạ|ầ|ấ|ẫ|ẩ|ậ|ằ|ắ|ẵ|ẳ|ặ|а/' => 'a',
'/Б/' => 'B',
'/б/' => 'b',
'/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
'/ç|ć|ĉ|ċ|č/' => 'c',
'/Ð|Ď|Đ/' => 'D',
'/ð|ď|đ/' => 'd',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e',
'/Ĝ|Ğ|Ġ|Ģ/' => 'G',
'/ĝ|ğ|ġ|ģ/' => 'g',
'/Д/' => 'D',
'/д/' => 'd',
'/Ð|Ď|Đ|Δ/' => 'Dj',
'/ð|ď|đ|δ/' => 'dj',
'/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ|Ẽ|Ẻ|Ẹ|Ề|Ế|Ễ|Ể|Ệ|Е|Э/' => 'E',
'/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε|ẽ|ẻ|ẹ|ề|ế|ễ|ể|ệ|е|э/' => 'e',
'/Ф/' => 'F',
'/ф/' => 'f',
'/Ĝ|Ğ|Ġ|Ģ|Γ|Г|Ґ/' => 'G',
'/ĝ|ğ|ġ|ģ|γ|г|ґ/' => 'g',
'/Ĥ|Ħ/' => 'H',
'/ĥ|ħ/' => 'h',
'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I',
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i',
'/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ|Ỉ|Ị|И|Ы/' => 'I',
'/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ|ỉ|ị|и|ы|ї/' => 'i',
'/Ĵ/' => 'J',
'/ĵ/' => 'j',
'/Ķ/' => 'K',
'/ķ/' => 'k',
'/Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L',
'/ĺ|ļ|ľ|ŀ|ł/' => 'l',
'/Ñ|Ń|Ņ|Ň/' => 'N',
'/ñ|ń|ņ|ň|ʼn/' => 'n',
'/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O',
'/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o',
'/Ŕ|Ŗ|Ř/' => 'R',
'/ŕ|ŗ|ř/' => 'r',
'/Ś|Ŝ|Ş|Š/' => 'S',
'/ś|ŝ|ş|š|ſ/' => 's',
'/Ţ|Ť|Ŧ/' => 'T',
'/ţ|ť|ŧ/' => 't',
'/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U',
'/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u',
'/Ý|Ÿ|Ŷ/' => 'Y',
'/ý|ÿ|ŷ/' => 'y',
'/Ķ|Κ|К/' => 'K',
'/ķ|κ|к/' => 'k',
'/Ĺ|Ļ|Ľ|Ŀ|Ł|Λ|Л/' => 'L',
'/ĺ|ļ|ľ|ŀ|ł|λ|л/' => 'l',
'/М/' => 'M',
'/м/' => 'm',
'/Ñ|Ń|Ņ|Ň|Ν|Н/' => 'N',
'/ñ|ń|ņ|ň|ʼn|ν|н/' => 'n',
'/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|Ο|Ό|Ω|Ώ|Ỏ|Ọ|Ồ|Ố|Ỗ|Ổ|Ộ|Ờ|Ớ|Ỡ|Ở|Ợ|О/' => 'O',
'/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|ο|ό|ω|ώ|ỏ|ọ|ồ|ố|ỗ|ổ|ộ|ờ|ớ|ỡ|ở|ợ|о/' => 'o',
'/П/' => 'P',
'/п/' => 'p',
'/Ŕ|Ŗ|Ř|Ρ|Р/' => 'R',
'/ŕ|ŗ|ř|ρ|р/' => 'r',
'/Ś|Ŝ|Ş|Ș|Š|Σ|С/' => 'S',
'/ś|ŝ|ş|ș|š|ſ|σ|ς|с/' => 's',
'/Ț|Ţ|Ť|Ŧ|τ|Т/' => 'T',
'/ț|ţ|ť|ŧ|т/' => 't',
'/Þ|þ/' => 'th',
'/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự|У/' => 'U',
'/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự|у/' => 'u',
'/Ý|Ÿ|Ŷ|Υ|Ύ|Ϋ|Ỳ|Ỹ|Ỷ|Ỵ|Й/' => 'Y',
'/ý|ÿ|ŷ|ỳ|ỹ|ỷ|ỵ|й/' => 'y',
'/В/' => 'V',
'/в/' => 'v',
'/Ŵ/' => 'W',
'/ŵ/' => 'w',
'/Ź|Ż|Ž/' => 'Z',
'/ź|ż|ž/' => 'z',
'/Ź|Ż|Ž|Ζ|З/' => 'Z',
'/ź|ż|ž|ζ|з/' => 'z',
'/Æ|Ǽ/' => 'AE',
'/ß/'=> 'ss',
'/ß/' => 'ss',
'/IJ/' => 'IJ',
'/ij/' => 'ij',
'/Œ/' => 'OE',
'/ƒ/' => 'f'
'/ƒ/' => 'f',
'/ξ/' => 'ks',
'/π/' => 'p',
'/β/' => 'v',
'/μ/' => 'm',
'/ψ/' => 'ps',
'/Ё/' => 'Yo',
'/ё/' => 'yo',
'/Є/' => 'Ye',
'/є/' => 'ye',
'/Ї/' => 'Yi',
'/Ж/' => 'Zh',
'/ж/' => 'zh',
'/Х/' => 'Kh',
'/х/' => 'kh',
'/Ц/' => 'Ts',
'/ц/' => 'ts',
'/Ч/' => 'Ch',
'/ч/' => 'ch',
'/Ш/' => 'Sh',
'/ш/' => 'sh',
'/Щ/' => 'Shch',
'/щ/' => 'shch',
'/Ъ|ъ|Ь|ь/' => '',
'/Ю/' => 'Yu',
'/ю/' => 'yu',
'/Я/' => 'Ya',
'/я/' => 'ya'
);
/* End of file foreign_chars.php */
/* Location: ./application/config/foreign_chars.php */
\ No newline at end of file
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Hooks
......@@ -6,26 +8,18 @@
| This file lets you define "hooks" to extend CI without hacking the core
| files. Please see the user guide for info:
|
| http://codeigniter.com/user_guide/general/hooks.html
| https://codeigniter.com/user_guide/general/hooks.html
|
*/
/*Включаем сессии*/
$hook['pre_system'][] = array(
'class' => 'Session',
'function' => '__construct',
'filename' => 'session.php',
'filepath' => 'hooks'
);
'filepath' => 'hooks');
/*Проверяем авторизирован ли пользователь*/
$hook['pre_controller'][] = array(
'class' => 'Check_authorized',
'function' => 'index',
'filename' => 'check_authorized.php',
'filepath' => 'hooks'
);
/* End of file hooks.php */
/* Location: ./application/config/hooks.php */
\ No newline at end of file
'filepath' => 'hooks');
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
......@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
</html>
\ No newline at end of file
</html>
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Enable/Disable Migrations
|--------------------------------------------------------------------------
|
| Migrations are disabled by default but should be enabled
| whenever you intend to do a schema migration.
|
*/
$config['migration_enabled'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migrations version
|--------------------------------------------------------------------------
|
| This is used to set migration version that the file system should be on.
| If you run $this->migration->latest() this is the version that schema will
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 0;
/*
|--------------------------------------------------------------------------
| Migrations Path
|--------------------------------------------------------------------------
|
| Path to your migrations folder.
| Typically, it will be within your application path.
| Also, writing permission is required within the migrations path.
|
*/
$config['migration_path'] = APPPATH . 'migrations/';
/* End of file migration.php */
/* Location: ./application/config/migration.php */
\ No newline at end of file
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Enable/Disable Migrations
|--------------------------------------------------------------------------
|
| Migrations are disabled by default for security reasons.
| You should enable migrations whenever you intend to do a schema migration
| and disable it back when you're done.
|
*/
$config['migration_enabled'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migration Type
|--------------------------------------------------------------------------
|
| Migration file names may be based on a sequential identifier or on
| a timestamp. Options are:
|
| 'sequential' = Sequential migration naming (001_add_blog.php)
| 'timestamp' = Timestamp migration naming (20121031104401_add_blog.php)
| Use timestamp format YYYYMMDDHHIISS.
|
| Note: If this configuration value is missing the Migration library
| defaults to 'sequential' for backward compatibility with CI2.
|
*/
$config['migration_type'] = 'timestamp';
/*
|--------------------------------------------------------------------------
| Migrations table
|--------------------------------------------------------------------------
|
| This is the name of the table that will store the current migrations state.
| When migrations runs it will store in a database table which migration
| level the system is at. It then compares the migration level in this
| table to the $config['migration_version'] if they are not the same it
| will migrate up. This must be set.
|
*/
$config['migration_table'] = 'migrations';
/*
|--------------------------------------------------------------------------
| Auto Migrate To Latest
|--------------------------------------------------------------------------
|
| If this is set to TRUE when you load the migrations class and have
| $config['migration_enabled'] set to TRUE the system will auto migrate
| to your latest migration (whatever $config['migration_version'] is
| set to). This way you do not have to call migrations anywhere else
| in your code to have the latest migration.
|
*/
$config['migration_auto_latest'] = FALSE;
/*
|--------------------------------------------------------------------------
| Migrations version
|--------------------------------------------------------------------------
|
| This is used to set migration version that the file system should be on.
| If you run $this->migration->current() this is the version that schema will
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 0;
/*
|--------------------------------------------------------------------------
| Migrations Path
|--------------------------------------------------------------------------
|
| Path to your migrations folder.
| Typically, it will be within your application path.
| Also, writing permission is required within the migrations path.
|
*/
$config['migration_path'] = APPPATH.'migrations/';
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Profiler Sections
......@@ -7,11 +9,6 @@
| data are displayed when the Profiler is enabled.
| Please see the user guide for info:
|
| http://codeigniter.com/user_guide/general/profiling.html
| https://codeigniter.com/user_guide/general/profiling.html
|
*/
/* End of file profiler.php */
/* Location: ./application/config/profiler.php */
\ No newline at end of file
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
......@@ -17,13 +19,13 @@
|
| Please see the user guide for complete details:
|
| http://codeigniter.com/user_guide/general/routing.html
| https://codeigniter.com/user_guide/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There area two reserved routes:
| There are three reserved routes:
|
| $route['default_controller'] = 'welcome';
|
......@@ -33,14 +35,18 @@
|
| $route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router what URI segments to use if those provided
| in the URL cannot be matched to a valid route.
| This route will tell the Router which controller/method to use if those
| provided in the URL cannot be matched to a valid route.
|
| $route['translate_uri_dashes'] = FALSE;
|
| This is not exactly a route, but allows you to automatically route
| controller and method names that contain dashes. '-' isn't a valid
| class or method name character, so it requires translation.
| When you set this option to TRUE, it will replace ALL dashes in the
| controller and method URI segments.
|
| Examples: my-controller/index -> my_controller/index
| my-controller/my-method -> my_controller/my_method
*/
$route['default_controller'] = "authorized";
$route['404_override'] = '';
/* End of file routes.php */
/* Location: ./application/config/routes.php */
\ No newline at end of file
$route['default_controller'] = 'authorization';
\ No newline at end of file
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| SMILEYS
| -------------------------------------------------------------------
| This file contains an array of smileys for use with the emoticon helper.
| Individual images can be used to replace multiple simileys. For example:
| Individual images can be used to replace multiple smileys. For example:
| :-) and :) use the same image replacement.
|
| Please see user guide for more info:
| http://codeigniter.com/user_guide/helpers/smiley_helper.html
| https://codeigniter.com/user_guide/helpers/smiley_helper.html
|
*/
$smileys = array(
// smiley image name width height alt
......@@ -57,10 +58,7 @@ $smileys = array(
':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'),
':vampire:' => array('vampire.gif', '19', '19', 'vampire'),
':snake:' => array('snake.gif', '19', '19', 'snake'),
':exclaim:' => array('exclaim.gif', '19', '19', 'excaim'),
':question:' => array('question.gif', '19', '19', 'question') // no comma after last item
);
':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'),
':question:' => array('question.gif', '19', '19', 'question')
/* End of file smileys.php */
/* Location: ./application/config/smileys.php */
\ No newline at end of file
);
......@@ -2,7 +2,7 @@
/*TYPOS super admin*/
$config['typos_admin_login'] = 'admin';
$config['typos_admin_password'] = 'none';
$config['typos_admin_password'] = 'someCoolPassword';
$config['typos_admin_email'] = 'info@etersoft.ru';
$config['pass']['key_1'] = "ghuHJGOuiар";
......@@ -11,3 +11,8 @@ $config['pass']['key_3'] = "&^^%$%$*Gposwорапо7д";
$config['error_login_count'] = 3;
$config['error_login_time'] = 600; //10 минут
/* Typos credentials for external apis */
$config['correction_path'] = "correctTypo";
$config['typos_user'] = 'typos.etersoft';
$config['typos_password'] = 'Ync~YC{jBamlfuw7N3kG?XkiMpn}l6YJ';
\ No newline at end of file
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с сайтами - администратор*/
class Sites extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->model('admins/mdl_sites');
$this->login_id = $this->mdl_session->get_data('login_id');
$this->usertype = $this->mdl_session->get_data('usertype');
if ($this->usertype != 'admin') {
redirect('users/typos');
}
}
/*Создаем шаблон*/
function index() {
$views['body']['url'] = "admins/sites";
$views['menu']['url'] = "menu";
$views['menu']['data']['items'] = $this->mdl_menu->admin();
$this->mdl_views->view($views);
return true;
}
function typos() {
$this->index();
return;
}
/*Получить сайты*/
function get_list_sites() {
$data['page'] = $this->mdl_post->int('page');
$data['limit'] = $this->mdl_post->int('rows', 1);
$data['sord'] = $this->mdl_post->string('sord');
$data['sidx'] = $this->mdl_post->string('sidx');
$data['search'] = $this->mdl_post->string('_search');
$data['searchField'] = $this->mdl_post->string('searchField');
$data['searchOper'] = $this->mdl_post->string('searchOper');
$data['searchString'] = $this->mdl_post->string('searchString');
$data['login_id'] = $this->login_id;
echo json_encode($this->mdl_sites->get_list_sites($data));
}
/*Получить пользователей по сайту*/
function get_list_users() {
$data['id_site'] = $this->mdl_post->int("id");
$data['page'] = $this->mdl_post->int('page');
$data['limit'] = $this->mdl_post->int('rows', 1);
$data['sord'] = $this->mdl_post->string('sord');
$data['sidx'] = $this->mdl_post->string('sidx');
$data['search'] = $this->mdl_post->string('_search');
$data['searchField'] = $this->mdl_post->string('searchField');
$data['searchOper'] = $this->mdl_post->string('searchOper');
$data['searchString'] = $this->mdl_post->string('searchString');
$data['login_id'] = $this->login_id;
echo json_encode($this->mdl_sites->get_list_users($data));
}
/*Управление сайтами*/
function panel_sites() {
$oper = $this->mdl_post->string('oper');
if ($oper == 'add') {
$data['site'] = $this->mdl_post->string('site');
if ($data['site'] == '') {
echo json_encode(array('message' => 'Название сайта некорректно'));
} else {
$return = $this->mdl_sites->add_site($data);
if ($return) {
echo json_encode($return);
}
}
return true;
} else if ($oper == 'edit') {
$data['id_site'] = $this->mdl_post->int('id');
$data['site'] = $this->mdl_post->string('site');
if ($data['site'] == '') {
echo json_encode(array('message' => 'Название сайта некорректно'));
} else {
$return = $this->mdl_sites->edit_site($data);
if ($return) {
echo json_encode($return);
}
}
return true;
} else if ($oper == 'del') {
$data['id_site'] = $this->mdl_post->int('id');
if (!$this->mdl_sites->delete_site($data)) {
echo json_encode(array('message' => 'Сайт нельзя удалить. Количество пользователей не равно 0'));
}
return true;
}
}
function panel_users() {
$oper = $this->mdl_post->string('oper');
if ($oper == 'del') {
$this->load->model('admins/mdl_users');
$data['id_user'] = $this->mdl_post->int('id');
$data['id_site'] = $this->mdl_post->int('id_site');
$this->mdl_users->delete_responsible($data);
}
}
}
/**/
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с пользователями - администратор*/
class Users extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->model('admins/mdl_users');
$this->login_id = $this->mdl_session->get_data('login_id');
$this->usertype = $this->mdl_session->get_data('usertype');
if ($this->usertype != 'admin') {
redirect('users/typos');
}
}
/*Создаем шаблон*/
function index() {
$views['body']['url'] = "admins/users";
$views['menu']['url'] = "menu";
$views['menu']['data']['items'] = $this->mdl_menu->admin();
$this->mdl_views->view($views);
return true;
}
function users() {
$this->index();
return;
}
/*Получить пользователей*/
function get_list_users() {
$data['page'] = $this->mdl_post->int('page');
$data['limit'] = $this->mdl_post->int('rows', 1);
$data['sord'] = $this->mdl_post->string('sord');
$data['sidx'] = $this->mdl_post->string('sidx');
$data['search'] = $this->mdl_post->string('_search');
$data['searchField'] = $this->mdl_post->string('searchField');
$data['searchOper'] = $this->mdl_post->string('searchOper');
$data['searchString'] = $this->mdl_post->string('searchString');
echo json_encode($this->mdl_users->get_list_users($data));
}
/*Получить сайты пользователя*/
function get_user_sites() {
$data['page'] = $this->mdl_post->int('page');
$data['limit'] = $this->mdl_post->int('rows', 1);
$data['sord'] = $this->mdl_post->string('sord');
$data['sidx'] = $this->mdl_post->string('sidx');
$data['search'] = $this->mdl_post->string('_search');
$data['searchField'] = $this->mdl_post->string('searchField');
$data['searchOper'] = $this->mdl_post->string('searchOper');
$data['searchString'] = $this->mdl_post->string('searchString');
$data['id_user'] = $this->mdl_post->int('id');
echo json_encode($this->mdl_users->get_user_sites($data));
}
/*Управление пользователями*/
function panel_users() {
$oper = $this->mdl_post->string('oper');
$data = array();
if ($oper == 'add') {
$data['login'] = $this->mdl_post->string('login');
if (strlen($data['login']) < 3) {
echo json_encode(array('message' => 'Логин не корректен'));
return;
}
$data['type'] = $this->mdl_post->string('type');
if ($data['type'] != 'user' && $data['type'] != 'admin') {
$data['type'] = 'user';
}
$data['email'] = $this->mdl_post->string('email');
if (!filter_var($data['email'], FILTER_VALIDATE_EMAIL)) {
echo json_encode(array('message' => 'Email не корректен'));
return;
}
$data['firstname'] = $this->mdl_post->string('firstname');
if (strlen($data['firstname']) < 2) {
echo json_encode(array('message' => 'Имя не корректна'));
return;
}
$data['middlename'] = $this->mdl_post->string('middlename');
$data['lastname'] = $this->mdl_post->string('lastname');
if (strlen($data['lastname']) < 2) {
echo json_encode(array('message' => 'Фамилия не корректна'));
return;
}
$data['password'] = $this->mdl_post->string('password');
if (strlen($data['password']) < 4) {
echo json_encode(array('message' => 'Пароль не корректен'));
return;
}
$data['status'] = $this->mdl_post->int('status');
if ($data['status'] != 1 && $data['status'] != 0) {
$data['status'] = 0;
}
$data['activity'] = $this->mdl_post->int('activity');
if ($data['activity'] != 0 && $data['activity'] != 1) {
$data['activity'] = 'user';
}
$return = $this->mdl_users->add_user($data);
if ($return) {
echo json_encode($return);
}
return;
} else if ($oper == 'del') {
$data['id_user'] = $this->mdl_post->int('id');
$this->mdl_users->delete_user($data);
return;
} else if ($oper == 'edit') {
$data['id_user'] = $this->mdl_post->int('id');
$data['login'] = $this->mdl_post->string('login');
if (strlen($data['login']) < 3) {
echo json_encode(array('message' => 'Логин не корректен'));
return;
}
$data['type'] = $this->mdl_post->string('type');
if ($data['type'] != 'user' && $data['type'] != 'admin') {
$data['type'] = 'user';
}
$data['email'] = $this->mdl_post->string('email');
if (!preg_match("/^([a-z0-9_-]+\.)*[a-z0-9_-]+@[a-z0-9_-]+(\.[a-z0-9_-]+)*\.[a-z]{2,4}$/", $data['email'])) {
echo json_encode(array('message' => 'Email не корректен'));
return;
}
$data['firstname'] = $this->mdl_post->string('firstname');
if (strlen($data['firstname']) < 2) {
echo json_encode(array('message' => 'Имя не корректна'));
return;
}
$data['middlename'] = $this->mdl_post->string('middlename');
$data['lastname'] = $this->mdl_post->string('lastname');
if (strlen($data['lastname']) < 2) {
echo json_encode(array('message' => 'Фамилия не корректна'));
return;
}
$data['password'] = $this->mdl_post->string('password');
if (strlen($data['password']) < 2) {
echo json_encode(array('message' => 'Пароль не корректен'));
return;
}
$data['status'] = $this->mdl_post->int('status');
if ($data['status'] != 1 && $data['status'] != 0) {
$data['status'] = 0;
}
$data['activity'] = $this->mdl_post->int('activity');
if ($data['activity'] != 0 && $data['activity'] != 1) {
$data['activity'] = 'user';
}
$return = $this->mdl_users->edit_user($data);
if ($return) {
echo json_encode($return);
}
return;
}
}
/*Получаем сайты для пользователя, кроме уже принадлежащих*/
//Возвращать должен html-список
function get_sites() {
$id_user = $this->mdl_post->int('id_user');
$sites = $this->mdl_users->get_sites($id_user);
$select = "<select>";
if (!$sites) {
$select .= "<option disabled selected value='-1'>Сайтов нет</option>";
} else {
for ($i=0; $i<count($sites); $i++) {
$select .= "<option value='".$sites[$i]['id']."'>".$sites[$i]['site']."</option>";
}
}
$select .= "</select>";
echo $select;
return;
}
/*Управление сайтами пользователя*/
function panel_users_site() {
$oper = $this->mdl_post->string('oper');
if ($oper == 'add') {
$data['id_user'] = $this->mdl_post->int('id_user');
$data['id_site'] = $this->mdl_post->int('site');
$data['status'] = $this->mdl_post->int('status');
if ($data['status'] != 1 && $data['status'] != 0) {
$data['status'] = 0;
}
$return = $this->mdl_users->add_responsible($data);
if ($return) {
echo json_encode($return);
}
} else if ($oper == 'edit') {
$data['id_user'] = $this->mdl_post->int('id_user');
$data['id_site'] = $this->mdl_post->int('id');
$data['status'] = $this->mdl_post->int('status');
$data['status'] = $this->mdl_post->int('status');
if ($data['status'] != 1 && $data['status'] != 0) {
$data['status'] = 0;
}
$this->mdl_users->edit_responsible($data);
} else if ($oper == 'del') {
$data['id_user'] = $this->mdl_post->int('id_user');
$data['id_site'] = $this->mdl_post->int('id');
$this->mdl_users->delete_responsible($data);
}
}
}
/**/
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Авторизация пользователя*/
class Authorized extends CI_Controller {
function index() {
$views['body']['url'] = "authorized";
$views['body']['data']['auth_url'] = $this->config->base_url()."authorized/check";
$this->mdl_views->view($views);
}
function check() {
if (!$this->check_login_error()) {
$views['body']['data']['auth_url'] = $this->config->base_url()."authorized/check";
$views['body']['data']['error_message'] = "Вы превысили число попыток";
$views['body']['url'] = "authorized";
$this->mdl_views->view($views);
return;
}
$username = $this->mdl_post->string('username');
$password = $this->mdl_post->string('password');
if ($username == "" || $password == "") {
$views['body']['data']['auth_url'] = $this->config->base_url()."authorized/check";
$views['body']['data']['error_message'] = "Логин/пароль пустой";
$views['body']['url'] = "authorized";
$this->mdl_views->view($views);
return;
}
/*Если совпадает с данными администратора по-умолчанию (см. typos_congig.php)*/
if ($this->config->item('typos_admin_login') && $this->config->item('typos_admin_password') && $this->config->item('typos_admin_email')) {
if ($username == $this->config->item('typos_admin_login') && $password == $this->config->item('typos_admin_password')) {
$this->mdl_session->set_data('login', $username);
$this->mdl_session->set_data('usertype', 'admin');
$this->mdl_session->set_data('email', $this->config->item('typos_admin_email'));
$this->mdl_session->set_data('login_id', -1);
$this->session->set_userdata('login_id', -1);
redirect('admins/sites/');
}
}
$user_info = $this->mdl_authorized->get_info($username);
$password = $this->mdl_authorized->process_pass($password);
if (!$user_info) {
$this->error_login();
$views['body']['data']['auth_url'] = $this->config->base_url()."authorized/check";
$views['body']['data']['error_message'] = "Пароль/логин не верен";
$views['body']['url'] = "authorized";
$this->mdl_views->view($views);
return;
} else {
if ($password == $user_info[0]['password']) {
if (intval($user_info[0]['activity']) == 1) {
$this->mdl_session->set_data('login', $username);
$this->mdl_session->set_data('usertype', $user_info[0]['type']);
$this->mdl_session->set_data('email', $user_info[0]['email']);
$this->mdl_session->set_data('login_id', $user_info[0]['id']);
$this->mdl_session->set_data('firstname', $user_info[0]['firstname']);
$this->mdl_session->set_data('lastname', $user_info[0]['lastname']);
$this->mdl_session->set_data('middlename', $user_info[0]['middlename']);
$this->session->set_userdata('login_id', $user_info[0]['id']);
/*Перенаправлям в зависимости от типа пользователя*/
if ($user_info[0]['type'] == 'admin') {
redirect('admins/sites/');
} else if ($user_info[0]['type'] == 'user') {
redirect('users/typos/');
}
}
} else {
$this->error_login();
$views['body']['data']['auth_url'] = $this->config->base_url()."authorized/check";
$views['body']['data']['error_message'] = "Пароль/логин не верен";
$views['body']['url'] = "authorized";
$this->mdl_views->view($views);
return;
}
}
}
function logout() {
$this->session->sess_destroy();
$this->mdl_session->delete_all_data();
redirect ("authorized");
}
/*Устанавливаем счетчики ошибок входа*/
function error_login() {
$this->mdl_session->set_data('error_login', intval($this->mdl_session->get_data('error_login_count')) + 1);
$this->mdl_session->set_data('error_login_time', time());
$this->session->set_userdata('error_login', intval($this->session->userdata('error_login')) + 1);
$this->session->set_userdata('error_login_time', time());
}
function check_login_error() {
if (!$this->mdl_session->get_data('error_login') && !$this->session->userdata('error_login')) {
return true;
} else {
$count_error = max(intval($this->mdl_session->get_data('error_login')), intval($this->session->userdata('error_login')));
$config_count = $this->config->item('error_login_count');
if (!$config_count) {
$config_count = 3;
}
$config_time = $this->config->item('error_login_time');
if (!$config_time) {
$config_time = 10000;
}
$time_error = max(intval($this->mdl_session->get_data('error_login_time')), intval($this->session->userdata('error_login_time')));
$time_error = time() - $time_error;
/*Если время бана прошло, обнуляем*/
if ($time_error > $config_time) {
$this->mdl_session->set_data('error_login_count', 0);
$this->session->userdata('error_login_count', 0);
return true;
}
if ($time_error <= $config_time && $count_error >= $config_count) {
return false;
} else {
return true;
}
}
}
}
/**/
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
......@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
</html>
\ No newline at end of file
</html>
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с опечатками - пользователь*/
class Typos extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->model('users/mdl_typos');
$this->load->model('mdl_session');
$this->login_id = $this->mdl_session->get_data('login_id');
}
/*Создаем шаблон*/
function index() {
if ($this->mdl_session->get_data('usertype') == 'admin') {$views['menu']['data']['items'] = $this->mdl_menu->admin();}
if ($this->mdl_session->get_data('usertype') == 'user') {$views['menu']['data']['items'] = $this->mdl_menu->user();}
$views['body']['url'] = "users/sites";
$views['menu']['url'] = "menu";
$this->mdl_views->view($views);
return true;
}
function typos() {
$this->index();
return;
}
/*Получить список сайтов для пользователя*/
function get_list_sites() {
$data['page'] = $this->mdl_post->int('page');
$data['limit'] = $this->mdl_post->int('rows', 1);
$data['sord'] = $this->mdl_post->string('sord');
$data['sidx'] = $this->mdl_post->string('sidx');
$data['search'] = $this->mdl_post->string('_search');
$data['searchField'] = $this->mdl_post->string('searchField');
$data['searchOper'] = $this->mdl_post->string('searchOper');
$data['searchString'] = $this->mdl_post->string('searchString');
$data['login_id'] = $this->login_id;
echo json_encode($this->mdl_typos->get_list_sites($data));
}
/*Получить список сообщений об опечатках для пользователя*/
function get_list_messages() {
$data['id_site'] = $this->mdl_post->int("id");
$data['page'] = $this->mdl_post->int('page');
$data['limit'] = $this->mdl_post->int('rows', 1);
$data['sord'] = $this->mdl_post->string('sord');
$data['sidx'] = $this->mdl_post->string('sidx');
$data['search'] = $this->mdl_post->string('_search');
$data['searchField'] = $this->mdl_post->string('searchField');
$data['searchOper'] = $this->mdl_post->string('searchOper');
$data['searchString'] = $this->mdl_post->string('searchString');
$data['login_id'] = $this->login_id;
echo json_encode($this->mdl_typos->get_list_messages($data));
}
/*Управление сайтами*/
function panel_sites() {
$id_site = $this->mdl_post->int("id");
$oper = $this->mdl_post->string("oper");
$status = $this->mdl_post->int("status");
$login_id = $this->login_id;
if ($oper == 'edit') {
if ($status != 0 && $status != 1) {
$status = 1;
}
$data['id_site'] = $id_site;
$data['status'] = $status;
$data['login_id'] = $login_id;
$this->mdl_typos->update_status($data);
}
}
/*Управление сообщениями*/
function panel_messages() {
$oper = $this->mdl_post->string('oper');
$data = array();
if ($oper == 'add') {
$data['id_site'] = $this->mdl_post->int('id_site');
$data['link'] = $this->mdl_post->string('link');
$data['error_text'] = $this->mdl_post->string('error_text');
$data['comment'] = $this->mdl_post->string('comment');
$data['status'] = $this->mdl_post->int('status');
if ($data['status'] != 0 && $data['status'] != 1) {
$data['status'] = 1;
}
$data['login_id'] = $this->login_id;
$this->mdl_typos->add_message($data);
} else if ($oper == 'del') {
$data['id_message'] = $this->mdl_post->int('id');
$data['id_site'] = $this->mdl_post->int('id_site');
$data['login_id'] = $this->login_id;
$this->mdl_typos->delete_message($data);
} else if ($oper == 'edit') {
$data['id_message'] = $this->mdl_post->int('id');
$data['id_site'] = $this->mdl_post->int('id_site');
$data['status'] = $this->mdl_post->int('status');
$data['login_id'] = $this->login_id;
if ($data['status'] != 0 && $data['status'] != 1) {
$data['status'] = 0;
}
$this->mdl_typos->edit_message($data);
}
}
}
/**/
\ No newline at end of file
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
*/
public function index()
{
$this->load->view('welcome_message');
}
}
/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
......@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
</html>
\ No newline at end of file
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>404 Page Not Found</title>
<style type="text/css">
::selection{ background-color: #E13300; color: white; }
::moz-selection{ background-color: #E13300; color: white; }
::webkit-selection{ background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
-webkit-box-shadow: 0 0 8px #D0D0D0;
}
p {
margin: 12px 15px 12px 15px;
}
</style>
</head>
<body>
<div id="container">
<h1><?php echo $heading; ?></h1>
<?php echo $message; ?>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<title>Database Error</title>
<style type="text/css">
::selection{ background-color: #E13300; color: white; }
::moz-selection{ background-color: #E13300; color: white; }
::webkit-selection{ background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
-webkit-box-shadow: 0 0 8px #D0D0D0;
}
p {
margin: 12px 15px 12px 15px;
}
</style>
</head>
<body>
<div id="container">
<h1><?php echo $heading; ?></h1>
<?php echo $message; ?>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<title>Error</title>
<style type="text/css">
::selection{ background-color: #E13300; color: white; }
::moz-selection{ background-color: #E13300; color: white; }
::webkit-selection{ background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#container {
margin: 10px;
border: 1px solid #D0D0D0;
-webkit-box-shadow: 0 0 8px #D0D0D0;
}
p {
margin: 12px 15px 12px 15px;
}
</style>
</head>
<body>
<div id="container">
<h1><?php echo $heading; ?></h1>
<?php echo $message; ?>
</div>
</body>
</html>
\ No newline at end of file
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: <?php echo $severity; ?></p>
<p>Message: <?php echo $message; ?></p>
<p>Filename: <?php echo $filepath; ?></p>
<p>Line Number: <?php echo $line; ?></p>
</div>
\ No newline at end of file
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
......@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
</html>
\ No newline at end of file
</html>
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Проверка авторизированности пользователя*/
class Check_authorized extends CI_Controller {
/*Если не страница авторизации/проверки логина/пароля - перенаправляем на главную*/
function index() {
$class = $this->uri->segment(1);
$method = $this->uri->segment(2);
if ((!$class) || ($class == 'authorized') || ($class.'/'.$method == 'authorized/check') || ($class.'/'.$method == 'authorized/logout')) {
return true;
} else {
if (!$this->session->userdata('login_id')) {
redirect('authorized');
}
}
}
}
/**/
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
......@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
</html>
\ No newline at end of file
</html>
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Включение сессий*/
class Session {
function __construct() {
if (!session_id()) {
ini_set('session.use_cookies', 'On');
ini_set('session.use_trans_sid', 'Off');
session_set_cookie_params(0, '/');
session_start();
}
}
}
/**/
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
......@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
</html>
\ No newline at end of file
</html>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
......@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
</html>
\ No newline at end of file
</html>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
......@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
</html>
\ No newline at end of file
</html>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
......@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
</html>
\ No newline at end of file
</html>
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с сайтами*/
class Mdl_sites extends CI_Model {
/*Получаем сайты*/
function get_list_sites($data) {
$login_id = $data['login_id'];
$page = $data['page'];
$limit = $data['limit'];
$sord = $data['sord'];
$sidx = $data['sidx'];
$search = $data['search'];
$searchstring = "";
if ($search == "true") {
$searchField = $data['searchField'];
$searchOper = $data['searchOper'];
$searchString = $data['searchString'];
$search_string = $this->mdl_search->search_string($searchField, $searchOper, $searchString);
if ($search_string != "") {
$searchstring .= " WHERE ".$search_string." ";
}
}
$data = array();
/*Данные для pagination jqGrid*/
$query_count = "SELECT COUNT(s.id) AS count FROM sites AS s";
$rows_count = $this->mdl_query->select($query_count);
if ($rows_count) {
$count = $rows_count[0]['count'];
}
if( $count > 0 ) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) {
$page = $total_pages;
}
$data['page'] = $page;
$data['total'] = $total_pages;
$data['records'] = $count;
/**/
$start = $limit * $page - $limit;
if ($start < 0) {
$start = 0;
}
$query_sites = "SELECT s.id AS id, s.site AS site, s.date as date
FROM sites AS s
$searchstring
ORDER BY $sidx $sord
LIMIT $start , $limit";
$rows_sites = $this->mdl_query->select($query_sites);
$i = 0;
if ($rows_sites) {
for ($i=0; $i<count($rows_sites); $i++) {
$data['rows'][$i]['id'] = $rows_sites[$i]['id'];
$data['rows'][$i]['cell'][] = $rows_sites[$i]['id'];
$data['rows'][$i]['cell'][] = $rows_sites[$i]['site'];
$data['rows'][$i]['cell'][] = $rows_sites[$i]['date'];
}
}
return $data;
}
/*Получаем пользователей по сайту*/
function get_list_users($data) {
$login_id = $data['login_id'];
$id_site = $data['id_site'];
$page = $data['page'];
$limit = $data['limit'];
$sord = $data['sord'];
$sidx = $data['sidx'];
$search = $data['search'];
$searchstring = "";
if ($search == "true") {
$searchField = $data['searchField'];
$searchOper = $data['searchOper'];
$searchString = $data['searchString'];
$search_string = $this->mdl_search->search_string($searchField, $searchOper, $searchString);
if ($search_string != "") {
$searchstring .= " AND ".$search_string." ";
}
}
$data = array();
/*Данные для pagination jqGrid*/
$query_count = "SELECT COUNT(u.id) AS count
FROM users AS u
JOIN responsible AS r
WHERE r.id_user = u.id
AND r.id_site = '".$id_site."'";
$rows_count = $this->mdl_query->select($query_count);
if ($rows_count) {
$count = $rows_count[0]['count'];
}
if( $count > 0 ) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) {
$page = $total_pages;
}
$data['page'] = $page;
$data['total'] = $total_pages;
$data['records'] = $count;
/**/
$start = $limit * $page - $limit;
if ($start < 0) {
$start = 0;
}
$query_users = "SELECT u.id AS id,
u.type AS type,
u.email AS email,
u.date AS date,
u.activity AS activity,
u.firstname AS firstname,
u.middlename AS middlename,
u.lastname AS lastname,
u.login AS login,
r.status AS mail,
r.date AS rdate
FROM users AS u
JOIN responsible AS r
WHERE r.id_user = u.id
AND r.id_site = '".$id_site."'
$searchstring
ORDER BY $sidx $sord
LIMIT $start , $limit ";
$rows_users = $this->mdl_query->select($query_users);
if ($rows_users) {
for ($i=0; $i<count($rows_users); $i++) {
$data['rows'][$i]['id'] = $rows_users[$i]['id'];
$data['rows'][$i]['cell'][] = $rows_users[$i]['id'];
$data['rows'][$i]['cell'][] = $rows_users[$i]['login'];
$data['rows'][$i]['cell'][] = $rows_users[$i]['type'];
$data['rows'][$i]['cell'][] = $rows_users[$i]['email'];
$data['rows'][$i]['cell'][] = $rows_users[$i]['firstname'];
$data['rows'][$i]['cell'][] = $rows_users[$i]['middlename'];
$data['rows'][$i]['cell'][] = $rows_users[$i]['lastname'];
$data['rows'][$i]['cell'][] = $rows_users[$i]['activity'];
$data['rows'][$i]['cell'][] = $rows_users[$i]['mail'];
$data['rows'][$i]['cell'][] = $rows_users[$i]['rdate'];
}
}
return $data;
}
/*Добавление сайта*/
function add_site($data) {
if (!$this->check_site($data['site'])) {
return array('message' => 'Сайт не уникален');
}
$data2[0] = 'NULL';
$data2[1] = $data['site'];
$data2[2] = date("Y-m-d H:i:s", time());
$this->mdl_query->insert('sites', $data2);
}
/*Обновление названия*/
function edit_site($data) {
if (!$this->check_site($data['site'])) {
return array('message' => 'Сайт не уникален');
}
$query = "UPDATE sites SET site='".$data['site']."' WHERE id = '".$data['id_site']."'";
$this->db->query($query);
}
/*Удаление сайта*/
function delete_site($data) {
if ($this->count_responsibles($data) == 0) {
$this->mdl_query->delete('sites', "id = '".$data['id_site']."'");
$this->mdl_query->delete('messages', "id_site = '".$data['id_site']."'");
return true;
} else {
return false;
}
}
/*Подсчет пользователей сайта*/
function count_responsibles($data) {
$query = "SELECT COUNT(r.id) AS count
FROM responsible AS r
WHERE r.id_site = '".$data['id_site']."'";
$count = $this->mdl_query->select($query);
return $count[0]['count'];
}
/*Проверяем сайт на уникальность*/
function check_site($site) {
$query = "SELECT COUNT(id) AS count
FROM sites AS s
WHERE site = '$site'";
$count = $this->mdl_query->select($query);
if ($count[0]['count'] == 0) {
return true;
} else {
return false;
}
}
}
/**/
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
......@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
</html>
\ No newline at end of file
</html>
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с пользовательскими данными*/
class Mdl_authorized extends CI_Model {
/*Информация о пользователе*/
function get_info($username) {
$query = "SELECT * FROM users WHERE login = '".$username."' LIMIT 1";
return $this->mdl_query->select($query);
}
/*Возвращает хэшированный пароль на основе конфигураций*/
function process_pass($password) {
$password = strval($password);
if ($this->config->item('pass')) {
$pass_key = $this->config->item('pass');
if (isset($pass_key['key_1']) && isset($pass_key['key_2']) && isset($pass_key['key_3'])) {
return md5($pass_key['key_2'].$password.$pass_key['key_3'].$pass_key['key_1']);
} else {
return md5($password.'56uyfgh');
}
} else {
return md5($password.'56uyfgh');
}
}
}
\ No newline at end of file
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Создание меню*/
class Mdl_menu extends CI_Model {
function admin() {
$data['sites'] = "<a href='".$this->config->base_url()."index.php/admins/sites'>Сайты</a>";
$data['users'] = "<a href='".$this->config->base_url()."index.php/admins/users'>Пользователи</a>";
$data['typos'] = "<a href='".$this->config->base_url()."index.php/users/typos'>Опечатки</a>";
$data['logout'] = "<a href='".$this->config->base_url()."index.php/authorized/logout'>Выйти</a>";
return $data;
}
function user() {
$data['logout'] = "<a href='".$this->config->base_url()."index.php/authorized/logout'>Выйти</a>";
return $data;
}
}
\ No newline at end of file
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Обработка входящих данных*/
class Mdl_post extends CI_Model {
function data($key = '', $null = '') {
if (!$this->input->get_post($key)) {
return $null;
} else {
return $this->input->get_post($key, TRUE);
}
}
function int($key = '', $null = 0) {
if (!$this->input->get_post($key)) {
return $null;
} else {
return intval($this->input->get_post($key));
}
}
function float($key = '', $null = 0) {
if (!$this->input->get_post($key)) {
return $null;
} else {
return floatval($this->input->get_post($key));
}
}
function string($key, $null = '') {
if (!$this->input->get_post($key)) {
return $null;
} else {
return trim(strval($this->input->get_post($key, TRUE)));
}
}
}
/**/
\ No newline at end of file
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Построение запросов*/
class Mdl_query extends CI_Model {
/*Вставка*/
function insert($table, $data) {
$query = "INSERT INTO `$table` VALUES(";
$count = count($data);
if ($count == 0) {
return false;
}
for ($i=0; $i<$count; $i++) {
$query .= "'".$data[$i]."'";
if ($i < (count($data) -1 )) {
$query .= ",";
}
}
$query .= ")";
$this->db->query($query);
}
function delete($table, $where) {
$query = "DELETE FROM `$table` WHERE $where";
if ($this->db->query($query)) {
return 1;
}
}
function update($table, $data, $where) {
$query = "UPDATE $table SET ";
$z = 0; //регистр запятой
$count = count($data);
if ($count == 0) {
return false;
}
for ($i = 0; $i < count($data); $i++) {
if (isset($data[$i]['value']) && isset($data[$i]['field'])) {
if ($data[$i]['value']) {
if ($z != 0) {
$query .= ", ";
}
$z = 1;
$f++;
$query .= "`".$data[$i]['field']."` = "."'".$data[$i]['value']."'";
} else {
continue;
}
} else {
continue;
}
}
$query .= " WHERE $where";
if ($f != 0) {
$this->db->query($query);
return true;
} else {
return false;
}
}
/*Вывод*/
function select($select) {
$query = $this->db->query($select);
$result = $query->result_array();
if (count($result) == 0) {
return false;
} else {
return $result;
}
}
}
/**/
\ No newline at end of file
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Построение поискового запроса*/
class Mdl_search extends CI_Model {
//Построение части запроса (поле->значение)
function search_string($field, $type, $string) {
$s = " $field ";
switch ($type) {
case 'eq':
$s .= "="."'".$string."'";
break;
case 'ne':
$s .= "!="."'".$string."'";
break;
case 'lt':
$s .= "<"."'".$string."'";
break;
case 'le':
$s .= "<="."'".$string."'";
break;
case 'gt':
$s .= ">"."'".$string."'";
break;
case 'ge':
$s .= ">="."'".$string."'";
break;
case 'bw':
$s .= "LIKE '".$string."%'";
break;
case 'bn':
$s .= "NOT LIKE '".$string."%'";
break;
case 'ew':
$s .= "LIKE '%".$string."'";
break;
case 'en':
$s .= "NOT LIKE '%".$string."'";
break;
case 'cn':
$s .= "LIKE '%".$string."%'";
break;
case 'nc':
$s .= "NOT LIKE '%".$string."%'";
break;
case 'nu':
$s .= "IS NULL";
break;
case 'nn':
$s .= "IS NOT NULL";
break;
case 'in':
$s .= "IN ($string)";
break;
case 'ni':
$s .= "NOT IN ($string)";
break;
default:
$s = "";
break;
}
return $s;
}
}
/**/
\ No newline at end of file
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с сессиями*/
class Mdl_session extends CI_Model {
function __construct() {
if (!session_id()) {
return false;
}
}
/*Установить данные*/
function set_data($key, $value) {
$_SESSION[strval($key)] = serialize($value);
}
/*Получить данные*/
function get_data($key) {
if ($this->check_data($key)) {
return unserialize($_SESSION[strval($key)]);
} else {
return false;
}
}
/*Проверить существование данных*/
function check_data($key) {
if (!isset($_SESSION[strval($key)])) {
return false;
} else {
return true;
}
}
/*Удаляем данные*/
function delete_data($key) {
unset($_SESSION[strval($key)]);
}
function delete_all_data() {
unset($_SESSION);
}
}
/**/
\ No newline at end of file
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с шаблонами*/
class Mdl_views extends CI_Model {
/*Загружаем основные шаблоны*/
function view($data = array()) {
$url = $this->config->item('base_url');
$data['header']['base_url'] = $url;
$data['menu']['base_url'] = $url;
$data['body']['base_url'] = $url;
$data['footer']['base_url'] = $url;
/**/
$this->load->view('header', $data['header']);
if (isset($data['menu']['url']) && isset($data['menu']['data'])) {
$this->load->view($data['menu']['url'], $data['menu']['data']);
}
if (!isset($data['body']['data'])) {
$data['body']['data'] = array();
}
$this->load->view($data['body']['url'], $data['body']['data']);
$this->load->view('footer', $data['footer']);
/**/
}
}
/**/
\ No newline at end of file
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/* Работа с опечатками*/
class Mdl_typos extends CI_Model {
//Получаем список сайтов, доступных для пользователя
function get_list_sites($data) {
$login_id = $data['login_id'];
$page = $data['page'];
$limit = $data['limit'];
$sord = $data['sord'];
$sidx = $data['sidx'];
$search = $data['search'];
$searchstring = "";
if ($search == "true") {
$searchField = $data['searchField'];
$searchOper = $data['searchOper'];
$searchString = $data['searchString'];
$search_string = $this->mdl_search->search_string($searchField, $searchOper, $searchString);
if ($search_string != "") {
$searchstring .= " AND ".$search_string." ";
}
}
$data = array();
/*Данные для pagination jqGrid*/
$query_count = "SELECT COUNT(s.id) AS count
FROM sites AS s
JOIN users AS u
JOIN responsible AS r ON r.id_user=u.id
WHERE u.id = '".$login_id."'
AND r.id_site = s.id";
$rows_count = $this->mdl_query->select($query_count);
if ($rows_count) {
$count = $rows_count[0]['count'];
}
if( $count > 0 ) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) {
$page = $total_pages;
}
$data['page'] = $page;
$data['total'] = $total_pages;
$data['records'] = $count;
/**/
$start = $limit * $page - $limit;
if ($start < 0) {
$start = 0;
}
$query_sites = "SELECT s.id AS id, s.site AS site, r.status AS status
FROM sites AS s
JOIN users AS u
JOIN responsible AS r ON r.id_user=u.id
WHERE u.id='".$login_id."'
AND r.id_site = s.id ".$searchstring."
ORDER BY $sidx $sord
LIMIT $start , $limit";
$rows_sites = $this->mdl_query->select($query_sites);
if ($rows_sites) {
for ($i=0; $i<count($rows_sites); $i++) {
$data['rows'][$i]['id'] = $rows_sites[$i]['id'];
$data['rows'][$i]['cell'][] = $rows_sites[$i]['id'];
$data['rows'][$i]['cell'][] = $rows_sites[$i]['site'];
$data['rows'][$i]['cell'][] = $rows_sites[$i]['status'];
}
}
return $data;
}
/*Получаем список сообщений об опечатках*/
function get_list_messages($data) {
$id_site = $data["id_site"];
$login_id = $data['login_id'];
if (!$this->get_right_site($data)) {
return array();
}
$page = $data['page'];
$limit = $data['limit'];
$sord = $data['sord'];
$sidx = $data['sidx'];
$search = $data['search'];
$searchstring = "";
if ($search == "true") {
$searchField = $data['searchField'];
$searchOper = $data['searchOper'];
$searchString = $data['searchString'];
$search_string = $this->mdl_search->search_string($searchField, $searchOper, $searchString);
if ($search_string != "") {
$searchstring .= " AND ".$search_string." ";
}
}
$data = array();
/*Данные для pagination jqGrid*/
$query_count = "SELECT COUNT(m.id) AS count
FROM `messages` AS m
JOIN users AS u
JOIN responsible AS r ON r.id_user=u.id
WHERE m.id_site = '".$id_site."'
AND u.id = '".$login_id."'
AND r.id_site = m.id_site
AND r.id_user = u.id";
$rows_count = $this->mdl_query->select($query_count);
if ($rows_count) {
$count = $rows_count[0]['count'];
}
if($count > 0) {
$total_pages = ceil($count/$limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) {
$page = $total_pages;
}
$data['page'] = $page;
$data['total'] = $total_pages;
$data['records'] = $count;
/**/
$start = $limit*$page - $limit;
if ($start < 0) {
$start = 0;
}
$query_messages = "SELECT m.id AS id,
m.link AS link,
m.error_text AS text,
m.comment AS comment,
m.date AS date,
m.status AS status
FROM messages AS m
JOIN users AS u
JOIN responsible AS r ON r.id_user=u.id
WHERE m.id_site = '".$id_site."'
AND u.id = '".$login_id."'
AND r.id_site = m.id_site
AND r.id_user = u.id ".$searchstring."
ORDER BY $sidx $sord
LIMIT $start , $limit";
$rows_messages = $this->mdl_query->select($query_messages);
if ($rows_messages) {
for ($i=0; $i<count($rows_messages); $i++) {
$data['rows'][$i]['id'] = $rows_messages[$i]['id'];
$data['rows'][$i]['cell'][] = $rows_messages[$i]['id'];
$data['rows'][$i]['cell'][] = anchor($rows_messages[$i]['link'], 'ссылка', array('class'=>'typos_link', 'target'=>'_blank'));
$data['rows'][$i]['cell'][] = $rows_messages[$i]['text'];
$data['rows'][$i]['cell'][] = $rows_messages[$i]['comment'];
$data['rows'][$i]['cell'][] = $rows_messages[$i]['date'];
$data['rows'][$i]['cell'][] = $rows_messages[$i]['status'];
}
}
return $data;
}
/*Обновляем статус для сайта*/
function update_status($data) {
if ($this->get_right_site($data)) {
$this->db->query("UPDATE responsible SET status = '".$data['status']."' WHERE id_site = '".$data['id_site']."' AND id_user = '".$data['login_id']."'");
} else {
return false;
}
}
/*Добавляем новое сообщение*/
function add_message($data) {
$data_m[0] = 'NULL'; //Инкремент id
$data_m[1] = $data['id_site'];
$data_m[2] = $data['link'];
$data_m[3] = $data['error_text'];
$data_m[4] = $data['comment'];
$data_m[5] = date('Y-m-d H:i:s', time());
$data_m[6] = $data['status'];
if ($this->get_right_site($data)) {
$this->mdl_query->insert('messages', $data_m);
}
}
/*Удаляем сообщение*/
function delete_message($data) {
if ($this->get_right_message($data)) {
$this->mdl_query->delete("messages", "id = '".$data['id_message']."'");
}
}
/*Обновляем статус сообщения*/
function edit_message($data) {
if ($this->get_right_message($data)) {
$this->db->query("UPDATE messages SET status = '".$data['status']."' WHERE id = '".$data['id_message']."' AND id_site = '".$data['id_site']."' ");
}
}
/*Узнать права на сайт*/
function get_right_site($data) {
$query = "SELECT r.id_site AS id_site
FROM responsible AS r
JOIN users AS u ON u.id = r.id_user
WHERE u.id = '".$data['login_id']."'
AND r.id_site = '".$data['id_site']."' ";
$row = $this->mdl_query->select($query);
if ($row) {
return true;
} else {
return false;
}
}
/*Узнать права пользователя на сообщение*/
function get_right_message($data) {
$query = "SELECT m.id AS id_message FROM messages AS m
JOIN sites AS s ON m.id_site = s.id
JOIN users AS u
JOIN responsible AS r ON r.id_user = u.id
WHERE m.id = '".$data['id_message']."'
AND u.id = '".$data['login_id']."'
AND r.id_site = s.id
AND s.id = '".$data['id_site']."' ";
$rows = $this->mdl_query->select($query);
if ($rows) {
return true;
} else {
return false;
}
}
}
/**/
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
......@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
</html>
\ No newline at end of file
</html>
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
......@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
</html>
\ No newline at end of file
</html>
<div class="body">
<!-- -->
<link rel="stylesheet" type="text/css" media="screen" href="<?=$base_url?>javascript/jquery_plugins/jqGrid/4.4.0/css/ui.jqgrid.css" />
<script type="text/javascript" src="<?=$base_url?>javascript/jquery_plugins/jqGrid/4.4.0/js/i18n/grid.locale-ru.js"></script>
<script type="text/javascript" src="<?=$base_url?>javascript/jquery_plugins/jqGrid/4.4.0/js/jquery.jqGrid.min.js"></script>
<script type="text/javascript" src="<?=$base_url?>javascript/jquery_plugins/jqGrid/4.4.0/src/grid.subgrid.js"></script>
<!-- -->
<table id="table_sites"></table>
<div id="additional_panel"></div>
<script type="text/javascript">
jQuery("#table_sites").jqGrid({ //Привязка плагина к таблице
url: TYPOS.base_url+'users/typos/get_list_sites', //Получить список сайтов пользователя
editurl: TYPOS.base_url+'users/typos/panel_sites',
datatype: "json", //Формат скрипта-обработчика
colNames:['Номер', 'Сайт', 'Подписан'],
colModel:[
{name:"id", index:'s.id', width:10, searchtype:"integer", align:'center'},
{name:"site", index:'s.site', align:'center', width:20, searchtype:"string"},
{name:"status", index:'r.status', editable: true, align:'center', width:20, edittype:"checkbox", editoptions: {value:"1:0"}, searchtype:"integer", formatter:'checkbox'}
],
//Подтаблица с сообщениями об опечатках
subGrid : true,
subGridRowExpanded: function(subgrid_id, row_id) {
//Дополнительные переменные
var subgrid_table_id, pager_id;
subgrid_table_id = subgrid_id+"_t";
pager_id = "p_"+subgrid_table_id;
$("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table><div id='"+pager_id+"' class='scroll'></div>");
jQuery("#"+subgrid_table_id).jqGrid({
url: TYPOS.base_url+'users/typos/get_list_messages?id='+row_id,
editurl: TYPOS.base_url+'users/typos/panel_messages?id_site='+row_id+'&id='+row_id,
datatype: "json",
colNames: ['Номер', 'Ссылка', 'Текст', 'Комментарий', 'Дата добавления', 'Статус сообщения'],
colModel: [
{name:"id",index:"m.id",width:80, searchtype:"integer", align:'center'},
{name:"link",index:"m.link",width:80, sortable:false, searchtype:"string", align:'center', editable:true},
{name:"error_text",index:"m.error_text",width:80, sortable:false, searchtype:"string", align:'center', editable:true},
{name:"comment",index:"m.comment",width:80, sortable:false, searchtype:"string", align:'center', editable:true },
{name:"date",index:"m.date",width:120, searchtype:"date", align:'center'},
{name:"status",index:"m.status",width:80, editable:true, edittype:"checkbox", editoptions: {value:"1:0"}, searchtype:"integer", align:'center', formatter:'checkbox'},
],
rowNum:20,
pager: pager_id,
sortname: 'm.date',
sortorder: 'desc',
height: '100%',
width: 1000
});
jQuery("#"+subgrid_table_id).jqGrid(
'navGrid',"#"+pager_id,
{edit:true,add:true,del:true},
{
//Скрываем ненужные поля при редактировании
afterShowForm:function() {
$('#tr_link').css('display','none');
$('#tr_error_text').css('display','none');
$('#tr_comment').css('display','none');
},
},
{
//При добавлении показываем поля (т.к. редактирование - скрывает их навсегда)
afterShowForm:function() {
$('#tr_link').css('display','table-row');
$('#tr_error_text').css('display','table-row');
$('#tr_comment').css('display','table-row');
}
}
)
},
caption: "Сайты",
rowNum:10,
rowList:[10,20,30],
width:1200,
height: '100%',
pager: '#additional_panel', //Привязка к таблице тулбара
sortname: 's.id',
viewrecords: true,
sortorder: "asc"
});
jQuery("#table_sites").jqGrid(
'navGrid','#additional_panel', //Управление тулбаром таблицы
{edit:true,add:false,del:false} //Отключаем от тулбара редактирование, добавление и удаление записей. На тулбаре останутся только две кнопки: "Поиск" и "Обновить"
);
</script>
</div>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Welcome to CodeIgniter</title>
<style type="text/css">
::selection{ background-color: #E13300; color: white; }
::moz-selection{ background-color: #E13300; color: white; }
::webkit-selection{ background-color: #E13300; color: white; }
body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}
a {
color: #003399;
background-color: transparent;
font-weight: normal;
}
h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}
code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}
#body{
margin: 0 15px 0 15px;
}
p.footer{
text-align: right;
font-size: 11px;
border-top: 1px solid #D0D0D0;
line-height: 32px;
padding: 0 10px 0 10px;
margin: 20px 0 0 0;
}
#container{
margin: 10px;
border: 1px solid #D0D0D0;
-webkit-box-shadow: 0 0 8px #D0D0D0;
}
</style>
</head>
<body>
<div id="container">
<h1>Welcome to CodeIgniter!</h1>
<div id="body">
<p>The page you are looking at is being generated dynamically by CodeIgniter.</p>
<p>If you would like to edit this page you'll find it located at:</p>
<code>application/views/welcome_message.php</code>
<p>The corresponding controller for this page is found at:</p>
<code>application/controllers/welcome.php</code>
<p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="user_guide/">User Guide</a>.</p>
</div>
<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds</p>
</div>
</body>
</html>
\ No newline at end of file
This diff is collapsed. Click to expand it.
var TYPOS = {
base_url: 'http://eterfund.ru/api/typos/cp/',
}
base_url: 'http://eterfund.ru/api/typos/new_cp/'
};
Copyright (c) 2008 - 2011, EllisLab, Inc.
All rights reserved.
This license is a legal agreement between you and EllisLab Inc. for the use
of CodeIgniter Software (the "Software"). By obtaining the Software you
agree to comply with the terms and conditions of this license.
PERMITTED USE
You are permitted to use, copy, modify, and distribute the Software and its
documentation, with or without modification, for any purpose, provided that
the following conditions are met:
1. A copy of this license agreement must be included with the distribution.
2. Redistributions of source code must retain the above copyright notice in
all source code files.
3. Redistributions in binary form must reproduce the above copyright notice
in the documentation and/or other materials provided with the distribution.
4. Any files that have been modified must carry notices stating the nature
of the change and the names of those who changed them.
5. Products derived from the Software must include an acknowledgment that
they are derived from CodeIgniter in their documentation and/or other
materials provided with the distribution.
6. Products derived from the Software may not be called "CodeIgniter",
nor may "CodeIgniter" appear in their name, without prior written
permission from EllisLab, Inc.
INDEMNITY
You agree to indemnify and hold harmless the authors of the Software and
any contributors for any direct, indirect, incidental, or consequential
third-party claims, actions or suits, as well as any related expenses,
liabilities, damages, settlements or fees arising from your use or misuse
of the Software, or a violation of any terms of this license.
DISCLAIMER OF WARRANTY
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF QUALITY, PERFORMANCE,
NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
LIMITATIONS OF LIABILITY
YOU ASSUME ALL RISK ASSOCIATED WITH THE INSTALLATION AND USE OF THE SOFTWARE.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS OF THE SOFTWARE BE LIABLE
FOR CLAIMS, DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION
WITH THE SOFTWARE. LICENSE HOLDERS ARE SOLELY RESPONSIBLE FOR DETERMINING THE
APPROPRIATENESS OF USE AND ASSUME ALL RISKS ASSOCIATED WITH ITS USE, INCLUDING
BUT NOT LIMITED TO THE RISKS OF PROGRAM ERRORS, DAMAGE TO EQUIPMENT, LOSS OF
DATA OR SOFTWARE PROGRAMS, OR UNAVAILABILITY OR INTERRUPTION OF OPERATIONS.
The MIT License (MIT)
Copyright (c) 2014 - 2017, British Columbia Institute of Technology
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
\ No newline at end of file
###################
What is CodeIgniter
###################
CodeIgniter is an Application Development Framework - a toolkit - for people
who build web sites using PHP. Its goal is to enable you to develop projects
much faster than you could if you were writing code from scratch, by providing
a rich set of libraries for commonly needed tasks, as well as a simple
interface and logical structure to access these libraries. CodeIgniter lets
you creatively focus on your project by minimizing the amount of code needed
for a given task.
*******************
Release Information
*******************
This repo contains in-development code for future releases. To download the
latest stable release please visit the `CodeIgniter Downloads
<https://codeigniter.com/download>`_ page.
**************************
Changelog and New Features
**************************
You can find a list of all changes for each release in the `user
guide change log <https://github.com/bcit-ci/CodeIgniter/blob/develop/user_guide_src/source/changelog.rst>`_.
*******************
Server Requirements
*******************
PHP version 5.6 or newer is recommended.
It should work on 5.3.7 as well, but we strongly advise you NOT to run
such old versions of PHP, because of potential security and performance
issues, as well as missing features.
************
Installation
************
Please see the `installation section <https://codeigniter.com/user_guide/installation/index.html>`_
of the CodeIgniter User Guide.
*******
License
*******
Please see the `license
agreement <https://github.com/bcit-ci/CodeIgniter/blob/develop/user_guide_src/source/license.rst>`_.
*********
Resources
*********
- `User Guide <https://codeigniter.com/docs>`_
- `Language File Translations <https://github.com/bcit-ci/codeigniter3-translations>`_
- `Community Forums <http://forum.codeigniter.com/>`_
- `Community Wiki <https://github.com/bcit-ci/CodeIgniter/wiki>`_
- `Community IRC <https://webchat.freenode.net/?channels=%23codeigniter>`_
Report security issues to our `Security Panel <mailto:security@codeigniter.com>`_
or via our `page on HackerOne <https://hackerone.com/codeigniter>`_, thank you.
***************
Acknowledgement
***************
The CodeIgniter team would like to thank EllisLab, all the
contributors to the CodeIgniter project and you, the CodeIgniter user.
Deny from all
\ No newline at end of file
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>
\ No newline at end of file
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
* An open source application development framework for PHP
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
// ------------------------------------------------------------------------
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* CodeIgniter Benchmark Class
* Benchmark Class
*
* This class enables you to mark points and calculate the time difference
* between them. Memory consumption can also be displayed.
* between them. Memory consumption can also be displayed.
*
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
* @author ExpressionEngine Dev Team
* @link http://codeigniter.com/user_guide/libraries/benchmark.html
* @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/libraries/benchmark.html
*/
class CI_Benchmark {
/**
* List of all benchmark markers and when they were added
* List of all benchmark markers
*
* @var array
* @var array
*/
var $marker = array();
// --------------------------------------------------------------------
public $marker = array();
/**
* Set a benchmark marker
*
* Multiple calls to this function can be made so that several
* execution points can be timed
* execution points can be timed.
*
* @access public
* @param string $name name of the marker
* @param string $name Marker name
* @return void
*/
function mark($name)
public function mark($name)
{
$this->marker[$name] = microtime();
$this->marker[$name] = microtime(TRUE);
}
// --------------------------------------------------------------------
/**
* Elapsed time
*
* Calculates the time difference between two marked points.
*
* If the first parameter is empty this function instead returns the
......@@ -63,15 +84,17 @@ class CI_Benchmark {
* execution time to be shown in a template. The output class will
* swap the real value for this variable.
*
* @access public
* @param string a particular marked point
* @param string a particular marked point
* @param integer the number of decimal places
* @return mixed
* @param string $point1 A particular marked point
* @param string $point2 A particular marked point
* @param int $decimals Number of decimal places
*
* @return string Calculated elapsed time on success,
* an '{elapsed_string}' if $point1 is empty
* or an empty string if $point1 is not found.
*/
function elapsed_time($point1 = '', $point2 = '', $decimals = 4)
public function elapsed_time($point1 = '', $point2 = '', $decimals = 4)
{
if ($point1 == '')
if ($point1 === '')
{
return '{elapsed_time}';
}
......@@ -83,13 +106,10 @@ class CI_Benchmark {
if ( ! isset($this->marker[$point2]))
{
$this->marker[$point2] = microtime();
$this->marker[$point2] = microtime(TRUE);
}
list($sm, $ss) = explode(' ', $this->marker[$point1]);
list($em, $es) = explode(' ', $this->marker[$point2]);
return number_format(($em + $es) - ($sm + $ss), $decimals);
return number_format($this->marker[$point2] - $this->marker[$point1], $decimals);
}
// --------------------------------------------------------------------
......@@ -97,22 +117,17 @@ class CI_Benchmark {
/**
* Memory Usage
*
* This function returns the {memory_usage} pseudo-variable.
* Simply returns the {memory_usage} marker.
*
* This permits it to be put it anywhere in a template
* without the memory being calculated until the end.
* The output class will swap the real value for this variable.
*
* @access public
* @return string
* @return string '{memory_usage}'
*/
function memory_usage()
public function memory_usage()
{
return '{memory_usage}';
}
}
// END CI_Benchmark class
/* End of file Benchmark.php */
/* Location: ./system/core/Benchmark.php */
\ No newline at end of file
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP 5.1.6 or newer
* An open source application development framework for PHP
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
// ------------------------------------------------------------------------
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* CodeIgniter Application Controller Class
* Application Controller Class
*
* This class object is the super class that every library in
* CodeIgniter will be assigned to.
......@@ -24,20 +46,27 @@
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
* @author ExpressionEngine Dev Team
* @link http://codeigniter.com/user_guide/general/controllers.html
* @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/general/controllers.html
*/
class CI_Controller {
/**
* Reference to the CI singleton
*
* @var object
*/
private static $instance;
/**
* Constructor
* Class constructor
*
* @return void
*/
public function __construct()
{
self::$instance =& $this;
// Assign all the class objects that were instantiated by the
// bootstrap file (CodeIgniter.php) to local class variables
// so that CI can run as one big super object.
......@@ -47,18 +76,21 @@ class CI_Controller {
}
$this->load =& load_class('Loader', 'core');
$this->load->initialize();
log_message('debug', "Controller Class Initialized");
log_message('info', 'Controller Class Initialized');
}
// --------------------------------------------------------------------
/**
* Get the CI singleton
*
* @static
* @return object
*/
public static function &get_instance()
{
return self::$instance;
}
}
// END Controller class
/* End of file Controller.php */
/* Location: ./system/core/Controller.php */
\ No newline at end of file
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment