97 lines
2.8 KiB
PHP
97 lines
2.8 KiB
PHP
<?php
|
|
error_reporting( E_ALL ^ E_NOTICE ^ E_STRICT ^ E_WARNING );
|
|
function __autoload_my_classes( $classname )
|
|
{
|
|
$q = explode( '\\' , $classname );
|
|
$c = array_pop( $q );
|
|
$f = 'autoload/' . implode( '/' , $q ) . '/class.' . $c . '.php';
|
|
|
|
if ( file_exists( $f ) )
|
|
require_once( $f );
|
|
}
|
|
spl_autoload_register( '__autoload_my_classes' );
|
|
date_default_timezone_set( 'Europe/Warsaw' );
|
|
|
|
require_once 'config.php';
|
|
require_once 'libraries/medoo/medoo.php';
|
|
|
|
session_start();
|
|
|
|
if ( !isset( $_SESSION['check'] ) )
|
|
{
|
|
session_regenerate_id();
|
|
$_SESSION['check'] = true;
|
|
$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
|
|
}
|
|
|
|
if ( $_SESSION['ip'] !== $_SERVER['REMOTE_ADDR'] )
|
|
{
|
|
session_destroy();
|
|
header( 'Location: /' );
|
|
exit;
|
|
}
|
|
|
|
$mdb = new medoo( [
|
|
'database_type' => 'mysql',
|
|
'database_name' => $database['name'],
|
|
'server' => $database['host'],
|
|
'username' => $database['user'],
|
|
'password' => $database['password'],
|
|
'charset' => 'utf8'
|
|
] );
|
|
|
|
if ( file_exists( 'plugins/special-actions.php' ) )
|
|
include 'plugins/special-actions.php';
|
|
|
|
if ( !$lang_id = \S::get_session( 'current-lang' ) )
|
|
{
|
|
$lang_id = \front\factory\Languages::default_language();
|
|
\S::set_session( 'current-lang', $lang_id );
|
|
}
|
|
|
|
if ( !$lang = \S::get_session( 'lang-' . $lang_id ) )
|
|
{
|
|
$lang = \front\factory\Languages::lang_translations( $lang_id );
|
|
\S::set_session( 'lang-' . $lang_id, $lang );
|
|
}
|
|
|
|
$settings = \front\factory\Settings::settings_details();
|
|
|
|
/* wysyłanie powiadomień o wygasaniu profilu */
|
|
\front\factory\GlobelusCron::email_profile_expiration();
|
|
|
|
/* wysyłanie powiadomień o wygaśnięciu profilu */
|
|
\front\factory\GlobelusCron::email_profile_expired();
|
|
|
|
/* wysyłanie powiadomień o usuwaniu profilu */
|
|
\front\factory\GlobelusCron::email_profile_delete();
|
|
|
|
/* usuwanie nieaktywnych kont */
|
|
\front\factory\GlobelusCron::delete_inactive_profiles();
|
|
|
|
/* wysyłanie powiadomień o wygasaniu ogłoszenia */
|
|
\front\factory\GlobelusCron::email_advert_expiration();
|
|
|
|
/* wysyłanie powiadomień o wygaśnięciu ogłoszenia */
|
|
\front\factory\GlobelusCron::email_advert_expired();
|
|
|
|
/* wyłączanie wyróżnionych profili */
|
|
\front\factory\GlobelusCron::disable_profile_highlights();
|
|
|
|
/* wyłączanie wyróżnionych ogłoszeń */
|
|
\front\factory\GlobelusCron::disable_adverts_highlights();
|
|
|
|
/* wyłączanie polecanych ogłoszeń */
|
|
\front\factory\GlobelusCron::disable_adverts_main_page();
|
|
|
|
/* usuwanie polskich znaków */
|
|
\front\factory\GlobelusCron::nopl();
|
|
|
|
/* usuwanie starych ogłoszeń */
|
|
\front\factory\GlobelusCron::disable_old_adverts();
|
|
|
|
/* wyłączanie dostępu do bazy kandydatów */
|
|
\front\factory\GlobelusCron::disable_cv_access();
|
|
|
|
/* uzupełnianie tabeli globelus_proposed_candidates */
|
|
\front\factory\GlobelusCron::fill_proposed_candidates(); |