Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2012
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.38 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. define( 'CS_ADMIN_CONTROLLER_FOLDER', 'administration' );
  15. define( 'CS_PRODUCT_NAME', 'Real Estate Script' );
  16.  
  17. class CS_Controller extends CI_Controller {
  18. var $user = null;
  19. var $license = null;
  20.  
  21. function __construct() {
  22. parent::__construct( );
  23.  
  24. if (( is_db_conf_empty( ) || !is_installed( ) )) {
  25. redirect( 'setup/index' );
  26. }
  27.  
  28. $this->load->database( );
  29. $this->load->library( 'datamapper' );
  30. $this->load->library( 'translate' );
  31. $this->load->library( 'loginmanager' );
  32. DataMapper::$config['prefix'] = $this->db->dbprefix;
  33. $this->templatemanager->set_title( Setting::value( 'website_title', CS_PRODUCT_NAME ) );
  34.  
  35. if (( ( get_class( $this ) != 'Auth' && get_class( $this ) != 'Lang' ) && !$this->is_ajax_request( ) )) {
  36. $this->loginmanager->set_redirect( current_url( ) );
  37. }
  38.  
  39. date_default_timezone_set( Setting::value( 'default_time_zone', 'Europe/Belgrade' ) );
  40. $sess_lang = $this->session->userdata( 'lang' );
  41.  
  42. if (!empty( $sess_lang )) {
  43. if (is_numeric( $sess_lang )) {
  44. $lang = Language::factory( )->get_by_id( (int)$sess_lang )->name;
  45. } else {
  46. $lang = Language::factory( )->get_by_slug( $sess_lang )->name;
  47. }
  48. } else {
  49. $lang = Setting::value( 'default_language', 'English' );
  50. }
  51.  
  52. $this->translate->set_language( $lang );
  53.  
  54. if ($this->loginmanager->is_logged_in( )) {
  55. $this->user = User::factory( $this->loginmanager->user->id );
  56. $this->templatemanager->assign( 'user', $this->user );
  57. }
  58.  
  59. $licenselib_filename_noext = 'system';
  60. $hash = md5_file( realpath( FCPATH . ( '' . 'application/libraries/' . $licenselib_filename_noext . '.php' ) ) );
  61.  
  62. if (!in_array( strtolower( $hash ), array( '6c8b336c1abbca1d6daaf96affd86b91', 'afdb5b60449ecf98623267c54f3a59a4' ) )) {
  63. 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.' );
  64. }
  65.  
  66. $this->load->library( $licenselib_filename_noext, '', 'felix' );
  67. $this->felix->api_server = 'http://my.cubescripts.com/api/index.php';
  68. $this->felix->license_key = Setting::value( 'license_key', '' );
  69. $this->felix->secret_key = '5f43954867af8b559ced183c6a9f321e';
  70. $this->felix->validate( );
  71. $this->license = $this->felix->key_data;
  72.  
  73. if ($this->felix->errors) {
  74. if ($this->in_admin( )) {
  75. if ($this->loginmanager->is_administrator( )) {
  76. $this->templatemanager->notify( __( substr( $this->felix->errors, 7 ) ) . ' <a href=\'' . site_url( 'administration/license' ) . '\'>' . __( 'Update license key' ) . '</a>.', 'error', __( 'License check' ) );
  77. }
  78. } else {
  79. show_error( __( substr( $this->felix->errors, 7 ) ) . ' <a href=\'' . site_url( 'administration/license' ) . '\'>' . __( 'Update license key' ) . '</a>.' );
  80. }
  81. } else {
  82. if (( isset( $this->felix->key_data['license_expires'] ) && is_numeric( $this->felix->key_data['license_expires'] ) )) {
  83. $diff = (int)$this->felix->key_data['license_expires'] - time( );
  84. $diffdays = (int)ceil( $diff / 86400 );
  85.  
  86. if (( ( ( 0 < $diff && $diffdays <= 7 ) && $this->loginmanager->is_administrator( ) ) && $this->in_admin( ) )) {
  87. $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' );
  88. }
  89. }
  90. }
  91.  
  92.  
  93. if (( $this->loginmanager->is_logged_in( ) && $this->in_admin( ) )) {
  94. $res = Reservation::factory( )->where( 'status', 'pending' )->where_related( 'property/user', 'id', $this->user->id )->get( );
  95.  
  96. if (0 < $res->result_count( )) {
  97. $this->templatemanager->notify( __( 'There are pending reservations for your properties!' ) . ' <a href=\'' . site_url( 'administration/reservations/review' ) . '\'>' . __( 'Check them out' ) . '</a>.', 'notice', __( 'Bookings alert' ) );
  98. }
  99. }
  100. .........................................................
  101. .............................
  102. ...............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement