Add candidate and employer templates, application form, and new password functionality
- Created 'dla-kandydata.php' template for candidates with job offers and registration options. - Developed 'dla-pracodawcy.php' template for employers detailing how Globelus works and registration for new employers. - Implemented 'advert-apply.php' for job applications, including form validation and file upload for CVs. - Added 'new-password.php' for users to set a new password with validation for password strength and matching.
This commit is contained in:
@@ -73,9 +73,13 @@ class GlobelusAdverts
|
||||
{
|
||||
$g_user = \S::get_session( 'g_user' );
|
||||
|
||||
\front\factory\GlobelusAdverts::send_message(
|
||||
\S::get( 'advert_id' ), $g_user['id'], \S::get( 'name' ), \S::get( 'surname' ), \S::get( 'email' ), \S::get( 'phone' ), \S::get( 'text' ), $_FILES['cv'], \S::get( 'register' )
|
||||
);
|
||||
if ( \front\factory\GlobelusAdverts::send_message( \S::get( 'advert_id' ), $g_user['id'], \S::get( 'name' ), \S::get( 'surname' ), \S::get( 'email' ), \S::get( 'phone' ), \S::get( 'text' ), $_FILES['cv'], \S::get( 'register' ) ) )
|
||||
{
|
||||
if ( \S::get( 'register' ) )
|
||||
\S::set_session( 'send_register', true );
|
||||
\S::set_session( 'send_message', true );
|
||||
}
|
||||
|
||||
header( 'Location: ' . \S::get( 'redirect_url' ) );
|
||||
exit;
|
||||
}
|
||||
@@ -493,4 +497,16 @@ class GlobelusAdverts
|
||||
'f_accommodation_provided' => \S::get_session( 'adverts_filtr_accommodation_provided' )
|
||||
] );
|
||||
}
|
||||
|
||||
static public function advert_apply() {
|
||||
|
||||
$g_user = \S::get_session( 'g_user' );
|
||||
|
||||
return \Tpl::view( 'globelus/adverts/advert-apply', [
|
||||
'advert' => \front\factory\GlobelusAdverts::advert_details( \S::get( 'advert_id' ) ),
|
||||
'g_user' => $g_user,
|
||||
'send_message' => \S::get_session( 'send_message' ),
|
||||
'send_register' => \S::get_session( 'send_register' )
|
||||
] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,10 @@ class GlobelusCv
|
||||
global $lang, $globelus_settings;
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return \Tpl::view( 'globelus/cv/cv-alert' );
|
||||
{
|
||||
header( 'Location: /logowanie' );
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( \S::get( 'filtr' ) )
|
||||
{
|
||||
|
||||
@@ -170,8 +170,8 @@ class GlobelusFirms
|
||||
$page['language']['meta_title'] = 'Zamówienie ● Globelus';
|
||||
|
||||
$package = \S::get( 'package' );
|
||||
if ( $package < 2 )
|
||||
$package = 2;
|
||||
if ( $package > 5)
|
||||
$package = 5;
|
||||
|
||||
$hash = \front\factory\GlobelusFirms::generate_order(
|
||||
$g_user['id'],
|
||||
@@ -198,6 +198,15 @@ class GlobelusFirms
|
||||
exit;
|
||||
}
|
||||
|
||||
static public function multi_refresh() {
|
||||
$g_user = \S::get_session( 'g_user' );
|
||||
|
||||
if ( is_array( \S::get( 'ids' ) ) ) foreach ( \S::get( 'ids' ) as $id )
|
||||
\front\factory\GlobelusFirms::advert_refresh( $id, $g_user['id'] );
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function multi_disable()
|
||||
{
|
||||
$g_user = \S::get_session( 'g_user' );
|
||||
@@ -528,9 +537,6 @@ class GlobelusFirms
|
||||
'contact_person' => \S::get( 'contact_person' ),
|
||||
'email' => \S::get( 'email' ),
|
||||
'phone' => \S::get( 'phone' ),
|
||||
'contact_person2' => \S::get( 'contact_person2' ),
|
||||
'email2' => \S::get( 'email2' ),
|
||||
'phone2' => \S::get( 'phone2' ),
|
||||
'salary' => \S::get( 'salary' ),
|
||||
'work_type' => \S::get( 'work_type' ),
|
||||
'without_language' => \S::get( 'without_language' ),
|
||||
@@ -619,7 +625,10 @@ class GlobelusFirms
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
{
|
||||
if ( !$g_user or !$g_user['type'] )
|
||||
return \Tpl::view( 'globelus/firms/alerts/advert-add' );
|
||||
{
|
||||
header( 'Location: /logowanie' );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !$g_user['profile_completed'] )
|
||||
|
||||
@@ -1,79 +1,100 @@
|
||||
<?php
|
||||
namespace front\controls;
|
||||
class GlobelusUser
|
||||
{
|
||||
class GlobelusUser
|
||||
{
|
||||
public static function confirm_account_delete()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
|
||||
if ( \front\factory\GlobelusUser::confirm_account_delete( \S::get( 'hash' ) ) )
|
||||
{
|
||||
\S::set_alert_prompt( 'Informacja', $lang[ 'konto-zostalo-usuniete' ] );
|
||||
unset( $_SESSION['g_user'] );
|
||||
unset( $g_user );
|
||||
}
|
||||
|
||||
|
||||
header( 'Location: /' );
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
public static function delete_account()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
|
||||
if ( !\front\factory\Globelus::permissions_check( $g_user = \S::get_session( 'g_user' ), __CLASS__ . "\\" . __FUNCTION__ ) )
|
||||
return false;
|
||||
|
||||
|
||||
if ( \front\factory\GlobelusUser::delete_account( $g_user['id'] ) )
|
||||
\S::set_alert_prompt( 'Informacja', $lang[ 'usuwanie-konta-email' ] );
|
||||
|
||||
|
||||
header( 'Location: /panel-kandydata/profil' );
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
static public function save_new_password() {
|
||||
global $lang;
|
||||
|
||||
if ( \front\factory\GlobelusUser::save_new_password( \S::get( 'hash' ), \S::get( 'password' ), \S::get( 'password_retype' ) ) )
|
||||
\S::set_alert_prompt( 'Informacja', $lang['haslo-zostalo-zmienione'] );
|
||||
|
||||
header( 'Location: /logowanie' );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function new_password()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
|
||||
return \Tpl::view( 'globelus/user/new-password', array(
|
||||
'hash' => \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: /' );
|
||||
|
||||
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: /' );
|
||||
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
|
||||
@@ -81,38 +102,38 @@ class GlobelusUser
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
public static function resend_activation_mail()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( \front\factory\GlobelusUser::resend_activation_mail( \S::get( 'hash' ) ) )
|
||||
|
||||
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' ) ) )
|
||||
|
||||
|
||||
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
|
||||
@@ -120,20 +141,20 @@ class GlobelusUser
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
public static function signin()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
if ( !\front\factory\GlobelusUser::signin( \S::get( 'email' ), \S::get( 'password' ) ) )
|
||||
|
||||
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
|
||||
@@ -146,14 +167,14 @@ class GlobelusUser
|
||||
}
|
||||
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' ) ) {
|
||||
@@ -162,15 +183,15 @@ class GlobelusUser
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return \front\view\GlobelusUser::register();
|
||||
}
|
||||
|
||||
|
||||
public static function login()
|
||||
{
|
||||
return \front\view\GlobelusUser::login();
|
||||
}
|
||||
|
||||
|
||||
public static function logout()
|
||||
{
|
||||
session_destroy();
|
||||
|
||||
Reference in New Issue
Block a user