Issues (8)

Security Analysis    no request data  

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.

views/user/widgets/profileHeader.php (1 issue)

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
use yii\helpers\Html;
4
use yii\helpers\Url;
5
use humhub\modules\user\controllers\ImageController;
6
7
if ($allowModifyProfileBanner || $allowModifyProfileImage) {
8
    $this->registerJsFile('@web-static/resources/user/profileHeaderImageUpload.js');
9
    $this->registerJs("var profileImageUploaderUserGuid='" . $user->guid . "';", \yii\web\View::POS_BEGIN);
10
    $this->registerJs("var profileImageUploaderCurrentUserGuid='" . Yii::$app->user->getIdentity()->guid . "';", \yii\web\View::POS_BEGIN);
11
    $this->registerJs("var profileImageUploaderUrl='" . Url::to(['/user/image/upload', 'userGuid' => $user->guid, 'type' => ImageController::TYPE_PROFILE_IMAGE]) . "';", \yii\web\View::POS_BEGIN);
12
    $this->registerJs("var profileHeaderUploaderUrl='" . Url::to(['/user/image/upload', 'userGuid' => $user->guid, 'type' => ImageController::TYPE_PROFILE_BANNER_IMAGE]) . "';", \yii\web\View::POS_BEGIN);
13
}
14
?>
15
<div class="panel panel-default panel-profile">
16
17
    <div class="panel-profile-header">
18
19
        <div class="image-upload-container" style="width: 100%; height: 100%; overflow:hidden;">
20
            <!-- profile image output-->
21
            <img class="img-profile-header-background" id="user-banner-image"
22
                 src="<?php echo $user->getProfileBannerImage()->getUrl(); ?>"
23
                 width="100%" style="width: 100%; max-height: 192px;">
24
25
            <!-- check if the current user is the profile owner and can change the images -->
26
            <?php if ($allowModifyProfileBanner) : ?>
27
                <form class="fileupload" id="bannerfileupload" action="" method="POST" enctype="multipart/form-data"
28
                      style="position: absolute; top: 0; left: 0; opacity: 0; width: 100%; height: 100%;">
29
                    <input type="file" name="images[]">
30
                </form>
31
32
                <?php
33
                // set standard padding for banner progressbar
34
                $padding = '90px 350px';
35
36
                // if the default banner image is displaying
37
                if (!$user->getProfileBannerImage()->hasImage()) {
38
                    // change padding to the lower image height
39
                    $padding = '50px 350px';
40
                }
41
                ?>
42
43
                <div class="image-upload-loader" id="banner-image-upload-loader"
44
                     style="padding: <?php echo $padding ?>;">
45
                    <div class="progress image-upload-progess-bar" id="banner-image-upload-bar">
46
                        <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="00"
47
                             aria-valuemin="0"
48
                             aria-valuemax="100" style="width: 0%;">
49
                        </div>
50
                    </div>
51
                </div>
52
53
            <?php endif; ?>
54
55
            <!-- show user name and title -->
56
            <div class="img-profile-data">
57
                <h1><?php echo Html::encode($user->displayName); ?></h1>
58
59
                <h2><?php echo Html::encode($user->profile->title); ?></h2>
60
            </div>
61
62
            <!-- check if the current user is the profile owner and can change the images -->
63
            <?php if ($allowModifyProfileBanner): ?>
64
                <div class="image-upload-buttons" id="banner-image-upload-buttons">
65
                    <a href="#" onclick="javascript:$('#bannerfileupload input').click();"
66
                       class="btn btn-info btn-sm"><i
67
                            class="fa fa-cloud-upload"></i></a>
68
                    <a id="banner-image-upload-edit-button"
69
                       style="<?php
70
                        if (!$user->getProfileBannerImage()->hasImage()) {
71
                            echo 'display: none;';
72
                        }
73
                        ?>"
74
                       href="<?php echo Url::to(['/user/image/crop', 'userGuid' => $user->guid, 'type' => ImageController::TYPE_PROFILE_BANNER_IMAGE]); ?>"
75
                       class="btn btn-info btn-sm" data-target="#globalModal" data-backdrop="static"><i
76
                            class="fa fa-edit"></i></a>
77
                        <?php
78
                        echo \humhub\widgets\ModalConfirm::widget(array(
79
                            'uniqueID' => 'modal_bannerimagedelete',
80
                            'linkOutput' => 'a',
81
                            'title' => Yii::t('UserModule.widgets_views_deleteBanner', '<strong>Confirm</strong> image deleting'),
82
                            'message' => Yii::t('UserModule.widgets_views_deleteBanner', 'Do you really want to delete your title image?'),
83
                            'buttonTrue' => Yii::t('UserModule.widgets_views_deleteBanner', 'Delete'),
84
                            'buttonFalse' => Yii::t('UserModule.widgets_views_deleteBanner', 'Cancel'),
85
                            'linkContent' => '<i class="fa fa-times"></i>',
86
                            'cssClass' => 'btn btn-danger btn-sm',
87
                            'style' => $user->getProfileBannerImage()->hasImage() ? '' : 'display: none;',
88
                            'linkHref' => Url::to(['/user/image/delete', 'userGuid' => $user->guid, 'type' => ImageController::TYPE_PROFILE_BANNER_IMAGE]),
89
                            'confirmJS' => 'function(jsonResp) { resetProfileImage(jsonResp); }'
90
                        ));
91
                        ?>
92
                </div>
93
            <?php endif; ?>
94
        </div>
95
96
        <div class="image-upload-container profile-user-photo-container" style="width: 140px; height: 140px;">
97
98
            <?php if ($user->profileImage->hasImage()) : ?>
99
                <a data-ui-gallery="profileHeader"  href="<?= $user->profileImage->getUrl('_org'); ?>">
100
                    <img class="img-rounded profile-user-photo" id="user-profile-image"
101
                         src="<?php echo $user->getProfileImage()->getUrl(); ?>"
102
                         data-src="holder.js/140x140" alt="140x140" style="width: 140px; height: 140px;"/>
103
                </a>
104
            <?php else {
0 ignored issues
show
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected '{', expecting ':'
Loading history...
105
    : ?>
106
                <img class="img-rounded profile-user-photo" id="user-profile-image"
107
                     src="<?php echo $user->getProfileImage()->getUrl();
108
}
109
?>"
110
                     data-src="holder.js/140x140" alt="140x140" style="width: 140px; height: 140px;"/>
111
                 <?php endif; ?>
112
113
            <!-- check if the current user is the profile owner and can change the images -->
114
            <?php if ($allowModifyProfileImage) : ?>
115
                <form class="fileupload" id="profilefileupload" action="" method="POST" enctype="multipart/form-data"
116
                      style="position: absolute; top: 0; left: 0; opacity: 0; height: 140px; width: 140px;">
117
                    <input type="file" name="images[]">
118
                </form>
119
120
                <div class="image-upload-loader" id="profile-image-upload-loader" style="padding-top: 60px;">
121
                    <div class="progress image-upload-progess-bar" id="profile-image-upload-bar">
122
                        <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="00"
123
                             aria-valuemin="0"
124
                             aria-valuemax="100" style="width: 0%;">
125
                        </div>
126
                    </div>
127
                </div>
128
129
                <div class="image-upload-buttons" id="profile-image-upload-buttons">
130
                    <a href="#" onclick="javascript:$('#profilefileupload input').click();" class="btn btn-info btn-sm"><i
131
                            class="fa fa-cloud-upload"></i></a>
132
                    <a id="profile-image-upload-edit-button"
133
                       style="<?php
134
                        if (!$user->getProfileImage()->hasImage()) {
135
                            echo 'display: none;';
136
                        }
137
                        ?>"
138
                       href="<?php echo Url::to(['/user/image/crop', 'userGuid' => $user->guid, 'type' => ImageController::TYPE_PROFILE_IMAGE]); ?>"
139
                       class="btn btn-info btn-sm" data-target="#globalModal" data-backdrop="static"><i
140
                            class="fa fa-edit"></i></a>
141
                        <?php
142
                        echo \humhub\widgets\ModalConfirm::widget(array(
143
                            'uniqueID' => 'modal_profileimagedelete',
144
                            'linkOutput' => 'a',
145
                            'title' => Yii::t('UserModule.widgets_views_deleteImage', '<strong>Confirm</strong> image deleting'),
146
                            'message' => Yii::t('UserModule.widgets_views_deleteImage', 'Do you really want to delete your profile image?'),
147
                            'buttonTrue' => Yii::t('UserModule.widgets_views_deleteImage', 'Delete'),
148
                            'buttonFalse' => Yii::t('UserModule.widgets_views_deleteImage', 'Cancel'),
149
                            'linkContent' => '<i class="fa fa-times"></i>',
150
                            'cssClass' => 'btn btn-danger btn-sm',
151
                            'style' => $user->getProfileImage()->hasImage() ? '' : 'display: none;',
152
                            'linkHref' => Url::to(["/user/image/delete", 'type' => ImageController::TYPE_PROFILE_IMAGE, 'userGuid' => $user->guid]),
153
                            'confirmJS' => 'function(jsonResp) { resetProfileImage(jsonResp); }'
154
                        ));
155
                        ?>
156
                </div>
157
            <?php endif; ?>
158
159
        </div>
160
161
162
    </div>
163
164
    <div class="panel-body">
165
166
        <div class="panel-profile-controls">
167
            <!-- start: User statistics -->
168
            <div class="row">
169
                <div class="col-md-12">
170
                    <div class="statistics pull-left">
171
172
                        <?php if ($friendshipsEnabled): ?>
173
                            <a href="<?= Url::to(['/friendship/list/popup', 'userId' => $user->id]); ?>" data-target="#globalModal">
174
                                <div class="pull-left entry">
175
                                    <span class="count"><?php echo $countFriends; ?></span>
176
                                    <br>
177
                                    <span class="title"><?php echo Yii::t('UserModule.widgets_views_profileHeader', 'Friends'); ?></span>
178
                                </div>
179
                            </a>
180
                        <?php endif; ?>
181
182
                        <a href="<?= $user->createUrl('/user/profile/follower-list'); ?>" data-target="#globalModal">
183
                            <div class="pull-left entry">
184
                                <span class="count"><?php echo $countFollowers; ?></span>
185
                                <br>
186
                                <span class="title"><?php echo Yii::t('UserModule.widgets_views_profileHeader', 'Followers'); ?></span>
187
                            </div>
188
                        </a>
189
                        <a href="<?= $user->createUrl('/user/profile/followed-users-list'); ?>" data-target="#globalModal">
190
                            <div class="pull-left entry">
191
                                <span class="count"><?php echo $countFollowing; ?></span>
192
                                <br>
193
                                <span class="title"><?php echo Yii::t('UserModule.widgets_views_profileHeader', 'Following'); ?></span>
194
                            </div>
195
                        </a>
196
                        <a href="<?= $user->createUrl('/user/profile/space-membership-list'); ?>" data-target="#globalModal">
197
                            <div class="pull-left entry">
198
                                <span class="count"><?php echo $countSpaces; ?></span><br>
199
                                <span class="title"><?php echo Yii::t('UserModule.widgets_views_profileHeader', 'Spaces'); ?></span>
200
                            </div>
201
                        </a>
202
                    </div>
203
                    <!-- end: User statistics -->
204
205
                    <div class="controls controls-header pull-right">
206
                        <?php
207
                        echo \humhub\modules\user\widgets\ProfileHeaderControls::widget(
208
                                array(
209
                                    'user' => $user,
210
                                    'widgets' => array(
211
                                        array(\humhub\modules\user\widgets\ProfileEditButton::className(), array('user' => $user), array()),
212
                                        array(\humhub\modules\user\widgets\UserFollowButton::className(), array('user' => $user), array()),
213
                                        array(\humhub\modules\friendship\widgets\FriendshipButton::className(), array('user' => $user), array()),
214
                                    )
215
                        ));
216
                        ?>
217
                    </div>
218
                </div>
219
            </div>
220
        </div>
221
    </div>
222
</div>
223
224
<!-- start: Error modal -->
225
<div class="modal" id="uploadErrorModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
226
     aria-hidden="true">
227
    <div class="modal-dialog modal-dialog-extra-small animated pulse">
228
        <div class="modal-content">
229
            <div class="modal-header">
230
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
231
                <h4 class="modal-title"
232
                    id="myModalLabel"><?php echo Yii::t('UserModule.widgets_views_profileHeader', '<strong>Something</strong> went wrong'); ?></h4>
233
            </div>
234
            <div class="modal-body text-center">
235
236
            </div>
237
            <div class="modal-footer">
238
                <button type="button" class="btn btn-primary"
239
                        data-dismiss="modal"><?php echo Yii::t('UserModule.widgets_views_profileHeader', 'Ok'); ?></button>
240
            </div>
241
        </div>
242
    </div>
243
</div>
244