We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Important modifications | Forum

UTAN
UTAN Nov 21 '13
Hi guys and gals,

I have a problem with an spammer posting obscene pictures , unfortunately he is using a proxy server and I can't ban him , he is able to changes to different ips on the fly...

I have stopped a bit, making an specific roll for new users disabling the ability to post pics , worked fine in the photo plugin but there is a catch, posting in the wall you can post pics either upload them or place the URL, I am more like finding how to disable the uploading..

As of now I have disabled to for new comers but c'mon I don't need a login system , I want them to network between them... this options is available in the private mailing system.. Had to disable to post on the wall and to send private emails.

Basically rendering the system useless..

Can anyone help me locate the php document I need to look at and try to fix a specific roll, I just don't want to disable posting on the wall and private messages?

Also, I need to find how to disable the admin or moderator is online...

your kind help will be appreciated..

My site is having a slow death because of this issues..
UTAN
UTAN Nov 22 '13
Pointers?
fbkca
fbkca Nov 22 '13
Keep banning the IP's... they'll eventually give up and/or run out of IP's...
UTAN
UTAN Nov 22 '13
@fbkca, doubt it.. it is RIPE network.. I have banned up to 45 ips so far from this network it keeps coming, I have banned by ip tables in my server the whole CIDR and I have stopped the spammer but also legit users from RIPE network...

The proxy tester I've implemented worked detains him on the chat but not on the website network..

I am out of ideas..
Shane
Shane Nov 26 '13
I had a requirement to remove the picture video upload function completely, I'll hunt through my code and see where it was and advise.
Daisy Team
Daisy Nov 27 '13
Neumann, we can suggest several solutions:

1. You can activate the Mandatory approval feature. Then once users registered at your site, they will not be able to add content to your site unless you approve their profiles.

2. You can disable the possibility to add images to comments via Admin area > Settings > User Settings. In this case to hide these buttons in the Newfeed you should make some changes. Please check out this solution: http://www.oxwall.org/forum/topic/13079

3. You can completely disable the possibility to comment or post content a the site for the certain role.


Quote from Neumann Can anyone help me locate the php document I need to look at and try to fix a specific roll, I just don't want to disable posting on the wall and private messages?

I am a bit puzzled about what exactly your concerns are. Could you please provide us with more details.


Quote from Neumann Also, I need to find how to disable the admin or moderator is online...

You can use the privacy plugin: http://www.oxwall.org/store/item/68. It allows you to hide your presence on the site.


Also, you might find this topic useful: http://www.oxwall.org/forum/topic/1458
UTAN
UTAN Nov 27 '13
[quote]I am a bit puzzled about what exactly your concerns are. Could you please provide us with more details.[/quote]

Daisy thanks for your support on this regard.,

When you disable for a specific roles , lets say new registered users you can "Disable the ability to post in walls and feeds" that is fine, but we are talking about a networking site, people wants to interact as soon as possible...

The problem is if you want them to post messages in wall in feeds and do private mail you still have the little icon to upload pictures to the server and show them in the wall , feeds, private messages... which is what the spammer uses to spam the website..

I was looking for an option to disable just the icon to upload pictures, since I can cope with the spammer writing spam but not if he upload obscene and sexual oriented pictures, which walls and feeds are public available.. 

Now Moderation approval , good idea but I have revised profiles and activated accounts that where the spammers, he is human and created legit to my eye profiles, and because he is able to change ips without any issue, checking if the ip is the same is not a go..

My best bet is disabling the upload icon in walls, feeds and private messaging for a determined ROLE of new registered users....

I for one, since uploading and showing publicly pictures are a security concern , next release must give complete management to admins and mods, because this is really bad...

There must be an option to disable uploading pictures , because not allowing new users to interact with the site and people is not a good idea, the system becomes a simple login registration system..

thanks for you kind support.. I will read your suggestions and the link you gave me.
Daisy Team
Daisy Dec 10 '13
Ok, let me clarify:

You want the 'Rich Media' feature to be dependent on the roles. Thus, you will be able to hide or show the add image and video to the certain role.

If I am right, you can find two functions in /ow_system_plugins/base/bol/text_format_service.php file:

public function isRichMediaAllowed()
    {
        return !((bool) OW::getConfig()->getValue('base', self::CONF_USER_INPUT_RICH_MEDIA_DISABLE));
    }

    public function isCommentsRichMediaAllowed()
    {
        return !((bool) OW::getConfig()->getValue('base', self::CONF_COMMENTS_RICH_MEDIA_DISABLE));
    }

These functions check if the 'rich media' is enabled. You can use these functions to create your own service for the roles. I suggest that you check the Blogs plugin to see how it adds the service to the role in the /ow_plugins/blogs/install.php file.
UTAN
UTAN Dec 10 '13
Thanks for pointer,

I have got this, and seems to disable richmedia in wall and profile page,  but doesn't work in  the feeds page..

 /**
     * Returns flag if rich media is allowed for comments.
     *
     * @return type
     */
    public function isCommentsRichMediaAllowed()
    {
        $configEnabled    =    !((bool) OW::getConfig()->getValue('base', self::CONF_COMMENTS_RICH_MEDIA_DISABLE));
        $isauthPhoto    =    OW::getUser()->isAuthorized('photo', 'upload');
       
        return ( $configEnabled && $isauthPhoto ) ? true : false;//!((bool) OW::getConfig()->getValue('base', self::CONF_COMMENTS_RICH_MEDIA_DISABLE));
    }

Now tried some test on isRichMediaAllowed() and it doesn't seem to work either in Feeds..

I would have thought that isCommentsRichMediaAllowed should have been used too in the feeds plugins...

Will dig on feed plugin to see if I find anything, will comeback with full code changes for if somebody else wants to apply same restrictions.

If you got more pointers please post them..
 


Daisy Team
Daisy Dec 19 '13
Unfortunately, the isRichMediaAllowed function does not effect the Newsfeed buttons. But you can add the check via: /ow_plugins/newsfeed/components/update_status.php

Go to this file and find the following strings:

 $attachment = new BASE_CLASS_Attachment( $attachmentId );

        $this->addComponent('attachment', $attachment);

replace them with the following condition:


       if ( BOL_TextFormatService::getInstance()->isCommentsRichMediaAllowed() )
        {
            $attachments = new BASE_CLASS_Attachment($id);
            $this->addComponent('attachment', $attachment);
        }
UTAN
UTAN Dec 20 '13
@Daysi,

Again thanks for you kind help.. I've fixed some typos in your proposed code:

if ( BOL_TextFormatService::getInstance()->isCommentsRichMediaAllowed() )
        {
            $attachment = new BASE_CLASS_Attachment( $attachmentId );
            $this->addComponent( 'attachment', $attachment );
        }

However I go this notices:

Message:Undefined index: attachment
File:/var/www/testbed/ow_smarty/template_c/58353b048015ce0c60d6b73d3e3e8b1f9d0a7e95.file.update_status.html.phpLine:78OW

Debug - NoticeMessage:Trying to get property of non-objectFile:/var/www/testbed/ow_smarty/template_c/58353b048015ce0c60d6b73d3e3e8b1f9d0a7e95.file.update_status.html.phpLine:7

So I m still looking for a workaround..
The Forum post is edited by UTAN Dec 20 '13
UTAN
UTAN Dec 20 '13
Found a workaround, it's not pretty but should work for a little while till next Oxwall version its mature enough.

code:

if ( BOL_TextFormatService::getInstance()->isCommentsRichMediaAllowed() ) {
       

            $js = 'owForms[{$form}].bind("success", function(data){
                        OW.trigger("base.init_attachment", {$uniqId});
                        owForms[{$form}].getElement("attachment").setValue("");
                        OWLinkObserver.getObserver("' .$inputId. '").resetObserver();
                    });
                    owForms[{$form}].reset = false;
                    OW.bind("base.attachment_added",
                        function(data){
                            if( data.uid == {$uniqId} ){
                                owForms[{$form}].getElement("attachment").setValue(JSON.stringify(data));
                            }
                        }
                    );

                    OW.bind("base.attachment_deleted",
                        function(data){
                            if( data.uid == {$uniqId} ){
                                owForms[{$form}].getElement("attachment").setValue("");
                                OWLinkObserver.getObserver("' .$inputId. '").resetObserver();
                            }
                        }
                    );';

            $js = UTIL_JsGenerator::composeJsString($js , array(
                'form' => $form->getName(),
                'uniqId' => $attachmentId
            ));


            OW::getDocument()->addOnloadScript($js);
        }

if you have a better suggestion, since after this code it seems like you can upload picture but it won't upload but will post your update..
Daisy Team
Daisy Dec 23 '13
 Neumann, to eliminate this notice you should go to the component template and add the check of the smarty variable existence. For example:
 
{if !empty($attachment)}<CODE>{/if}