ImpressCMS/impresscms

View on GitHub
htdocs/modules/system/admin/avatars/main.php

Summary

Maintainability
A
0 mins
Test Coverage

Call to method __construct from undeclared class \icms_form_elements_Label
Open

        $form->addElement(new icms_form_elements_Label(_MD_RESTRICTIONS, $restrictions));

Call to method addElement from undeclared class \icms_form_Theme
Open

        $form->addElement(new icms_form_elements_Label(_MD_RESTRICTIONS, $restrictions));

Reference to undeclared constant \_IMAGENAME
Open

                    . '" alt="" /></td><td class="head">' . _IMAGENAME, '</td><td class="even"><input type="hidden" name="avatar_id[]" value="'

Variable $avatar_id is undeclared
Open

        $count = count($avatar_id);

Variable $avatar_id is undeclared
Open

                    $error[] = sprintf(_FAILSAVEIMG, $avatar_id[$i]);

Argument 4 (addredirect) is string but \redirect_header() takes bool|true defined at /code/htdocs/include/functions.php:188
Open

            redirect_header('admin.php?fct=avatars', 1, 3, implode('<br />', icms::$security->getErrors()));

Reference to static property security from undeclared class \icms
Open

            redirect_header('admin.php?fct=avatars', 1, 3, implode('<br />', icms::$security->getErrors()));

Variable $avatar_id is undeclared
Open

        $avatar_id = (int) ($avatar_id);

Reference to undeclared constant \_NUMIMAGES
Open

            . _MD_CSTAVATARS . ' (' . sprintf(_NUMIMAGES, '<strong>' . icms_conv_nr2local($cavatar_count) . '</strong>')

Reference to undeclared constant \_IMGDISPLAY
Open

        $form->addElement(new icms_form_elements_Radioyn(_IMGDISPLAY, 'avatar_display', 1, _YES, _NO));

Variable $icmsConfigUser is undeclared
Open

        $restrictions .= _MD_AM_AVATARH . ": ". $icmsConfigUser['avatar_height']. "px";

Call to method handler from undeclared class \icms
Open

        $avt_handler = icms::handler('icms_data_avatar');

Reference to undeclared constant \_DELETE
Open

                    . $id . '">' . _DELETE . '</a></td></tr></table><br />';

Call to method __construct from undeclared class \icms_file_MediaUploadHandler
Open

        $uploader = new icms_file_MediaUploadHandler(ICMS_UPLOAD_PATH, array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png'), $icmsConfigUser['avatar_maxsize'], $icmsConfigUser['avatar_width'], $icmsConfigUser['avatar_height']);

Call to method error from undeclared class \icms_core_Message
Open

            icms_core_Message::error(sprintf(_MD_FAILDEL, $avatar->getVar('avatar_id')));

Call to method __construct from undeclared class \icms_db_criteria_Item
Open

        $savatar_count = $avt_handler->getCount(new icms_db_criteria_Item('avatar_type', 'S'));

Call to method __construct from undeclared class \icms_form_Theme
Open

        $form = new icms_form_Theme(_MD_ADDAVT, 'avatar_form', 'admin.php', "post", TRUE);

Call to method __construct from undeclared class \icms_form_elements_Text
Open

        $form->addElement(new icms_form_elements_Text(_IMAGENAME, 'avatar_name', 50, 255), TRUE);

Reference to undeclared constant \_IMAGEFILE
Open

        $form->addElement(new icms_form_elements_File(_IMAGEFILE, 'avatar_file', $icmsConfigUser['avatar_maxsize']));

Call to method __construct from undeclared class \icms_form_elements_Button
Open

        $form->addElement(new icms_form_elements_Button('', 'avt_button', _SUBMIT, 'submit'));

Call to method upload from undeclared class \icms_file_MediaUploadHandler
Open

            if (!$uploader->upload()) {

Call to method handler from undeclared class \icms
Open

                $avt_handler = icms::handler('icms_data_avatar');

Reference to undeclared constant \_FAILSAVEIMG
Open

                    $err[] = sprintf(_FAILSAVEIMG, $avatar->getVar('avatar_name'));

Call to method addElement from undeclared class \icms_form_Theme
Open

        $form->addElement(new icms_form_elements_Hidden('fct', 'avatars'));

Call to method addElement from undeclared class \icms_form_Theme
Open

        $form->addElement(new icms_form_elements_Button('', 'avt_button', _SUBMIT, 'submit'));

Call to method handler from undeclared class \icms
Open

        $avt_handler = icms::handler('icms_data_avatar');

Reference to undeclared constant \_NUMIMAGES
Open

            . _MD_SYSAVATARS . ' (' . sprintf(_NUMIMAGES, '<strong>' . icms_conv_nr2local($savatar_count) . '</strong>')

Call to method setExtra from undeclared class \icms_form_Theme
Open

        $form->setExtra('enctype="multipart/form-data"');

Call to method __construct from undeclared class \icms_form_elements_Text
Open

        $form->addElement(new icms_form_elements_Text(_IMGWEIGHT, 'avatar_weight', 3, 4, 0));

Reference to undeclared constant \_IMAGENAME
Open

                    . '" alt="" /></td><td class="head">' . _IMAGENAME, '</td><td class="even"><a href="'

Reference to static property security from undeclared class \icms
Open

                    . icms::$security->getTokenHTML()

Reference to undeclared constant \_LIST
Open

            . ') [<a href="admin.php?fct=avatars&amp;op=listavt&amp;type=C">' . _LIST

Call to method __construct from undeclared class \icms_form_elements_File
Open

        $form->addElement(new icms_form_elements_File(_IMAGEFILE, 'avatar_file', $icmsConfigUser['avatar_maxsize']));

Call to method addElement from undeclared class \icms_form_Theme
Open

        $form->addElement(new icms_form_elements_Text(_IMGWEIGHT, 'avatar_weight', 3, 4, 0));

Reference to undeclared constant \_NO
Open

        $form->addElement(new icms_form_elements_Radioyn(_IMGDISPLAY, 'avatar_display', 1, _YES, _NO));

Call to method __construct from undeclared class \icms_form_elements_Hidden
Open

        $form->addElement(new icms_form_elements_Hidden('op', 'addfile'));

Reference to undeclared constant \_IMAGEMIME
Open

                    . _IMAGEMIME . '</td><td class="odd">' . $avatars[$i]->getVar('avatar_mimetype') . '</td></tr><tr><td class="head">' . _MD_USERS . '</td><td class="even">'

Reference to undeclared constant \_MD_AM_DBUPDATED
Open

        redirect_header('admin.php?fct=avatars', 2, _MD_AM_DBUPDATED);

Reference to undeclared constant \_MD_AM_DBUPDATED
Open

        redirect_header('admin.php?fct=avatars', 2, _MD_AM_DBUPDATED);

Call to method addElement from undeclared class \icms_form_Theme
Open

        $form->addElement(new icms_form_elements_Radioyn(_IMGDISPLAY, 'avatar_display', 1, _YES, _NO));

Call to method __construct from undeclared class \icms_view_PageNav
Open

                $nav = new icms_view_PageNav($avtcount, 10, $start, 'start', 'fct=avatars&amp;type=' . $type . '&amp;op=listavt');

Variable $avatar_display is undeclared
Open

                $avatar_display[$i] = empty($avatar_display[$i]) ? 0 : 1;

Reference to static property security from undeclared class \icms
Open

        if (!icms::$security->check()) {

Variable $icmsModule is undeclared
Open

if (!is_object(icms::$user) || !is_object($icmsModule) || !icms::$user->isAdmin($icmsModule->getVar('mid'))) {

Call to method addElement from undeclared class \icms_form_Theme
Open

        $form->addElement(new icms_form_elements_Text(_IMAGENAME, 'avatar_name', 50, 255), TRUE);

Call to method addElement from undeclared class \icms_form_Theme
Open

        $form->addElement(new icms_form_elements_File(_IMAGEFILE, 'avatar_file', $icmsConfigUser['avatar_maxsize']));

Reference to undeclared constant \_YES
Open

        $form->addElement(new icms_form_elements_Radioyn(_IMGDISPLAY, 'avatar_display', 1, _YES, _NO));

Reference to undeclared constant \_SUBMIT
Open

        $form->addElement(new icms_form_elements_Button('', 'avt_button', _SUBMIT, 'submit'));

Reference to undeclared constant \_IMGDISPLAY
Open

                    . _IMGDISPLAY . '</td><td class="even"><input type="checkbox" name="avatar_display[]" value="1"';

Reference to undeclared constant \_DELETE
Open

                    . _DELETE . '</a></td></tr></table><br />';

Call to method fetchMedia from undeclared class \icms_file_MediaUploadHandler
Open

        if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {

Variable $icmsConfigUser is undeclared
Open

        $restrictions .= _MD_AM_AVATARW . ": " . $icmsConfigUser['avatar_width'] . "px<br />";

Reference to static property security from undeclared class \icms
Open

        if (!icms::$security->check()) {

Call to method confirm from undeclared class \icms_core_Message
Open

        icms_core_Message::confirm(array('op' => 'delfileok', 'avatar_id' => (int) ($_GET['avatar_id']), 'fct' => 'avatars', 'user_id' => $user_id), 'admin.php', _MD_RUDELIMG);

Call to method __construct from undeclared class \icms_form_elements_Radioyn
Open

        $form->addElement(new icms_form_elements_Radioyn(_IMGDISPLAY, 'avatar_display', 1, _YES, _NO));

Variable $icmsConfigUser is undeclared
Open

        $restrictions  = _MD_AM_AVATARMAX . ": " . $icmsConfigUser['avatar_maxsize'] . "<br />";

Reference to undeclared constant \_FAILGETIMG
Open

                    $error[] = sprintf(_FAILGETIMG, $avatar_id[$i]);

Call to method getMediaType from undeclared class \icms_file_MediaUploadHandler
Open

                $avatar->setVar('avatar_mimetype', $uploader->getMediaType());

Reference to undeclared constant \_LIST
Open

            . ') [<a href="admin.php?fct=avatars&amp;op=listavt&amp;type=S">' . _LIST . '</a>]</li><li>'

Call to method display from undeclared class \icms_form_Theme
Open

        $form->display();

Call to method __construct from undeclared class \icms_db_criteria_Item
Open

        $criteria = new icms_db_criteria_Item('avatar_type', $type);

Call to method setStart from undeclared class \icms_db_criteria_Item
Open

        $criteria->setStart($start);

Call to method renderImageNav from undeclared class \icms_view_PageNav
Open

                echo '<div style="text-align:' . _GLOBAL_RIGHT . ';">' . $nav->renderImageNav() . '</div>';

Call to method setPrefix from undeclared class \icms_file_MediaUploadHandler
Open

        $uploader->setPrefix('savt');

Reference to static property xoopsDB from undeclared class \icms
Open

            icms::$xoopsDB->query("UPDATE " . icms::$xoopsDB->prefix('users') . " SET user_avatar='blank.gif' WHERE user_avatar='" . $file . "'");

Reference to undeclared constant \_MD_AM_DBUPDATED
Open

        redirect_header('admin.php?fct=avatars', 2, _MD_AM_DBUPDATED);

Reference to undeclared constant \_IMAGEMIME
Open

                    . '</a></td></tr><tr><td class="head">' . _IMAGEMIME

Call to method handler from undeclared class \icms
Open

            $avt_handler = icms::handler('icms_data_avatar');

Reference to undeclared constant \_IMAGENAME
Open

        $form->addElement(new icms_form_elements_Text(_IMAGENAME, 'avatar_name', 50, 255), TRUE);

Call to method addElement from undeclared class \icms_form_Theme
Open

        $form->addElement(new icms_form_elements_Hidden('op', 'addfile'));

Variable $avatar_id is undeclared
Open

                    $error[] = sprintf(_FAILGETIMG, $avatar_id[$i]);

Reference to static property security from undeclared class \icms
Open

            redirect_header('admin.php?fct=avatars', 3, implode('<br />', icms::$security->getErrors()));

Call to method handler from undeclared class \icms
Open

        $avt_handler = icms::handler('icms_data_avatar');

Reference to static property xoopsDB from undeclared class \icms
Open

            icms::$xoopsDB->query("UPDATE " . icms::$xoopsDB->prefix('users') . " SET user_avatar='blank.gif' WHERE uid='". (int) ($user_id) . "'");

Call to method __construct from undeclared class \icms_db_criteria_Item
Open

        $cavatar_count = $avt_handler->getCount(new icms_db_criteria_Item('avatar_type', 'C'));

Reference to static property security from undeclared class \icms
Open

        if (!icms::$security->check()) {

Call to method __construct from undeclared class \icms_form_elements_Hidden
Open

        $form->addElement(new icms_form_elements_Hidden('fct', 'avatars'));

Reference to undeclared constant \_IMGWEIGHT
Open

                    . _IMGWEIGHT . '</td><td class="odd"><input type="text" name="avatar_weight[]" value="'

Call to method getSavedFileName from undeclared class \icms_file_MediaUploadHandler
Open

                $avatar->setVar('avatar_file', $uploader->getSavedFileName());

Reference to static property user from undeclared class \icms
Open

if (!is_object(icms::$user) || !is_object($icmsModule) || !icms::$user->isAdmin($icmsModule->getVar('mid'))) {

Call to method getErrors from undeclared class \icms_file_MediaUploadHandler
Open

            $err = array_merge($err, $uploader->getErrors(FALSE));

Reference to undeclared constant \_IMGWEIGHT
Open

        $form->addElement(new icms_form_elements_Text(_IMGWEIGHT, 'avatar_weight', 3, 4, 0));

Argument 3 (message) is 3 but \redirect_header() takes string defined at /code/htdocs/include/functions.php:188
Open

            redirect_header('admin.php?fct=avatars', 1, 3, implode('<br />', icms::$security->getErrors()));

Call to method setLimit from undeclared class \icms_db_criteria_Item
Open

        $criteria->setLimit(10);

Reference to undeclared constant \_SUBMIT
Open

                    . '<input type="submit" name="submit" value="' . _SUBMIT . '" />'

Reference to static property security from undeclared class \icms
Open

            redirect_header('admin.php?fct=avatars', 3, implode('<br />', icms::$security->getErrors()));

Reference to undeclared constant \_FAILSAVEIMG
Open

                    $error[] = sprintf(_FAILSAVEIMG, $avatar_id[$i]);

Call to method getErrors from undeclared class \icms_file_MediaUploadHandler
Open

                $err[] = $uploader->getErrors();

Call to method error from undeclared class \icms_core_Message
Open

            icms_core_Message::error($err);

TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE"
Open

        $form = new icms_form_Theme(_MD_ADDAVT, 'avatar_form', 'admin.php', "post", TRUE);

TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE"
Open

        icms_loadLanguageFile('system', 'preferences', TRUE);

Blank line found at start of control structure
Open

            if ($type == 'S') {

Blank line found at start of control structure
Open

        if (isset($user_id) && $avatar->getVar('avatar_type') == 'C') {

Blank line found at end of control structure
Open


Blank line found at end of control structure
Open


TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE"
Open

        $avatars =& $avt_handler->getObjects($criteria, TRUE);

TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE"
Open

            $err = array_merge($err, $uploader->getErrors(FALSE));

Blank line found at end of control structure
Open


Blank line found at start of control structure
Open

} else {

TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE"
Open

        $form->addElement(new icms_form_elements_Text(_IMAGENAME, 'avatar_name', 50, 255), TRUE);

Inline control structures are not allowed
Open

    if (!empty($_POST)) foreach ($_POST as $k => $v) ${$k} = StopXSS($v);

Inline control structures are not allowed
Open

    if (!empty($_GET)) foreach ($_GET as $k => $v) ${$k} = StopXSS($v);

Newline required after opening brace
Open

    if (!empty($_GET)) foreach ($_GET as $k => $v) ${$k} = StopXSS($v);

Closing brace must be on a line by itself
Open

    if (!empty($_POST)) foreach ($_POST as $k => $v) ${$k} = StopXSS($v);

Expected 1 space after closing parenthesis; found " $"
Open

    if (!empty($_POST)) foreach ($_POST as $k => $v) ${$k} = StopXSS($v);

Newline required after opening brace
Open

    if (!empty($_POST)) foreach ($_POST as $k => $v) ${$k} = StopXSS($v);

Expected 1 space after closing parenthesis; found " $"
Open

    if (!empty($_GET)) foreach ($_GET as $k => $v) ${$k} = StopXSS($v);

Closing brace must be on a line by itself
Open

    if (!empty($_GET)) foreach ($_GET as $k => $v) ${$k} = StopXSS($v);

There are no issues that match your filters.

Category
Status