Issues (1177)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

application/libraries/DX_Auth_Event.php (10 issues)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
if (!defined('BASEPATH')) {
4
    exit('No direct script access allowed');
5
}
6
7
// Event for DX_Auth
8
// You can use DX_Auth_Event to extend DX_Auth to fullfil your needs
9
// For example: you can use event below to PM user when he already activated the account, etc.
10
11
class DX_Auth_Event
12
{
13
14
    var $ci;
15
16
    public function __construct() {
17
        $this->ci = & get_instance();
18
    }
19
20
    // If DX_email_activation in config is TRUE,
21
    // this event occurs after user succesfully activated using specified key in their email.
22
    // If DX_email_activation in config is FALSE,
23
    // this event occurs right after user succesfully registered.
24
25
    public function user_activated($user_id) {
26
        // Load models
27
        $this->ci->load->model('dx_auth/user_profile', 'user_profile');
28
29
        // Create user profile
30
        $this->ci->user_profile->create_profile($user_id);
31
    }
32
33
    // This event occurs right after user login
34
35
    public function user_logged_in($user_id) {
0 ignored issues
show
The parameter $user_id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
36
37
    }
38
39
    // This event occurs right before user logout
40
41
    public function user_logging_out($user_id) {
0 ignored issues
show
The parameter $user_id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
42
43
    }
44
45
    // This event occurs right after user change password
46
47
    public function user_changed_password($user_id, $new_password) {
0 ignored issues
show
The parameter $user_id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $new_password is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
48
49
    }
50
51
    // This event occurs right before user account is canceled
52
53
    public function user_canceling_account($user_id) {
54
        // Load models
55
        $this->ci->load->model('dx_auth/user_profile', 'user_profile');
56
57
        // Delete user profile
58
        $this->ci->user_profile->delete_profile($user_id);
59
    }
60
61
    // This event occurs when check_uri_permissions() function in DX_Auth is called
62
    // after checking if user role is allowed or not to access URI, this event will be triggered
63
    // $allowed is result of the check before, it's possible to alter the value since it's passed by reference
64
65
    public function checked_uri_permissions($user_id, &$allowed) {
0 ignored issues
show
The parameter $user_id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $allowed is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
66
67
    }
68
69
    // This event occurs when get_permission_value() function in DX_Auth is called
70
71
    public function got_permission_value($user_id, $key) {
0 ignored issues
show
The parameter $user_id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $key is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
72
73
    }
74
75
    // This event occurs when get_permissions_value() function in DX_Auth is called
76
77
    public function got_permissions_value($user_id, $key) {
0 ignored issues
show
The parameter $user_id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $key is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
78
79
    }
80
81
    // This event occurs right before dx auth send email with account details
82
    // $data is an array, containing username, password, email and last ip
83
    // $content is email content, passed by reference
84
    // You can customize email content here
85
86
    public function sending_account_email($data, &$content) {
87
        // Load helper
88
        $this->ci->load->helper('url');
89
90
        // Create content
91
        $content = sprintf($this->ci->lang->line('auth_account_content'), $this->ci->config->item('DX_website_name'), $data['username'], $data['email'], $data['password'], site_url($this->ci->config->item('DX_login_uri')), $this->ci->config->item('DX_website_name'));
92
    }
93
94
    // This event occurs right before dx auth send activation email
95
    // $data is an array, containing username, password, email, last ip, activation_key, activate_url
96
    // $content is email content, passed by reference
97
    // You can customize email content here
98
99
    public function sending_activation_email($data, &$content) {
100
        // Create content
101
        $content = sprintf($this->ci->lang->line('auth_activate_content'), $this->ci->config->item('DX_website_name'), $data['activate_url'], $this->ci->config->item('DX_email_activation_expire') / 60 / 60, $data['username'], $data['email'], $data['password'], $this->ci->config->item('DX_website_name'));
102
    }
103
104
    // This event occurs right before dx auth send forgot password request email
105
    // $data is an array, containing password, key, and reset_password_uri
106
    // $content is email content, passed by reference
107
    // You can customize email content here
108
109
    public function sending_forgot_password_email($data, &$content) {
110
        if (class_exists(ShopCore)) {
111
            $replaceData = [
112
                            '%webSiteName%'      => $this->ci->config->item('DX_website_name'),
113
                            '%resetPasswordUri%' => $data['reset_password_uri'],
114
                            '%password%'         => $data['password'],
115
                            '%key%'              => $data['key'],
116
                            '%webMasterEmail%'   => $this->ci->config->item('DX_webmaster_email'),
117
                           ];
118
119
            $content = str_replace(array_keys($replaceData), $replaceData, ShopCore::app()->SSettings->getForgotPasswordMessageText());
120
        } else {
121
            // Create content
122
            $content = sprintf($this->ci->lang->line('auth_forgot_password_content'), $this->ci->config->item('DX_website_name'), $data['reset_password_uri'], $data['password'], $data['key'], $this->ci->config->item('DX_webmaster_email'), $this->ci->config->item('DX_website_name'));
123
        }
124
    }
125
126
}