Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 1.1.5.0
- * @ Author : DeZender
- * @ Release on : 09.06.2012
- * @ Official site : http://DeZender.Net
- *
- */
- define( 'CS_ADMIN_CONTROLLER_FOLDER', 'administration' );
- define( 'CS_PRODUCT_NAME', 'Real Estate Script' );
- class CS_Controller extends CI_Controller {
- var $user = null;
- var $license = null;
- function __construct() {
- parent::__construct( );
- if (( is_db_conf_empty( ) || !is_installed( ) )) {
- redirect( 'setup/index' );
- }
- $this->load->database( );
- $this->load->library( 'datamapper' );
- $this->load->library( 'translate' );
- $this->load->library( 'loginmanager' );
- DataMapper::$config['prefix'] = $this->db->dbprefix;
- $this->templatemanager->set_title( Setting::value( 'website_title', CS_PRODUCT_NAME ) );
- if (( ( get_class( $this ) != 'Auth' && get_class( $this ) != 'Lang' ) && !$this->is_ajax_request( ) )) {
- $this->loginmanager->set_redirect( current_url( ) );
- }
- date_default_timezone_set( Setting::value( 'default_time_zone', 'Europe/Belgrade' ) );
- $sess_lang = $this->session->userdata( 'lang' );
- if (!empty( $sess_lang )) {
- if (is_numeric( $sess_lang )) {
- $lang = Language::factory( )->get_by_id( (int)$sess_lang )->name;
- } else {
- $lang = Language::factory( )->get_by_slug( $sess_lang )->name;
- }
- } else {
- $lang = Setting::value( 'default_language', 'English' );
- }
- $this->translate->set_language( $lang );
- if ($this->loginmanager->is_logged_in( )) {
- $this->user = User::factory( $this->loginmanager->user->id );
- $this->templatemanager->assign( 'user', $this->user );
- }
- $licenselib_filename_noext = 'system';
- $hash = md5_file( realpath( FCPATH . ( '' . 'application/libraries/' . $licenselib_filename_noext . '.php' ) ) );
- if (!in_array( strtolower( $hash ), array( '6c8b336c1abbca1d6daaf96affd86b91', 'afdb5b60449ecf98623267c54f3a59a4' ) )) {
- show_error( 'It seems like licensing files are corrupted. Please <a href="http://my.cubescripts.com/support/index.php?/Tickets/Submit" target="_blank">contact us</a> as soon as possible.' );
- }
- $this->load->library( $licenselib_filename_noext, '', 'felix' );
- $this->felix->api_server = 'http://my.cubescripts.com/api/index.php';
- $this->felix->license_key = Setting::value( 'license_key', '' );
- $this->felix->secret_key = '5f43954867af8b559ced183c6a9f321e';
- $this->felix->validate( );
- $this->license = $this->felix->key_data;
- if ($this->felix->errors) {
- if ($this->in_admin( )) {
- if ($this->loginmanager->is_administrator( )) {
- $this->templatemanager->notify( __( substr( $this->felix->errors, 7 ) ) . ' <a href=\'' . site_url( 'administration/license' ) . '\'>' . __( 'Update license key' ) . '</a>.', 'error', __( 'License check' ) );
- }
- } else {
- show_error( __( substr( $this->felix->errors, 7 ) ) . ' <a href=\'' . site_url( 'administration/license' ) . '\'>' . __( 'Update license key' ) . '</a>.' );
- }
- } else {
- if (( isset( $this->felix->key_data['license_expires'] ) && is_numeric( $this->felix->key_data['license_expires'] ) )) {
- $diff = (int)$this->felix->key_data['license_expires'] - time( );
- $diffdays = (int)ceil( $diff / 86400 );
- if (( ( ( 0 < $diff && $diffdays <= 7 ) && $this->loginmanager->is_administrator( ) ) && $this->in_admin( ) )) {
- $this->templatemanager->notify( '' . 'Your license will expire in about ' . $diffdays . ' day(s) (on ' . date( 'Y-m-d / H:i', (int)$this->felix->key_data['license_expires'] ) . '). <a href=\'' . site_url( 'administration/license' ) . '\'>Update license key</a>.', 'warning', 'License check' );
- }
- }
- }
- if (( $this->loginmanager->is_logged_in( ) && $this->in_admin( ) )) {
- $res = Reservation::factory( )->where( 'status', 'pending' )->where_related( 'property/user', 'id', $this->user->id )->get( );
- if (0 < $res->result_count( )) {
- $this->templatemanager->notify( __( 'There are pending reservations for your properties!' ) . ' <a href=\'' . site_url( 'administration/reservations/review' ) . '\'>' . __( 'Check them out' ) . '</a>.', 'notice', __( 'Bookings alert' ) );
- }
- }
- .........................................................
- .............................
- ...............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement