\S::get( 'hash' ) ) ); if ( \front\factory\GlobelusUser::new_password( \S::get( 'hash' ) ) ) \S::set_alert_prompt( 'Informacja', $lang['nowe-haslo-zostalo-wyslane-na-twoj-adres-email'] ); header( 'Location: /logowanie' ); exit; } public static function send_email_password_recovery() { global $lang; if ( !\front\factory\GlobelusUser::email_user_exists( \S::get( 'email' ) ) ) { \S::set_alert_prompt( 'Informacja', 'Podany adres email nie znajduje siÄ™ w naszej bazie danych.' ); header( 'Location: /logowanie' ); exit; } if ( \front\factory\GlobelusUser::send_email_password_recovery( \S::get( 'email' ) ) ) \S::set_alert_prompt( 'Informacja', $lang['odzyskiwanie-hasla-link-komunikat'] ); else \S::set_alert_prompt( 'Informacja', $lang['odzyskiwanie-hasla-blad'] ); header( 'Location: /logowanie' ); exit; } public static function recover_password() { return \front\view\GlobelusUser::recover_password(); } public static function confirm() { global $lang; if ( \front\factory\GlobelusUser::register_confirm( \S::get( 'hash' ) ) ) { \S::set_alert_prompt( 'Informacja', $lang['rejestracja-potwierdzenie'] ); \front\factory\GlobelusUser::signin( null, null, null, null, \S::get( 'hash' ) ); $g_user = \S::get_session( 'g_user' ); if ( $g_user['type'] and !$g_user['profile_completed'] ) \S::set_alert_prompt( 'Informacja', $lang['pracodawca-niewypelniony-profil-komunikat'] ); if ( !$g_user['type'] ) header( 'Location: /panel-kandydata/profil' ); else header( 'Location: /panel-pracodawcy/profil' ); } exit; } public static function resend_activation_mail() { global $lang; if ( \front\factory\GlobelusUser::resend_activation_mail( \S::get( 'hash' ) ) ) \S::set_alert_prompt( 'Informacja', $lang['wyslano-link-do-aktywacji-konta'] ); header( 'Location: /logowanie' ); exit; } public static function login_as() { global $lang; if ( !\front\factory\GlobelusUser::signin( null, null, null, null, \S::get( 'hash' ) ) ) header( 'Location: /logowanie' ); else { $g_user = \S::get_session( 'g_user' ); if ( $g_user['type'] and !$g_user['profile_completed'] ) \S::set_alert_prompt( 'Informacja', $lang['pracodawca-niewypelniony-profil-komunikat'] ); if ( \S::get( 'return_url' ) ) { header( 'Location: ' . \S::get( 'return_url' ) ); exit; } if ( !$g_user['type'] ) header( 'Location: /panel-kandydata/profil' ); else header( 'Location: /panel-pracodawcy/profil' ); } exit; } public static function signin() { global $lang; if ( !\front\factory\GlobelusUser::signin( \S::get( 'email' ), \S::get( 'password' ) ) ) header( 'Location: /logowanie' ); else { $g_user = \S::get_session( 'g_user' ); if ( $g_user['type'] and !$g_user['profile_completed'] ) \S::set_alert_prompt( 'Informacja', $lang['pracodawca-niewypelniony-profil-komunikat'] ); if ( !$g_user['type'] ) header( 'Location: /panel-kandydata/profil' ); else { if ( !$g_user['profile_completed'] ) header( 'Location: /panel-pracodawcy/profil' ); else header( 'Location: /panel-pracodawcy/ogloszenia' ); } } exit; } public static function signup() { $result = \front\factory\GlobelusUser::signup( \S::get( 'email' ), \S::get( 'password' ), \S::get( 'type' ), \S::get( 'agremment_profile' ), \S::get( 'agremment_marketing' ) ); echo json_encode( $result ); exit; } public static function register() { if ( $g_user = \S::get_session( 'g_user' ) ) { if ( $g_user['type'] == '1' ) { header( 'Location: /panel-pracodawcy/profil' ); exit; } } return \front\view\GlobelusUser::register(); } public static function login() { return \front\view\GlobelusUser::login(); } public static function logout() { session_destroy(); header( 'Location: /' ); exit; } }