Issues (847)

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.

inc/Extension/AdminPlugin.php (1 issue)

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
namespace dokuwiki\Extension;
4
5
/**
6
 * Admin Plugin Prototype
7
 *
8
 * Implements an admin interface in a plugin
9
 *
10
 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
11
 * @author     Christopher Smith <[email protected]>
12
 */
13
abstract class AdminPlugin extends Plugin
14
{
15
16
    /**
17
     * Return the text that is displayed at the main admin menu
18
     * (Default localized language string 'menu' is returned, override this function for setting another name)
19
     *
20
     * @param string $language language code
21
     * @return string menu string
22
     */
23
    public function getMenuText($language)
0 ignored issues
show
The parameter $language 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...
24
    {
25
        $menutext = $this->getLang('menu');
26
        if (!$menutext) {
27
            $info = $this->getInfo();
28
            $menutext = $info['name'] . ' ...';
29
        }
30
        return $menutext;
31
    }
32
33
    /**
34
     * Return the path to the icon being displayed in the main admin menu.
35
     * By default it tries to find an 'admin.svg' file in the plugin directory.
36
     * (Override this function for setting another image)
37
     *
38
     * Important: you have to return a single path, monochrome SVG icon! It has to be
39
     * under 2 Kilobytes!
40
     *
41
     * We recommend icons from https://materialdesignicons.com/ or to use a matching
42
     * style.
43
     *
44
     * @return string full path to the icon file
45
     */
46
    public function getMenuIcon()
47
    {
48
        $plugin = $this->getPluginName();
49
        return DOKU_PLUGIN . $plugin . '/admin.svg';
50
    }
51
52
    /**
53
     * Determine position in list in admin window
54
     * Lower values are sorted up
55
     *
56
     * @return int
57
     */
58
    public function getMenuSort()
59
    {
60
        return 1000;
61
    }
62
63
    /**
64
     * Carry out required processing
65
     */
66
    public function handle()
67
    {
68
        // some plugins might not need this
69
    }
70
71
    /**
72
     * Output html of the admin page
73
     */
74
    abstract public function html();
75
76
    /**
77
     * Checks if access should be granted to this admin plugin
78
     *
79
     * @return bool true if the current user may access this admin plugin
80
     */
81
    public function isAccessibleByCurrentUser() {
82
        $data = [];
83
        $data['instance'] = $this;
84
        $data['hasAccess'] = false;
85
86
        $event = new Event('ADMINPLUGIN_ACCESS_CHECK', $data);
87
        if($event->advise_before()) {
88
            if ($this->forAdminOnly()) {
89
                $data['hasAccess'] = auth_isadmin();
90
            } else {
91
                $data['hasAccess'] = auth_ismanager();
92
            }
93
        }
94
        $event->advise_after();
95
96
        return $data['hasAccess'];
97
    }
98
99
    /**
100
     * Return true for access only by admins (config:superuser) or false if managers are allowed as well
101
     *
102
     * @return bool
103
     */
104
    public function forAdminOnly()
105
    {
106
        return true;
107
    }
108
109
    /**
110
     * Return array with ToC items. Items can be created with the html_mktocitem()
111
     *
112
     * @see html_mktocitem()
113
     * @see tpl_toc()
114
     *
115
     * @return array
116
     */
117
    public function getTOC()
118
    {
119
        return array();
120
    }
121
122
}
123
124