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:
@@ -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